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


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

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

2.单项选择题

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;

3.多项选择题Which three SELECT statements displays 2000 in the format "$2,000.00"? ()

A. SELECT TO CNAR(2000, '$#,###.##') FROM dual;
B. SELECT TO CNAR(2000, '$0,000.00') FROM dual;
C. SELECT TO CNAR(2000, '$9,999.00') FROM dual;
D. SELECT TO CNAR(2000, '$9,999.99') FROM dual;
E. SELECT TO CNAR(2000, '$2,000.00') FROM dual;
F. SELECT TO CNAR(2000, '$N,NNN.NN') FROM dual;

4.多项选择题For which two constraints does the Oracle Server implicitly create a unique index? ()

A. NOT NULL
B. PRIMARY KEY
C. FOREIGN KEY
D. CHECK
E. UNIQUE

5.单项选择题

You created a view called EMP_DEPT_VU that contains three columns from the EMPLOYEES and DEPARTMENTS tables:
EMPLOYEE_ID, EMPLOYEE_NAME AND DEPARTMENT_NAME.
The DEPARTMENT_ID column of the EMPLOYEES table is the foreign key to the primary key
DEPARTMENT_ID column of the DEPARTMENTS table.
You want to modify the view by adding a fourth column, MANAGER_ID of NUMBER data type from the EMPLOYEES tables.
How can you accomplish this task? ()

A. ALTER VIEW EMP_dept_vu (ADD manger_id NUMBER);
B. MODIFY VIEW EMP_dept_vu (ADD manger_id NUMBER);
C. ALTER VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employee e, departments d WHERE e.department _ id = d.department_id;
D. MODIFY VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id = d.department_id;
E. CREATE OR REPLACE VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id = d.department_id;
F. You must remove the existing view first, and then run the CREATE VIEW command with a new column list to modify a view.

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

8.单项选择题

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;

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

10.单项选择题

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.