duminică, 7 octombrie 2018

programming database quiz 4

Which of the following are types of SQL functions? (Choose two correct answers.) Mark for Review
(1) Points

(Choose all correct answers)


Column-Row Functions


Multi-Row Functions (*)


Many-to-Many Functions


Single-Row Functions (*)



Evaluate this SELECT statement:
SELECT LENGTH(email)
FROM employee;

What will this SELECT statement display?

 Mark for Review
(1) Points


The longest e-mail address in the EMPLOYEE table


The number of characters for each value in the EMAIL column in the employees table (*)


The maximum number of characters allowed in the EMAIL column


The email address of each employee in the EMPLOYEE table



Which SQL function is used to return the position where a specific character string begins within a larger character string? Mark for Review
(1) Points


CONCAT


LENGTH


INSTR (*)


SUBSTR



What does the following SQL SELECT statement return?
SELECT UPPER( SUBSTR('Database Programming', INSTR('Database Programming','P'),20))
FROM dual;

 Mark for Review
(1) Points


Programming


PROGRAMMING (*)


DATABASE


Database



You need to display each employee's name in all uppercase letters. Which function should you use? Mark for Review
(1) Points


TOUPPER


UPPER (*)


UCASE


CASE


You issue this SQL statement:
SELECT TRUNC(751.367,-1) FROM dual;
Which value does this statement display?

 Mark for Review
(1) Points


751


750 (*)


700


751.3


The answer to the following script is 456. True or False?
SELECT TRUNC(ROUND(456.98))
FROM dual;

 Mark for Review
(1) Points


True


False (*)


Which two functions can be used to manipulate number or date column values, but NOT character column values? (Choose two.) Mark for Review
(1) Points

(Choose all correct answers)


TRUNC (*)


CONCAT


RPAD


ROUND (*)


INSTR


Which number function may be used to determine if a value is odd or even? Mark for Review
(1) Points


MOD (*)


TRUNC


ROUND


BINARY


Which comparison operator retrieves a list of values? Mark for Review
(1) Points


BETWEEN IN


LIKE


IS NULL


IN (*)


What is the result of the following query?
SELECT ADD_YEARS ('11-Jan-1994',6)
FROM dual; Mark for Review
(1) Points


This in not a valid SQL statement. (*)


11-Jul-2000


11-Jul-1995


11-Jan-2000


What is the result of the following query?
SELECT ADD_MONTHS ('11-Jan-1994',6)
FROM dual; Mark for Review
(1) Points


11-Jan-1995


17-Jan-1994


17-Jul-1994


11-Jul-1994 (*)



Evaluate this SELECT statement:
SELECT SYSDATE + 30
FROM dual;

Which value is returned by the query?

 Mark for Review
(1) Points


No value is returned because the SELECT statement generates an error.


The current date plus 30 hours.


The current date plus 30 days. (*)


The current date plus 30 months.


Round and Trunc cannot be used on Date datatypes. True or False? Mark for Review
(1) Points


True


False (*)



Which of the following Date Functions will add calendar months to a date? Mark for Review
(1) Points


ADD_MONTHS (*)


MONTHS + Date


NEXT_MONTH


Months + Calendar (Month)


Which number function may be used to determine if a value is odd or even? Mark for Review
(1) Points


ROUND


BINARY


MOD (*)


TRUNC


Which script displays '01-May-2004' when the HIRE_DATE value is '20-May-2004'? Mark for Review
(1) Points


SELECT ROUND(hire_date, 'MONTH')
FROM employees;


SELECT ROUND(hire_date, 'MON')
FROM employees;


SELECT TRUNC(hire_date, 'MI')
FROM employees;


SELECT TRUNC(hire_date, 'MONTH')
FROM employees;
(*)


Evaluate this function: MOD (25, 2) Which value is returned? Mark for Review
(1) Points


2


0


25


1 (*)



Which two functions can be used to manipulate number or date column values, but NOT character column values? (Choose two.) Mark for Review
(1) Points

(Choose all correct answers)


TRUNC (*)


CONCAT


RPAD


INSTR


ROUND (*)


ROUND and TRUNC functions can be used with which of the following Datatypes? Mark for Review
(1) Points


Dates and numbers (*)


Dates and characters


Numbers and characters


None of the above



