单项选择题The EMPLOYEES table has these columns:LAST_NAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATEManagement wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement:ALTER TABLE EMPLOYEES MODIFY (SALARY DEFAULT 5000);Which is true about your ALTER statement?()

A.Column definitions cannot be altered to add DEFAULT values.
B.A change to the DEFAULT value affects only subsequent insertions to the table.
C.Column definitions cannot be altered to add DEFAULT values for columns with a NUMBER data type.
D.All the rows that have a NULL value for the SALARY column will be updated with the value 5000.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

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, through substitution 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);

2.单项选择题Which SELECT statement should you use to extract the year from the system date and display it in the format "1998"?()

A.SELECT TO_CHAR(SYSDATE,'yyyy') FROM dual;
B.SELECT TO_DATE(SYSDATE,'yyyy') FROM dual;
C.SELECT DECODE(SUBSTR(SYSDATE, 8), 'YYYY') FROM dual;
D.SELECT DECODE(SUBSTR(SYSDATE, 8), 'year') FROM dual;
E.SELECT TO_CHAR(SUBSTR(SYSDATE, 8,2),'yyyy') FROM dual;

3.单项选择题

Click the Exhibit button to examine the structure of the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables.
Two new departments are added to your company as shown:
DEPARTMENT_ID DEPARTMENT_NAME MGR_ID LOCATION_ID
9998 Engineering 123
9999 Administrative Boston
You need to list the names of employees, the department IDs, the department names, and the cities where the departments are, even if there are no employees in the departments and even if the departments are not yet assigned to a location. You need to join the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables to retrieve this information.
Which statement do you execute to retrieve this information?()

A.SELECT e.last_name, d.department_id, d.department_name, l.city FROM departments d RIGHT OUTER JOIN employees e ON d.department_id = e.department_id RIGHT OUTER JOIN locations l ON d.location_id = l.location_id;
B.SELECT e.last_name, d.department_id, d.department_name, l.city FROM departments d FULL OUTER JOIN employees e ON d.department_id = e.department_id FULL OUTER JOIN locations l ON d.location_id = l.location_id; 
C.SELECT e.last_name, d.department_id, d.department_name, l.city FROM departments d LEFT OUTER JOIN employees e ON d.department_id = e.department_id LEFT OUTER JOIN locations l ON d.location_id = l.location_id;
D.SELECT last_name, department_id, department_name, city FROM departments d NATURAL JOIN employees e NATURAL JOIN locations l;

4.单项选择题

The STUDENT_GRADES table has these columns:
STUDENT_ID NUMBER(12)
SEMESTER_END DATE
GPA NUMBER(4,3)
Which statement finds the highest grade point average (GPA) per semester?()

A.SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL;
B.SELECT (gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL;
C.SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL GROUP BY semester_end;
D.SELECT MAX(gpa) GROUP BY semester_end WHERE gpa IS NOT NULL FROM student_grades;
E.SELECT MAX(gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL;

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

6.单项选择题

Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATE
Which UPDATE statement is valid?()

A.UPDATE employees SET first_name = 'John' SET last_name ='Smith' WHERE employee_id = 180;
B.UPDATE employees SET first_name = 'John', SET last_name ='Smith' WHERE employee_id = 180;
C.UPDATE employees SET first_name = 'John' AND last_name ='Smith' WHERE employee_id = 180;
D.UPDATE employees SET first_name = 'John', last_name ='Smith' WHERE employee_id = 180;

7.单项选择题

Examine the structure of the EMPLOYEES and DEPARTMENTS tables:
EMPLOYEES
EMPLOYEE_ID NUMBER
DEPARTMENT_ID NUMBER
MANAGER_ID NUMBER
LAST_NAME VARCHAR2(25)
DEPARTMENTS
DEPARTMENT_ID NUMBER
MANAGER_ID NUMBER
DEPARTMENT_NAME VARCHAR2(35)
LOCATION_ID NUMBER
You want to create a report displaying employee last names, department names, and locations. Which query should you use?()

A.SELECT e.last_name, d. department_name, d.location_id FROM employees e NATURAL JOIN departments D USING department_id ;
B.SELECT last_name, department_name, location_id FROM employees NATURAL JOIN departments WHERE e.department_id =d.department_id;
C.SELECT e.last_name, d.department_name, d.location_id FROM employees e NATURAL JOIN departments d;
D.SELECT e.last_name, d.department_name, d.location_id FROM employees e JOIN departments d USING (department_id );

8.单项选择题

The STUDENT_GRADES table has these columns:
STUDENT_ID NUMBER(12)
SEMESTER_END DATE
GPA NUMBER(4,3)
The registrar requested a report listing the students' grade point averages (GPA) sorted from highest grade point average to lowest.
Which statement produces a report that displays the student ID and GPA in the sorted order requested by the registrar?()

A.SELECT student_id, gpa FROM student_grades ORDER BY gpa ASC;
B.SELECT student_id, gpa FROM student_grades SORT ORDER BY gpa ASC;
C.SELECT student_id, gpa FROM student_grades SORT ORDER BY gpa;
D.SELECT student_id, gpa FROM student_grades ORDER BY gpa;
E.SELECT student_id, gpa FROM student_grades SORT ORDER BY gpa DESC;
F.SELECT student_id, gpa FROM student_grades ORDER BY gpa DESC;

10.单项选择题Which SQL statement generates the alias Annual Salary for the calculated column SALARY*12?()

A.SELECT ename, salary*12 'Annual Salary' FROM employees;
B.SELECT ename, salary*12 "Annual Salary" FROM employees;
C.SELECT ename, salary*12 AS Annual Salary FROM employees;
D.SELECT ename, salary*12 AS INITCAP("ANNUAL SALARY") FROM employees

最新试题

The PRODUCTS table has these columns:PRODUCT_ID NUMBER(4)PRODUCT_NAME VARCHAR2(45)PRICE NUMBER(8,2)Evaluate this SQL statement:SELECT *FROM PRODUCTSORDER BY price, product _ name;What is true about the SQL statement? ()

题型:单项选择题

User Mary has a view called EMP_DEPT_LOC_VU that was created based on the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables. She has the privilege to create a public synonym, and would like to create a synonym for this view that can be used by all users of the database. Which SQL statement can Mary use to accomplish that task?()

题型:单项选择题

Which statement correctly describes SQL and /SQL*Plus? ()

题型:单项选择题

Which three are true? ()

题型:多项选择题

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary KeyFIRST_NAME VARCHAR2 (25)LAST_NAME VARCHAR2 (25)HIRE_DATE DATEWhich UPDATE statement is valid? ()

题型:单项选择题

In which two cases would you use an outer join? ()

题型:多项选择题

You need to design a student registration database that contains several tables storing academic information.The STUDENTS table stores information about a student. The STUDENT_GRADES table storesinformation about the student's grades. Both of the tables have a column named STUDENT_ID. The STUDENT_ID column in the STUDENTS table is a primary key.You need to create a foreign key on the STUDENT_ID column of the STUDENT_GRADES table thatpoints to the STUDENT_ID column of the STUDENTS table. Which statement creates the foreign key?()

题型:单项选择题

Which two statements about subqueries are true? ()

题型:多项选择题

Which one is a system privilege? ()

题型:单项选择题

Which four are types of functions available in SQL? ()

题型:多项选择题