单项选择题

Examine the data from the ORDERS and CUSTOMERS table.

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.
B.
C.
D.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

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.

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 MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);

3.单项选择题

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;

4.单项选择题

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');

5.多项选择题

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)

6.单项选择题

The EMPLOYEE tables has these columns:
LAST_NAME VARCHAR2(35)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(5,2)
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;

7.多项选择题

Examine the description of the STUDENTS table:
STD_ID NUMBER(4)
COURSE_ID VARCHARD2(10)
START_DATE DATE
END_DATE DATE
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)

8.单项选择题Which syntax turns an existing constraint on?()

A. ALTER TABLE table_name   ENABLE constraint_name;
B. ALTER TABLE table_name   STATUS = ENABLE CONSTRAINT constraint_name;
C. ALTER TABLE table_name   ENABLE CONSTRAINT constraint_name;
D. ALTER TABLE table_name   STATUS ENABLE CONSTRAINT constraint_name;
E. ALTER TABLE table_name   TURN ON CONSTRAINT constraint_name;

9.单项选择题Which syntax turns an existing constraint on?()

A. ALTER TABLE table_name ENABLE constraint_name;
B. ALTER TABLE table_name STATUS = ENABLE CONSTRAINT constraint _ name;
C. ALTER TABLE table_name ENABLE CONSTRAINT constraint _ name;
D. ALTER TABLE table_name TURN ON CONSTRAINT constraint _ name;

10.单项选择题

Management has asked you to calculate the value 12*salary* commission_pct for all the employees in the EMP table. The EMP table contains these columns:

Which statement ensures that a value is displayed in the calculated columns for all employees?()

A. SELECT last_name, 12*salary* commission_pct FROM emp;
B. SELECT last_name, 12*salary* (commission_pct,0) FROM emp;
C. SELECT last_name, 12*salary*(nvl(commission_pct,0)) FROM emp;
D. SELECT last_name, 12*salary*(decode(commission_pct,0)) FROM emp;

最新试题