最新的Oracle Database SQL Expert - 1Z1-047免費考試真題
View the Exhibit and examine the structure of the EMP table.
You executed the following command to add a primary key to the EMP table:
ALTER TABLE emp
ADD CONSTRAINT emp_id_pk PRIMARY KEY (emp_id)
USING INDEX emp_id_idx;
Which statement is true regarding the effect of the command?

You executed the following command to add a primary key to the EMP table:
ALTER TABLE emp
ADD CONSTRAINT emp_id_pk PRIMARY KEY (emp_id)
USING INDEX emp_id_idx;
Which statement is true regarding the effect of the command?

正確答案: D
View the Exhibit and examine the structure of the LOCATIONS and DEPARTMENTS tables.
Which SET operator should be used in the blank space in the following SQL statement to display the cities that have departments located in them?
SELECT location_id, city FROM locations
SELECT location_id, city FROM locations JOIN departments USING(location_id);
Which SET operator should be used in the blank space in the following SQL statement to display the cities that have departments located in them?
SELECT location_id, city FROM locations
SELECT location_id, city FROM locations JOIN departments USING(location_id);
正確答案: A
View the Exhibit and examine the structure of the
PRODUCTINFORMATION and INVENTORIES tables.
You want to display the quantity on hand for all the products available in the PRODUCTINFORMATION table that have the PRODUCT_STATUS as 'orderable'
QUANTITY_ON_HAND is a column in the INVENTORIES table. The following SQL statement
was written to accomplish the task:
SELECT pi. Product_id, pi.product_status, sum(i.quantity_on_hand)
FROM product_information pi LEFT OUTER JOIN inventories i
ON (pi. Product_id = i. product_id)
WHERE (pi.product_status = 'orderable")
GROUP BY pi.product_id, pi.product_status;
Which statement is true regarding the execution of this SQL statement?
PRODUCTINFORMATION and INVENTORIES tables.
You want to display the quantity on hand for all the products available in the PRODUCTINFORMATION table that have the PRODUCT_STATUS as 'orderable'
QUANTITY_ON_HAND is a column in the INVENTORIES table. The following SQL statement
was written to accomplish the task:
SELECT pi. Product_id, pi.product_status, sum(i.quantity_on_hand)
FROM product_information pi LEFT OUTER JOIN inventories i
ON (pi. Product_id = i. product_id)
WHERE (pi.product_status = 'orderable")
GROUP BY pi.product_id, pi.product_status;
Which statement is true regarding the execution of this SQL statement?
正確答案: C
View the Exhibit and examine the structure of ORDERS and CUSTOMERS tables. Which INSERT statement should be used to add a row into the ORDERS table for the customer
whose CUST LAST NAME is Roberts and CREDIT LIMIT is 600?

whose CUST LAST NAME is Roberts and CREDIT LIMIT is 600?

正確答案: B
User OE, the owner of the ORDERS table, issues the following command:
GRANT SELECT .INSERT ON orders TO hr WITH GRANT OPTION;
The user HR issues the following command:
GRANT SELECT ON oe. orders
TO scott;
Then, OE issues the following command: REVOKE ALL ON orders FROM hr;
Which statement is correct?
GRANT SELECT .INSERT ON orders TO hr WITH GRANT OPTION;
The user HR issues the following command:
GRANT SELECT ON oe. orders
TO scott;
Then, OE issues the following command: REVOKE ALL ON orders FROM hr;
Which statement is correct?
正確答案: B
View the Exhibit and examine the structure of the ORDERS table. The ORDER_ID column is the PRIMARY KEY in the ORDERS table. Evaluate the following
CREATE TABLE command:
CREATE TABLE new_orders(ord_id, ord_date DEFAULT SYSDATE, cus_id)
AS
SELECT order_id.order_date.customer_id
FROM orders;
Which statement is true regarding the above command?

CREATE TABLE command:
CREATE TABLE new_orders(ord_id, ord_date DEFAULT SYSDATE, cus_id)
AS
SELECT order_id.order_date.customer_id
FROM orders;
Which statement is true regarding the above command?

正確答案: C
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 LARGE_DRDERS table. The order ID, order date, and order total should be added to the ORDER_HISTORY table, and order ID and customer ID should be added to the CUST_HISTORY table. Which multitable INSERT statement would you use?
正確答案: C
Which two statements are true regarding views? (Choose two.)
正確答案: B,D
Evaluate the following statement:
CREATE TABLE bonuses(employee_id NUMBER, bonus NUMBER DEFAULT 100);
The details of all employees who have made sales need to be inserted into the BONUSES table. You can obtain the list of employees who have made sales based on the SALES_REP_ID column of the ORDERS table. The human resources manager now decides that employees with a salary of $8,000 or less should receive a bonus. Those who have not made sales get a bonus of 1% of their salary. Those who have made sales get a bonus of 1 % of their salary and also a salary increase of 1 %. The salary of each employee can be obtained from the EMPLOYEES table.
Which option should be used to perform this task most efficiently?
CREATE TABLE bonuses(employee_id NUMBER, bonus NUMBER DEFAULT 100);
The details of all employees who have made sales need to be inserted into the BONUSES table. You can obtain the list of employees who have made sales based on the SALES_REP_ID column of the ORDERS table. The human resources manager now decides that employees with a salary of $8,000 or less should receive a bonus. Those who have not made sales get a bonus of 1% of their salary. Those who have made sales get a bonus of 1 % of their salary and also a salary increase of 1 %. The salary of each employee can be obtained from the EMPLOYEES table.
Which option should be used to perform this task most efficiently?
正確答案: D
View the Exhibit and examine the description of the ORDERS table.
Your manager asked you to get the SALES_REP_ID and the total numbers of orders placed by each of the sales representatives. Which statement would provide the desired result?
Your manager asked you to get the SALES_REP_ID and the total numbers of orders placed by each of the sales representatives. Which statement would provide the desired result?
正確答案: A
View the Exhibit and examine the data in ORDERS and ORDER_ITEMS tables.
You need to create a view that displays the ORDER ID, ORDER_DATE, and the total number of
items in each order.
Which CREATE VIEW statement would create the view successfully?

You need to create a view that displays the ORDER ID, ORDER_DATE, and the total number of
items in each order.
Which CREATE VIEW statement would create the view successfully?

正確答案: A
View the Exhibit and examine the structure of the ORDERS and ORDER_ITEMS tables.
Evaluate the following SQL statement:
SELECT oi.order_id, product_id, order_date FROM order_items oi JOIN orders o
USING(order_id);
Which statement is true regarding the execution of this SQL statement?

Evaluate the following SQL statement:
SELECT oi.order_id, product_id, order_date FROM order_items oi JOIN orders o
USING(order_id);
Which statement is true regarding the execution of this SQL statement?

正確答案: B
View the Exhibit and examine the description of the ORDERS table.
You need to display CUSTOMER_ID for all customers who have placed orders more than three times in the last six months. You issued the following SQL statement:
SELECT customer_id,COUNT(order_id) FROM orders WHERE COUNT(order_id)>3 AND order_date BETWEEN ADD_MONTHS(SYSDATE,-6) AND SYSDATE GROUP BY customer_id;
Which statement is true regarding the execution of the above statement?
You need to display CUSTOMER_ID for all customers who have placed orders more than three times in the last six months. You issued the following SQL statement:
SELECT customer_id,COUNT(order_id) FROM orders WHERE COUNT(order_id)>3 AND order_date BETWEEN ADD_MONTHS(SYSDATE,-6) AND SYSDATE GROUP BY customer_id;
Which statement is true regarding the execution of the above statement?
正確答案: A
View the Exhibit and examine the structure of ORD and ORD_ITEMS tables.
In the ORD table, the PRIMARY KEY is ORD_NO and in the ORD_ITEMS tables the composite
PRIMARY KEY is (ORD_NO, ITEM_NO).
Which two CREATE INDEX statements are valid? (Choose two.)

In the ORD table, the PRIMARY KEY is ORD_NO and in the ORD_ITEMS tables the composite
PRIMARY KEY is (ORD_NO, ITEM_NO).
Which two CREATE INDEX statements are valid? (Choose two.)

正確答案: A,C