单项选择题

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.


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题

The EMP table contains these columns:
LAST_NAME VARCHAR2 (25)
SALARY NUMBER (6,2)
DEPARTMENT_ID NUMBER (6)
You need to display the employees who have not been assigned to any department. You write the SELECT statement:
SELECT LAST_NAME, SALARY, DEPARTMENT_ID
FROM EMP
WHERE DEPARTMENT_ID = NULL;
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.

3.多项选择题In which three cases would you use the USING clause?()

A.You want to create a nonequijoin.
B.The tables to be joined have multiple NULL columns.
C.The tables to be joined have columns of the same name and different data types.
D.The tables to be joined have columns with the same name and compatible data types.
E.You want to use a NATURAL join, but you want to restrict the number of columns in the join condition.

4.多项选择题Which two tasks can you perform using only the TO_CHAR function? ()

A.convert 10 to 'TEN'
B.convert '10' to 10
C.convert 10 to '10'
D.convert 'TEN' to 10
E.convert a date to a character expression
F.convert a character expression to a date

6.多项选择题

Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER NOT NULL, Primary Key
EMP_NAME VARCHAR2(30)
JOB_ID NUMBER
SAL NUMBER
MGR_ID NUMBER References EMPLOYEE_ID column
DEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table
You created a sequence called EMP_ID_SEQ in order to populate sequential values for the EMPLOYEE_ID column of the EMPLOYEES table.
Which two statements regarding the EMP_ID_SEQ sequence are true? ()

A.You cannot use the EMP_ID_SEQ sequence to populate the JOB_ID column.
B.The EMP_ID_SEQ sequence is invalidated when you modify the EMPLOYEE_ID column.
C.The EMP_ID_SEQ sequence is not affected by modifications to the EMPLOYEES table.
D.Any other column of NUMBER data type in your schema can use the EMP_ID_SEQ sequence.
E.The EMP_ID_SEQ sequence is dropped automatically when you drop the EMPLOYEES table.
F.The EMP_ID_SEQ sequence is dropped automatically when you drop the EMPLOYEE_ID column.

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

8.单项选择题

Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER NOT NULL
EMP_NAME VARCHAR2(30)
JOB_ID VARCHAR2(20)
SAL NUMBER
MGR_ID NUMBER
DEPARTMENT_ID NUMBER
You want to create a SQL script file that contains an INSERT statement. When the script is run, the INSERT statement should insert a row with the specified values into the EMPLOYEES table. The INSERT statement should pass values to the table columns as specified below:
EMPLOYEE_ID: Next value from the sequence
EMP_ID_SEQ EMP_NAME and JOB_ID: As specified by the user during run time, throughsubstitution variables
SAL: 2000
MGR_ID: No value
DEPARTMENT_ID: Supplied by the user during run time through
substitution variable. The INSERT statement should fail if the user supplies a value other than 20 or 50.
Which INSERT statement meets the above requirements?()

A.INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
B.INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did IN (20,50));
C.INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50)) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
D.INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50) WITH CHECK OPTION) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
E.INSERT INTO (SELECT * FROM employees WHERE (department_id = 20 AND department_id = 50) WITH CHECK OPTION ) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);

9.单项选择题You need to perform certain data manipulation operations through a view called EMP_DEPT_VU, which you previously created. You want to look at the definition of the view (the SELECT statement on which the view was created.) How do you obtain the definition of the view?()

A.Use the DESCRIBE command on the EMP_DEPT_VU view.
B.Use the DEFINE VIEW command on the EMP_DEPT_VU view.
C.Use the DESCRIBE VIEW command on the EMP_DEPT_VU view.
D.Query the USER_VIEWS data dictionary view to search for the EMP_DEPT_VU view.
E.Query the USER_SOURCE data dictionary view to search for the EMP_DEPT_VU view.
F.Query the USER_OBJECTS data dictionary view to search for the EMP_DEPT_VU view.

10.单项选择题

Examine the description of the CUSTOMERS table:
CUSTOMER_ID NUMBER(4) NOT NULL
CUSTOMER_NAME VARCHAR2(100) NOT NULL
STREET_ADDRESS VARCHAR2(150)
CITY_ADDRESS VARCHAR2(50)
STATE_ADDRESS VARCHAR2(50)
PROVINCE_ADDRESS VARCHAR2(50)
COUNTRY_ADDRESS VARCHAR2(50)
POSTAL_CODE VARCHAR2(12)
CUSTOMER_PHONE VARCHAR2(20)
The CUSTOMER_ID column is the primary key for the table.
Which statement returns the city address and the number of customers in the cities Los Angeles or San Francisco?()

A.SELECT city_address, COUNT(*) FROM customers WHERE city_address IN ('Los Angeles', 'San Francisco');
B.SELECT city_address, COUNT(*) FROM customers WHERE city_address IN ('Los Angeles', 'San Francisco') GROUP BY city_address;
C.SELECT city_address, COUNT(customer_id) FROM customers WHERE city_address IN ('Los Angeles', 'San Francisco') GROUP BY city_address, customer_id;
D.SELECT city_address, COUNT(customer_id) FROM customers GROUP BY city_address IN ('Los Angeles', 'San Francisco');