The EMPLOYEES table contains these columns:
LAST_NAME VARCHAR2(20)
FIRST_NAME VARCHAR2(20)
HIRE_DATE DATE
EVAL_MONTHS NUMBER(3)

Evaluate this SELECT statement:

SELECT hire_date + eval_months
FROM employees;

The values returned by this SELECT statement will be of which data type?

 Mark for Review
(1) Points


DATETIME


NUMBER


INTEGER


DATE (*)



Which SELECT statement will NOT return a date value? Mark for Review
(1) Points


SELECT (30 + hire_date) + 1440/24
FROM employees;


SELECT SYSDATE - TO_DATE('25-Jun-2002') + hire_date
FROM employees;


SELECT (SYSDATE - hire_date) + 10*8
FROM employees;
(*)



SELECT (hire_date - SYSDATE) + TO_DATE('25-Jun-2002')
FROM employees;



What is the result of the following query?
SELECT ADD_MONTHS ('11-Jan-1994',6)
FROM dual; Mark for Review
(1) Points


11-Jul-1994 (*)


11-Jan-1995


17-Jan-1994


17-Jul-1994



Which SELECT statement will return a numeric value? Mark for Review
(1) Points


SELECT ROUND(hire_date, DAY)
FROM employees;


SELECT (SYSDATE - hire_date) / 7
FROM employees;
(*)



SELECT SYSDATE - 7
FROM employees;


SELECT SYSDATE + 600 / 24
FROM employees;



Which of the following Date Functions will add calendar months to a date? Mark for Review
(1) Points


MONTHS + Date


ADD_MONTHS (*)


NEXT_MONTH


Months + Calendar (Month)


Identify the output from the following SQL statement:
SELECT RPAD('SQL',6, '*')
FROM DUAL;

 Mark for Review
(1) Points


SQL******


SQL*** (*)


***SQL


******SQL


Evaluate this SELECT statement:
SELECT LENGTH(email)
FROM employee;

What will this SELECT statement display?

 Mark for Review
(1) Points


The maximum number of characters allowed in the EMAIL column


The longest e-mail address in the EMPLOYEE table


The number of characters for each value in the EMAIL column in the employees table (*)


The email address of each employee in the EMPLOYEE table



The STYLES table contains this data:
STYLE_ID STYLE_NAME CATEGORY COST
895840 SANDAL 85940 12.00
968950 SANDAL 85909 10.00
869506 SANDAL 89690 15.00
809090 LOAFER 89098 10.00
890890 LOAFER 89789 14.00
857689 HEEL 85940 11.00
758960 SANDAL 86979 12.00
You query the database and return the value 79. Which script did you use?

 Mark for Review
(1) Points


SELECT INSTR(category, 2,2)
FROM styles
WHERE style_id = 895840;


SELECT INSTR(category, -2,2)
FROM styles
WHERE style_id = 895840;


SELECT SUBSTR(category, -2,2)
FROM styles
WHERE style_id = 758960;
(*)



SELECT SUBSTR(category, 2,2)
FROM styles
WHERE style_id = 895840;


Which character manipulation function always returns a numerical value? Mark for Review
(1) Points


SUBSTR


LPAD


TRIM


LENGTH (*)



You query the database with this SQL statement:
SELECT LOWER(SUBSTR(CONCAT(last_name, first_name)), 1, 5) "ID"
FROM employee;

In which order are the functions evaluated?

 Mark for Review
(1) Points


CONCAT, SUBSTR, LOWER (*)


SUBSTR, CONCAT, LOWER


LOWER, SUBSTR, CONCAT


LOWER, CONCAT, SUBSTR


Evaluate this SELECT statement:
SELECT SYSDATE + 30
FROM dual;

Which value is returned by the query?

 Mark for Review
(1) Points


The current date plus 30 months.


No value is returned because the SELECT statement generates an error.


The current date plus 30 days. (*)


The current date plus 30 hours.


If hire_date has a value of '03-Jul-2003', then what is the output from this code?
SELECT ROUND(hire_date, 'Year') FROM employees; Mark for Review
(1) Points


01-Aug-2003


01-Jan-2004 (*)


01-Jul-2003


01-Jan-2003



What is the result of the following query?
SELECT ADD_YEARS ('11-Jan-1994',6)
FROM dual; Mark for Review
(1) Points


11-Jul-2000


This in not a valid SQL statement. (*)


11-Jan-2000


11-Jul-1995



