View the Exhibit and examine the structure of the PRODUCT_INFORMATIONtable.
You want to see the product names and the date of expiration of warranty for all the products, if the product is purchased today. The products that have no warranty should be displayed at the top and the products with maximum warranty period should be displayed at the bottom.
Which SQL statement would you execute to fulfill this requirement?
SELECT product_name, SYSDATE+warranty_period AS "Warranty expire date"
View the exhibit and examine the structures of the EMPLOYEESand DEPARTMENTStables.
EMPLOYEES
Name Null? Type
- ---------------- ----- -------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(10,2)
COMMISSION NUMBER(6,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
DEPARTMENTS
Name Null? Type
----------------- ----- -------------
DEPARTMENT_ID NOT NULL NUMBER(4)
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER(6)
LOCATION_ID NUMBER(4)
You want to update EMPLOYEEStable as follows:
Update only those employees who work in Boston or Seattle (locations 2900 and 2700).
Set department_idfor these employees to the department_idcorresponding to London
(location_id 2100).
Set the employees' salary in location_id2100 to 1.1 times the average salary of their department.
Set the employees' commission in location_id2100 to 1.5 times the average commission of their
department.
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?
Which two statements are true about Oracle synonyms?
View and Exhibit and examine the structure and data in the INVOICE table.
Which two statements are true regarding data type conversion in query expressions? (Choose two.)
Which three statements are true reading subqueries? (Choose three.)