单项选择题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.多项选择题Which two are true about aggregate functions? ()

A. You can use aggregate functions in any clause of a SELECT statement.
B. You can use aggregate functions only in the column list of the SELECT clause and in the WHERE clause of a SELECT statement.
C. You can mix single row columns with aggregate functions in the column list of a SELECT statement by grouping on the single row columns.
D. You can pass column names, expressions, constants, or functions as parameters to an aggregate function.
E. You can use aggregate functions on a table, only by grouping the whole table as one single group.
F. You cannot group the rows of a table by more than one column while using aggregate functions.

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:

SUBJ1 and SUBJ2 indicate the marks obtained by a student in two subjects.
Examine this SELECT statement based on the MARKS table:

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.

5.单项选择题

Evaluate the SQL statement:

What will be displayed?()

A. 0
B. 1
C. 0.00
D. An error statement

6.单项选择题

The EMP table contains these columns:

You need to display the employees who have not been assigned to any department.
You write the SELECT statement:

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.单项选择题

The STUDENT_GRADES table has these columns:
STUDENT_ID NUMBER(12)
SEMESTER_END DATE
GPA NUMBER(4,3)
The registrar has asked for a report on the average grade point average (GPA) for students enrolled during semesters that end in the year 2000. Which statement accomplish this?()

A. SELECT AVERAGE(gpa) FROM student_grades WHERE semester _ end > '01-JAN-2000' and semester end <31-DEC-2000';
B. SELECT COUNT(gpa) FROM student grades WHERE semester _ end > '01-JAN-2000' and semester end <31-DEC-2000';
C. SELECT MIN(gpa) FROM student grades WHERE semester _ end > '01-JAN-2000' and semester end <31-DEC-2000';
D. SELECT AVG(gpa) FROM student_grades WHERE semester _ end BETWEEN '01-JAN-2000' and '31-DEC-2000';
E. SELECT SUM(gpa) FROM student grades WHERE semester _ end > '01-JAN-2000' and semester end <31-DEC-2000';
F. SELECT MEDIAN(gpa) FROM student_grades WHERE semester _ end > '01-JAN-2000' and semester end <31-DEC-2000';

8.单项选择题

Examine the structure if the EMPLOYEES table:
Column name Data Type Remarks
EMPLOYEE_ID NUMBER NOT NULL, Primary Key
EMP_NAME VARCHAR2(30)
JOB_ID VARCHAR2(20) NOT NULL
SAL NUMBER
MGR_ID NUMBER References EMPLOYEE_ID column
DEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID
column of the DEPARTMENTS table
You need to create a view called EMP_VU that allows the user to insert rows through the view. Which SQL statement, when used to create the EMP_VU view, allows the user to insert rows?()

A. CREATE VIEW emp_Vu AS SELECT employee_id, emp_name, department_id FROM employees WHERE mgr_id IN (102, 120);
B. CREATE VIEW emp_Vu AS SELECT employee_id, emp_name, job_id department_id FROM employees WHERE mgr_id IN (102, 120);
C. CREATE VIEW emp_Vu AS SELECT department_id, SUM(sal) TOTALSAL FROM employees WHERE mgr_id IN (102, 120) GROUP BY department_ id;
D. CREATE VIEW emp_Vu AS SELECT employee_id, emp_name, job_id, DISTINCT department_id FROM employees;

10.单项选择题

Examine the description of the EMPLOYEES table:
EMP_ID NUMBER(4) NOT NULL
LAST_NAME VARCHAR2(30) NOT NULL
FIRST_NAME VARCHAR2(30)
DEPT_ID NUMBER(2)
JOB_CAT VARCHAR2(30)
SALARY NUMBER(8,2)
Which statement shows the department ID, minimum salary, and maximum salary paid in that department, only of the minimum salary is less then 5000 and the maximum salary is more than 15000?()

A. SELECT dept_id, MIN(salary(, MAX(salary) FROM employees WHERE MIN(salary) <5000 AND MAX (salary) > 15000;
B. SELECT dept_id, MIN(salary), MAX(salary) FROM employees WHERE MIN(salary) < 5000 AND MAX(salary) > 15000 GROUP BY dept_id;
C. SELECT dept_id, MIN(salary), MAX(salary) FROM employees HAVING MIN(salary) <5000 AND MAX (salary) > 15000;
D. SELECT dept_id, MIN(salary), MAX(salary) FROM employees GROUP BY dept_id HAVING MIN (salary) < 5000 AND MAX(salary)
E. SELECT dept_id, MIN(salary), MAX(salary) FROM employees GROUP BY dept_id, salary HAVING MIN (salary) <5000 AND MAX (salary) > 15000;