Which function would you use to return the current database server date and time? Mark for Review
(1) Points


DATE


CURRENTDATE


DATETIME


SYSDATE (*)



You need to subtract three months from the current date. Which function should you use? Mark for Review
(1) Points


MONTHS_BETWEEN


ROUND


ADD_MONTHS (*)


TO_DATE


Which character manipulation function always returns a numerical value? Mark for Review
(1) Points


LPAD


SUBSTR


LENGTH (*)


TRIM


You query the database with this SQL statement:
SELECT LOWER(SUBSTR(CONCAT(last_name, first_name)), 1, 5) "ID"
FROM employee;

In which order are the functions evaluated?

 Mark for Review
(1) Points


CONCAT, SUBSTR, LOWER (*)


SUBSTR, CONCAT, LOWER


LOWER, CONCAT, SUBSTR


LOWER, SUBSTR, CONCAT



Which SQL function can be used to remove heading or trailing characters (or both) from a character string? Mark for Review
(1) Points


NVL2


LPAD


TRIM (*)


CUT


Which of the following SQL statements would correctly return a song title identified in the database as "All These Years"? Mark for Review
(1) Points


WHERE title IN('All','These','Years');


WHERE title LIKE LOWER('all these years');


WHERE title CONTAINS 'Years';


WHERE title LIKE INITCAP('%all these years'); (*)



Which query would return a user password combining the ID of an employee and the first 4 digits of the last name? Mark for Review
(1) Points


SELECT CONCAT (employee_id, INSTR(last_name,1,4))
AS "User Passwords"
FROM employees


SELECT CONCAT (employee_id, SUBSTR(last_name,4,1))
AS "User Passwords"
FROM employees


SELECT CONCAT (employee_id, INSTR(last_name,4,1))
AS "User Passwords"
FROM employees


SELECT CONCAT (employee_id, SUBSTR(last_name,1,4))
AS "User Passwords"
FROM employees
(*)


You issue this SQL statement:
SELECT ROUND (1282.248, -2) FROM dual;
What value does this statement produce?

 Mark for Review
(1) Points


1300 (*)


1200


1282


1282.25


You issue this SQL statement:
SELECT TRUNC(751.367,-1) FROM dual;
Which value does this statement display?

 Mark for Review
(1) Points


750 (*)


700


751.3


751


Evaluate this function: MOD (25, 2) Which value is returned? Mark for Review
(1) Points


25


1 (*)


0


2


ROUND and TRUNC functions can be used with which of the following Datatypes? Mark for Review
(1) Points


Dates and numbers (*)


Dates and characters


Numbers and characters


None of the above


The answer to the following script is 456. True or False?
SELECT TRUNC(ROUND(456.98))
FROM dual;

 Mark for Review
(1) Points


True


False (*)


You need to return a portion of each employeeメs last name, beginning with the first character up to the fifth character. Which character function should you use? Mark for Review
(1) Points


CONCAT


INSTR


SUBSTR(*)


TRUNC


Which three statements about functions are true? (Choose three.) Mark for Review
(1) Points

(Choose all correct answers)


The SUBSTR character function returns a portion of a string beginning at a defined character position to a specified length.(*)


The CONCAT function can only be used on character strings, not on numbers.


The SYSDATE function returns the Oracle Server date and time.(*)


The ROUND number function rounds a value to a specified decimal place or the nearest whole number.(*)


Character functions accept character arguments and only return character values. True or False? Mark for Review
(1) Points


True


False(*)



You want to create a report that displays all orders and their amounts that were placed during the month of January. You want the orders with the highest amounts to appear first. Which query should you issue? Mark for Review 
(1) Points
SELECT orderid, total 
FROM orders 
WHERE order_date BETWEEN '01-Jan-2002' AND '31-Jan-2002' 
ORDER BY total DESC;(*)

SELECT orderid, total 
FROM orders 
WHERE order_date BETWEEN '31-Jan-2002' AND '01-Jan-2002' 
ORDER BY total DESC;

SELECT orderid, total 
FROM orders 
WHERE order_date IN ( 01-Jan-2002 , 31-Jan-2002 ) 
ORDER BY total;

SELECT orderid, total 
FROM orders 
WHERE order_date LIKE '01-Jan-2002' AND '31-Jan-2002' 
ORDER BY total DESC;

joi, 4 octombrie 2018

dabase programming section 2

