单项选择题

Examine the data in the EMPLOYEES and DEPARTMENTS tables:

Also examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables:

On the EMPLOYEES table, EMPLOYEE_ID is the primary key.
MGR_ID is the ID of managers and refers to the EMPLOYEE_ID.
DEPT_ID is foreign key to DEPARTMENT_ID column of the DEPARTMENTS table.
On the DEPARTMENTS table, DEPARTMENT_ID is the primary key.
Examine this DELETE statement:

What happens when you execute the DELETE statement?()

A. Only the row with department ID 40 is deleted in the DEPARTMENTS table.
B. The statement fails because there are child records in the EMPLOYEES table with department ID 40.
C. The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 110 and 106 are deleted from the EMPLOYEES table.
D. The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 106 and 110 and the employees working under employee 110 are deleted from the EMPLOYEES table.
E. The row with department ID 40 is deleted in the DEPARTMENTS table. Also all the rows in the EMPLOYEES table are deleted.
F. The statement fails because there are no columns specifies in the DELETE clause of the DELETE statement.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题Which statement explicitly names a constraint?()

A. ALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students (student_id);
B. ALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
C. ALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
D. ALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
E. ALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);

2.单项选择题

You want to display the titles of books that meet these criteria:
1. Purchased before January 21, 2001
2. Price is less then $500 or greater than $900
You want to sort the results by their data of purchase, starting with the most recently bought book.
Which statement should you use?()

A. SELECT book_title FROM books WHERE price between 500 and 900 AND purchase_date < '21-JAN-2001' ORDER BY purchase_date;
B. SELECT book_title FROM books WHERE price IN (500,900) AND purchase_date < '21-JAN-2001' ORDER BY purchase date ASC;
C. SELECT book_title FROM books WHERE price < 500 or > 900 AND purchase_date < '21-JAN-2001' ORDER BY purchase date DESC;
D. SELECT book_title FROM books WHERE (price < 500 OR price > 900) AND purchase_date < '21-JAN-2001' ORDER BY purchase date DESC;

3.单项选择题Which /SQL*Plus feature can be used to replace values in the WHERE clause?()

A. Substitution variables
B. Replacement variables
C. Prompt variables
D. Instead-of variables
E. This feature cannot be implemented through /SQL*Plus.

4.单项选择题

Examine the description of the MARKS table:
STD_ID NUMBER(4)
STUDENT_NAME VARCHAR2(30)
SUBJ1 NUMBER(3)
SUBJ2 NUMBER(3)
SUBJ1 and SUBJ2 indicate the marks obtained by a student in two subjects.
Examine this SELECT statement based on the MARKS table:
SELECT subj1+subj2 total_marks, std_id
FROM marks
WHERE subj1 > AVG(subj1) AND subj2 > AVG(subj2)
ORDER BY total_ marks;
What is the result of the SELECT statement?()

A. The statement executes successfully and returns the student ID and sum of all marks for each student who obtained more than the average mark in each subject.
B. The statement returns an error at the SELECT clause.
C. The statement returns an error at the WHERE clause.
D. The statement returns an error at the ORDER BY clause.

6.单项选择题

The EMP table contains these columns:
LAST NAME VARCHAR2(25)
SALARY NUMBER(6,2)
DEPARTMENT_ID NUMBER(6)
You need to display the employees who have not been assigned to any department.
You write the SELECT statement:
SELECT LAST_NAME, SALARY, DEPARTMENT_ID
FROM EMP
WHERE DEPARMENT_ID = NULL;
What is true about this SQL statement?()

A. The SQL statement displays the desired results.
B. The column in the WHERE clause should be changed to display the desired results.
C. The operator in the WHERE clause should be changed to display the desired results.
D. The WHERE clause should be changed to use an outer join to display the desired results.

7.单项选择题

Examine the structure of the EMPLOYEES and DEPARTMENTS tables:
EMPLOYEESColumn name Data type Remarks
EMPLOYEE_ID NUMBER NOT NULL, Primary Key
EMP_NAME VARCHAR2 (30)
JOB_ID VARCHAR2 (20)
SALARY NUMBER
MGR_ID NUMBER References EMPLOYEE_ID COLUMN
DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID
column of the DEPARTMENTS table
DEPARTMENTSColumn name Data type Remarks
DEPARTMENT_ID NUMBER NOT NULL, Primary Key
DEPARTMENT_NAME VARCHAR2(30)
MGR_ID NUMBER References MGR_ID column of the
EMPLOYEES table
Evaluate this SQL statement:
SELECT employee_id, e.department_id, department_name,
salary
FROM employees e, departments d
WHERE e. department_id = d.department_id;
Which SQL statement is equivalent to the above SQL statement?()

A. SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);
B. SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;
C. SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;
D. SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);

8.单项选择题Which data dictionary table should you query to view the object privileges granted to the user on specific columns?()

A. USER_TAB_PRIVS_MADE
B. USER_TAB_PRIVS
C. USER_COL_PRIVS_MADE
D. USER_COL_PRIVS

9.单项选择题

Evaluate the SQL statement:

What is the result of the statement?()

A. The statement produces an error at line 1.
B. The statement produces an error at line 3.
C. The statement produces an error at line 6.
D. The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all departments that pay less salary then the maximum salary paid in the company.
E. The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all employees who earn less than the maximum salary in their department.

10.单项选择题

Evaluate the set of SQL statements:
CREATE TABLE dept
(deptno NUMBER(2),
dname VARCNAR2(14),
1oc VARCNAR2 (13));
ROLLBACK;
DESCRIBE DEPT
What is true about the set?()

A. The DESCRIBE DEPT statement displays the structure of the DEPT table.
B. The ROLLBACK statement frees the storage space occupies by the DEPT table.
C. The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does not exist.
D. The DESCRIBE DEPT statement displays the structure of the DEPT table only if there is a COMMIT statement introduced before the ROLLBACK statement.

最新试题

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

题型:单项选择题

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 the structure of the EMPLOYEES table:EMPLOYEE_ID NUMBER NOT NULL, Primary KeyEMP_NAME VARCHAR2(30)JOB_ID NUMBER\SAL NUMBERMGR_ID NUMBER References EMPLOYEE_ID columnDEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table You created a sequence called EMP_ID_SEQ inorderto populate sequential values for the EMPLOYEE_ID column of the EMPLOYEES table. Which two statements regarding the EMP_ID_SEQ sequence are true? ()

题型:多项选择题

Which two are true about aggregate functions?()

题型:多项选择题

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

题型:单项选择题

Which is a valid CREATE TABLE statement? ()

题型:单项选择题

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 one is a system privilege? ()

题型:单项选择题

You need to design a student registration database that contains several tables storing academic information.The STUDENTS table stores information about a student. The STUDENT_GRADES table storesinformation about the student's grades. Both of the tables have a column named STUDENT_ID. The STUDENT_ID column in the STUDENTS table is a primary key.You need to create a foreign key on the STUDENT_ID column of the STUDENT_GRADES table thatpoints to the STUDENT_ID column of the STUDENTS table. Which statement creates the foreign key?()

题型:单项选择题

Which is an iSQL*Plus command? ()

题型:单项选择题