Database Section 6 L4-9 Answers + Stuff Jaedan doesn't know
True
A join between two tables that returns the results of the INNER join, as well as the unmatched rows from the left (or right) table, is called a left (or right) OUTER join.
A (A calculation)
A literal can be all of the following except: A) a calculation B) a date D) a character C) a number
Wildcard Character
A symbol which is a complex character (not a letter or number) that is used in PL/SQL
B (null)
Arithmetic expressions containing a null value evaluate to _________. A) whatever the calculation evaluates to B) null D) will cause an error C) zero
'%a'
Finds any value ending with "a"
'a%'
Finds any value starting with "a"
A (anything in parenthesis)
If an arithmetic expression contains more than one operator, __________ are evaluated first. A) anything in parenthesis B) multiplication and division C) exponentiation D) addition and subtraction
D (Order by)
In a SELECT statement the ________ clause can be used to sort the rows. A) SORT B) WHERE C) ORDER D) ORDER BY
%
Represents a zero, one, or multiple characters
D (Projection)
Selecting specific columns from a table to be displayed in a query is called _____________. A) selection B) elimination C) sorting D) projection
Truncate
Statement used to remove all data or records from a table while keeping the table structure
A (*)
The following statement displays all the rows in the departments table: SELECT ____ FROM departments; A) * B) # C) % D) ALL
False
Users may view data that is in the process of being changed by another user.
True
You can create a marker in the current transaction by using the SAVEPOINT statement.
True
You can display all columns of data in a table by following the SELECT keyword with an asterisk
True
The ORDER BY clause must be placed before the WHERE clause in a SQL statement.
True
The Oracle server ensures data consistency based on transactions.
C (%)
Which of the following is the wildcard used for any number of characters in SQL? A) || B) # C) % D) &
C (Using)
A _______ clause creates an equijoin between two tables using one column with the same name, regardless of the data type. A) NATURAL JOIN B) ON C) USING D) EQUI-JOIN
'%a%'
Finds any value with "a" in any position
True
Literals can be used within a SELECT statement
False
Null is the same as zero or a blank space. True or False?
True
The CARTESIAN or CROSS join gets created when a join condition is omitted.
C (OR)
The ______ operator requires either of the component conditions to be true. A) AND B) EITHER C) OR D) BETWEEN
A (Natural Join)
The ________ join clause is based on all the columns in the two tables that have the same name and the same datatype. A) NATURAL JOIN B) USING C) OUTER JOIN D) CROSS JOIN
B (Using)
The __________ clause can be used to match columns with the same name, but different data types. A) NATURAL JOIN B) USING C) CROSS JOIN D) OUTER JOIN
C (:)
Which character is used as a substitution variable in APEX? A) & B) ; C) : D) *
D (First Name)
Which column alias is invalid? A) First_Name B) "First Name" C) "FIRST NAME" D) First Name
B (SELECT last_name AS Last Name FROM employees;)
Which column alias will cause an error? A) SELECT last_name AS lname FROM employees; B) SELECT last_name AS Last Name FROM employees; C) SELECT last_name "Last Name" FROM employees; D) SELECT last_name lname FROM employees;
B (LIKE)
You use the ______ operator to perform wildcard searches of valid search string values. A) MATCH B) LIKE C) BETWEEN D) STRING
C (Read)
_______ consistency guarantees a consistent view of the data at all times. A) Table B) Write C) Read D) Data
B (Transactions)
____________ give you more flexibility and control when changing data, and they ensure data consistency in the event of user process failure or system failure. A) Code blocks B) Transactions C) Procedures D) Functions
C (Either of the above)
A transaction begins when the first DML statement is encountered and ends when one of the following occurs: A) A COMMIT or ROLLBACK statement is issued. B) A DDL statement, such as CREATE, is issued. C) Either of the above statements D) None of the above
C and D
Joining tables with the NATURAL JOIN, USING, or ON clauses results in an __________ join. (Choose 2) A) OUTER B) CROSS C) INNER D) Equi-join
_ (underscore)
Represents a single character
D
Which of the following statements is an example of a SELF JOIN? A) SELECT department_id, department_name,location_id, city FROM departments NATURAL JOIN locations; B) SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id FROM employees e JOIN departments d ON (e.department_id = d.department_id); C) SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id FROM employees e JOIN departments d ON (e.department_id = d.department_id) AND e.manager_id = 149 ; D) SELECT worker.last_name emp, manager.last_name mgr FROM employees worker JOIN employees manager ON (worker.manager_id = manager.employee_id);
A
Which statement displays the last name, salary, and annual compensation of employees where the annual compensation is calculated by multiplying the monthly salary with 15, plus a one-time bonus of $200. A) SELECT last_name, salary, 15*salary+200 FROM employees; B) SELECT last_name, salary, 15*(salary+200) FROM employees; C) Either statement will produced the desired result. D) Neither statement will produce the desired result.
A (SELECT employee_id, last_name, job_id, salary FROM employees WHERE salary >= 10000 AND job_id LIKE '%JEF%';)
Which statement will display those employees who have a job title that contains the string 'JEF' and earn $10,000 or more? A) SELECT employee_id, last_name, job_id, salary FROM employees WHERE salary >= 10000 AND job_id LIKE '%JEF%'; B) SELECT employee_id, last_name, job_id, salary FROM employees WHERE salary >= 10000 OR job_id LIKE '%JEF%'; C) Either statement displays the desired output. D) Neither statement displays the desired output.
C and D
Which statements are NOT true? (Choose 2) A) You can sort query results by specifying the numeric position of the column in the SELECT clause. B) You can sort by a column that is not in the SELECT list. C) You cannot sort query results by more than one column. D) You cannot use a column alias in the ORDER BY clause.
A and B
Which statements will execute successfully? (Choose 2) A) SELECT employee_id, last_name, job_id, department_id, hire_date FROM employees ORDER BY 3; B) SELECT first_name, last_name FROM employees ORDER BY employee_id DES; C) SELECT first_name, last_name, first_name||last_name fullname FROM employees ORDER BY fullname; D) SELECT employee_id, first_name, last_name FROM employees ORDER BY employee_id DESCEND;
C (The field in the USING clause cannot have a qualifier.)
Why will the following statement result in an error? SELECT l.city, d.department_name FROM locations l JOIN departments d USING (location_id) WHERE d.location_id = 1400; A) Syntax of the USING clause is incorrect. B) WHERE clause cannot be used in a query with USING. C) The field in the USING clause cannot have a qualifier. D) There is nothing wrong
True
Will the following statement execute successfully (True or False)? SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id FROM employees e JOIN departments d ON (e.department_id = d.department_id);