When using the "LIKE" operator, the % and _ symbols can be used to do a pattern-matching, wild card search. True or False? Mark for Review
(1) Points


True (*)


False

Which of the following WHERE clauses would not select the number 10? Mark for Review
(1) Points


WHERE hours <>10 (*)


WHERE hours BETWEEN 10 AND 20


WHERE hours IN (8,9,10)


WHERE hours <= 10

The EMPLOYEES table contains these columns:
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
EMAIL VARCHAR2(50)

You are writing a SELECT statement to retrieve the names of employees that have an email address.

SELECT last_name||', '||first_name "Employee Name"
FROM employees;

Which WHERE clause should you use to complete this statement?

 Mark for Review
(1) Points


WHERE email IS NOT NULL; (*)


WHERE email = NULL;


WHERE email != NULL;


WHERE email IS NULL;

The EMPLOYEES table includes these columns:
EMPLOYEE_ID NUMBER(4) NOT NULL
LAST_NAME VARCHAR2(15) NOT NULL
FIRST_NAME VARCHAR2(10) NOT NULL
HIRE_DATE DATE NOT NULL

You want to produce a report that provides the last names, first names, and hire dates of those employees who were hired between March 1, 2000, and August 30, 2000. Which statements can you issue to accomplish this task?

 Mark for Review
(1) Points


SELECT last_name, first_name, hire_date
FROM employees
WHERE hire_date BETWEEN '01-Mar-2000' AND '30-Aug-2000';
(*)



SELECT last_name, first_name, hire_date
FROM employees
WHERE hire_date BETWEEN '30-Aug-2000' AND '01-Mar-2000';


SELECT last_name, first_name, hire_date
FROM employees
AND hire_date >= '01-Mar-2000' and hire_date <= '30-Aug-2000';


SELECT last_name, first_name, hire_date
FROM employees
GROUP BY hire_date >= '01-Mar-2000' and hire_date <= '30- Aug-2000';


Which of the following are examples of comparison operators used in the WHERE clause? Mark for Review
(1) Points


=, >, <, <=, >=, <>


between ___ and ___


in (..,..,.. )


like


is null


All of the above (*)


Which SELECT statement will display both unique and non-unique combinations of the MANAGER_ID and DEPARTMENT_ID values from the EMPLOYEES table? Mark for Review 
(1) Points
SELECT manager_id, DISTINCT department_id FROM employees;

SELECT manager_id, department_id DISTINCT FROM employees;

SELECT DISTINCT manager_id, department_id FROM employees;

SELECT manager_id, department_id FROM employees; (*)


Which of the following commands will display the last name concatenated with the job ID from the employees table, separated by a comma and space, and label the resulting column "Employee and Title"? Mark for Review 
(1) Points
SELECT last_name||","|| job_id "Employee and Title" FROM employees;

SELECT " last name" ||', '|| "job_id" + "Employee and Title" FROM emp;

SELECT last_name||', '|| job_id "Employee and Title" FROM employees; (*)

SELECT " last name" ||', '|| "job_id" + "Employee and Title" FROM employees;



Evaluate this SELECT statement:
SELECT * 
FROM employees
WHERE department_id IN(10, 20, 30) 
AND salary > 20000;

Which values would cause the logical condition to return TRUE?

 Mark for Review 
(1) Points
DEPARTMENT_ID = 10 and SALARY = 20000

DEPARTMENT_ID = null and SALARY = 20001

DEPARTMENT_ID = 20 and SALARY = 20000

DEPARTMENT_ID = 10 and SALARY = 20001 (*)


Evaluate this SELECT statement:
SELECT last_name, first_name, salary 
FROM employees;

How will the heading for the FIRST_NAME column appear in the display by default in Oracle Application Express?

 Mark for Review 
(1) Points
The heading will display with the first character capitalized and centered.

The heading will display with the first character capitalized and left justified.

The heading will display as uppercase and left justified.

The heading will display as uppercase and centered. (*)


You want to determine the orders that have been placed by customers who reside in the city of Chicago. You write this partial SELECT statement:
SELECT orderid, orderdate, total 
FROM orders;

What should you include in your SELECT statement to achieve the desired results?

 Mark for Review 
(1) Points
AND city = 'Chicago';

WHERE city = 'Chicago'; (*)

AND city = Chicago;

WHERE city = Chicago;


