1)When explicity inserting a row into a
table, the VALUES clause must include a value for every column of the
table. True or False?
*false
2.Is it possible to insert more than one row at a time using an INSERT statement with a VALUES clause?
*No, you can only create one row at a time when using the VALUES clause.
3.To modify an existing row in a table, you can use the ________ statement.
*UPDATE
4.What would be the result of the following statement:
DELETE FROM employees
*All rows in the employees table will be deleted
5.What is wrong with the following statement?
DELETE from employees WHERE salary > (SELECT MAX(salary) FROM employees);
DELETE from employees WHERE salary > (SELECT MAX(salary) FROM employees);
*Nothing is wrong, the statement will execute correctly.
6.You want to modify existing rows in a table. Which of the following are NOT needed in your SQL statement?
*A MODIFY clause
7.What is wrong with the following statement?
MERGE INTO emps e
USING new_emps ne
ON (e.employee_id = ne.employee_id)
WHEN MATCHED
THEN UPDATE SET ne.salary = e.salary
WHEN NOT MATCHED
THEN INSERT VALUES
(ne.employee_id, ne.first_name, ne.last_name, .... ne.salary, ....);
*The SET clause is trying to update the source table from the target table
8.Look at this SQL statement:
MERGE INTO old_trans ot
USING new_trans nt
ON (ot.trans_id = nt.trans_id) .... ;
OLD_TRANS is the source table and NEW_TRANS is the target table. True or false?
*False
Comments
Post a Comment