单项选择题

You need to create a table named ORDERS that contains four columns:
1.an ORDER_ID column of number data type
2.a CUSTOMER_ID column of number data type
3.an ORDER_STATUS column that contains a character data type
4.a DATE_ORDERED column to contain the date the order was placed
When a row is inserted into the table, if no value is provided for the status of the order, the value PENDING should be used instead.
Which statement accomplishes this?()

A.CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status NUMBER(10) DEFAULT 'PENDING', date_ordered DATE );
B.CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) = 'PENDING', date_ordered DATE );
C.CREATE OR REPLACE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) DEFAULT 'PENDING', date_ordered DATE );
D.CREATE OR REPLACE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) = 'PENDING', date_ordered DATE );
E.CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) DEFAULT 'PENDING', date_ordered DATE );
F.CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) DEFAULT 'PENDING', date_ordered VARCHAR2 );


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables:
EMPLOYEES
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATE
NEW_EMPLOYEES
EMPLOYEE_ID NUMBER Primary Key
NAME VARCHAR2(60)
Which DELETE statement is valid?()

A.DELETE FROM employees WHERE employee_id = (SELECT employee_id FROM employees);
B.DELETE * FROM employees WHERE employee_id = (SELECT employee_id FROM new_employees);
C.DELETE FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE name ='Carrey');
D.DELETE * FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE last_name ='Carrey');

2.单项选择题Which SQL statement returns a numeric value?()

A.SELECT ADD_MONTHS(MAX(hire_Date), 6) FROM EMP;
B.SELECT ROUND(hire_date) FROM EMP;
C.SELECT sysdate-hire_date FROM EMP;
D.SELECT TO_NUMBER(hire_date + 7) FROM EMP;

3.多项选择题Which two statements complete a transaction? ()

A.DELETE employees;
B.DESCRIBE employees;
C.ROLLBACK TO SAVEPOINT C;
D.GRANT SELECT ON employees TO SCOTT;
E.ALTER TABLE employees SET UNUSED COLUMN sal;
F.SELECT MAX(sal) FROM employees WHERE department_id = 20;

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

A.The UNIQUE constraint does not permit a null value for the column.
B.A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.
C.The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index.
D.The NOT NULL constraint ensures that null values are not permitted for the column.

5.单项选择题What is true about joining tables through an equijoin?()

A.You can join a maximum of two tables through an equijoin.
B.You can join a maximum of two columns through an equijoin.
C.You specify an equijoin condition in the SELECT or FROM clauses of a SELECT statement.
D.To join two tables through an equijoin, the columns in the join condition must be primary key and foreign key columns.
E.You can join n tables (all having single column primary keys) in a SQL statement by specifying a minimum of n-1 join conditions.

6.单项选择题

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;

7.单项选择题What does the FORCE option for creating a view do?()

A.creates a view with constraints
B.creates a view even if the underlying parent table has constraints
C.creates a view in another schema even if you don't have privileges
D.creates a view regardless of whether or not the base tables exist

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

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

9.单项选择题Which are iSQL*Plus commands? ()

A.INSERT
B.UPDATE
C.SELECT
D.DESCRIBE
E.DELETE
F.RENAME

10.多项选择题

Examine the description of the MARKS table:
STD_ID NUMBER(4)
STUDENT_NAME VARCHAR2(30)
SUBJ1 NUMBER(3)
SUBJ2 NUMBER(3)
SUBJ3 NUMBER(3)
SUBJ1, SUBJ2, and SUBJ3 indicate the marks (grades) obtained by a student in the three subjects. Which two statements are valid? ()

A.SELECT SUM(subj1, subj2, subj3) FROM marks;
B.SELECT SUM(subj1 + subj2 + subj3) FROM marks;
C.SELECT SUM(subj1), SUM(subj2), SUM(subj3) FROM marks;
D.SELECT MAX(subj1, subj2, subj3) FROM marks;
E.SELECT MINIMUM(subj1) FROM marks;
F.SELECT COUNT(std_id) FROM marks WHERE subj1 >= AVG(subj1);