You need to display all the rows in the EMPLOYEES table that contain a null value in the DEPARTMENT_ID column. Which comparison operator should you use? Mark for Review 
(1) Points
IS NULL (*)

NULL!

ISNULL

"= NULL"



Which comparison operator searches for a specified character pattern? Mark for Review 
(1) Points
BETWEEN...AND...

IN

IS NULL

LIKE (*)


When using the LIKE condition, which symbol represents any sequence of characters of any length--zero, one, or more characters? Mark for Review 
(1) Points
#
_

&

% (*)



The Concatenation Operator does which of the following? Mark for Review 
(1) Points
Links rows of data together inside the database.

Separates columns.

Is represented by the asterisk (*) symbol

Links two or more columns or literals to form a single output column (*)



  When using the LIKE condition to search for _ symbols, which character can you use as the default ESCAPE option? Mark for Review 
(1) Points
&

%

\ (*)

^


Which symbol represents the not equal to condition? Mark for Review 
(1) Points
~

!= (*)

#



The structure of the table can be displayed with the _________ command: Mark for Review 
(1) Points
Desc and the Describe (*)

Dis

Desc

Describe



Which of the following is NOT BEING DONE in this SQL statement?
SELECT first_name || ' ' || last_name "Name" 
FROM employees;

 Mark for Review 
(1) Points
Concatenating first name, middle name and last name (*)

Selecting columns from the employees table

Using a column alias

Putting a space between first name and last name


Which comparison condition would you use to select rows that match a character pattern? Mark for Review 
(1) Points
SIMILAR

IN

LIKE (*)

ALMOST



You need to display only unique combinations of the LAST_NAME and MANAGER_ID columns in the EMPLOYEES table. Which keyword should you include in the SELECT clause? Mark for Review 
(1) Points
ONLY

DISTINCT (*)

DISTINCTROW

UNIQUEONE





Which two statements would select salaries that are greater than or equal to 2500 and less than or equal to 3500? (Choose two) Mark for Review 
(1) Points
(Choose all correct answers)
WHERE salary BETWEEN 2500 AND 3500 (*)

WHERE salary BETWEEN 3500 AND 2500

WHERE salary <=2500 AND salary >= 3500

WHERE salary >= 2500 AND salary <= 3500 (*)


If you write queries using the BETWEEN operator, it does not matter in what order you enter the values, i.e. BETWEEN low value AND high value will give the same result as BETWEEN high value and low value. True or False? Mark for Review 
(1) Points
True

False (*)



Which of the following is true? Mark for Review 
(1) Points
Date values are enclosed in single quotation marks (*)

Date values are not format-sensitive

Character strings must be enclosed in double quotation marks

Character values are not case-sensitive



Which of the following statements will work? Mark for Review 
(1) Points
SELECT first_name ||' '||last_name NAME, department_id DEPARTMENT, salary*12 'ANNUAL SALARY' 
FROM employees 
WHERE last_name = 'King';

SELECT first_name ||' '||last_name NAME, department_id DEPARTMENT, salary*12 'ANNUAL SALARY' 
FROM employees 
WHERE name = 'King';

SELECT first_name ||' '||last_name NAME, department_id DEPARTMENT, salary*12 "ANNUAL SALARY" 
FROM employees 
WHERE name = 'King';

SELECT first_name ||' '||last_name NAME, department_id DEPARTMENT, salary*12 "ANNUAL SALARY" 
FROM employees 
WHERE last_name = 'King';
(*)



You want to retrieve a list of customers whose last names begin with the letters 'Fr' . Which keyword should you include in the WHERE clause of your SELECT statement to achieve the desired result? Mark for Review 
(1) Points
AND

LIKE (*)

BETWEEN

IN


Which of the following would be returned by this SELECT statement:
SELECT last_name, salary 
FROM employees 
WHERE salary < 3500;

 Mark for Review 
(1) Points
LAST_NAME SALARY
King 5000

LAST_NAME SALARY
Rajas 3500

LAST_NAME SALARY
Davies 3100
(*)


All of the above






You need to display employees whose salary is in the range of 10000 through 25000 for employees in department 50 . What does the WHERE clause look like? Mark for Review 
(1) Points
WHERE department_id > 50 
AND salary BETWEEN 10000 AND 25000 

WHERE department_id < 50 
AND salary BETWEEN 10000 AND 25000

