OCP 1Z0-051 166
(166)View the Exhibit and examine the structures of the EMPLOYEES and DEPARTMENTS tables. You want to update the EMPLOYEES table as follows:-Update only those employees who work in Boston or Seattle (locations 2900 and 2700).-Set department_id for these employees to the department_id corres...
OCP 1Z0-051 167
(167)Evaluate the following DELETE statement: DELETE FROM sales; There are no other uncommitted transactions on the SALES table.Which statement is true about the DELETE statement?A. It would not remove the rows if the table has a primary key.B. It removes all the rows as well as the str...
OCP 1Z0-051 161
(161)View the exhibit and examine the description for the SALES and CHANNELS tables. You issued the following SQL statement to insert a row in the SALES table:INSERT INTO sales VALUES (23, 2300, SYSDATE, (SELECT channel_id FROM channels WHERE channel_desc='Direct Sales'), 12,...
OCP 1Z0-051 170
(170)Which two statements are true regarding the DELETE and TRUNCATE commands? (Choose two.)A. DELETE can be used to remove only rows from only one table at a time.B. DELETE can be used to remove only rows from multiple tables at a time.C. DELETE can be used only on a table that is a pa...
OCP 1Z0-051 169
(169)View the Exhibit and examine the description for the PRODUCTS and SALES table.PROD_ID is a primary key in the PRODUCTS table and foreign key in the SALES table.You want to remove all the rows from the PRODUCTS table for which no sale was done for the last three years.Which is the v...
OCP 1Z0-051 168
(168)View the Exhibit and examine the description of SALES and PROMOTIONS tables.You want to delete rows from the SALES table, where the PROMO_NAME column in the PROMOTIONS table has either blowout sale or everyday low price as values.Which DELETE statements are valid? (Choose all that appl...
OCP 1Z0-051 165
(165)View the Exhibit and examine the description for the CUSTOMERS table.You want to update the CUST_INCOME_LEVEL and CUST_CREDIT_LIMIT columns for the customer with the CUST_ID 2360.You want the value for the CUST_INCOME_LEVEL to have the same value as that of the customer with the CUST_I...
OCP 1Z0-051 162
(162)View the Exhibit and examine the structure of the PRODUCTS, SALES, and SALE_SUMMARY tables. SALE_VW is a view created using the following command :CREATE VIEW sale_vw AS SELECT prod_id, SUM(quantity_sold) QTY_SOLD FROM sales GROUP BY prod_id;You issue th...
OCP 1Z0 051 155
(155)Evaluate the following SQL statement:SELECT promo_id, promo_category FROM promotions WHERE promo_category = 'Internet' ORDER BY 2 DESCUNIONSELECT promo_id, promo_category FROM promotions WHERE promo_category = 'TV'UNION...
OCP 1Z0 051 152
(152)Which statement is true regarding the UNION operator?A. By default, the output is not sorted.B. NULL values are not ignored during duplicate checking.C. Names of all columns must be identical across all SELECT statements.D. The number of columns selected in all SELECT statem...
OCP 1Z0 051 153
(153)View the Exhibits and examine the structures of the PRODUCTS and SALES tables. Which two SQL statements would give the same output? (Choose two.)A.SELECT prod_id FROM productsINTERSECTSELECT prod_id FROM sales;...
OCP 1Z0 051 154
(154)View the Exhibit and evaluate structures of the SALES, PRODUCTS, and COSTS tables. Evaluate the following SQL statement:SELECT prod_id FROM productsINTERSECTSELECT prod_id FROM salesMINUSSELECT prod_id FROM c...
OCP 1Z0 051 158
(158)Which statements are true regarding the FOR UPDATE clause in a SELECT statement? (Choose all that apply.)A. It locks only the columns specified in the SELECT list.B. It locks the rows that satisfy the condition in the SELECT statement.C. It can be used only in SELECT statements tha...
OCP 1Z0 051 156
(156)Evaluate the following SQL statement:SELECT cust_id, cust_last_name "Last Name" FROM customers WHERE country_id = 10UNIONSELECT cust_id CUST_NO, cust_last_name FROM customers WHERE country_id = 30;Which ORDER BY clauses ar...
OCP 1Z0 051 159
(159)View the Exhibit and examine the structure of the CUSTOMERS table.NEW_CUSTOMERS is a new table with the columns CUST_ID, CUST_NAME and CUST_CITY that have the same data types and size as the corresponding columns in the CUSTOMERS table. Evaluate the following INSERT statement:...
OCP 1Z0 051 160
(160)View the Exhibit and examine the structure of ORDERS and CUSTOMERS tables. There is only one customer with the cust_last_name column having value Roberts.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...
OCP 1Z0 051 149
(149)View the Exhibits and examine the structures of the COSTS and PROMOTIONS tables. Evaluate the following SQL statement:SELECT prod_id FROM costsWHERE promo_id IN (SELECT promo_id FROM promotions WHERE promo_cost < ALL (SELECT MAX(promo_cost) FROM promotions...
OCP 1Z0 051 145
(145)View the Exhibit and examine the structure of the CUSTOMERS table.You issue the following SQL statement on the CUSTOMERS table to display the customers who are in the same country as customers with the last name 'KING' andwhose credit limit is less than the maximum credit limit in coun...
OCP 1Z0 051 146
(146)Evaluate the following SQL statement:SELECT cust_id, cust_last_nameFROM customersWHERE cust_credit_limit IN (select cust_credit_limit FROM customers WHERE cust_city ='Singapore');Which statement is true regarding the above...
OCP 1Z0 051 142
(142)View the Exhibit and examine the structure of the PRODUCTS table. Evaluate the following query:SELECT prod_name FROM productsWHERE prod_id IN (SELECT prod_id FROM products WHERE prod_list_price = (SELECT MAX(prod_list_price) FROM produ...