单项选择题

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.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题Which SQL statement defines the FOREIGN KEY constraint on the DEPTNO column of the EMP table?()

A. CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) NOT NULL CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);
B. CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));
C. CREATE TABLE EMP (empno NUMBER(4) ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));
D. CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp deptno fk REFERENCES dept (deptno));

2.单项选择题You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()

A. ALTER TABLE students   ADD PRIMARY KEY student_id;
B. ALTER TABLE students   ADD CONSTRAINT PRIMARY KEY (student_id);
C. ALTER TABLE students   ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;
D. ALTER TABLE students   ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
E. ALTER TABLE students   MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

3.多项选择题Which three are DATETIME data types that can be used when specifying column definitions? ()

A. TIMESTAMP
B. INTERVAL MONTH TO DAY
C. INTERVAL DAY TO SECOND
D. INTERVAL YEAR TO MONTH
E. TIMESTAMP WITH DATABASE TIMEZONE

4.单项选择题

Examine the data in the EMPLOYEES and DEPARTMENTS tables:
EMPLOYEES
EMP_NAME DEPT_ID MGR_ID JOB_ID SALARY
EMPLOYEE_ID
101 Smith 20 120 SA_REP 4000
102 Martin 10 105 CLERK 2500
103 Chris 20 120 IT_ADMIN 4200
104 John 30 108 HR_CLERK 2500
105 Diana 30 108 IT_ADMIN 5000
106 Smith 40 110 AD_ASST 3000
108 Jennifer 30 110 HR_DIR 6500
110 Bob 40 EX_DIR 8000
120 Ravi 20 110 SA*DIR 6500
DEPARTMENTS
DEPARTMENT_ID DEPARTMENT_NAME
10 Admin
20 Education
30 IT
40 Human Resources
Also examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables:
CREATE TABLE departments
(department_id NUMBER PRIMARY KEY,
department _ name VARCHAR2(30));
CREATE TABLE employees
(EMPLOYEE_ID NUMBER PRIMARY KEY,
EMP_NAME VARCHAR2(20),
DEPT_ID NUMBER REFERENCES
departments(department_id),
MGR_ID NUMBER REFERENCES
employees(employee id),
MGR_ID NUMBER REFERENCES
employees(employee id),
JOB_ID VARCHAR2(15).
SALARY NUMBER);
ON the EMPLOYEES,
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:
DELETE
FROM departments
WHERE department id = 40;
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.

6.单项选择题

Evaluate the SQL statement:
1 SELECT a.emp_name, a.sal, a.dept_id, b.maxsal
2 FROM employees a,
3 (SELECT dept_id, MAX(sal) maxsal
4. FROM employees
5 GROUP BY dept_id) b
6 WHERE a.dept_id = b.dept_id
7 AND a. asl < b. maxsal;
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.

7.单项选择题You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()

A. ALTER TABLE students ADD PRIMARY KEY student_id;
B. ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);
C. ALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
D. ALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);

8.单项选择题

The EMPLOYEE tables has these columns:

You want to display the name and annual salary multiplied by the commission_pct for all employees. For records that have a NULL commission_pct, a zero must be displayed against the calculated column.
Which SQL statement displays the desired results?()

A. SELECT last_name, (salary * 12) * commission_pct   FROM EMPLOYEES;
B. SELECT last_name, (salary * 12) * IFNULL(commission_pct, 0)   FROM EMPLOYEES;
C. SELECT last_name, (salary * 12) * NVL2(commission_pct, 0)   FROM EMPLOYEES;
D. SELECT last_name, (salary * 12) * NVL(commission_pct, 0)   FROM EMPLOYEES;

9.单项选择题

Examine the data from the ORDERS and CUSTOMERS table.
ORDERS
ORD_ID ORD_DATE CUST_ID ORD_TOTAL
100 12-JAN-2000 15 10000
09-MAR-
101 40 8000
09-MAR-
102 35 12500
15-MAR-
103 15 12000
104 25-JUN-2000 15 6000
105 18-JUL-2000 20 5000
106 18-JUL-2000 35 7000
107 21-JUL-2000 20 6500
04-AUG-
108 10 8000
CUSTOMERS
CUST_ID CUST_NAME CITY
10 Smith Los Angeles
15 Bob San Francisco
20 Martin Chicago
25 Mary New York
30 Rina Chicago
35 Smith New York
40 Linda New York
Which SQL statement retrieves the order ID, customer ID, and order total for the orders that are placed on the same day that Martin places his orders?()
 

A. SELECT ord_id, cust_id, ord_total FROM orders, customers WHERE cust_name='Mating' AND ord _ date IN ('18-JUL-2000','21-JUL-2000');
B. SELECT ord_id, cust_id, ord_total FROM orders Where ord_date IN (SELECT ord_date FROM orders WHERE cust_id = (SELECT cust_id FROM customers WHERE cust_name = 'MARTIN'));
C. SELECT ord_id, cust_id, ord_total FROM orders Where ord_date IN (SELECT ord_date FROM orders, customers Where cust _ name = 'Martin');
D. SELECT ord_id, cust_id, ord_total FROM orders WHERE cust_id IN (SELECT cust_id FROM customers WHERE cust name = 'Martin');

10.多项选择题

Examine the description of the STUDENTS table:

Which two aggregate functions are valid on the START_DATE column?()

A. SUM(start_date)
B. AVG(start_date)
C. COUNT(start_date)
D. AVG(start_date, end_date)
E. MIN(start_date)
F. MAXIMUM(start_date)

最新试题

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? ()

题型:多项选择题

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? ()

题型:单项选择题

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

题型:单项选择题

Which is an iSQL*Plus command? ()

题型:单项选择题

Which three statements about subqueries are true? ()

题型:多项选择题

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? ()

题型:单项选择题

Evaluate the SQL statement: TRUNCATE TABLE DEPT; Which three are true about the SQL statement? ()

题型:多项选择题

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

题型:单项选择题

In which two cases would you use an outer join? ()

题型:多项选择题

Which is a valid CREATE TABLE statement? ()

题型:单项选择题