Question: 1
Examine the structure of the MEMBERS table:
NameNull?Type
------------------------------------------------------------
MEMBER_IDNOT NULLVARCHAR2 (6)
FIRST_NAMEVARCHAR2 (50)
LAST_NAMENOT NULLVARCHAR2 (50)
ADDRESSVARCHAR2 (50)
CITYVARCHAR2 (25)
STATEVARCHAR2 (3)
You want to display details of all members who reside in states starting with the letter A followed by exactly one character.
Which SQL statement must you execute?
Question: 2
You issue the following command to drop the PRODUCTS table: (Choose all that apply.)
SQL > DROP TABLE products;
Which three statements are true about the implication of this command?
Question: 3
View the Exhibit and examine the structure of ORDERS and ORDER_ITEMS tables.
ORDER_ID is the primary key in the ORDERS table. It is also the foreign key in the ORDER_ITEMS table wherein it is created with the ON DELETE CASCADE option.
Which DELETE statement would execute successfully?
Question: 4
View the exhibit and examine the structures of the EMPLOYEES and DEPARTMENTS tables.
EMPLOYEES
NameNull?Type
---------------------- -------------
EMPLOYEE_IDNOT NULLNUMBER(6)
FIRST_NAMEVARCHAR2(20)
LAST_NAMENOT NULLVARCHAR2(25)
HIRE_DATENOT NULLDATE
JOB_IDNOT NULLVARCHAR2(10)
SALARYNUMBER(10,2)
COMMISSIONNUMBER(6,2)
MANAGER_IDNUMBER(6)
DEPARTMENT_IDNUMBER(4)
DEPARTMENTS
NameNull?Type
---------------------- -------------
DEPARTMENT_IDNOT NULLNUMBER(4)
DEPARTMENT_NAMENOT NULLVARCHAR2(30)
MANAGER_IDNUMBER(6)
LOCATION_IDNUMBER(4)
You want to update EMPLOYEES table as follows:
You issue the following command:
SQL> UPDATE employees
SET department_id =
(SELECT department_id
FROM departments
WHERE location_id = 2100),
(salary, commission) =
(SELECT 1.1*AVG(salary), 1.5*AVG(commission)
FROM employees, departments
WHERE departments.location_id IN(2900, 2700, 2100))
WHERE department_id IN
(SELECT department_id
FROM departments
WHERE location_id = 2900
OR location_id = 2700;
What is outcome?
Question: 5
Evaluate the following two queries:
SQL> SELECT cust_last_name, cust_city
FROM customers
WHERE cust_credit_limit IN (1000, 2000, 3000);
SQL> SELECT cust_last_name, cust_city
FROM customers
WHERE cust_credit_limit = 1000 or cust_credit_limit = 2000 or
cust_credit_limit = 3000
Which statement is true regarding the above two queries?