WHERE department_id = 50 
AND salary BETWEEN 25001 AND 10001 

WHERE department_id = 50 
AND salary BETWEEN 10000 AND 25000 
(*)



Where in a SQL statement can you not use arithmetic operators? Mark for Review 
(1) Points
NONE

FROM (*)

WHERE

SELECT


You need to combine the FIRST_NAME and LAST_NAME columns in the EMPLOYEES table and display the columns as a combined character string. Which operator should you use? Mark for Review 
(1) Points
+

|

|| (*)

AND



Which operator is used to combine columns of character strings to other columns? Mark for Review 
(1) Points
/

*

+

|| (*)




If the EMPLOYEES table has the following columns, and you want to write a SELECT statement to return the employee last name and department number for employee number 176, which of the following SQL statements should you use?
Name Type Length
EMPLOYEE_ID NUMBER 22
FIRST_NAME VARCHAR2 20
LAST_NAME VARCHAR2 25
EMAIL VARCHAR2 25
PHONE_NUMBER VARCHAR2 20
SALARY NUMBER 22
COMMISSION_PCT NUMBER 22
MANAGER_ID NUMBER 22
DEPARTMENT_ID NUMBER 22
 Mark for Review 
(1) Points
SELECT last_name, employee_id 
FROM employees 
WHERE employee_id equals 176;

SELECT last_name, department_id 
FROM employees 
WHERE employee_id equals 176;

SELECT last_name, department_id 
FROM employees 
WHERE employee_id = 176;
(*)


SELECT first_name, employee_id 
FROM employees 
WHERE employee_id = 176;




You need write a SELECT statement that should only return rows that contain 34, 46, or 48 for the DEPARTMENT_ID column. Which operator should you use in the WHERE clause to compare the DEPARTMENT_ID column to this specific list of values? Mark for Review 
(1) Points
!=

=

BETWEEN..AND..

IN (*)


Which example would limit the number of rows returned? Mark for Review 
(1) Points
SELECT title FROM d_songs WHERE type_code = = 88;

SELECT title FROM d_songs WHEN type_code = = 88;

SELECT title FROM d_songs WHEN type_code = 88;

SELECT title FROM d_songs WHERE type_code = 88; (*)


You need to display all the employees whose last names (of any length) start with the letters 'Sm' . Which WHERE clause should you use? Mark for Review 
(1) Points
WHERE last_name LIKE '_Sm'

WHERE last_name LIKE '%Sm'

WHERE last_name LIKE 'Sm_'

WHERE last_name LIKE 'Sm%'(*)



You need to display all the values in the EMAIL column that contains the underscore (_) character as part of that email address. The WHERE clause in your SELECT statement contains the LIKE operator. What must you include in the LIKE operator? Mark for Review 
(1) Points
A percent sign (%)

The ESCAPE option (\) and one or more percent signs (%)(*)

The (+) operator

The ESCAPE option (\)



What will be the result of the SELECT statement and what will display?
SELECT last_name, salary, salary + 300 
FROM employees;

 Mark for Review 
(1) Points
Display the last name and salary of all employees who have a salary greater than 300.

Display the last name, salary, and the results of adding 300 to the salary of the first employee row

Display the last name, salary, and the results of adding 300 to each salary for all the employees (*)

Modify the salary column by adding 300 and only display the last name and the new salary.



The concatenation operator ... Mark for Review 
(1) Points
Brings together columns or character strings into other columns

Creates a resultant column that is a character expression

Is represented by two vertical bars ( || )

All of the above (*)



The following is a valid SQL SELECT statement. True or False?
SELECT first_name || ' ' || last_name alias AS Employee_Name 
FROM employees:

 Mark for Review 
(1) Points
True

False (*)




databse programming section 1

1. Which SQL keyword specifies that an alias will be substituted for a column name in the output of a SQL query? Mark for Review
(1) Points


OR


AND


SUBSTITUTE


AS (*)

2.The SQL SELECT statement is capable of: Mark for Review
(1) Points


Selection and protection


Selection and projection (*)


Projection and updating


None of the above


3.What is a NULL value? Mark for Review
(1) Points


A blank space


A known value less than zero


A perfect zero


An unknown value (*)


4. In which clause of a SELECT statement would you specify the name of the table or tables being queried? Mark for Review
(1) Points


The FROM clause (*)


The SELECT clause


The WHERE clause


