单项选择题

Evaluate this SQL statement:
SELECT e.emp_name, d.dept_name
FROM employees e
JOIN departments d
USING (department_id)
WHERE d.department_id NOT IN (10,40)
ORSER BY dept_name;
The statement fails when executed. Which change fixes the error? ()

A. remove the ORDER BY clause
B. remove the table alias prefix from the WHERE clause
C. remove the table alias from the SELECT clause
D. prefix the column in the USING clause with the table alias
E. prefix the column in the ORDER BY clause with the table alias
F. replace the condition "d.department_id NOT IN (10,40)" in the WHERE clause with "d.department_id <> 10 AND d.department_id <> 40"


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题Which three statements about subqueries are true? ()

A. A main query can have more than one subquery.
B. A subquery can have more than one main query.
C. The subquery and main query must retrieve data from the same table.
D. The subquery and main query can retrieve data from different tables.
E. Only one column or expression can be compared between the subquery and main query.
F. Multiple columns or expression can be compared between the subquery and main query.

2.单项选择题For which action can you use the TO_DATE function? ()

A. Convert any date literal to a date
B. Convert any numeric literal to a date
C. Convert any character literal to a date
D. Convert any date to a character literal
E. Format '10-JAN-99' to 'January 10 1999'

3.单项选择题What is true regarding subqueries?()

A. The inner query always sorts the results of the outer query
B. The outer query always sorts the results of the inner query
C. The outer query must return a value to the outer query
D. The inner query returns a value to the outer query
E. The inner query must always return a value or the outer query will give an error

4.单项选择题What is true about sequences? ()

A. The start value of the sequence is always 1.
B. A sequence always increments by 1.
C. The minimum value of an ascending sequence defaults to 1.
D. The maximum value of descending sequence defaults to 1.

5.单项选择题

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2 (25)
LAST_NAME VARCHAR2 (25)
HIRE_DATE DATE
Which UPDATE statement is valid? ()

A. UPDATE employees SET first_name = 'John' SET last_name = 'Smith' WHERE employee_id = 180;
B. UPDATE employees SET first_name = 'John', SET last_name = 'Smoth' WHERE employee_id = 180;
C. UPDATE employee SET first_name = 'John' AND last_name = 'Smith' WHERE employee_id = 180;
D. UPDATE employee SET first_name = 'John', last_name = 'Smith' WHERE employee_id = 180;

6.单项选择题Examine the statement: Create synonym emp for hr. employees; What happens when you issue the statement? ()

A. An error is generated.
B. You will have two identical tables in the HR schema with different names.
C. You create a table called employees in the HR schema based on you EMP table.
D. You create an alternative name for the employees table in the HR schema in your own schema.

7.单项选择题Which statement accomplish this? ()

A. CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE = SYSDATE);
B. CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE DEFAULT SYSDATE);
C. CREATE OR REPLACE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE DEFAULT SYSDATE);
D. CREATE OR REPLACE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE = SYSDATE);
E. CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE = SYSDATE);
F. CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE DEFAULT SYSDATE);

8.单项选择题User Mary has a view called EMP_DEPT_LOC_VU that was created based on the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables. She has the privilege to create a public synonym, and would like to create a synonym for this view that can be used by all users of the database. Which SQL statement can Mary use to accomplish that task?()

A. CREATE PUBLIC SYNONYM EDL_VU ON emp_dept_loc_vu
B. CREATE PUBLIC SYNONYM EDL:VU FOR mary (emp_dept_loc_vu);
C. CREATE PUBLIC SYNONYM EDL_VU FOR emp _dept_loc_vu;
D. CREATE SYNONYM EDL_VU ON emp_dept_loc_vu FOR EACH USER;
E. CREATE SYNONYM EDL_VU FOR EACH USER ON emp_dept_loc_vu
F. CREATE PUBLIC SYNONYM EDL_VU ON emp_dept_loc_vu FOR ALL USERS;

9.多项选择题Which two statements about subqueries are true? ()

A. A single row subquery can retrieve data from only one table.
B. A SQL query statement cannot display data from table B that is referred to in its subquery, unless table B is included in the main query's FROM clause.
C. A SQL query statement can display data from table B that is referred to in its subquery, without including B in its own FROM clause.
D. A single row subquery can retrieve data from more than one table.
E. A single row subquery cannot be used in a condition where the LIKE operator is used for comparison.
F. A multiple-row subquery cannot be used in an INSERT statement to insert multiple rows at a time.

10.单项选择题

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATE
Which INSERT statement is valid? ()

A. INSERT INTO employees (employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01/01/01);
B. INSERT INTO employees(employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01 january 01');
C. INSERT INTO employees(employee_id, first_name, last_name, Hire_date) VALUES (1000, 'John', 'smith', To_ date ('01/01/01));
D. INSERT INTO employees(employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01-Jan-01');

最新试题

A SELECT statement can be used to perform these three functions:1. Choose rows from a table.2. Choose columns from a table3. Bring together data that is stored in different tables by creating a link between them. Which set of keywords describes these capabilities? ()

题型:单项选择题

Which constraint can be defined only at the column level? ()

题型:单项选择题

Which statement accomplish this? ()

题型:单项选择题

Which object privileges can be granted on a view? ()

题型:单项选择题

The user Alice wants to grant all users query privileges on her DEPT table. Which SQL statement accomplishes this? ()

题型:单项选择题

For which action can you use the TO_DATE function? ()

题型:单项选择题

Examine the structure of the STUDENTS table:STUDENT_ID NUMBER NOT NULL, Primary KeySTUDENT_NAME VARCHAR2(30)COURSE_ID VARCHAR2(10) NOT NULLMARKS NUMBERSTART_DATE DATEFINISH_DATE DATEYou need to create a report of the 10 students who achieved the highest ranking in the course INT SQL and who completed the course in the year 1999.Which SQL statement accomplishes this task? ()

题型:单项选择题

Examine these statements:CREATE ROLE registrarGRANT UPDATE ON dtudent_grades TO registrar;GRANT registrar to user1, user2, user3;What does this set of SQL statements do? ()

题型:单项选择题

Which three are true? ()

题型:多项选择题

You need to perform these tasks:1. Create and assign a MANAGER role to Blake and Clark2. Grant CREATE TABLE and CREATE VIEW privileges to Blake and ClarkWhich set of SQL statements achieves the desired results? ()

题型:单项选择题