Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
127 views
64 pages
Oracle 1Z0-061
Oracle
Uploaded by
ROUNAK MAHANTY
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Oracle 1Z0-061 (2) For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
127 views
64 pages
Oracle 1Z0-061
Oracle
Uploaded by
ROUNAK MAHANTY
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Oracle 1Z0-061 (2) For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 64
Search
Fullscreen
Certkiller.120-061.75.QA Number: 120-061 Passing Score: 800 Time Limit: 120 min File Version: 3.4 Cert-Killer 420-061 Oracle Database 12c: SQL Fundamentals Provided information is extremely useful for you, By study this, | am reached my goal easily. Thanks a lot. | purchased the study guide package. I thought it was a great resource for studying for the exam, ‘Awesome collection for preparing a certification exam; really your inputs are appreciable. you want to score high marks in exam then go for this dump. | have personally used it and trust me | scored more than 90% in my exam. + These are the most accurate study questions. Just focus on these and sit in your exam. + The test guide is very realistic. If you have never taken an actual guide before this is extremely valuable and reduces the exam stress. + Best of luck guys, Use this Exam and pass your Oracle Certification now.Exam A QUESTION 1 View the Exhibit and examine the structure of the products table. a |Bl2| F PROD_DESC PROD_CATEGORY PROD_CATEGORY_1D PROD_UNIT_OF_MEASURI PLERIO a zlzlzlz| zizizlz| FIE aa] |S 8 FI IE s [Ramo [PROD_NAME | [PROD_OESC [PROD_CATEGORY | [PROD _CATEGORY_ID | pSUPPUER PROD CST PRaCE Evaluate the following query: SQL> SELECT prod_name FROM products WHERE prod_id IN (SELECT prod_id FROM products WHERE prod_list_price (SELECT MAX (prod_list_price) FROM product WHERE prod_list_price < (SELECT MAX (prod_list_price)FROM p What would be the outcome of executing the above SQL statement? A. It produces an error. B. It shows the names of all products in the table. C. It shows the names of products whose list price is the second highest in the table. D. Itshows the names of all products whose list price is less than the maximum list price. Correct Answer: C Section: (none) Explanation Explanation/Reference: QUESTION 2 View the Exhibits and examine the structures of the products, sales, and customers tables.VARCHAR (40) NOTNULL| NUMBER VARCHAR2 (30) VARCHAR (30) CUSTINCOME LEVEL | =i [cusrcreDmMumir |__| feusrena | +d i [Name ult? __d type Table PROD_NAME INOT NULL | VARCHAR2(50} PROD_DESC [PROD_CATEGORY_ID | [NUMBER | [FROD_ONIT_OF.NEASURE| _[ vancnanzizay_| [SUPPLIERID—____ | NOT NULL | NUMBERIG) [PROD_STATUS [Table SALES [Name uit? type = ——— OT NULL] | 107 —SYNOTNULLIDATE IQUANTITY_SOLD NOT NULL] NUMBER(10,2) You need to generate a report that gives details of the customer's last name, name of the product, and the quantity sold for a customers in "Tokyo!Which two queries give the required result? A) SELECT c.cust_last_name,p-prod_name, s.quantity_sold FROM sales © JOIN products p USING (prod_id) JOIN customers ¢ USING (cust_id) WHERE c.cust_cit: Tokyo"; B) SELECT c.cust_last_name, p.prod_name, s.quantity sold FROM products p JOIN sales s JOIN customers c ON(p.prod_id=s.prod_id) ON(s.cust_id=c.cust_id) Toxyo'; C) SELECT c.cust_last_name, p.prod_name, s.quantity_sold FROM products p JOIN sales s ON(p.prod_id=s.prod_id) JOIN customers c ON(s.cust_id=c.cust_id) ty="Tokyo's D) SELECT c.cust_id,c.cust_last_name,p.prod_id, p.prod_name, s.q FROM products p JOIN sales s USING (prod_id) JOIN customers c USING (cust_id) WHERE c.cust_cit "Tokyo"; Option A Option B Option A 8. c D. Option D Correct Answer: AC Section: (none) QUESTION 3 Examine the create table statements for the stores and sales tables. SQL> CREATE TABLE stores(store_id NUMBER(4) CONSTRAINT store_id_pk PRIMARY KEY, store_name VARCHAR2(112), store_address VARCHAR2(20), start_date DATE); SQL> CREATE TABLE sales(sales_id NUMBER(4) CONSTRAINT sales _id_pk PRIMARY KEY, item _id NUMBER(4), quantity NUMBER(10), sales date DATE, store_id NUMBER(4), CONSTRAINT store _id_fk FOREIGN KEY(store_id) REFERENCES stores(store id);You executed the following statement: SQL> DELETE from stores WHERE store_id=900; The statement fails due to the integrity constraint error: (ORA-02292: integrity constraint (HR.STORE_ID_FK) violated Which three options ensure that the statement will execute successfully? Disable the primary key in the STORES table. Use CASCADE keyword with DELETE statement. DELETE the rows with STORE_ID = 900 from the SALES table and then delete rows from STORES table. Disable the FOREIGN KEY in SALES table and then delete the rows. Create the foreign key in the SALES table on SALES_ID column with on DELETE CASCADE option. moomp> Correct Answer: ACD Section: (none) Explanation Explanation/Reference: QUESTION 4 You issued the following command: SQL> DROP TABLE employees; Which three statements are true? All uncommitted transactions are committed All indexes and constraints defined on the table being dropped are also dropped. ‘Sequences used in the employees table become invalid, ‘The space used by the employees table is reclaimed immediately. ‘The employees table can be recovered using the rollback command. ‘The employees table is moved to the recycle bin, mmoog> Correct Answer: BCF Section: (none) Explanation Explanation/Reference: Reference: hitp:/www.sqlcourse.com/drop.htm! QUESTION 5 Examine the data in the CUST_NAME column of the customers table.cUST_NAME Renske Ladwig Jason Mallin Samuel McCain Allan MCEwen Irene Mikkilineni Julia Nayer ‘You need to display customers’ second names where the second name starts with "Mc" or "MC." Which query gives the required output? A) SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1) FROM customers WHERE INITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1))="Nc's B) SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1) FROM customers WHERE INITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1)) LIKE 'Mc%'; C) SELECT sUBSTR(cust_name, INSTR(cust_name,‘ ')+1) FROM customers WHERE SUBSTR(cust_name, INSTR(cust_name,' ')+1) LIKE INITCAP('MC'); D) SELECT suBsTR(cust_name, INSTR(cust_name,' ')+1) FROM customers WHERE INITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1)) = INTTCAP('MCS'); ‘A. Option A B. Option B ©. Option & D. Option D Correct Answer: B Section: (none) Explanation Explanation/Reference: QUESTION 6 You want to create a sales table with the following column specifications and data types SALESID: Number STOREID: Number ITEMID: Number QTY: Number, should be set to 1 when no value is specified SLSDATE: Date, should be set to current date ‘when no value is specified PAYMENT: Characters up to 30 characters, should be set to CASH when no value is specified Which statement would create the table?A) CREATE TABLE sales( salesid NUMBER (4), storeid NUMBER (4), Ttemid NUMBER (4), qty NUMBER DEFAULT = 1, elsdate DATE DEFAULT SYSDATE, payment VARCHAR2 (30) DEFAULT CASE) ; B) CREATE TABLE sales( salesid NUMBER(4), storeid NUMBER(4), itemid NUMBER (4), QTY NUMBER DEFAULT 1, sisdate DATE DEFAULT SYSDATE, payment VARCHAR2 (30) DEFAULT 'CASH'); C) CREATE TABLE sales( salesid NUMBER (4), storeid NUMBER (4), itemid NUMBER (4), qty NUMBER DEFAULT slsdate DATE DEFAULT 'SYSDATE', Payment VARCHAR? (30) DEFAULT CASH) D) CREATE TABLE sales ( salesid NUMBER (4), storeid NUMBER (4), itemid NUMBER (4), gty NUMBER DEFAULT = 1, sisdate DATE DEFAULT SYSDATE, payment VARCHAR2 (30) DEFAULT = “CASH"); ‘A. Option A B. Option B ©. Option C D. Option D Correct Answer: D Section: (none) Explanation Explanation/Referenc QUESTION 7 You want to display 5 percent of the rows from the sales table for products with the lowest AMOUNT_SOLD and also want to include the rows that have the same AMOUNT_SOLD even if this causes the output to exceed 5 percent of the rows. Which query will provide the required result?A) SELECT prod_id, cust_id, amount_sold FROM sales ‘ORDER BY anount_sold FETCH FIRST 5 PERCENT ROWS ONLY: B) Sezer prod_id, cust_i¢,amount_sold FROM sales ORDER BY anount_sold FETCH FIRST 5 PERCENT ROWS WITH TIES ONLY: C) SELECT prod_id,cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS ONLY WITH TIES; D) setecr prod_id, cust_i FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS WITH TIES; y amount_sold ‘A. Option A 8. Option B ©. Option D. Option D Correct Answer: D Section: (none) Explanation Explanation/Referenc QUESTION 8 Evaluate the following query: SQL> SELECT TRUNC(ROUND(156.00, -1), -1) FROM DUAL; What would be the outcome? 16 100 160 200 150 moop> Correct Answer: C Section: (none) Explanation Explanation/Reference: Explanation: Function Purpose ROUND(columnjexpression, n) Rounds the column, expression, or value to n decimal places or, ifn is omitted, ‘no decimal places (ifn is negative, numbers to the left of decimal point are rounded.) TRUNC(columnlexpression, n) Truncates the column, expression, or value to n decimal places or, ifn isomitted, n defaults to zero QUESTION 9 Using the customers table, you need to generate a report that shows 50% of each credit amount in each income level. The report should NOT show any repeated credit amounts in each income level. Which query would give the required result? A) SELECT cust_income_level, DISTINCT cust_credit_limit * 0.50 AS "508 Credit Limit” FROM customers; B) SELECT DISTINCT cust_incone_leve. AS "S08 Credit Limit” FROM customers; DISTINCT cust_credit_limit ~ 0.50 C) SELECT DISTINCT cust_income_level || ' ' || cust_credi AS "SO% Credit Limit" FROM customers; limit * 0.50 D) SELECT cust_income_level ||' ‘|| cust_credit_limit * 0.50 AS "SO% Credit Limit! FROM customers; ‘A. Option A B. Option B ©. Option D. Option D Correct Answer: C Section: (none) Explanation Explanation/Reference: Duplicate Rows Unless you indicate otherwise, SQL displays the results of a query without eliminating the duplicate rows. To eliminate duplicate rows in the result, include the DISTINCT keyword in the SELECT clause immediately after the SELECT keyword. ‘You can specify multiple columns after the DISTINCT qualifier. The DISTINCT qualifier affects all the selected columns, and the result is every distinct combination of the columns. QUESTION 10 Examine the structure of the employees table.Name Null? EMPLOYEE _ID NOT NULL FIRST_NAME LAST_NAME NOT NULL EMAIL NOT NULL PHONE_NUMBER HIRE_DATE NOT NULL JOB_ID NOT NULL SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID You want to display the maximum and minimum salaries of employees hired 1 year ago. Which two statements would get the correct output? A) SELECT MIN (salary) ,MAX(salary) FROM (SELECT salary FROM employees WHERE hire date < SYSDATE-365) ; B) SELECT minsal, maxsal FROM (SELECT MIN(salary) minsal, MAX(salary) maxsal FROM employees WHERE hire date < SYSDATE-365 GROUP BY MIN(salary), MAX(salary)) 7 C) SELECT minsal, maxsal FROM (SELECT MIN(salary) minsal, MAX(salary) maxsal FROM employees WHERE hire date < SYSDATE-365) GROUP BY maxsal, minsal ; D) SELECT MIN(salary) minsal, MAX(salary) maxsal FROM employees WHERE hire date < SYSDATE-365 GROUP BY MIN(salary), MAX(salary); ‘A. Option A 8. Option B©. Option & D. Option D Correct Answer: 8D Section: (none) Explanation Explanation/Reference: hitp://publib.boulder.ibm.com/infocenter/dzichelpiv2r2iindex.jsp?topic= %2Fcom.ibm.db2z10.doc.sqiret%2F sre °%2Ftpc%2Fdb2z_sq|_subselectexamples.htm QUESTION 11 Evaluate the following SQL statement: SQL> SELECT cust_id, cust_last_name FROM customers WHERE cust_credit_limit 1 (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 subquery is null? A. It produces an error. B, Itexecutes but returns no rows. C. Itgenerates output for null as well as the other values produced by the subquery. D. Itignores the null value and generates output for the other values produced by the subquery. Correct Answer: C Section: (none) Explanation Explanation/Reference: ‘Answer is Modified, QUESTION 12 You issue the following command to drop the products table: SQL> DROP TABLE products; Which three statements are true about the implication of this command? All data along with the table structure is deleted, ‘A pending transaction in the session is committed. All indexes on the table remain but they are invalidated, All views and synonyms remain but they are invalidated. All data in the table is deleted but the table structure remains. moom> Correct Answer: ABD Section: (none) Explai Explanation/Reference:QUESTION 13 Which statement is true regarding the default behavior of the order by clause? ‘A, Ina character sor, the values are case-sensitive. B. NULL values are not considered at all by the sort operation . Only those columns that are specified in the select list can be used in the order by clause. D. Numeric values are displayed from the maximum to the minimum value if they have decimal positions. Correct Answer: A Section: (none) Explanation Explanation/Reference: Explanation: Character Strings and Dates Character strings and date values are enclosed with single quotation marks. Character values are case- sensitive and date values are format-sensitive, The default date display format is DD-MON-RR. QUESTION 14 Examine the structure of the employees table: Name Null? Type EMPLOYEE_ID NO? NULL NUMBER (6) FIRST_NAME VARCHAR? (20) LAST_NAME NOT NULL VARCHAR? (25) EMAIL NOT NULL VARCHAR? (25) PHONE_NUMBER VARCHAR? (20) HIRE_DATE NOP NULL DATE JOB_ID NOT NULL VARCHAR? (10) SALARY NUMBER (8,2) COMMISSION_PCT NUMBER (2,2) MANAGER_ID NUMBER (6) DEPARTMENT_1D NUMBER (4) ‘There is a parentichild relationship between EMPLOYEE_ID and MANAGER _ID. You want to display the name, joining date, and manager for all the employees. Newly hired employees are yet to be assigned a department or a manager. For them, ‘No Manager should be displayed in the manager column, Which SQL query gets the required output?A) SELECT e.last_name, @.hire_date, NVL(m.last_name, 'No Manager!) Manager FROM employees © JOIN employees m ON (e.manager_id = m.employee_id); B) SELECT e.last_name, e.hire date, NVL(m.last_name, 'No Manager') Manager FROM employees e LEFT OUTER JOIN employees m ON (e.manager_id = m.employee id); C) SELECT e.last_name, e.hire date, NVI(m.last_name, ‘No Manager') Manager FROM employees e RIGHT OUTER JOIN employees n ON (2.manager_id = m.employee_id); D) SELECT e.last_name, e.hire date, NVL(m.last_name, 'No Manager') Manager FROM employees e NATURAL JOIN employees m ON (2.manager_id = m.employee_ia) 7 A. Option A B. Option B ©. Option D. Option D Correct Answer: D Section: (none) Explanation Explanation/Refer: Reference: http://ivrainbow6S.blogspot.com/ QUESTION 15 ‘The customers table has the following structure: Name Null? Type cusTt_ID NOT NULL NUMBER CUST_FIRST_NAME NOT NULL VARCHAR2 (20) CUST_LAST_NAME NOT NULL VARCHAR2 (30) CUST_INCOME_LEVEL VARCHAR2 (30) CUST_CREDIT_LIMIT NUMBER ‘You need to write a query that does the following tasks: 4. Display the first name and tax amount of the customers. Tax is 5% of their credit limit. 2. Only those customers whose income level has a value should be considered, 3. Customers whose tax amount is null should not be considered, Which statement accomplishes all the required tasks?A) SELECT cust_first_name, cust_credit_limit * .05 AS TAX_AMOUN FROM customers WHERE cust_income_level IS NOT NULL AND tax_amount IS NOT NULL; B) SELECT cust_first_name, cust_credit_limit * .05 AS TAX_AMOUN FROM customers WHERE cust_income_level IS NOT NULL AND cust_credit_limit IS NOT NULL; C) SELECT cust_first_name, cust_credit_limit * .05 AS TAK_AMO FROM customers WHERE cust_income_level <> NULL AND tax_amount <> NULL; D) SELECT cust_first_name, cust_credit_limit * .05 AS TAK_AM FROM customers WHERE (cust_income_level,tax_amount) IS NOT NULL; ‘A. Option A B. Option B €. Option ¢ D. Option D Correct Answer: B Section: (none) Explanation Explanation/Reference: QUESTION 16 View the Exhibits and examine the structures of the products and sales tables.[ratte PRODUCTS — N Cs pT NULL TT NULL [SUPPLIER ID [NOT NULL] NUMBER [PROD_STATUS [NOT NULL, [PROD_UST_PRICE [NOT NULL. NOT NULL | NUMBER(S,2) [QUANTITY SOLO ___—*[NOTNULLJNUMBER(10.2) —_| Which two SQL statements would give the same output? A) SELECT prod_id FROM products INTERSECT SELECT prod_id FROM sales; B) SELECT prod_id FROM products MINUS SELECT prod_id FROM sales; C) SELECT DISTINCT p.prod_id FROM products p JOIN sales s ON p.prod_id=s.prod_id; D) SELECT DISTINCT p.prod_id FROM products p JOIN sales s ON p.prod_id <> s.prod_id;Option A Option B Option Option D pomp Correct Answer: AC Section: (none) Explanation Explanation/Reference: QUESTION 17 View the Exhibit and examine the description of SALES and PROMOTIONS tables.[ACENOAR- WER NUMBER” [EALENOAR-MOWTH NUMER fEACENORI: MONTE RAME [CALENOAA YEAR [PRD_NANe [PROD CATEGORY 10 [PROO-UNIT_OF MEASORE| [everest ume | Pancha 40)] [eosi.cenoen Fenacy [cusr-vear or anne —[wormutc | wimner a —} feustsakrnac stars} Tyancuane ao] [essrsorrat-cooe— fwornvufvancwans oy} ——_ [cust cone tever fF vancnaz caf [cusr_creor_twnt —|-~“"{uwaen [vet enat franca] You want to delete rows from the sales table, where the PROMO_NAME column in the promotions table has either blowout sale of everyday low prices as values. Which three delete statements are valid?A) DELETE FROM sales WHERE promo_id = (SELECT promo_id FROM promotions WHERE promo_name = ‘blowout sale") AND promo_id = (SELECT promo id FROM promotions WHERE promo_name = ‘everyday low price'): B) DELETE FROM sales WHERE promo_id = (SELECT promo_id FRON promotions WHERE promo_name = ‘blowout sale') OR promo_id = (SELECT prono_id FROM promotions WHERE promo_name = ‘everyday low price’) C) DELETE FROM sales WHERE promo_id IN (SELECT promo_id FROM promotions WHERE promo name = "blowout sale! OR promo_name = ‘everyday low price'); D) DELETE FROM sales WHERE promo_id IN (SELECT promo_id FROM promotions WHERE promo name IN (‘blowout sale', ‘everyday low price’) ‘A. Option A B. Option B ©. Option & D. Option D Correct Answer: BCD Section: (none) Explanation Explanation/Reference: QUESTION 18 Which three tasks can be performed using SQL functions built into Oracle Database? A. Displaying a date in a nondefault format 8. Finding the number of characters in an expression C. Substituting a character string in a text expression with a specified string D. Combining more than two columns or expressions into a single column in the output Correct Answer: ABC Section: (none) ExplanationExplanation/Reference: QUESTION 19 You want to display 5 percent of the employees with the highest salaries in the EMPLOYEES table. Which query will generate the required result? A) SELECT employee_id, last_name, salary FROM employees ORDER BY salary FETCH FIRST 5 PERCENT ROWS ONLY; B) SELECT employee id, last_name, salary FROM employees ORDER BY salary DESC FETCH FIRST 5 PERCENT ROWS ONLY; C) SELECT employee id, last_name, salary FROM employees ORDER BY salary DESC FETCH FIRST 5 PERCENT ROWS ONLY WITH TIES; D) SELECT employee _id, last_name, salary FROM employees ORDER BY salary DESC FETCH 5 PERCENT ROWS ONLY; ‘A. Option A 8. Option B ©. Option & D. Option D Correct Answer: D Section: (none) Explanation Explanation/Referenc QUESTION 20 Which three SQL statements would display the value 1890.55 as $1, 890.55?A) SELECT TO_CHAR(i890.55,'$0G000D00') FROM DUAL; B) SELECT TO_CHAR (1890.55, '$9,999V99") FROM DUAL; C) SELECT TO_CHAR(1890.55,'$99,999D99") FROM DUAL; D) SELECT TO_CHAR(1890.55, '$99G999D00') FROM DUAL; E) SELECT TO_CHAR (1890.55, '$99G999D99") FROM DUAL; Option A Option B Option C Option D Option E moog> Correct Answer: ADE Section: (none) Explanation Explanation/Reference: QUESTION 24 ‘View the Exhibit and evaluate the structure and data in the CUST_STATUS table.CUST_STATUS Name Null? Type CUSTNO NOT NULL NUMBER (2) ANT_SPENT NUMBER (10,2) CREDIT_LINIT NUMBER(10,2) cCUSTNO AMT_SPENT CREDIT_LIMIT 1 1000 1000 2 2000 2500 3 3000 4 3000 2800 You issue the following SQL statement: SQL> SELECT custno, NVL2(NULLIF(amt_spent, credit_limit), 0, 1000) "BONUS" FROM cust_statuss Which statement is true regarding the execution of the above query? ‘A, It produces an error because the AMT_SPENT column contains a null value. B. Itdisplays a bonus of 1000 for all customers whose AMT_SPENT is less than CREDIT_LIMIT. C. Itdisplays a bonus of 1000 for all customers whose AMT_SPENT equals CREDIT_LIMIT, or AMT_SPENT is null D. Itproduces an error because the TO_NUMBER function must be used fo convert the result of the NULLIF. function before it can be used by the NVL2 function, Correct Answer: C Section: (none) Explanation Explanation/Reference: Explanation: The NULLIF Function The NULLIF function tests two terms for equality. If they are equal the function returns a null, else it returns the first of the two terms tested. The NULLIF function takes two mandatory parameters of any data type. The syntax is NULLIF(ifunequal, comparison_term), where the parameters ifunequal and comparison_term are compared. If they are identical, then NULL is returned. If they differ, the ifunequal parameter is returned QUESTION 22 In the customers table, the CUST_CITY column contains the value 'Paris' for the CUST_FIRST_NAME ‘Abigail. Evaluate the following query:SQL> SELECT INITCAP(cust_first_name || ' UPPER (SUBSTR (cust_; FROM customers WHERE cust_first_name = 'Abigail'; What would be the outcome? A, Abigail PA B. Abigail Pa ©. Abigail IS D. An error message Correct Answer: B Section: (none) Explanation Explanation/Reference: QUESTION 23 Examine the types and examples of relationships that follow: 4. One-to-one a) Teacher to students 2. One-to-many b) Employees to Manager 3. Many-to-one c) Person to SSN 4, Many-to-many d) Customers to products Which option indicates the correctly matched relationships? A. 1-8, 2b, 3 B, 1-,2-4, 3 C. te, 2-8, 3+, and 4d D. 1-4, 2b, 3-a, and 4-c Correct Answer: C Section: (none) Explanation Explanation/Reference: Corrected. QUESTION 24 at y,~LENGTH (cust_city),2))) Which normal form is a table in if it has no multi-valued attributes and no partial dependencies? A, First normal form B. Second normal form . Third normal form D. Fourth normal form Correct Answer: B Section: (none) Explanation Explanation/Reference:QUESTION 25 View the Exhibit and examine the structure of the promotions table. i Q Ls = [Name Nutt? type VARCHAR2(30) NOT NU NOT NULL | VARCHARZ(30 [PRONO_CATEGORY.10__ [WOT NUL [PRONO_COST [NOT NU PROMO_BEGIN_DATE NOT NU PROMO_END_DATE NOT NU Evaluate the following SQL statement: SQL>SELECT promo_name, CASE WHEN promo_cost >=(SELECT AVG(pz FROM promotic WHERE promo_c THEN 'HIGH' ELSE 'LOW' END COST_REMARK FROM promotions; Which statement is true regarding the outcome of the above query? ‘A. It shows COST_REMARK for all the promos in the table. B. It produces an error because the SUBQUERY gives an error. . It shows COST_REMARK for all the promos in the promo category "TV" D. Itproduces an error because SUBQUERIES cannot be used with the case expression. Correct Answer: A : (none) Explanation/Reference: QUESTION 26 View the Exhibit and examine the structure of the customers table.JTable CUSTOMERS [Name nuit? TP type RCHAR? (20) NOT NULL (/ARCHAR2 (40) NOT NU [CUSTMARITIAL STATUS |__| VARCHAR? (0 VARCHAR? (40) VARCHAR? (10) ‘CUST_STATE_ PROVINCE country N 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 NYL(cust_credit_limit,'Not Available')*.15 "NEW CREDIT" FROM customers; B) seLecr Nvx(cust_credit_limit+.15,'Not available") "NEW cReDrT" FROM customers; C) SELECT To_CHAR(NVL(cust_credi: FROM customers; limit*.15,'Not Available')) W CREDIT" D) SELECT NVL(TO_CHAR(cust_credit_limit*.iS),'Not Available") "NEW CREDIT" FROM customers; Option A Option B Option Option D pomp Correct Answer: D Section: (none) Explani Explanation/Reference: Explanation: NVL Function Converts a null value to an actual value: Data types that can be used are date, character, and number. Data types must match: NVL(commission_pet, 0) NVL(hire_date, '07-JAN-97")NVL(job_id, 'No Job Yet’) QUESTION 27 View the Exhibit and examine the structure of the customers table. fcustID——~—SSs NOT NULLA i T. [ vARCHARZ (20 | NOTNULL| CHAR) | [CUST_MARMAL-STATUS| | VARCHAR? (6) | VAI UST | | NOT NULL VARCHARZ (20) CUST_LAST_NAME COUNTRY. NUMBER ‘CUST_INCOME_LEVE! VARCHARZ (30) VARCHAR? (0 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: INSERT INTO new_customers (cust_id, cust_name, cust_city) VALUES (SELECT cust_id,cust_first_name||‘ ‘| |cust_last_name,cust_city FROM customers WHERE cust_id > 23004); The insert statement fails when executed. What could be the reason? ‘A, The values clause cannot be used in an INSERT with a subquery. 8. Column names in the NEW_CUSTOMERS and CUSTOMERS tables do not match. C. The where clause cannot be used in a subquery embedded in an INSERT statement. D. The total number of columns in the NEW_CUSTOMERS table does not match the total number of columns in the CUSTOMERS table. Correct Answer: A Section: (none) Explanation Explanation/Reference: Explanation: Copying Rows from Another Table Write your INSERT statement with a subquery Do not use the VALUES clauseMatch the number of columns in the INSERT clause to those in the subquery, Inserts all the rows returned by the subquery in the table, sales_reps. QUESTION 28 Examine the structure and data of the CUST_TRANS table CUST_TRANS Name Null? Type CUSTNO NOT NULL CHAR (2) TRANSDATE DATE TRANSAMT NUMBER (6, 2) CUSTNO TRANSDATE 12 01-JAN-07 22 01-FEB-07 33 01-MAR-07 Dates are stored in the default date format dd-mon-rr in the CUST_TRANS table. Which three SQL statements ‘would execute successfully? ‘A. SELECT transdate +10’ FROM cust trans; SELECT * FROM cust_trans WHERE transdate = '01-01-07; SELECT transamt FROM cust_trans WHERE custno > "11"; SELECT * FROM cust trans WHERE transdate="01-JANUARY-07' ‘SELECT cusino + 'A' FROM cust_trans WHERE transamt > 2000; moow Correct Answer: ACD Section: (none) Explanation Explanation/Reference: QUESTION 29 Examine the data in the ORD_ITEMS table: ORD_NO © ITEM_NO ua 222 333 333 444 ii 1 1 2 2 3 Evaluate the following query:SQL>SELECT item_no, AVG(aty) FROM ord items HAVING AVG(aty) > 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 group by clause. B. Itgives an error because all the aggregate functions used in the having clause must be specified in the select list. C. Itdisplays the item nos with their average quantity where the average quantity is more than double the minimum quantity of that item in the table. D. Itdisplays the item nos with their average quantity where the average quantity is more than double the ‘overall minimum quantity of all the ites in the table. Correct Answer: C Section: (none) Explanation Explanation/Reference: QUESTION 30 YOU need to display the date l-oct-2007 in words as ‘Eleventh of October, Two Thousand Seven’ Which SQL statement would give the required result? A) SELECT TO_CHAR('ii-oct-2007', 'fmDdspth "of" Month, Year') FROM DUAL B) SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdspth of month, ye FROM DUAL C) SELECT TO_CHAR(TO_DATE('ii-oct-2007'), 'fmDdthsp "of" Month, FROM DUAL; fmDdspth ''of'' Month, D) SELECT TO_DATE (TO_CHAR('11-oct-2007 FROM DUAL. ‘A. Option A 8. Option B ©. Option C D. Option D Correct Answer: A Section: (none) Explanation Explanation/ReferencQUESTION 31 You need to create a table withthe following column specifications: 4. Employee ID (numeric data type) for each employee 2. Employee Name (character data type) that stores the employee name 3. Hire date, which stores the date of joining the organization for each employee 4. Status (character data type), that contains the value ‘activet ifno data is entered 5, Resume (character large object [CLOB] data type), which contains the resume submitted by the employee Which is the correct syntax to create this table? A) CREATE TABLE EMP_1 (emp_id NUMBER (4), emp_name VARCHAR2 (25) , start_date DATE, e_status VARCHAR2(10) DEFAULT 'ACTIVE', resume CLOB(200)); B) CREATE TABLE 1_EMP (emp_id NUMBER (4), emp_name VARCHAR2 (25), start_date DATE, emp_status VARCHAR2(10) DEFAULT 'ACTIVE', xesume CLOB) ; C) CREATE TABLE EMP_1 (emp_id NUMBER (4) , emp_name VARCHAR2 (25), start_date DATE, emp_status VARCHAR2(10) DEFAULT "ACTIVE", resume CLOB); D) CREATE TABLE EMP_i (emp_id NUMBER, emp_name VARCHAR2 (25), start_date DATE, emp_status VARCHAR2(10) DEFAULT 'ACTIVE', resume CLOB); ‘A. Option A B. Option B ©. Option & D. Option D Explanation Explanation/Reference: Explanation: CLOB Character data (up to 4 GB) NUMBER ((p. 5)] Number having precision p and scale s (Precision is the total number of decimal digits and.scale is the number of digits to the right of the decimal point; precision can range from 1 to 38, and scale can range from 84 to 127,) QUESTION 32 View the Exhibit and examine the data in the promotions table. @ PRONO_NAME PROMO_CATEGORY |i} PROMO_COST | PROMO_BEGIN_DATE NO PROMOTION # NO PROMOTION 0.O1-JAN-99 newspaper promotion #16-108 newspaner 200 23-DEC-00 post promotion #20-232 post 300 25-SEP-98 newspaper promotion #16-349 newspaper 400 10-UL-98 internet promotion #14-471 internet 600 26-FEB-00 ‘TV promotion #13-448 wv 1100 06-AUG-00 internet promotion #25-86 internet 1400 20-SEP-98 TV promotion #12-49 Ww 1500 10-AUG-00 post promotion #21-166 post 2000 25-SEP-98 newspaper promotion #19-210 newspaper 2100 19-MaR-99 post promotion #20-262 post 2300 06-DEC-00 newspaper promotion #16-327 newspaner 2800 09-APR-99 internet promotion #29-289 internet 3000 01-Nov-96 ‘TV promotion #12-252 wv 3100 20-JUN-98 magazine promotion #26-258 magazine 3200 04-May-00 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 WHERE promo_category = ‘post’ AND promo begin date < '01-01-00'; B) SELECT promo_name, promo_cost, promo_begin_date FROM promotions WHERE prowo_cost LIKE ‘post®' AND promo_begin date < '01-01-2000'; C) SELECT promo_name, promo_cost, promo_begin_date FROM promotions WHERE promo_category LIKE 'Pt' AND promo_begin_date < '1-JANUARY-00'; D) SELECT promo_name, promo_cost, promo_begin date FROM promotions WHERE promo_category LI ‘Spost#' AND promo_begin_date < '1-JAN-00'; ‘A. Option A B. Option B ©. Option &D. Option D Correct Answer: D Section: (none) Explanation Explanation/Reference: QUESTION 33 Examine the data in the PROMO_BEGIN_DATE column of the promotions table: PROMO_BEGIN_DATE 15-dec-99 18-oct-98 22-aug-29 You want to display the number of promotions started in 1999 and 2000. Which query gives the correct output? A) SELECT SUM(DECODE (SUBSTR(promo_begin_date,8),'00',1,0)) "2000", SUM (DECODE (SUBSTR (promo_begin date,8),'99',1,0)) "1999" FROM promotions; B) SELECT SUM(CASE TO_CHAR(promo_begin_date,*yyyy') WHEN '99' THEN 1 ELSE 0 END) "1999",SUM(CASE TO_CHAR(promo_begin_date, 'yyyy') WHEN ELSE 0 END) "2000" FROM promotions; C) SELECT COUNT(CASE TO CHAR(promo_begin date, 'yyyy') WHEN '99' THEN ELSE 0 END) "1999",COUNT(CASE TO_CHAR(promo_begin_date, 'yyyy') WHI ELSE 0 END) "2000" FROM promotions? D) SELECT COUNT (DECODE (SUBSTR(TO_CHAR (promo _begin_ date, 'yyyy'), 8), | COUNT (DECODE (SUBSTR (TO_CHAR(promo_begin date, 'yyyy'), &),'2000', 0)) "2000" FROM promotions; ‘A. Option A 8. Option B ©. Option C D. Option D Correct Answer: A Section: (none)Explanation Explanation/Reference: QUESTION 34 View the Exhibit and examine the structure of the products table. PROD_DESC INOT NULL PROD_CATEGORY [PROD_CATEGORY_10__] PROD_CATEGORY_ID [SUPPUIERIO ——_[NOTNULL | NUMBER All products have a list price. You issue the following command to display the total price of each product after a discount of 25% and a tax of 15% are applied on it. Freight charges of $100 have to be applied to all the products. SQL>SELECT prod_name, prod_list_price -(prod_list_price*(25/100)) +(prod_list_price -(prod_1ist_price* (25/100) )*(15/100)) +100 AS "TOTAL PRICE" FROM products; What would be the outcome if all the parentheses are removed from the above statement? ‘A, It produces a syntax error. B. The result remains unchanged. C. The total price value would be lower than the correct value. D. The total price value would be higher than the correct value. Correct Answer: Section: (non Explanation Explanation/Reference: QUESTION 35 \Viow the Exhibit and examine the structure of the CUSTOMERS table.c Dd il ULL] NUMBE! i [CUST_FIRST_NAME | NOT NULL] VARCHAR2 (20) | [CUST_LAST_NAME | NOT NULL] VARCHAR? (40) | [CUST_MARITIAL_sTATUS | VAR’ z NOT NU CI (20) 7ARCHARZ (40 a [COUNTRY_ID NOT NUL CUST_INCOME_LEVEL ‘CUST_CREDIT_LIMIT ‘CUST_EMAIL ‘You have been asked to produce a report on the customers table showing the customers details sorted in descending order of the city and in the descending order of their income level in each city Which query would accomplish this task? A) SELECT cust_city, cust_income_level, cust_last_name FROM customers ORDER BY cust_city desc, cust_income_level DESC; B) SELECT cust_city, cust_income_level, cust_last_name FROM customers ORDER BY cust_income_level desc, cust_city DESC, C) SELECT cust_city, cust_income_level, cust_last_name FROM customers ORDER BY (cust_city, cust_income level) DESC; ) SELECT cust_city, cust_income_level, cust_last_name FROM customers ORDER BY cust_city, cust_income_level DESC? ‘A. Option A 8. Option B ©. Option & D. Option D Correct Answer: A Section: (none) Explanation Explanation/Reference:QUESTION 36 ‘You want to display the date for the first Monday of the next month and issue the following command: SQL>SELECT TO_CHAR(NEXT_DAY(LAST_DAY (SYSDATE), 'MON'), "dd “is the first Monday for" fmmonth rrrr') FROM DUAL; What is the outcome? A. Itexecutes successfully and returns the correct result. B, Itexecutes successfully but does not return the correct result. C. Itgenerates an error because TO_CHAR should be replaced with TO_DATE. D. Itgenerates an error because rrr should be replaced by rrin the format string. E, Itgenerates an error because fm and double quotation marks should not be used in the format string. Correct Answer: A Section: (none) Explanation Explanation/Reference: QUESTION 37 You need to display the first names of all customers from the customers table that contain the character'e' and have the character’a'’ in the second last position, Which query would give the required output? A) SELECT cust_first_name FROM customers WHERE INSTR(cust_first_name, 'e')<>0 AND SUBSTR (cust_first_name, -2, 1 B) SELECT cust_first_name FROM customers WHERE INSTR (cust_first_name, 'e')<>'' AND SUBSTR (cust_first_name, -2, 1)= C) SELECT cust_first_name FROM customers WHERE INSTR (cust_first_name, 'e')IS NOT NULL AND SUBSTR (cust_first_name, 1,-2)='a's D) SELECT cust_first_name FROM customers WHERE INSTR (cust_first_name, ‘e')<>0 AND SUBSIR (cust_first_name, LENGTH (cust_first_name) ,-2 ‘A. Option A 8. Option B ©. Option © D. Option DCorrect Answer: A Section: (none) Explanation Explanation/Reference: Explanation: The SUBSTR(string, start position, number of characters) function accepts three parameters and returns a string consisting of the number of characters extracted from the source string, beginning at the specified start position. substr(‘http:/www.domain.com’, 12, 6) = domain The position at which the first character of the returned string begins, When position is 0 (zero), then itis treated as 1. When position is positive, then the function counts from the beginning of string to find the first character. When position is negative, then the function counts backward from the end of string substring_length The length of the returned string, SUBSTR calculates lengths using characters as defined by the input character set. SUBSTRB uses bytes instead of characters. SUBSTRC uses Unicode complete characters. SUBSTR2 uses UCS2 code points. SUBSTR4 uses UCS4 code points. When you do not specify a value for this argument, then the function The INSTR(source string, search item, [start position], [nth occurrence of search item) function returns a number that represents the position in the source string, beginning from the given start position, where the nth occurrence of the search item begins: instr(http:www.domain.com’, "', 1, 2)= 18 QUESTION 38 View the Exhibit and examine the data in the products table. PROD. | PROD_NAME PROD_CATEGORY | PROD_MIN_PRICE| EF 101 Envoy Z56MB - | Hardware 6000 I 40GB Y Box Electronics 3000 DVD-R Disc, Software/Other | 2000 I 4.7 GB Documentation | Software/Other | 4000 Set - Spanish You need to display product names from the products table that belong to the 'software/other’ category with ‘minimum prices as either $2000 or $4000 and no unit of measure. You issue the following query: SQL>SELECT prod_name, prod_category, prod_min_price FROM products WHERE prod_category LIKE '$Others' AND (prod_min_price = 2000 oR prod_min price = 4000) AND prod_unit_of_measure > ''; Which statement is true regarding the above query?A, It executes successfully but returns no result. B. Itexecutes successfully and returns the required result . Itgenerates an error because the condition specified for PROD_UNIT_OF_MEASURE is not valid D. Itgenerates an error because the condition specified for the prod category column is not valid Correct Answer: A Section: (none) Explanation Explanation/Reference: QUESTION 39 You need to generate a list of all customer last names with their credit limits from the customers table. Those customers who do not have a credit limit should appear last in the list. Which two queries would achieve the required result? A) SELECT cust_last_name, cust_credit_limit FROM customers ORDER BY cust_credit limit DESC; B) SELECT cust_last_name, cust_credit_limit FROM customers ORDER BY cust_credit_limit; () SELECT cust_last_name, cust_credit_limit FROM customars ORDER BY cust_credit_limit NULLS LAST: D) SELECT cust_last_name, cust_credit_, FROM customers ORDER BY cust_last_name, cust_credit_limit NULLS LAST; ‘A. Option A B, Option B ©. Option & D. Option D Correct Answer: BC Section: (none) Explanation Explanation/Reference: Explanation: if the ORDER BY clause is not used, the sort order is undefined, and the Oracle server may not fetch rows in the same order for the same query twice. Use the ORDER BY ciause to display the rows in a specific order. Note: Use the keywords NULLS FIRST or NULLS LAST to specify whether returned rows containing null values should appear first or ast in the ordering sequence. ANSWER C Sorting The default sort order is ascending: Numeric values are displayed with the lowest values first (for example, 1 to 999). - Date values are displayed with the earliest value first (for example, 01-JAN-92 before 01-JAN- 96). Character values are displayed in the alphabetical order (for example, ist and "2" last). - Null values aredisplayed last for ascending sequences and first for descending sequences. - ANSWER 8 You can also sort by a column that is not in the SELECT list. QUESTION 40 Examine the structure of the customers table: Name Null? Type cusTNo NUMBER (3) CUSTNAME NOT NULL VARCHAR? (25) CUSTADDRESS VARCHAR2 (35) CUST_CREDIT_LIMIT NUMBER (5) CUSTNO is the primary key in the table. You want to find out if any customers’ details have been entered more than once using different CUSTNO, by listing all the duplicate names. Which two methods can you use to get the required result? Self-join Subquery Full outer-join with setf-join Left outer-join with selF-join Right outer-join with selfjoin moomp> Correct Answer: AB Section: (none) Explanation Explanation/Ret nce: QUESTION 41 Evaluate the following query SQL> SELECT promo_name || g'{'s start date was \}' || promo_begin date AS "Promotion Launches" FROM promotions; What would be the outcome of the above query? ‘A. It produces an error because flower braces have been used. B. It produces an error because the data types are not matching. C. Itexecutes successfully and introduces an's at the end of each PROMO_NAME in the output. D. Itexecutes successfully and displays the literal "'s start date was \} * for each row in the output. Correct Answer: C Section: (none) Explanation Explanation/Reference: Explanation: So, how are words that contain single quotation marks dealt with? There are essentially two mechanisms available. The most popular of these is to add an additional single quotation mark next to each naturally ‘occurring single quotation mark in the character string Oracle offers a neat way to deal with this type ofcharacter literal in the form of the alternative quote (q) operator. Notice that the problem is that Oracle chose the single quote characters as the special pair of symbols that enclose or wrap any other character literal These character- enclosing symbols could have been anything other than single quotation marks. Bearing this in mind, consider the alternative quote (q) operator. The q operator enables you to choose from a set of Possible pairs of wrapping symbols for character literals as alternatives to the single quote symbols. The options are any single-byte or multibyte character or the four brackets: (round brackets), {curly braces), [squarebrackets], or
, Using the q operator, the character delimiter can effectively be changed from a single quotation mark to any other character The syntax ofthe alternative quote operator is as follows delimiter character literal which may include the single quotes delimiter’ where delimiter can be any character or bracket. Allemative Quote (q) Operator ‘Specify your own quotation mark delimiter. Select any delimiter. Increase readability and usability. SELECT depariment_name || q{ Department's Manager Id: Jl manager_i AS "Department and Manager" FROM departments; ‘Alternative Quote (q) Operator Many SQL statements tse character literals in expressions or conditions. If he itera itself contains a single quotation mark, you can use the quote (q) operator and select your own quotation mark delimiter. You can choose any convenient delimiter, single-byte or multi byte, or any of the following character pairs: [ ], 0, 0,0r<> In the example shown, the string contains a single quotation mark, whichis normally interpreted as a delimiter of a character string. By using the a operator, however, brackets (| are used as the quotation mark delimiters. The string between the brackets delimiters is interpreted as a iteral character string. QUESTION 42 View the Exhibit and examine the data in the employees table: EMPLOYEES EMPLOYEE ID EMPLOYEE_NAME MANAGER_ID SALARY DE 7369 SMITH 600 77698 ALLEN 1600 7902 WARD 1250 7654 MARTIN 7698 1250 You want to display all the employee names and their corresponding manager names, Evaluate the following query: SQL> SELECT e.employee_name "EMP NAME", m.employee_name "MGR FROM employees e employees m ON e.manager_id = m.employee_id; Which join option can be used in the blank in the above query to get the required output? A, INNER JOIN8, FULL OUTER JOIN C. LEFT OUTER JOIN D. RIGHT OUTER JOIN Correct Answer: C Section: (none) Explanation Explanation/Reference: QUESTION 43 View the Exhibit and examine the structures of the employees and departments tables. EMPLOYEES Name Wall? Type EMPLOYEE_ID NOT NULL HUMBER(6) FIRST_NAME VARCHARZ (20) LAST_HaMe NOT NULL VARCHAR2 (25) HIRE_DATE NOT NULL DATE JoB_ID NOT NULL VARCHAR2 (10) SALARY NUMBER( 10,2) COMMIS STON NUMBER(6 , 2) MANAGER_ID NUMBER(6} DEPARTMENT_ID WUMBER( 4) DEPARTMENTS Name Mull? ‘Type DEPARTMENT_ID NOT NULL NUMBER(4) DEPARTMENT NAME NOT NULL VARCHARZ (30) MANAGER_ID WUMBER(6} LOCATI ON_ID WUMBER( 4) 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 corresponding to London (location_id 2100) -Set the employees’ salary in iocation_id 2100 to 1.1 times the average salary of their department, -Set the employees’ commission in iocation_id 2100 to 1.5 times the average commission of their department. You issue the following command:SQL>UPDATE employees SET department (SELECT department_id FROM departments WHERE location_id = 2100), (salary, commission) (SELECT 1.1*AVG(salary), 1.5*AVG (commission) FROM employees, departments WHERE departments.location_id IN(2900,2700,2100) ) WHERE department_id IN (SELECT department_id FROM departments WHERE location_id = 2900 OR location_id = 2700) What is the outcome? A. Itexecutes successfully and gives the correct result. B. Itexecutes successfully but does not give the correct result, C. Itgenerates an error because a subquery cannot have a join condition in an update statement, D. Itgenerates an error because multiple columns (SALARY, COMMISSION) cannot be specified together in an update statement. Correct Answer: B Section: (none) Explanation Explanation/Reference: QUESTION 44 Examine the structure ofthe transactions table: Name null? type ‘TRANS_1D NUMBER (3) cust_NaMe VARCHAR? (30) TRANS DATE ‘TIMESTAMP TRANS_AMT NUMBER (10, 2) ‘You want to display the date, time, and transaction amount of transactions that where done before 12 noon, ‘The value zero should be displayed for transactions where the transaction amount has not been entered, Which query gives the required result?A) SELECT TO_CHAR(trans_date, 'dd-mon-yyyy hh24:mi:ss'), 70_CHAR (trans_amt, '$9999995 FROM transactions WHERE 70 NUMBER(TO DATE (trans date,'hh24')) < 12 AND COALESCE (trans_amt,NULL)<>t B) SELECT To_CHAR(trans_date, ‘dd-mon-yyyy nh24:mi:ss"), NVL(TO_CHAR(trans_amt, ‘$995 FROM transactions WHERE TO_CHAR(trans_date,'hh24") < 12; C) SELECT To_CHAR(trans_date, 'dd-mon-yyyy hh24:mi:ss'), COALESCE (TO_NUMBER (trans_an FROM transactions WHERE 70_DATE(trans_date,'hh24") < 12; D) SELECT To_DATE (trans_date, 'dd-mon-yyyy hh24:mi:ss'), NVL2(trans_amt, TO_NUMBER (t FROM transactions WHERE T0_DATE(trans_date, 'hh24') < 12; Option A Option B Option C Option D pomp Correct Answer: B Section: (none) Explanation Explanation/Referenc QUESTION 4s View the Exhibit and examine the data inthe costs table costs PROD_ID |PROMO ID |UNIT_COST | UNIT_PRICE 14 111 900 1129 is 333 875 1075 16 333 700 900 17 444 1000 1150 You need to generate a report that displays the IDs of all products in the costs table whose unit price is at least 25% more than the unit cost. The details should be displayed in the descending order of 25% of the unit cost. You issue the following query: SQL>SELECT prod_id FROM costs WHERE unit_price >= unit_cost * 1.25 ORDER BY unit_cost * 0.25 DESC; Which statement is true regarding the above query?A, Itexecutes and produces the required result. B. It produces an error because an expression cannot be used in the order by clause. . Itproduces an error because the DESC option cannot be used with an expression in the order by clause. D. Itproduces an error because the expression in the ORDER by clause should also be specified in the SELECT clause. Correct Answer: A Section: (none) Explanation Explanation/Reference: QUESTION 46 You need to produce a report where each customer's credit limit has been incremented by $1000. In the output, the customer's last name should have the heading Name and the incremented credit limit should be labeled New credit Limit, The column headings should have only the fist letter of each word in uppercase. Which statement would accomplish this requirement? A) SELECT cust_last_name Name, cust_credit_limit + 1000 “New Credit Limit" FROM customers; 8) SELECT cust_last_name AS Name, cust_credit_limit + 1000 AS New Credit Limit FROM customers; C) SELECT cust_last_name AS "Name", cust_credit_limit + 1000 AS "New Credit Limit" FROM customers: D) SELECT INTTCAP(cust_last_name) "Name", cust_credit limit + 1000 INITCAP("NEW CREDIT LIMIT") FROM customers; ‘A. Option A 8. Option B C. Option C D. Option D Correct Answer: C Section: (none) Explanation Explanation/Reference: Explanatior ‘Acolumn alias: = Renames a column heading + Is useful with calculations - Immediately follows the column name (There can also be the optional AS keyword between the column name and the alias.) = Requires double quotation marks if it contains spaces or special characters, or ifit is case sensitive. QUESTION 47Which create table statement is valid? A) CREATE TABLE ord_details (ord_no NUMBER(2) PRIMARY KEY, item_no NUMBER (3) PRIMARY KEY, ord_date DATE NOT NULL); B) CREATE TABLE ord_details (ord_no NUMBER(2) UNIQUE, NOT NULL, item_no NUMBER (3), ord_date DATE DEFAULT SYSDATE NOT NULL); (C) CREATE TABLE ord_details (ord_no NUMBER(2) , item_no NUMBER (3), ord_date DATE DEFAULT NOT NULL, CONSTRAINT ord_uq UNIQUE (ord_no), CONSTRAINT ord_pk PRIMARY KEY (ord_no)); D) CREATE TABLE ord_details (oxd_no NUMBER (2), item_no NUMBER (3), ord_date DATE DEFAULT SYSDATE NOT NULL, CONSTRAINT ord_pk PRIMARY KEY (ord_no, item_no))7 ‘A. Option A 8. Option B ©. Option © D. Option D Correct Answer: D Section: (none) Explanation Explanation/Referenc Explanation: PRIMARY KEY Constraint A PRIMARY KEY constraint creates a primary key for the table. Only one primary key can be created for each table. The PRIMARY KEY constraint is a column or a set of columns that uniquely identifies each row in a table, This constraint enforces the uniqueness of the column or column combination and ensures that no column that is part of the primary key can contain a null vaiue. Note: Because uniqueness is part of the primary key constraint definition, the Oracle server enforces the Uniqueness by implicitly creating a unique index on the primary key column or columns. QUESTION 48 You need to list the employees in DEPARTMENT_ID 30 in a single row, ordered by HIRE_DATE. Examine the sample output: Emp_list Raphaely; Khoo; Tobias; Baida; Himuro; ColmenaresWhich query will provide the required output? A) SELECT LISTAGG (1ast_name) WITHIN GROUP ORDER BY (hire date) FROM employees WHERE department_id = 30; fmp_list", MIN(hire date) “Earliest” B) SELECT LISTAGG(1ast_name, '; ') WITHIN GROUP (ORDER BY hire date) FROM employees WHERE department_id = 30; Emp_list", MIN(hire date) “Earliest” C) SELECT LISTAGG (last_name, FROM employees WHERE department_id = 3 WITHIN GROUP ORDER BY hire dates ‘) “Emp_list", MIN(hire_date) "Earliest" D) SELECT LISTAGG(last_name, '; FROM employees WHERE department_id = 30 ORDER BY hire date; EMP_LIST", MIN(hire_date) ‘A. Option A 8. Option B ©. Option © D. Option D Correct Answer: B Section: (none) Explanation Explanation/Reference: Reference: hitp:/idocs.oracle.com/cd/E11882_01/server.112/e10592/functions089.htm QUESTION 49 Which two statements are true regarding the count function? ‘A. The count function can be used only for CHAR, VARCHAR2, and NUMBER data types. B. Count (*) retums the number of rows including duplicate rows and rows containing null value in any of the columns, C. Count (cust _id) returns the number of rows including rows with duplicate customer IDs and NULL value in the CUST_ID column. D. Count (distinct inv_amt) returns the number of rows exclu in the INV_AMT column, E. Asselect statement using the COUNT function with a DISTINCT keyword cannot have a where clause. rows containing duplicates and NULL values Correct Answer: 8D Section: (none) Explanation Explanation/Reference: Explanation: Using the COUNT Function ‘The COUNT function has three formats: COUNT(*)
You might also like
All MCQ Answers - Merged
PDF
No ratings yet
All MCQ Answers - Merged
136 pages
IT Spesialist Database 7 Januari 2022
PDF
100% (1)
IT Spesialist Database 7 Januari 2022
26 pages
Worksheet With Solution SQL (Cs & Ip)
PDF
No ratings yet
Worksheet With Solution SQL (Cs & Ip)
66 pages
Advanced DBMS Sheet - 2022
PDF
100% (1)
Advanced DBMS Sheet - 2022
64 pages
Solution Worksheet SQL
PDF
100% (1)
Solution Worksheet SQL
14 pages
1z0 071
PDF
100% (4)
1z0 071
144 pages
Oracle 1z0-071 - 2 Free Exam Questions
PDF
No ratings yet
Oracle 1z0-071 - 2 Free Exam Questions
15 pages
Oracle Actualtests 1z0-071 v2020-05-27 by Finn 212q
PDF
No ratings yet
Oracle Actualtests 1z0-071 v2020-05-27 by Finn 212q
161 pages
Capgemini Rdbms SQL Exam
PDF
No ratings yet
Capgemini Rdbms SQL Exam
5 pages
Oracle.1z0-071.v2020-01-19.q80: Leave A Reply
PDF
100% (1)
Oracle.1z0-071.v2020-01-19.q80: Leave A Reply
42 pages
IP Class XII Holiday H.W (WS)
PDF
No ratings yet
IP Class XII Holiday H.W (WS)
8 pages
Soal Ujian Oracle
PDF
0% (1)
Soal Ujian Oracle
26 pages
Test Questions
PDF
No ratings yet
Test Questions
10 pages
All DBMS MCQ Answers
PDF
No ratings yet
All DBMS MCQ Answers
38 pages
MS SQL Server Developer
PDF
No ratings yet
MS SQL Server Developer
93 pages
Chapter 6 Introduction To SQL
PDF
No ratings yet
Chapter 6 Introduction To SQL
8 pages
Oracle Database: SQL Fundamentals 1Z0-051: Exam
PDF
No ratings yet
Oracle Database: SQL Fundamentals 1Z0-051: Exam
12 pages
1z0-071 UPDATE 15-09
PDF
No ratings yet
1z0-071 UPDATE 15-09
337 pages
1z0 071 PDF
PDF
No ratings yet
1z0 071 PDF
168 pages
Oracle Actualtests 1z0-071 v2018-09-21 by Lisa 95q
PDF
No ratings yet
Oracle Actualtests 1z0-071 v2018-09-21 by Lisa 95q
83 pages
Exit Exam
PDF
100% (1)
Exit Exam
23 pages
1Z0-061 - Oracle Database 12c - SQL Fundamentals PDF
PDF
No ratings yet
1Z0-061 - Oracle Database 12c - SQL Fundamentals PDF
75 pages
Oracle Prep4sure 1z0-071 v2016-07-12 by Lana 48q
PDF
No ratings yet
Oracle Prep4sure 1z0-071 v2016-07-12 by Lana 48q
40 pages
Oracle Dumps SQL Fundamentals
PDF
No ratings yet
Oracle Dumps SQL Fundamentals
12 pages
Oracle Sem.2
PDF
No ratings yet
Oracle Sem.2
106 pages
Mid Term Exam Semester 2 Part 2
PDF
No ratings yet
Mid Term Exam Semester 2 Part 2
24 pages
PDF 1Z0 071
PDF
No ratings yet
PDF 1Z0 071
183 pages
1Z0-071 Dumps Oracle Database 12c SQL: 100% Valid and Newest Version 1Z0-071 Questions & Answers Shared by Certleader
PDF
No ratings yet
1Z0-071 Dumps Oracle Database 12c SQL: 100% Valid and Newest Version 1Z0-071 Questions & Answers Shared by Certleader
18 pages
RDBMS and HTML Mock Test - 1549084911357
PDF
No ratings yet
RDBMS and HTML Mock Test - 1549084911357
20 pages
The Oracle Deployed
PDF
No ratings yet
The Oracle Deployed
38 pages
Basic về query language
PDF
No ratings yet
Basic về query language
23 pages
CC6001ES ADSD SQL Exam Model Paper 1 Answers
PDF
No ratings yet
CC6001ES ADSD SQL Exam Model Paper 1 Answers
12 pages
SQL
PDF
No ratings yet
SQL
18 pages
Mid Term Ex Semester 2 Part 2
PDF
No ratings yet
Mid Term Ex Semester 2 Part 2
19 pages
Killtest: Ki J GT 3 WCNKV ($ GVVGT 5 Gtxkeg
PDF
No ratings yet
Killtest: Ki J GT 3 WCNKV ($ GVVGT 5 Gtxkeg
13 pages
Test1 Oca
PDF
No ratings yet
Test1 Oca
6 pages
Vaishali SQL Assessment
PDF
No ratings yet
Vaishali SQL Assessment
25 pages
Now You Can Find Us at Quiz Oracle
PDF
No ratings yet
Now You Can Find Us at Quiz Oracle
35 pages
Week 2 - SQL Joins, Subqueries, Groupby
PDF
No ratings yet
Week 2 - SQL Joins, Subqueries, Groupby
14 pages
Questions For Late Bloomers:: CBSE Ques. No. Chapter / Topic Marks Distribution of Marks Question Wise
PDF
No ratings yet
Questions For Late Bloomers:: CBSE Ques. No. Chapter / Topic Marks Distribution of Marks Question Wise
12 pages
Aaaaaa
PDF
No ratings yet
Aaaaaa
15 pages
Questions For SQL Part 1
PDF
No ratings yet
Questions For SQL Part 1
17 pages
Worksheet SQL - 13.12.24
PDF
No ratings yet
Worksheet SQL - 13.12.24
14 pages
Oracle 1z0 051 Practice Questions
PDF
No ratings yet
Oracle 1z0 051 Practice Questions
12 pages
SQL Interview Guide For Three Previous Posts
PDF
No ratings yet
SQL Interview Guide For Three Previous Posts
15 pages
Assignment 2 DBMS January 2024
PDF
No ratings yet
Assignment 2 DBMS January 2024
10 pages
Oracle: Exam Questions 1Z0-071
PDF
No ratings yet
Oracle: Exam Questions 1Z0-071
7 pages
Interview Preparation Data Collection-01
PDF
No ratings yet
Interview Preparation Data Collection-01
14 pages
Lecture 4
PDF
No ratings yet
Lecture 4
4 pages
Examine The Structure of The EMP - DEPT - VU View
PDF
No ratings yet
Examine The Structure of The EMP - DEPT - VU View
8 pages
1Z0 007 C
PDF
No ratings yet
1Z0 007 C
6 pages