Pivoting INSERT
Unconditional INSERT
Conditional ALL INSERT
Conditional FIRST INSERT
第1题:
The details of the order ID, order date, order total, and customer ID are obtained from the ORDERS table. If the order value is more than 30000, the details have to be added to the LARGEjDRDERS table. The order ID, order date, and order total should be added to the ORDERJHISTORY table, and order ID and customer ID should be added to the CUSTJHISTORY table. Which multitable INSERT statement would you use? ()
第2题:
Which statement accomplish this? ()
第3题:
Evaluate the following statements: CREATE TABLE purchase_orders (po_id NUMBER(4), po_date TIMESTAMP, supplier_id NUMBER(6), po_total NUMBER(8,2), CONSTRAINT order_pk PRIMARY KEY(po_id)) PARTITION BY RANGE(po_date) (PARTITION Q1 VALUES LESS THAN (TO_DATE(?1-apr-2007?d-mon-yyyy?), PARTITION Q2 VALUES LESS THAN (TO_DATE(?1-jul-2007?d-mon-yyyy?), PARTITION Q3 VALUES LESS THAN(TO_DATE(?1-oct - 2007?d-mon-yyyy?), PARTITION Q4 VALUES LESS THAN (TO_DATE(?1-jan-2008?d-mon-yyyy?)); CREATE TABLE purchase_order_items (po_id NUMBER(4) NOT NULL, product_id NUMBER(6) NOT NULL, unit_price NUMBER(8,2), quantity NUMBER(8), CONSTRAINT po_items_fk FOREIGN KEY (po_id) REFERENCES purchase_orders(po_id)) PARTITION BY REFERENCE(po_items_fk); What are the two consequences of the above statements?()
第4题:
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?()
第5题:
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?()
第6题:
SELECT ord_id, cust_id, ord_total FROM orders, customers WHERE cust_name='Martin' AND ord_date IN ('18-JUL-2000','21-JUL-2000');
SELECT ord_id, cust_id, ord_total FROM orders WHERE ord_date IN (SELECT ord_date FROM orders WHERE cust_id = (SELECT cust_id FROM customers WHERE cust_name = 'Martin'));
SELECT ord_id, cust_id, ord_total FROM orders WHERE ord_date IN (SELECT ord_date FROM orders, customers WHERE cust_name = 'Martin');
SELECT ord_id, cust_id, ord_total FROM orders WHERE cust_id IN (SELECT cust_id FROM customers WHERE cust_name = 'Martin');
第7题:
displaying the total order value for sales representatives 161 and 163
displaying the order total for sales representative 161 in the year 1999
displaying the number of orders that have order mode online and order date in 1999
displaying the number of orders whose order total is more than the average order total for all online orders
第8题:
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE = SYSDATE);
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE DEFAULT SYSDATE);
CREATE OR REPLACE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE DEFAULT SYSDATE);
CREATE OR REPLACE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE = SYSDATE);
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE = SYSDATE);
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE DEFAULT SYSDATE);
第9题:
SELECT ord_id, cust_id, ord_total FROM orders, customers WHERE cust_name='Mating' AND ord _ date IN ('18-JUL-2000','21-JUL-2000');
SELECT ord_id, cust_id, ord_total FROM orders Where ord_date IN (SELECT ord_date FROM orders WHERE cust_id = (SELECT cust_id FROM customers WHERE cust_name = 'MARTIN'));
SELECT ord_id, cust_id, ord_total FROM orders Where ord_date IN (SELECT ord_date FROM orders, customers Where cust _ name = 'Martin');
SELECT ord_id, cust_id, ord_total FROM orders WHERE cust_id IN (SELECT cust_id FROM customers WHERE cust name = 'Martin');
第10题:
SER_NO
ORDER_ID
STATUS
PROD_ID
ORD_TOTAL
composite index on ORDER_ID and ORDER_DATE
第11题:
SER_NO
ORDER_ID
STATUS
PROD_ID
ORD_TOTAL
Composite index on ORDER_ID and ORDER_DATE
第12题:
SER_NO
ORDER_ID
STATUS
PROD_ID
ORD_TOTAL
Composite index on ORDER_ID and ORDER_DATE
第13题:
Examine the data from the ORDERS and CUSTOMERS table. ORDERS ORD_ID ORD_DATE CUST_ID ORD_TOTAL 100 12-JAN-2000 15 10000 09-MAR- 101 40 8000 09-MAR- 102 35 12500 15-MAR- 103 15 12000 104 25-JUN-2000 15 6000 105 18-JUL-2000 20 5000 106 18-JUL-2000 35 7000 107 21-JUL-2000 20 6500 04-AUG- 108 10 8000 CUSTOMERS CUST_ID CUST_NAME CITY 10 Smith Los Angeles 15 Bob San Francisco 20 Martin Chicago 25 Mary New York 30 Rina Chicago 35 Smith New York 40 Linda New York Which SQL statement retrieves the order ID, customer ID, and order total for the orders that are placed on the same day that Martin places his orders?()
第14题:
Examine the SQL statements that creates ORDERS table: CREATE TABLE orders (SER_NO NUMBER UNIQUE, ORDER_ID NUMBER, ORDER_DATE DATE NOT NULL STATUS VARCHARD2(10) CHECK (status IN ('CREDIT','CASH')), PROD_ID_NUMBER REFERENCES PRODUCTS(PRODUCT_ID), ORD_TOTAL NUMBER, PRIMARY KEY (order id, order date)); For which columns would an index be automatically created when you execute the aboveSQL statement? ()
第15题:
The ORDERS table has these columns: ORDER_ID NUMBER(4) NOT NULL CUSTOMER_ID NUMBER(12) NOT NULL ORDER_TOTAL NUMBER(10,2) The ORDERS table tracks the Order number, the order total, and the customer to whom the Order belongs. Which two statements retrieve orders with an inclusive total that ranges between 100.00 and 2000.00 dollars? ()
第16题:
You need to create a table named ORDERS that contain four columns: 1. an ORDER_ID column of number data type 2. aCUSTOMER_ID column of number data type 3. an ORDER_STATUS column that contains a character data type 4. aDATE_ORDERED column to contain the date the order was placed. When a row is inserted into the table, if no value is provided when the order was placed, today's date should be used instead. Which statement accomplishes this?()
第17题:
SELECT customer_id, order_id, order_total FROM orders RANGE ON order _ total (100 AND 2000) INCLUSIVE;
SELECT customer_id, order_id, order_total FROM orders HAVING order _ total BETWEEN 100 and 2000;
SELECT customer_id, order_id, order_total FROM orders WHERE order _ total BETWEEN 100 and 2000;
SELECT customer_id, order_id, order_total FROM orders WHERE order_total>= 100 and <= 2000;
SELECT customer_id, order_id, order_total FROM orders WHERE order_total>= 100 and order_total <= 2000;
第18题:
SELECT student_id, gpa FROM student_grades ORDER BY gpa ASC;
SELECT student_id, gpa FROM student_grades SORT ORDER BY gpa ASC;
SELECT student_id, gpa FROM student_grades SORT ORDER BY gpa;
SELECT student_id, gpa FROM student_grades ORDER BY gpa;
SELECT student_id, gpa FROM student_grades SORT ORDER BY gpa DESC;
SELECT student_id, gpa FROM student_grades ORDER BY gpa DESC;
第19题:
The statement would not execute because table aliases are not allowed in the JOIN clause.
The statement would not execute because the table alias prefix is not used in the USING clause.
The statement would not execute because all the columns in the SELECT clause are not prefixed with table aliases.
The statement would not execute because the column part of the USING clause cannot have a qualifier in the SELECT list.
第20题:
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE = SYSDATE);
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE DEFAULT SYSDATE);
CREATE OR REPLACE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE DEFAULT SYSDATE);
CREATE OR REPLACE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE = SYSDATE);
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE = SYSDATE);
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE DEFAULT SYSDATE);
第21题:
CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status NUMBER(10) DEFAULT 'PENDING', date_ordered DATE );
CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) = 'PENDING', date_ordered DATE );
CREATE OR REPLACE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) DEFAULT 'PENDING', date_ordered DATE );
CREATE OR REPLACE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) = 'PENDING', date_ordered DATE );
CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) DEFAULT 'PENDING', date_ordered DATE );
CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) DEFAULT 'PENDING', date_ordered VARCHAR2 );
第22题:
Pivoting INSERT
Unconditional INSERT
Conditional ALL INSERT
Conditional FIRST INSERT
第23题:
SER_NO
ORDER_ID
STATUS
PROD_ID
ORD_TOTAL
composite index on ORDER_ID and ORDER_DATE
第24题:
SELECT ord_id, cust_id, ord_total FROM orders, customers WHERE cust_name='Mating' AND ord _ date IN ('18-JUL-2000','21-JUL-2000');
SELECT ord_id, cust_id, ord_total FROM orders Where ord_date IN (SELECT ord_date FROM orders WHERE cust_id = (SELECT cust_id FROM customers WHERE cust_name = 'MARTIN'));
SELECT ord_id, cust_id, ord_total FROM orders Where ord_date IN (SELECT ord_date FROM orders, customers Where cust _ name = 'Martin');
SELECT ord_id, cust_id, ord_total FROM orders WHERE cust_id IN (SELECT cust_id FROM customers WHERE cust name = 'Martin');