单项选择题

Examine the structure of the STUDENTS table:

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

A.
B.
C.
D.


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题

You need to create a view EMP_VU. The view should allow the users to manipulate the records of only the employees that are working for departments 10 or 20.
Which SQL statement would you use to create the view EMP_VU?()

A. CREATE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20);
B. CREATE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20)   WITH READ ONLY;
C. CREATE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20)   WITH CHECK OPTION;
D. CREATE FORCE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20);
E. CREATE FORCE VIEW emp_vu AS   SELECT *   FROM employees   WHERE department_id IN (10,20)   NO UPDATE;

3.单项选择题

Evaluate the SQL statement:
SELECT ROUND(45.953, -1), TRUNC(45.936, 2)
FROM dual;
Which values are displayed?()

A. 46 and 45
B. 46 and 45.93
C. 50 and 45.93
D. 50 and 45.9
E. 45 and 45.93
F. 45.95 and 45.93

4.单项选择题Which SQL statement accepts user input for the columns to be displayed, the table name, and WHERE condition?()

A. SELECT &1, "&2" FROM &3 WHERE last_name = '&8';
B. SELECT &1, '&2' FROM &3 WHERE '& last_name = '&8';
C. SELECT &1, &2 FROM &3 WHERE last_name = '&8';
D. SELECT &1, '&2' FROM EMP WHERE last_name = '&8';

5.多项选择题

From SQL*Plus, you issue this SELECT statement:

You use this statement to retrieve data from a data table for()。

A. Updating
B. Viewing
C. Deleting
D. Inserting
E. Truncating

6.单项选择题

EMPLOYEES and DEPARTMENTS data:
EMPLOYEES
DEMP_NAME DEPT_ID MGR_ID JOB_ID SALARY
EMPLOYEE_I
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
On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID.
On the DEPARTMENTS table DEPARTMENT_ID is the primary key.
Evaluate this UPDATE statement.
UPDATE employees
SET mgr_id =
(SELECT mgr_id
FROM employees
WHERE dept_id=
(SELECT department_id
FROM departments
WHERE department_name = 'Administration')),
Salary = (SELECT salary
FROM employees
WHERE emp_name = 'Smith')
WHERE job_id = 'IT_ADMIN';
What happens when the statement is executed?()

A. The statement executes successfully, leaves the manager ID as the existing value, and changes the salary to 4000 for the employees with ID 103 and 105.
B. The statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105.
C. The statement executes successfully, changes the manager ID to NULL, and changes the salary to 3000 for the employees with ID 103 and 105.
D. The statement fails because there is more than one row matching the employee name Smith.
E. The statement fails because there is more than one row matching the IT_ADMIN job ID in the EMPLOYEES table.
F. The statement fails because there is no 'Administration' department in the DEPARTMENTS table.

7.单项选择题

Evaluate this SQL statement:

What will happen if you remove all the parentheses from the calculation?()

A. The value displayed in the CALC_VALUE column will be lower.
B. The value displayed in the CALC_VALUE column will be higher.
C. There will be no difference in the value displayed in the CALC_VALUE column.
D. An error will be reported.

8.多项选择题Which two statements are true about WHERE and HAVING clauses? ()

A. A WHERE clause can be used to restrict both rows and groups.
B. A WHERE clause can be used to restrict rows only.
C. A HAVING clause can be used to restrict both rows and groups.
D. A HAVING clause can be used to restrict groups only.
E. A WHERE clause CANNOT be used in a query of the query uses a HAVING clause.
F. A HAVING clause CANNOT be used in subqueries.

9.单项选择题Which SELECT statement will the result ‘ello World’ from the string ‘Hello World’?()

A. SELECT SUBSTR( ‘Hello World’,1) FROM dual;
B. SELECT INITCAP(TRIM (‘Hello World’, 1,1)) FROM dual;
C. SELECT LOWER(SUBSTR(‘Hello World’, 1, 1) FROM dual;
D. SELECT LOWER(SUBSTR(‘Hello World’, 2, 1) FROM dual;
E. SELECT LOWER(TRIM (‘H’ FROM ‘Hello World’)) FROM dual;

10.多项选择题Which two statements about creating constraints are true? ()

A. Constraint names must start with SYS_C
B. All constraints must be defines at the column level
C. Constraints can be created after the table is created
D. Constraints can be created at the same time the table is created
E. Information about constraints is found in the VIEW_CONSTRAINTS dictionary view