Q1. - (Topic 2) 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…
Q1. - (Topic 2) Evaluate the following query: SELECT INTERVAL '300' MONTH, INTERVAL '54-2' YEAR TO MONTH, INTERVAL '11:12:10.1234567' HOUR TO SECOND FROM dual; What is the correct output of the above query? A. +25-00 , +54-02, +00 11:12:10.123457 B. +00-300, +54-02, +00 11:12:10.123457 C. +25-00 , +00-650, +00 11:12:10.123457 D. +00-300 , +00-650, +00 11:12:10.123457 View AnswerAnswer: A Explanation: Datetime Data Types You can use several datetime data types: INTERVAL YEAR TO…
Q1. - (Topic 1) Evaluate the following SQL statement: SQL> SELECT cust_id. cust_last_name FROM customers WHERE cust_credit_limit IN (select cust_credit_limit FROM customers WHERE cust_city='Singapore'): Which statement is true regarding the above query if one of the values generated by the sub query is NULL? A. It produces an error. B. It executes but returns no rows. C. It generates output for NULL as well as the…
Q1. - (Topic 1) Which view should a user query to display the columns associated with the constraints on a table owned by the user? A. USER_CONSTRAINTS B. USER_OBJECTS C. ALL_CONSTRAINTS D. USER_CONS_COLUMNS E. USER_COLUMNS View AnswerAnswer: D Explanation: view the columns associated with the constraint names in the USER_CONS_COLUMNS view. Incorrect Answer: Atable to view all constraints definition and names Bshow all object name belong to user…
Q1. - (Topic 2) Which are iSQL*Plus commands? (Choose all that apply.) A. INSERT B. UPDATE C. SELECT D. DESCRIBE E. DELETE F. RENAME View AnswerAnswer: D Explanation: The only SQL*Plus command in this list : DESCRIBE. It cannot be used as SQL command. This command returns a description of tablename, including all columns in that table, the datatype for each column and an indication of whether the column permits…
Q1. - (Topic 1) 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 valid DELETE statement? A. DELETE FROM…
Q1. - (Topic 2) Examine the data in the ORD_ITEMS table: ORD_NO ITEM_NO QTY 1 111 10 1 222 20 1 333 30 2 333 30 2 444 40 3 111 40 Evaluate the following query: SQL>SELECT item_no, AVG(qty) FROM ord_items HAVING AVG(qty) > MIN(qty) * 2 GROUP BY item_no; Which statement is true regarding the outcome of the above query? A. It gives an error because the HAVING clause should be specified after the…
Q1. - (Topic 2) View the Exhibit and examine the structure of the PRODUCTS tables. You want to generate a report that displays the average list price of product categories where the average list price is less than half the maximum in each category. Which query would give the correct output? A. SELECT prod_category,avg(prod_list_price) FROM products GROUP BY prod_category HAVING avg(prod_list_price) < ALL (SELECT max(prod_list_price)/2…
Q1. - (Topic 1) Evaluate the following SQL commands: The command to create a table fails. Identify the reason for the SQL statement failure? (Choose all that apply.) A. You cannot use SYSDATE in the condition of a CHECK constraint. B. You cannot use the BETWEEN clause in the condition of a CHECK constraint. C. You cannot use the NEXTVAL sequence value as a DEFAULT value…
Q1. - (Topic 1) View the Exhibit for the structure of the STUDENT and FACULTY tables. You need to display the faculty name followed by the number of students handled by the faculty at the base location. Examine the following two SQL statements: Which statement is true regarding the outcome? A. Only statement 1 executes successfully and gives the required result. B. Only statement 2…
Q1. - (Topic 1) Which two are true about aggregate functions? (Choose two.) A. You can use aggregate functions in any clause of a SELECT statement. B. You can use aggregate functions only in the column list of the select clause and in the WHERE clause of a SELECT statement. C. You can mix single row columns with aggregate functions in the column list…
Q1. - (Topic 2) Examine the description of the CUSTOMERS table: The CUSTOMER_ID column is the primary key for the table. Which statement returns the city address and the number of customers in the cities Los Angeles or San Francisco? A. SELECT city_address, COUNT(*) FROM customers WHERE city_address IN ( ‘Los Angeles’, ‘San Fransisco’); B. SELECT city_address, COUNT (*) FROMcustomers WHERE city address IN ( ‘Los Angeles’, ‘San…
Q1. - (Topic 1) See the Exhibit and Examine the structure of the CUSTOMERS table: Using the CUSTOMERS table, you need to generate a report that shows an increase in the credit limit by 15% for all customers. Customers whose credit limit has not been entered should have the message "Not Available" displayed. Which SQL statement would produce the required result? A. SELECT NVL(cust_credit_limit,'Not…
Q1. - (Topic 1) View the Exhibit and examine the structure of the SALES table. The following query is written to retrieve all those product IDs from the SALES table that have more than 55000 sold and have been ordered more than 10 times. Which statement is true regarding this SQL statement? A. It executes successfully and generates the required result. B. It produces an…
Q1. - (Topic 1) See the exhibit and examine the structure of the CUSTOMERS and GRADES tables: You need to display names and grades of customers who have the highest credit limit. Which two SQL statements would accomplish the task? (Choose two.) A. SELECT custname, grade FROM customers, grades WHERE (SELECT MAX(cust_credit_limit) FROM customers) BETWEEN startval and endval; B. SELECT custname, grade FROM customers, grades WHERE (SELECT MAX(cust_credit_limit) FROM customers)…
Q1. - (Topic 2) 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 parent of a referential…
Q1. - (Topic 1) See the Exhibit and examine the structure and data in the INVOICE table: Exhibit: Which two SQL statements would execute successfully? (Choose two.) A. SELECT MAX(inv_date),MIN(cust_id) FROM invoice; B. SELECT AVG(inv_date-SYSDATE),AVG(inv_amt) FROM invoice; C. SELECT MAX(AVG(SYSDATE-inv_date)) FROM invoice; D. SELECT AVG(inv_date) FROM invoice; View AnswerAnswer: A,B Q2. - (Topic 1) Evaluate the following SQL commands: The command to create a table fails. Identify the reason for…
Q1. - (Topic 1) A SELECT statement can be used to perform these three functions: Choose rows from a table. Choose columns from a table Bring together data that is stored in different tables by creating a link between them. Which set of keywords describes these capabilities? A. difference, projection, join B. selection, projection, join C. selection, intersection, join D. intersection, projection, join E. difference, projection, product View AnswerAnswer: B Explanation: Explanation: choose…
Q1. - (Topic 2) View the Exhibit and examine the data in the PROMO_NAME and PROMO_END_DATE columns of the PROMOTIONS table, and the required output format. Which two queries give the correct result? (Choose two.) A. SELECT promo_name, TO_CHAR(promo_end_date,'Day') ', ' TO_CHAR(promo_end_date,'Month') ' ' TO_CHAR(promo_end_date,'DD, YYYY') AS last_day FROM promotions; B. SELECT promo_name,TO_CHAR (promo_end_date,'fxDay') ', ' TO_CHAR(promo_end_date,'fxMonth') ' ' TO_CHAR(promo_end_date,'fxDD, YYYY') AS last_day FROM promotions; C. SELECT promo_name, TRIM(TO_CHAR(promo_end_date,'Day')) ', '…
Q1. - (Topic 2) Examine the structure of the SHIPMENTS table: You want to generate a report that displays the PO_ID and the penalty amount to be paid if the SHIPMENT_DATE is later than one month from the PO_DATE. The penalty is $20 per day. Evaluate the following two queries: Which statement is true regarding the above commands? A. Both execute successfully and give correct results. B. Only…
Q1. - (Topic 1) View the Exhibit and examine the structure of the CUSTOMERS and CUST_HISTORY tables. The CUSTOMERS table contains the current location of all currently active customers. The CUST_HISTORY table stores historical details relating to any changes in the location of all current as well as previous customers who are no longer active with the company. You need to find those…
Q1. - (Topic 1) View the Exhibit and examine the structure of the PROMOTIONS, SALES, and CUSTOMER tables. You need to generate a report showing the promo name along with the customer name for all products that were sold during their promo campaign and before 30th October 2007. You issue the following query: Which statement is true regarding the above query? A. It executes successfully…
Q1. - (Topic 1) Which two statements are true regarding single row functions? (Choose two.) A. They can be nested only to two levels B. They always return a single result row for every row of a queried table C. Arguments can only be column values or constant D. They can return a data type value different from the one that is referenced E. They accept…
Q1. - (Topic 1) Evaluate the following SQL statements: Exhibit: Exhibit: The above command fails when executed. What could be the reason? A. The BETWEEN clause cannot be used for the CHECK constraint B. SYSDATE cannot be used with the CHECK constraint C. ORD_NO and ITEM_NO cannot be used as a composite primary key because ORD_NO is also the FOREIGN KEY D. The CHECK constraint cannot be…
Q1. - (Topic 1) Examine the structure of the MARKS table: Exhibit: Which two statements would execute successfully? (Choose two.) A. SELECT student_name,subject1 FROM marks WHERE subject1 > AVG(subject1); B. SELECT student_name,SUM(subject1) FROM marks WHERE student_name LIKE 'R%' C. SELECT SUM(subject1+subject2+subject3) FROM marks WHERE student_name IS NULL; D. SELECT SUM(DISTINCT NVL(subject1,0)), MAX(subject1) FROM marks WHERE subject1 > subject2; View AnswerAnswer: C,D Q2. - (Topic 1) The following data exists in the PRODUCTS table: PROD_ID PROD_LIST_PRICE 123456 152525.99 You issue the…
Q1. - (Topic 2) View the Exhibit and examine the structure of the PRODUCTS tables. You want to generate a report that displays the average list price of product categories where the average list price is less than half the maximum in each category. Which query would give the correct output? A. SELECT prod_category,avg(prod_list_price) FROM products GROUP BY prod_category HAVING avg(prod_list_price) < ALL (SELECT max(prod_list_price)/2…
Q1. - (Topic 1) Evaluate the following SQL commands: The command to create a table fails. Identify the reason for the SQL statement failure? (Choose all that apply.) A. You cannot use SYSDATE in the condition of a CHECK constraint. B. You cannot use the BETWEEN clause in the condition of a CHECK constraint. C. You cannot use the NEXTVAL sequence value as a DEFAULT value…
Q1. - (Topic 2) View the Exhibit and examine the data in the PROMOTIONS table. PROMO_BEGIN_DATE is stored in the default date format, dd-mon-rr. You need to produce a report that provides the name, cost, and start date of all promos in the POST category that were launched before January 1, 2000. Which SQL statement would you use? A. SELECT promo_name, promo_cost, promo_begin_date FROM promotions…
Q1. - (Topic 1) You work as a database administrator at ABC.com. You study the exhibit carefully. Exhibit Using the PROMOTIONS table, you need to display the names of all promos done after January 1, 2001 starting with the latest promo. Which query would give the required result? (Choose all that apply.) A. SELECT promo_name,promo_begin_date FROM promotions WHERE promo_begin_date > '01-JAN-01' ORDER BY 1 DESC; B. SELECT promo_name,promo_begin_date "START…