Any of the above options; you can list tables wherever you want in a SELECT statement.



6. In the real world, databases used by businesses generally have a single table . True or False? Mark for Review
(1) Points


True


False (*)

7. What language is used to query data in a Relational Database? Mark for Review
(1) Points


Java


C++


BASIC


SQL (*)

8. Databases are used in most countries and by most governments. Life, as we know it, would change drastically if we no longer had access to databases. True or False? Mark for Review
(1) Points


True (*)


False




9. Most of the well know Internet search engines use databases to store data. True or False? Mark for Review 
(1) Points
True (*)

False


10. A Relational Database generally contains two or more tables. True or False? Mark for Review 

(1) Points


True (*)

False

11. What command can be used to show information about the structure of a table? Mark for Review 
(1) Points
INSERT

ALTER

DESCRIBE (*)

SELECT


12. What command retrieves data from the database? Mark for Review 
(1) Points
SELECT (*)

INSERT

DESCRIBE

ALTER



13. All computers in the world speak the same languages, so you only need to learn one programming language - Oracle SQL. True or False? Mark for Review 
(1) Points
True

False (*)





15. What command will return data from the database to you? Mark for Review 
(1) Points
FETCH

RETURN

SELECT (*)

GET




Every time you shop online, it is likely you will be accessing a database. True or False? Mark for Review 
(1) Points
True (*)

False


  Every row in a relational database table is unique. Mark for Review 
(1) Points
True (*)

False


  The basic storage structure in a Relational Database is a _________: Mark for Review 
(1) Points
Key

Row

Table (*)

Field


  Columns in a database table contain data with the same _________: Mark for Review 
(1) Points
Type (*)

Field

Row

Key

In the default order of precedence, which operator would be evaluated first? Mark for Review 
(1) Points
Divisions and Subtractions are at the same level and would be evaluated first based on left to right order

Subtractions and Additions are at the same level and would be evaluated first based on left to right order

Additions and Multiplications are at the same level and would be evaluated first based on left to right order

Multiplications and Divisions are at the same level and would be evaluated first based on left to right order (*)


The SELECT statement retrieves information from the database. In a SELECT statement, you can do all of the following EXCEPT: Mark for Review 
(1) Points
Projection

Manipulation (*)

Selection

Joining

When listing columns in the SELECT list, what should you use to separate the columns? Mark for Review 
(1) Points
Underscores

Dashes

Commas (*)

Semicolons


Which SQL keyword specifies that an alias will be substituted for a column name in the output of a SQL query? Mark for Review 
(1) Points
OR

AND

SUBSTITUTE

AS (*)


If a SQL statement returns data from two or more tables, which SQL capability is being used? Mark for Review 
(1) Points
Selection

Joining (*)

Insertion

Projection

There is only one kind of software used by all computers. True or False? Mark for Review 
(1) Points
True

False (*)


What command can be used to show information about the structure of a table? Mark for Review 
(1) Points
SELECT

INSERT

DESCRIBE (*)

ALTER


The _______ clause can be added to a SELECT statement to return a subset of the data. Mark for Review 
(1) Points
WHICH

EVERY

ANYWHERE

WHERE (*)


You cannot use computers unless you completely understand exactly how they work. True or False? Mark for Review 
(1) Points
True

False (*)


What command can be added to a select statement to return a subset of the data? Mark for Review 
(1) Points
WHERE (*)

ALL

WHEN

EVERYONE


The EMPLOYEES table contains these columns:
SALARY NUMBER(7,2)
BONUS NUMBER(7,2)
COMMISSION_PCT NUMBER(2,2)

All three columns contain values greater than zero.
There is one row of data in the table and the values are as follows:
Salary = 500, Bonus = 50, Commission_pct = .5

Evaluate these two SQL statements:

1.
SELECT salary + bonus + commission_pct * salary - bonus AS income
FROM employees;

2.
SELECT (salary + bonus ) + commission_pct * (salary - bonus) income
FROM employees;

What will be the result?

 Mark for Review
(1) Points


One of the statements will NOT execute.


Statement 2 will return a higher value than statement 1.(*)


Statement 1 will return a higher value than statement 2.


Statement 1 will display a different column heading.




Examine the follolowing SELECT statement.
SELECT *
FROM employees;

This statement will retrieve all the rows in the employees table. True or False?

 Mark for Review
(1) Points


True(*)


False