Q1. View the Exhibit and examine the structures of the employees and departments tables.
You want to update the employees table as follows:
-Update only those employees who work in Boston or Seattle (locations 2900 and 2700).
-Set department_id for these employees to the department_id corresponding to London (location_id 2100).
-Set the employees' salary in iocation_id 2100 to 1.1 times the average salary of their department.
-Set the employees' commission in iocation_id 2100 to 1.5 times the average commission of their department.
You issue the following command:
What is the outcome?
A. It executes successfully and gives the correct result.
B. It executes successfully but does not give the correct result.
C. It generates an error because a subquery cannot have a join condition in an update statement.
D. It generates an error because multiple columns (SALARY, COMMISSION) cannot be specified together in an update statement.
Answer: B
Q2. View the Exhibit and examine the description of SALES and PROMOTIONS tables.
You want to delete rows from the sales table, where the PROMO_NAME column in the promotions table has either blowout sale of everyday low prices as values.
Which three delete statements are valid?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B,C,D
Q3. Evaluate the following SQL statement:
Which statement is true regarding the outcome of the above query?
A. It executes successfully and displays rows in the descending order of PROMO_CATEGORY.
B. It produces an error because positional notation cannot be used in the order by clause with set operators.
C. It executes successfully but ignores the order by clause because it is not located at the end of the compound statement.
D. It produces an error because the order by clause should appear only at the end of a compound query-that is, with the last select statement.
Answer: D
Q4. Which three SQL statements would display the value 1890.55 as $1, 890.55?
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: A,D,E
Q5. View the Exhibit and examine the structure of the products table.
Evaluate the following query:
What would be the outcome of executing the above SQL statement?
A. It produces an error.
B. It shows the names of all products in the table.
C. It shows the names of products whose list price is the second highest in the table.
D. It shows the names of all products whose list price is less than the maximum list price.
Answer: C
Q6. Examine the data in the CUST_NAME column of the customers table.
You need to display customers' second names where the second name starts with "Mc" or "MC."
Which query gives the required output?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Q7. Evaluate the following SQL commands:
The command to create a table fails. Identify the two reasons for the SQL statement failure?
A. You cannot use SYSDATE in the condition of a check constraint.
B. You cannot use the BETWEEN clause in the condition of a check constraint.
C. You cannot use the NEXTVAL sequence value as a default value for a column.
D. You cannot use ORD_NO and ITEM_NO columns as a composite primary key because ORD_NO is also the foreign key.
Answer: A,C
Explanation:
CHECK Constraint The CHECK constraint defines a condition that each row must satisfy. The condition can use the same constructs as the query conditions, with the following exceptions: References to the CURRVAL, NEXTVAL, LEVEL, and ROWNUM pseudocolumns Calls to SYSDATE, UID, USER, and USERENV functions Queries that refer to other values in other rows A single column can have multiple CHECK constraints that refer to the column in its definition. There is no limit to the number of CHECK constraints that you can define on a column. CHECK constraints can be defined at the column level or table level. CREATE TABLE employees (... Salary NUMBER(8, 2) CONSTRAINT emp_salary_min CHECK (salary > 0),
Q8. Examine the structure of the employees table:
There is a parent/child relationship between EMPLOYEE_ID and MANAGER_ID.
You want to display the name, joining date, and manager for all the employees. Newly hired employees are yet to be assigned a department or a manager. For them, 'No Manager1 should be displayed in the manager column.
Which SQL query gets the required output?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Reference: http://ivrainbow65.blogspot.com/
Q9. You want to display 5 percent of the employees with the highest salaries in the EMPLOYEES table.
Which query will generate the required result?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Q10. You need to list the employees in DEPARTMENT_ID 30 in a single row, ordered by HIRE_DATE.
Examine the sample output:
Which query will provide the required output?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Reference: http://docs.oracle.com/cd/E11882_01/server.112/e10592/functions089.htm