+ All Categories
Home > Documents > Exit End Ahmed

Exit End Ahmed

Date post: 29-Nov-2014
Category:
Upload: fatmabdllh
View: 122 times
Download: 2 times
Share this document with a friend
75
. Test: Institute Exit Exam Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Database Design Section 16-17 (Answer all questions in this section) 1. What value will the following SQL statement return? SELECT employee_id FROM employees WHERE employee_id BETWEEN 100 AND 150 OR employee_id IN(119, 175, 205) AND (employee_id BETWEEN 150 AND 200); Mark for Review (1) Points 19 No rows will be returned 100, 101, 102, 103, 104, 107, 124, 141, 142, 143, 144, 149 (*) 200, 201, 202, 203, 204, 205, 206 . Test: Institute Exit Exam Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Database Design Section 16-17 (Answer all questions in this section) 2. The EMPLOYEES table contains these columns: EMPLOYEE_ID NUMBER(9) PK LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) DEPARTMENT_ID NUMBER(9) Compare these two SQL statements: ; 1. SELECT DISTINCT department_id DEPT, last_name, first_name FROM employees ORDER BY department_id; 2. SELECT department_id DEPT, last_name, first_name
Transcript
Page 1: Exit End Ahmed

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Design Section 16-17(Answer all questions in this section)

1. What value will the following SQL statement return?

SELECT employee_idFROM employeesWHERE employee_id BETWEEN 100 AND 150 OR employee_id IN(119, 175, 205) AND (employee_id BETWEEN 150 AND 200);

Mark for Review (1) Points

19

No rows will be returned

100, 101, 102, 103, 104, 107, 124, 141, 142, 143, 144, 149 (*)

200, 201, 202, 203, 204, 205, 206

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Design Section 16-17(Answer all questions in this section)

2. The EMPLOYEES table contains these columns:

EMPLOYEE_ID NUMBER(9) PKLAST_NAME VARCHAR2(25)FIRST_NAME VARCHAR2(25)DEPARTMENT_ID NUMBER(9)Compare these two SQL statements: ;

1.SELECT DISTINCT department_id DEPT, last_name, first_nameFROM employeesORDER BY department_id;

2.SELECT department_id DEPT, last_name, first_nameFROM employeesORDER BY DEPT;How will the results differ?

Mark for Review (1) Points

One of the statements will return a syntax error.

Page 2: Exit End Ahmed

One of the statements will eliminate all duplicate DEPARTMENT_ID values.

There is no difference in the result between the two statements. (*)

The statements will sort on different column values.

Correct Correct.

Previous Page 2 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Design Section 16-17(Answer all questions in this section)

3. When using the LIKE condition, which symbol represents any sequence of none, one or more characters? Mark for Review (1) Points

_

% (*)

#

&

Correct Correct.

Previous Page 3 of 50 Next Summary.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Design Section 16-17(Answer all questions in this section)

4. Evaluate this SELECT statement:

SELECT last_name, first_name, salaryFROM employees;

How will the heading for the SALARY column appear in the display by default in Oracle Application Express?

Mark for Review (1) Points

Page 3: Exit End Ahmed

The heading will display with the first character capitalized and centered.

The heading will display with the first character capitalized and left justified.

The heading will display as uppercase and centered. (*)

The heading will display as uppercase and left justified.

Correct Correct.

Previous Page 4 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

5. Which statement about subqueries is true? Mark for Review (1) Points

Subqueries should be enclosed in double quotation marks.

Subqueries cannot contain group functions.

Subqueries are often used in a WHERE clause to return values for an unknown conditional value. (*)

Subqueries generally execute last, after the main or outer query executes.

Correct Correct

Previous Page 5 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

6. You query the database with this SQL statement:

SELECT LOWER(SUBSTR(CONCAT(last_name, first_name)), 1, 5) "ID"

Page 4: Exit End Ahmed

FROM employee;

In which order are the functions evaluated?Mark for Review

(1) Points

LOWER, SUBSTR, CONCAT

LOWER, CONCAT, SUBSTR

SUBSTR, CONCAT, LOWER

CONCAT, SUBSTR, LOWER (*)

Correct Correct

Previous Page 6 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

7. You need to delete a record in the EMPLOYEES table for Tim Jones, whose unique employee identification number is 348. The EMPLOYEES table contains these columns:

EMPLOYEE_ID NUMBER(5) PRIMARY KEYLAST_NAME VARCHAR2(20)FIRST_NAME VARCHAR2(20)ADDRESS VARCHAR2(30)PHONE NUMBER(10)

Which DELETE statement will delete the appropriate record without deleting any additional records?

Mark for Review (1) Points

DELETE FROM employeesWHERE employee_id = 348;

(*)

DELETE FROM employeesWHERE last_name = jones;

DELETE *FROM employees

Page 5: Exit End Ahmed

WHERE employee_id = 348;

DELETE 'jones'FROM employees;

Correct Correct

Previous Page 7 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

8. Examine the structures of the PRODUCTS and SUPPLIERS tables:

SUPPLIERSSUPPLIER_ID NUMBER NOT NULL, Primary KeySUPPLIER_NAME VARCHAR2 (25)ADDRESS VARCHAR2 (30)CITY VARCHAR2 (25)REGION VARCHAR2 (10)POSTAL_CODE VARCHAR2 (11)

PRODUCTSPRODUCT_ID NUMBER NOT NULL, Primary KeyPRODUCT_NAME VARCHAR2 (25)SUPPLIER_ID NUMBER Foreign key to SUPPLIER_ID of the SUPPLIERS tableCATEGORY_ID NUMBERQTY_PER_UNIT NUMBERUNIT_PRICE NUMBER (7,2)QTY_IN_STOCK NUMBERQTY_ON_ORDER NUMBERREORDER_LEVEL NUMBER

You want to delete any products supplied by the five suppliers located in Atlanta. Which script should you use?

Mark for Review (1) Points

DELETE FROM productsWHERE supplier_id IN(SELECT supplier_id FROM suppliers WHERE UPPER(city) = 'ATLANTA');

(*)

DELETE FROM productsWHERE UPPER(city) = 'ATLANTA';

Page 6: Exit End Ahmed

DELETE FROM productsWHERE supplier_id =(SELECT supplier_id FROM suppliers WHERE UPPER(city) = 'ATLANTA');

DELETE FROM suppliersWHERE supplier_id IN(SELECT supplier_id FROM suppliers WHERE UPPER(city) = 'ALANTA');

Correct Correct

Previous Page 8 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

9. The PRODUCTS table contains these columns:

PROD_ID NUMBER(4)PROD_NAME VARCHAR2(25)PROD_PRICE NUMBER(3)

You want to add the following row data to the PRODUCTS table:

(1) a NULL value in the PROD_ID column(2) "6-foot nylon leash" in the PROD_NAME column(3) "10" in the PROD_PRICE column

You issue this statement:

INSERT INTO productsVALUES (null,'6-foot nylon leash', 10);

What row data did you add to the table?Mark for Review

(1) Points

The row was created with the correct data in all three columns. (*)

The row was created with the correct data in two of three columns.

The row was created with the correct data in one of the three columns.

The row was created completely wrong. No data ended up in the correct columns.

Page 7: Exit End Ahmed

Correct Correct

Previous Page 9 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

9. The PRODUCTS table contains these columns:

PROD_ID NUMBER(4)PROD_NAME VARCHAR2(25)PROD_PRICE NUMBER(3)

You want to add the following row data to the PRODUCTS table:

(1) a NULL value in the PROD_ID column(2) "6-foot nylon leash" in the PROD_NAME column(3) "10" in the PROD_PRICE column

You issue this statement:

INSERT INTO productsVALUES (null,'6-foot nylon leash', 10);

What row data did you add to the table?Mark for Review

(1) Points

The row was created with the correct data in all three columns. (*)

The row was created with the correct data in two of three columns.

The row was created with the correct data in one of the three columns.

The row was created completely wrong. No data ended up in the correct columns.

Correct Correct

Previous Page 9 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

Page 8: Exit End Ahmed

10. Examine the structure of the EMPLOYEE, DEPARTMENT, and ORDERS tables.

EMPLOYEE:EMPLOYEE_ID NUMBER(9)LAST_NAME VARCHAR2(25)FIRST_NAME VARCHAR2(25)DEPARTMENT_ID NUMBER(9)

DEPARTMENT:DEPARTMENT_ID NUMBER(9)DEPARTMENT_NAME VARCHAR2(25)CREATION_DATE DATE

ORDERS:ORDER_ID NUMBER(9)EMPLOYEE_ID NUMBER(9)DATE DATECUSTOMER_ID NUMBER(9)

You want to display all employees who had an order after the Sales department was established. Which of the following constructs would you use?

Mark for Review (1) Points

A group function

A single-row subquery (*)

The HAVING clause

A MERGE statement

Correct Correct

Previous Page 10 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

11. You created the CUSTOMERS and ORDERS tables by issuing these CREATE TABLE statements in sequence:

CREATE TABLE customers(custid varchar2(5),companyname varchar2(30),contactname varchar2(30),address varchar2(30),city varchar2(20),state varchar2(30),

Page 9: Exit End Ahmed

phone varchar2(20),constraint pk_customers_01 primary key (custid));

CREATE TABLE orders(orderid varchar2(5) constraint pk_orders_01 primary key,orderdate date,total number(15),custid varchar2(5) references customers (custid));

You have been instructed to compile a report to present the information about orders placed by customers who reside in Nashville. Which query should you issue to achieve the desired results?

Mark for Review (1) Points

SELECT custid, companynameFROM customersWHERE city = 'Nashville';

SELECT orderid, orderdate, totalFROM orders oNATURAL JOIN customers c ON o.custid = c.custidWHERE city = 'Nashville';

SELECT orderid, orderdate, totalFROM orders oJOIN customers c ON o.custid = c.custidWHERE city = 'Nashville';

(*)

SELECT orderid, orderdate, totalFROM ordersWHERE city = 'Nashville';

Correct Correct

Previous Page 11 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

12. Which keyword in a SELECT statement creates an equijoin by specifying a column name common to both tables? Mark for Review (1) Points

Page 10: Exit End Ahmed

A HAVING clause

The FROM clause

The SELECT clause

A USING clause (*)

Correct Correct

Previous Page 12 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

13. Which group function would you use to display the lowest value in the SALES_AMOUNT column? Mark for Review (1) Points

AVG

COUNT

MAX

MIN (*)

Correct Correct

Previous Page 13 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

14. The PLAYERS and TEAMS tables contain these columns:

PLAYERSPLAYER_ID NUMBER NOT NULL, PRIMARY KEYLAST_NAME VARCHAR2 (30) NOT NULLFIRST_NAME VARCHAR2 (25) NOT NULL

Page 11: Exit End Ahmed

TEAM_ID NUMBERPOSITION VARCHAR2 (25)

TEAMSTEAM_ID NUMBER NOT NULL, PRIMARY KEYTEAM_NAME VARCHAR2 (25)

You need to create a report that lists the names of each team with more than three goal keepers.Which SELECT statement will produce the desired result?

Mark for Review (1) Points

SELECT t.team_name, COUNT(p.player_id)FROM players p, teams tON (p.team_id = t.team_id)WHERE UPPER(p.position) = 'GOAL KEEPER'GROUP BY t.team_name;

SELECT t.team_name, COUNT(p.player_id)FROM playersJOIN teams t ON (p.team_id = t.team_id)WHERE UPPER(p.position) = 'GOAL KEEPER'HAVING COUNT(p.player_id) > 3;

SELECT t.team_name, COUNT(p.player_id)FROM players p, teams tON (p.team_id = t.team_id)WHERE UPPER(p.position) = 'GOAL KEEPER'GROUP BY t.team_nameHAVING COUNT(p.player_id) > 3;

SELECT t.team_name, COUNT(p.player_id)FROM players pJOIN teams t ON (p.team_id = t.team_id)WHERE UPPER(p.position) = 'GOAL KEEPER'GROUP BY t.team_nameHAVING COUNT(p.player_id) > 3;

(*)

Correct Correct

Previous Page 14 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

Page 12: Exit End Ahmed

15. The PRODUCT table contains this column: PRICE NUMBER(7,2)Evaluate this statement:

SELECT NVL(10 / price, '0')FROM PRODUCT;

What would happen if the PRICE column contains null values?Mark for Review

(1) Points

The statement would fail because values cannot be divided by 0.

A value of 0 would be displayed. (*)

A value of 10 would be displayed.

The statement would fail because values cannot be divided by null.

Correct Correct

Previous Page 15 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

16. Which two sets of join keywords create a join that will include unmatched rows from the first table specified in the SELECT statement?

Mark for Review (1) Points

LEFT OUTER JOIN and FULL OUTER JOIN (*)

RIGHT OUTER JOIN and LEFT OUTER JOIN

USING and HAVING

OUTER JOIN and USING

Correct Correct

Previous Page 16 of 50 Next Summary

Page 13: Exit End Ahmed

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

17. What should be included in a SELECT statement to return NULL values from all tables? Mark for Review (1) Points

Natural joins

Left outer joins

Full outer joins (*)

Right outer joins

Correct Correct

Previous Page 17 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

18. You need to create a SELECT statement that contains a multiple-row subquery, which comparison operator(s) can you use? Mark for Review (1) Points

IN, ANY, and ALL (*)

LIKE

BETWEEN?AND?

=, <, and >

Correct Correct

Previous Page 18 of 50 Next Summary

Page 14: Exit End Ahmed

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

19. Examine the data from the LINE_ITEM table:

LINE_ITEM_ID ORDER_ID PRODUCT_ID PRICE DISCOUNT890898 847589 848399 8.99 0.10768385 862459 849869 5.60 0.05867950 985490 945809 5.60954039 439203 438925 5.25 0.15543949 349302 453235 4.50

You query the LINE_ITEM table and a value of 5 is returned. Which SQL statement did you execute?

Mark for Review (1) Points

SELECT COUNT(discount)FROM line_item;

(*)

SELECT COUNT(*)FROM line_item;

SELECT SUM(discount)FROM line_item;

SELECT AVG(discount)FROM line_item;

Correct Correct. .Section 4 Lesson 3.

Previous Page 19 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

20. The Rule of 3rd Normal Form states that No Non-UID attribute can be dependant on another non-UID attribute. True or False? Mark for Review (1) Points

Page 15: Exit End Ahmed

True (*)

False

Correct Correct. .Section 6 Lesson 4.

Previous Page 20 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

21. Which script displays '01-MAY-04' when the HIRE_DATE value is '20-MAY-04'? Mark for Review (1) Points

SELECT TRUNC(hire_date, 'MONTH')FROM employee;

(*)

SELECT ROUND(hire_date, 'MONTH')FROM employee;

SELECT ROUND(hire_date, 'MON')FROM employee;

SELECT TRUNC(hire_date, 'MI')FROM employee;

Correct Correct

Previous Page 21 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

22. Which command could you use to quickly remove all data from the rows in a table without deleting the table itself? Mark for Review

Page 16: Exit End Ahmed

(1) Points

ALTER TABLE

DROP TABLE

MODIFY

TRUNCATE TABLE (*)

Correct Correct

Previous Page 22 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

23. Comments on tables and columns can be stored for documentation by: Mark for Review (1) Points

Embedding /* comment */ within the definition of the table.

Using the ALTER TABLE CREATE COMMENT syntax

Using the COMMENT ON TABLE or COMMENT on COLUMN (*)

Using an UPDATE statement on the USER_COMMENTS table

Correct Correct

Previous Page 23 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

24. Evaluate this statement:ALTER TABLE employees SET UNUSED (fax);

Page 17: Exit End Ahmed

Which task will this statement accomplish?Mark for Review

(1) Points

Deletes the FAX column

Frees the disk space used by the data in the FAX column

Prevents data in the FAX column from being displayed, by performing a logical drop of the column. (*)

Prevents a new FAX column from being added to the EMPLOYEES table

Correct Correct

Previous Page 24 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

25. Evaluate this statement:TRUNCATE TABLE employees;

Which statement about this TRUNCATE TABLE statement is true?Mark for Review

(1) Points

You can produce the same results by issuing the 'DROP TABLE employee' statement.

You can issue this statement to retain the structure of the employees table. (*)

You can reverse this statement by issuing the ROLLBACK statement.

You can produce the same results by issuing the 'DELETE employees' statement.

Correct Correct

Previous Page 25 of 50 Next Summary

.

Page 18: Exit End Ahmed

Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

26. You use GROUPING function to ______ database rows from tabulated rows. Mark for Review (1) Points

CREATE

DISTINGUISH (*)

COMPUTE

COUNT

Correct Correct

Previous Page 26 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

27. Evaluate this CREATE TABLE statement:

CREATE TABLE sales(sales_id NUMBER,customer_id NUMBER,employee_id NUMBER,sale_date TIMESTAMP WITH LOCAL TIME ZONE,sale_amount NUMBER(7,2));

Which statement about the SALE_DATE column is true?Mark for Review

(1) Points

Data will be normalized to the client time zone.

Data stored will not include seconds.

Data will be stored using a fractional seconds precision of 5.

Data stored in the column will be returned in the database's local time zone. (*)

Page 19: Exit End Ahmed

Correct Correct

Previous Page 27 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

28. To store time with fractions of seconds, which datatype should be used for a table column? Mark for Review (1) Points

DATE

INTERVAL YEAR TO MONTH

TIMESTAMP (*)

INTERVAL DAY TO SECOND

Correct Correct

Previous Page 28 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

29. The ___________ operator returns all rows from both tables, after eliminating duplicates. Mark for Review (1) Points

UNION (*)

UNION ALL

INTERSECT

MINUS

Page 20: Exit End Ahmed

Correct Correct. .Section 5 Lesson 3.

Previous Page 29 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

30. Which SELECT statement will return a numeric value? Mark for Review (1) Points

SELECT SYSDATE + 600 / 24FROM employee;

SELECT ROUND(hire_date, DAY)FROM employee;

SELECT (SYSDATE - hire_date) / 7FROM employee;

(*)

SELECT SYSDATE - 7FROM employee;

Correct Correct

Previous Page 30 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

31. Which SELECT statement implements a self join? Mark for Review (1) Points

SELECT p.part_id, t.product_idFROM part p, part tWHERE p.part_id = t.product_id;

Page 21: Exit End Ahmed

(*)

SELECT p.part_id, t.product_idFROM part p, product tWHERE p.part_id = t.product_id;

SELECT p.part_id, t.product_idFROM part p, product tWHERE p.part_id = t.product_id (+);

SELECT p.part_id, t.product_idFROM part p, product tWHERE p.part_id =! t.product_id;

Correct Correct. .Section 3 Lesson 4.

Previous Page 31 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

32. A DEFAULT value can be specified for a column when the table is __________. Mark for Review (1) Points

Created

Altered

All of the above (*)

None of the above

Correct Correct. .Section 7 Lesson 3.

Previous Page 32 of 50 Next Summary

.Test: Institute Exit Exam

Page 22: Exit End Ahmed

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

33. Evaluate this CREATE TABLE statement:

CREATE TABLE line_item ( line_item_id NUMBER(9), order_id NUMBER(9), product_id NUMBER(9));

You are a member of the SYSDBA role, but are not logged in as SYSDBA. You issue this CREATE TABLE statement. Which statement is true?

Mark for Review (1) Points

You created the LINE_ITEM table in the public schema.

You created the LINE_ITEM table in the SYS schema.

You created the table in your schema. (*)

You created the table in the SYSDBA schema.

Correct Correct

Previous Page 33 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

34. Which arithmetic operation will return a numeric value? Mark for Review

(1) Points

TO_DATE('01-JUN-2004') - TO_DATE('01-OCT-2004') (*)

NEXT_DAY(hire_date) + 5

SYSDATE - 6

SYSDATE + 30 / 24

Correct Correct

Page 23: Exit End Ahmed

Previous Page 34 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

35. The FACULTY table contains these columns:FACULTYID VARCHAR2(5) NOT NULL PRIMARY KEYFIRST_NAME VARCHAR2(20)LAST_NAME VARCHAR2(20)ADDRESS VARCHAR2(35)CITY VARCHAR2(15)STATE VARCHAR2(2)ZIP NUMBER(9)TELEPHONE NUMBER(10)STATUS VARCHAR2(2) NOT NULL

The COURSE table contains these columns:

COURSEID VARCHAR2(5) NOT NULL PRIMARY KEYSUBJECT VARCHAR2(5)TERM VARCHAR2(6)FACULTYID VARCHAR2(5) NOT NULL FOREIGN KEY

You have been asked to compile a report that identifies all adjunct professors who will be teaching classes in the upcoming term. You want to create a view that will simplify the creation of this report. Which CREATE VIEW statements will accomplish this task?

Mark for Review (1) Points

CREATE VIEW (SELECT first_name, last_name, status, courseid, subject, term FROM faculty, course WHERE facultyid = facultyid);

CREATE VIEW pt_viewON (SELECT first_name, last_name, status, courseid, subject, termFROM faculty f and course cWHERE f.facultyid = c.facultyid);

CREATE VIEW pt_view IN (SELECT first_name, last_name, status, courseid, subject, termFROM faculty course);

CREATE VIEW pt_view AS (SELECT first_name, last_name, status, courseid, subject, term FROM faculty f, course c WHERE f.facultyid = c.facultyid);

Page 24: Exit End Ahmed

(*)

Correct Correct

Previous Page 35 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

36. Which of the following keywords cannot be used when creating a view? Mark for Review (1) Points

HAVING

WHERE

ORDER BY

They are all valid keywords when creating views. (*)

Correct Correct

Previous Page 36 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

37. You have been asked to create a report that lists all corporate customers and all orders that they have placed. The customers should be listed alphabetically beginning with the letter 'A', and their corresponding order totals should be sorted from the highest amount to the lowest amount.Which of the following statements should you issue? Mark for Review (1) Points

SELECT c.custid, c.companyname, o.orderdate, o. custid, o.amountFROM customers c, orders oWHERE c.custid = o.custidORDER BY amount DESC, companyname;

Page 25: Exit End Ahmed

SELECT c.custid, c.companyname, o.orderdate, o. custid, o.amountFROM customers c, orders oWHERE c.custid = o.custidORDER BY companyname, amount DESC;

(*)

SELECT c.custid, c.companyname, o.orderdate, o. custid, o.amountFROM customers c, orders oWHERE c.custid = o.custidORDER BY companyname, amount;

SELECT c.custid, c.companyname, o.orderdate, o. custid, o.amountFROM customers c, orders oWHERE c.custid = o.custidORDER BY companyname ASC, amount ASC;

Correct Correct

Previous Page 37 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

38. Which option would you use when creating a view to ensure that no DML operations occur on the view? Mark for Review (1) Points

FORCE

NOFORCE

WITH READ ONLY (*)

WITH ADMIN OPTION

Correct Correct

Previous Page 38 of 50 Next Summary

.Test: Institute Exit Exam

Page 26: Exit End Ahmed

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

39. A table can only have one unique key constraint defined. True or False? Mark for Review (1) Points

True

False (*)

Correct Correct

Previous Page 39 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

40. You need to ensure that each value in the SEAT_ID column is unique or null. Which constraint should you define on the SEAT_ID column?

Mark for Review (1) Points

CHECK

UNIQUE (*)

NOT NULL

PRIMARY KEY

Correct Correct

Previous Page 40 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

Page 27: Exit End Ahmed

41. User BOB's schema contains an EMPLOYEES table. BOB executes the following statement:

GRANT SELECT ON employees TO mary WITH GRANT OPTION;

Which of the following statements can MARY now execute successfully? (Choose two)

Mark for Review (1) Points

(Choose all correct answers)

SELECT FROM bob.employees; (*)

REVOKE SELECT ON bob.employees FROM bob;

GRANT SELECT ON bob.employees TO PUBLIC; (*)

DROP TABLE bob.employees;

Correct Correct

Previous Page 41 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

42. Which of these SQL functions used to manipulate strings is not a valid regular expression function ? Mark for Review (1) Points

REGEXP_REPLACE

REGEXP_LIKE

REGEXP (*)

REGEXP_SUBSTR

Correct Correct. .Section 13 Lesson 3.

Previous Page 42 of 50 Next Summary

Page 28: Exit End Ahmed

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

43. When creating a referential constraint, which keyword(s) identifies the table and column in the parent table? Mark for Review (1) Points

FOREIGN KEY

REFERENCES (*)

ON DELETE CASCADE

ON DELETE SET NULL

Correct Correct

Previous Page 43 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

44. Which constraint type enforces uniqueness? Mark for Review (1) Points

CHECK

FOREIGN KEY

PRIMARY KEY (*)

NOT NULL

Correct Correct

Previous Page 44 of 50 Next Summary

.

Page 29: Exit End Ahmed

Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

45. You need to create a composite primary key constraint on the EMPLOYEES table. Which statement is true? Mark for Review (1) Points

The PRIMARY KEY constraint must be defined at the table level. (*)

A PRIMARY KEY constraint must be defined for each column in the composite primary key.

The PRIMARY KEY constraint must be defined for the first column of the composite primary key.

The PRIMARY KEY constraint must be defined at the table level and for each column in the composite primary key.

Correct Correct

Previous Page 45 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

46. Which statement about a FOREIGN KEY constraint is true? Mark for Review

(1) Points

An index is automatically created for a FOREIGN KEY constraint.

A FOREIGN KEY constraint requires the constrained column to contain values that exist in the referenced Primary or Unique key column of the parent table. (*)

A FOREIGN KEY constraint allows that a list of allowed values be checked before a value can be added to the constrained column.

A FOREIGN KEY column can have a different data type from the primary key column that it references.

Page 30: Exit End Ahmed

Correct Correct

Previous Page 46 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

47. The PO_DETAILS table contains these columns:

PO_NUM NUMBER NOT NULL, Primary KeyPO_LINE_ID NUMBER NOT NULL, Primary KeyPRODUCT_ID NUMBER Foreign Key to PRODUCT_ID column of the PRODUCTS tableQUANTITY NUMBERUNIT_PRICE NUMBER(5,2)

Evaluate this statement:

ALTER TABLE po_detailsDISABLE CONSTRAINT product_id_pk CASCADE; For which task would you issue this statement?

Mark for Review (1) Points

To create a new PRIMARY KEY constraint on the PO_NUM column

To drop and recreate the PRIMARY KEY constraint on the PO_NUM column

To disable the PRIMARY KEY and any FOREIGN KEY constraints that are dependent on the PO_NUM column (*)

To disable the constraint on the PO_NUM column while creating a PRIMARY KEY index

Correct Correct

Previous Page 47 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

48. You can view the columns used in a constraint defined for a specific table by looking at which data dictionary table? Mark for Review (1) Points

Page 31: Exit End Ahmed

USER_CONS_COLUMNS (*)

CONSTRAINTS_ALL_COLUMNS

SYS_DATA_DICT_COLUMNS

US_CON_SYS

Correct Correct

Previous Page 48 of 50 Next Summary

.Test: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

49. Evaluate this CREATE VIEW statement:

CREATE VIEW sales_viewAS SELECT customer_id, region, SUM(sales_amount)FROM salesWHERE region IN (10, 20, 30, 40)GROUP BY region, customer_id;

Which statement is true?Mark for Review

(1) Points

You can modify data in the SALES table using the SALES_VIEW view.

You cannot modify data in the SALES table using the SALES_VIEW view. (*)

You can only insert records into the SALES table using the SALES_VIEW view.

The CREATE VIEW statement generates an error.

Correct Correct

Previous Page 49 of 50 Next Summary

ÝÍÉTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Page 32: Exit End Ahmed

Database Programming Sections 10-15(Answer all questions in this section)

50. Unique indexes are automatically created on columns that have which two types of constraints? Mark for Review (1) Points

NOT NULL and UNIQUE

UNIQUE and PRIMARY KEY (*)

UNIQUE and FOREIGN KEY

PRIMARY KEY and FOREIGN KEY

Correct Correct

Previous Page 50 of 50 Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Design Section 16-17(Answer all questions in this section)

1. The PLAYERS table contains these columns:

PLAYERS TABLE:LAST_NAME VARCHAR2 (20)FIRST_NAME VARCHAR2 (20)SALARY NUMBER(8,2)TEAM_ID NUMBER(4)MANAGER_ID NUMBER(9)POSITION_ID NUMBER(4)

You want to display all players' names with position 6900 or greater. You want the players names to be displayed alphabetically by last name and then by first name. Which statement should you use to achieve the required results?

Mark for Review (1) Points

SELECT last_name, first_nameFROM playersWHERE position_id >=6900ORDER BY last_name, first_name;

(*)

SELECT last_name, first_nameFROM players

Page 33: Exit End Ahmed

WHERE position_id > 6900ORDER BY last_name, first_name;

SELECT last_name, first_nameFROM playersWHERE position_id <= 6900ORDER BY last_name, first_name;

FROM playersWHERE position_id >= 6900ORDER BY last_name DESC, first_name;

Correct Correct! See Section 17 Lesson 3.

Page 1 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Design Section 16-17(Answer all questions in this section)

2. When using the LIKE condition, which symbol represents any sequence of none, one or more characters? Mark for Review (1) Points

_

% (*)

#

&

Correct Correct.

Previous Page 2 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Design Section 16-17(Answer all questions in this section)

Page 34: Exit End Ahmed

3. Evaluate this SELECT statement:

SELECT last_name, first_name, salaryFROM employees;

How will the heading for the SALARY column appear in the display by default in Oracle Application Express?

Mark for Review (1) Points

The heading will display with the first character capitalized and centered.

The heading will display with the first character capitalized and left justified.

The heading will display as uppercase and centered. (*)

The heading will display as uppercase and left justified.

Correct Correct.

Previous Page 3 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Design Section 16-17(Answer all questions in this section)

4. Evaluate this SELECT statement:

SELECT *FROM employeesWHERE salary > 30000AND department_id = 10OR email IS NOT NULL;

Which statement is true?Mark for Review

(1) Points

The OR condition will be evaluated before the AND condition.

The AND condition will be evaluated before the OR condition. (*)

The OR and AND conditions have the same precedence and will be evaluated from left to right

Page 35: Exit End Ahmed

The OR and AND conditions have the same precedence and will be evaluated from right to left

Correct Correct.

Previous Page 4 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

5. Which best describes the TO_CHAR function? Mark for Review (1) Points

The TO_CHAR function can be used to specify meaningful column names in an SQL statement's result set.

The TO_CHAR function can be used to remove text from column data that will be returned by the database.

The TO_CHAR function can be used to display dates and numbers according to formatting conventions that are supported by Oracle. (*)

The TO_CHAR function can only be used on Date columns.

Correct Correct

Previous Page 5 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

6. Which statement about the COUNT function is true? Mark for Review (1) Points

The COUNT function ignores duplicates by default.

The COUNT function always ignores null values by default. (*)

Page 36: Exit End Ahmed

The COUNT function can be used to find the maximum value in each column.

The COUNT function can be used to determine the number of unique, non-null values in a column.

Correct Correct

Previous Page 6 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

7. You use GROUPING function to ______ database rows from tabulated rows. Mark for Review (1) Points

CREATE

DISTINGUISH (*)

COMPUTE

COUNT

Correct Correct

Previous Page 7 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

8. Evaluate this SELECT statement:

SELECT LENGTH(email)FROM employee;

What will this SELECT statement display?Mark for Review

(1) Points

The longest e-mail address in the EMPLOYEE table

Page 37: Exit End Ahmed

The email address of each employee in the EMPLOYEE table

The number of characters for each value in the EMAIL column in the employees table (*)

The maximum number of characters allowed in the EMAIL column

Correct Correct

Previous Page 8 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

9. Comments on tables and columns can be stored for documentation by: Mark for Review (1) Points

Embedding /* comment */ within the definition of the table.

Using the ALTER TABLE CREATE COMMENT syntax

Using the COMMENT ON TABLE or COMMENT on COLUMN (*)

Using an UPDATE statement on the USER_COMMENTS table

Correct Correct

Previous Page 9 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

10. Which command could you use to quickly remove all data from the rows in a table without deleting the table itself? Mark for Review (1) Points

ALTER TABLE

Page 38: Exit End Ahmed

DROP TABLE

MODIFY

TRUNCATE TABLE (*)

Correct Correct

Previous Page 10 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

11. You need to remove all the data in the SCHEDULE table, the structure of the table, and the indexes associated with the table. Which statement should you use? Mark for Review (1) Points

DROP TABLE (*)

TRUNCATE TABLE

ALTER TABLE

DELETE TABLE

Correct Correct. .Section 8 Lesson 3.

Previous Page 11 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

12. Evaluate the structure of the EMPLOYEE table:

EMPLOYEE_ID NUMBER(9)LAST_NAME VARCHAR2(25)FIRST_NAME VARCHAR2(25)DEPARTMENT_ID NUMBER(9)

Page 39: Exit End Ahmed

MANAGER_ID NUMBER(9)SALARY NUMBER(7,2)

The EMPLOYEE_ID column currently contains 500 employee identification numbers. Business requirements have changed and you need to allow users to include text characters in the identification values. Which statement should you use to change this column's data type?

Mark for Review (1) Points

ALTER TABLE employeeMODIFY (employee_id VARCHAR2(9));

ALTER TABLE employeeREPLACE (employee_id VARCHAR2(9));

ALTER employee TABLEMODIFY COLUMN (employee_id VARCHAR2(15));

You CANNOT modify the data type of the EMPLOYEE_ID column, as the table is not empty. (*)

Correct Correct

Previous Page 12 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

13. As a database designer you do not need to worry about where in the datamodel you store a particular attribute, as long as you get it onto the ERD your job is done. True or False? Mark for Review (1) Points

True

False (*)

Correct Correct

Previous Page 13 of 50 Next Summary

Page 40: Exit End Ahmed

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

14. The STYLES table contains this data:

STYLE_ID STYLE_NAME CATEGORY COST895840 SANDAL 85940 12.00968950 SANDAL 85909 10.00869506 SANDAL 89690 15.00809090 LOAFER 89098 10.00890890 LOAFER 89789 14.00857689 HEEL 85940 11.00758960 SANDAL 86979

Evaluate this SELECT statement:

SELECT style_id, style_name, category, costFROM stylesWHERE style_name LIKE 'SANDAL' AND NVL(cost, 0) < 15.00ORDER BY category, cost;

Which result will the query provide?Mark for Review

(1) Points

STYLE_ID STYLE_NAME CATEGORY COST895840 SANDAL 85940 12.00968950 SANDAL 85909 10.00758960 SANDAL 86979

STYLE_ID STYLE_NAME CATEGORY COST895840 SANDAL 85909 12.00968950 SANDAL 85909 10.00869506 SANDAL 89690 15.00758960 SANDAL 86979

STYLE_ID STYLE_NAME CATEGORY COST895840 SANDAL 85909 12.00968950 SANDAL 85909 10.00758960 SANDAL 86979 869506 SANDAL 89690 15.00

STYLE_ID STYLE_NAME CATEGORY COST968950 SANDAL 85909 10.00895840 SANDAL 85940 12.00758960 SANDAL 86979

Page 41: Exit End Ahmed

(*)

Correct Correct

Previous Page 14 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

15. Using the INSERT statement, and assuming that a column can accept null values, how can you implicitly insert a null value in a column?

Mark for Review (1) Points

Use the NULL keyword.

Use the ON clause

Omit the column in the column list. (*)

It is not possible to implicitly insert a null value in a column.

Correct Correct

Previous Page 15 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

16. You need to create a report to display the names of products with a cost value greater than the average cost of all products. Which SELECT statement should you use? Mark for Review (1) Points

SELECT product_nameFROM productsWHERE cost > (SELECT AVG(cost)FROM product);

(*)

Page 42: Exit End Ahmed

SELECT product_nameFROM productsWHERE cost > AVG(cost);

SELECT AVG(cost), product_nameFROM productsWHERE cost > AVG(cost)GROUP by product_name;

SELECT product_nameFROM (SELECT AVG(cost) FROM product)WHERE cost > AVG(cost);

Correct Correct

Previous Page 16 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

17. Which of the following statements is the simplest description of a nonequijoin? Mark for Review (1) Points

A join condition containing something other than an equality operator (*)

A join condition that is not equal to other joins.

A join condition that includes the (+) on the left hand side.

A join that joins a table to itself

Correct Correct

Previous Page 17 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8

Page 43: Exit End Ahmed

(Answer all questions in this section)

18. Below find the structures of the PRODUCTS and VENDORS tables:

PRODUCTSPRODUCT_ID NUMBERPRODUCT_NAME VARCHAR2 (25)VENDOR_ID NUMBERCATEGORY_ID NUMBER

VENDORSVENDOR_ID NUMBERVENDOR_NAME VARCHAR2 (25)ADDRESS VARCHAR2 (30)CITY VARCHAR2 (25)REGION VARCHAR2 (10)POSTAL_CODE VARCHAR2 (11)

You want to create a query that will return an alphabetical list of products, including the product name and associated vendor name, for all products that have a vendor assigned. Which two queries could you use?

Mark for Review (1) Points

(Choose all correct answers)

SELECT p.product_name, v.vendor_nameFROM products pLEFT OUTER JOIN vendors vON p.vendor_id = v.vendor_idORDER BY p.product_name;

SELECT p.product_name, v.vendor_nameFROM products pJOIN vendors vON (vendor_id)ORDER BY p.product_name;

SELECT p.product_name, v.vendor_nameFROM products pNATURAL JOIN vendors vORDER BY p.product_name;

(*)

SELECT p.product_name, v.vendor_nameFROM products pJOIN vendors vUSING (p.vendor_id)ORDER BY p.product_name;

SELECT p.product_name, v.vendor_nameFROM products p

Page 44: Exit End Ahmed

JOIN vendors vUSING (vendor_id)ORDER BY p.product_name;

(*)

Correct Correct

Previous Page 18 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

19. Which operator or keyword cannot be used with a multiple-row subquery? Mark for Review (1) Points

ALL

ANY

= (*)

>

Correct Correct

Previous Page 19 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

20. Which of the following SQL statements will create a table called Birthdays with three columns for storing employee number, name and date of birth? Mark for Review (1) Points

CREATE table BIRTHDAYS (EMPNO, EMPNAME, BIRTHDATE);

CREATE table BIRTHDAYS (employee number, name, date of birth);

Page 45: Exit End Ahmed

CREATE TABLE Birthdays (Empno NUMBER, Empname CHAR(20), Birthdate DATE); (*)

CREATE TABLE Birthdays (Empno NUMBER, Empname CHAR(20), Date of Birth DATE);

Correct Correct

Previous Page 20 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

21. The TEACHERS and CLASS_ASSIGNMENTS tables contain these columns:

TEACHERSTEACHER_ID NUMBER(5)NAME VARCHAR2(25)SUBJECT_ID NUMBER(5)HIRE_DATE DATESALARY NUMBER(9,2)

CLASS_ASSIGNMENTSCLASS_ID NUMBER(5)TEACHER_ID NUMBER(5)START_DATE DATEMAX_CAPACITY NUMBER(3)

Which scenario would require a subquery to return the desired results?Mark for Review

(1) Points

You need to display the start date for each class taught by a given teacher.

You need to create a report to display the teachers who were hired more than five years ago.

You need to display the names of the teachers who teach classes that start within the next week.

You need to create a report to display the teachers who teach more classes than the average number of classes taught by each teacher. (*)

Correct Correct

Page 46: Exit End Ahmed

Previous Page 21 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

22. You need to delete a record in the EMPLOYEES table for Tim Jones, whose unique employee identification number is 348. The EMPLOYEES table contains these columns:

EMPLOYEE_ID NUMBER(5) PRIMARY KEYLAST_NAME VARCHAR2(20)FIRST_NAME VARCHAR2(20)ADDRESS VARCHAR2(30)PHONE NUMBER(10)

Which DELETE statement will delete the appropriate record without deleting any additional records?

Mark for Review (1) Points

DELETE FROM employeesWHERE employee_id = 348;

(*)

DELETE FROM employeesWHERE last_name = jones;

DELETE *FROM employeesWHERE employee_id = 348;

DELETE 'jones'FROM employees;

Correct Correct

Previous Page 22 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

Page 47: Exit End Ahmed

23. When using SET operators the number of columns and the data types of the columns must be identical in all of the SELECT statements used in the query. True or False. Mark for Review (1) Points

True (*)

False

Correct Correct. .Section 5 Lesson 3.

Previous Page 23 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

24. Which SELECT statement implements a self join? Mark for Review (1) Points

SELECT p.part_id, t.product_idFROM part p, part tWHERE p.part_id = t.product_id;

(*)

SELECT p.part_id, t.product_idFROM part p, product tWHERE p.part_id = t.product_id;

SELECT p.part_id, t.product_idFROM part p, product tWHERE p.part_id = t.product_id (+);

SELECT p.part_id, t.product_idFROM part p, product tWHERE p.part_id =! t.product_id;

Correct Correct

Previous Page 24 of 50 Next Summary

Page 48: Exit End Ahmed

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

25. Which data types stores variable-length character data? Select two. Mark for Review (1) Points

(Choose all correct answers)

CHAR

NCHAR

CLOB (*)

VARCHAR2 (*)

Correct Correct

Previous Page 25 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

26. You need to store the HIRE_DATE value with a time zone displacement value and allow data to be returned in the user's local session time zone. Which data type should you use? Mark for Review (1) Points

DATETIME

TIMESTAMP

TIMESTAMP WITH TIME ZONE

TIMESTAMP WITH LOCAL TIME ZONE (*)

Correct Correct

Page 49: Exit End Ahmed

Previous Page 26 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

27. The VENDORS table contains these columns:

VENDOR_ID NUMBER Primary KeyNAME VARCHAR2(30)LOCATION_ID NUMBERORDER_DT DATEORDER_AMOUNT NUMBER(8,2)

Which two clauses represent valid uses of aggregate functions for this table?Mark for Review

(1) Points

(Choose all correct answers)

FROM MAX(order_dt)

SELECT SUM(order_dt)

SELECT SUM(order_amount) (*)

WHERE MAX(order_dt) = order_dt

SELECT MIN(AVG(order_amount)) (*)

Correct Correct

Previous Page 27 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

28. You issue this SQL statement:

SELECT ROUND (1282.248, -2) FROM dual;What value does this statement produce?

Mark for Review (1) Points

Page 50: Exit End Ahmed

1200

1282

1282.25

1300 (*)

Correct Correct. .Section 1 Lesson 2.

Previous Page 28 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

29. The default value must match the __________ of the column. Mark for Review

(1) Points

Table

Size

Datatype (*)

Column name

Correct Correct. .Section 7 Lesson 3.

Previous Page 29 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

30. Which statement about the <> operator is true? Mark for Review (1) Points

The <> operator is NOT a valid SQL operator.

Page 51: Exit End Ahmed

The <> operator CANNOT be used in a single-row subquery.

The <> operator returns the same result as the ANY operator in a subquery.

The <> operator can be used when a single-row subquery returns only one row. (*)

Correct Correct

Previous Page 30 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

31. You need to join the EMPLOYEE_HIST and EMPLOYEES tables. The EMPLOYEE_HIST table will be the first table in the FROM clause. All the matched and unmatched rows in the EMPLOYEES table need to be displayed. Which type of join will you use? Mark for Review (1) Points

A cross join

An inner join

A left outer join

A right outer join (*)

Correct Correct

Previous Page 31 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

32. Which query will retrieve all the rows in the EMPLOYEES table, even if there is no match in the DEPARTMENTS table? Mark for Review (1) Points

Page 52: Exit End Ahmed

SELECT e.last_name, e.department_id, d.department_nameFROM employees eRIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);

SELECT e.last_name, e.department_id, d.department_nameFROM employees eNATURAL JOIN departments d;

SELECT e.last_name, e.department_id, d.department_nameFROM employees eLEFT OUTER JOIN departments d ON (e.department_id = d.department_id);

(*)

SELECT e.last_name, e.department_id, d.department_nameFROM employees eJOIN departments d USING (e.department_id = d.department_id);

Correct Correct

Previous Page 32 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

33. Evaluate this SELECT statement:

SELECT SYSDATE + 30FROM dual;

Which value is returned by the query?Mark for Review

(1) Points

The current date plus 30 hours.

The current date plus 30 days. (*)

The current date plus 30 months.

No value is returned because the SELECT statement generates an error.

Page 53: Exit End Ahmed

Correct Correct. .Section 1 Lesson 3.

Previous Page 33 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 1-8(Answer all questions in this section)

34. Which statement about the GROUP BY clause is true? Mark for Review (1) Points

To exclude rows before dividing them into groups using the GROUP BY clause, you should use a WHERE clause. (*)

You can use a column alias in a GROUP BY clause.

By default, rows are not sorted when a GROUP BY clause is used.

You must use the HAVING clause with the GROUP BY clause.

Correct Correct

Previous Page 34 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

35. You want to create a view based on the SALESREP table. You plan to grant access to this view to members of the Sales department. You want Sales employees to be able to update the SALESREP table through the view, which you plan to name SALESREP_VIEW. What should not be specified in your CREATE VIEW statement? Mark for Review (1) Points

The AS keyword

A WHERE clause

The IN keyword

Page 54: Exit End Ahmed

A GROUP BY clause (*)

Correct Correct

Previous Page 35 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

36. Which constraint type enforces uniqueness? Mark for Review (1) Points

CHECK

FOREIGN KEY

PRIMARY KEY (*)

NOT NULL

Correct Correct

Previous Page 36 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

37. What is an attribute of data that is entered into a primary key column? Mark for Review (1) Points

Null and non-unique values cannot be entered into a primary key column. (*)

Data that is entered into a primary key column automatically increments by a value of 1 each time a new record is entered into the table.

Data that is entered into a primary key column references a column of the same datatype in another table.

Page 55: Exit End Ahmed

Data that is entered into a primary key column is restricted to a range of numbers that is defined by the local Oracle database.

Correct Correct

Previous Page 37 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

38. Evaluate this CREATE TABLE statement:

CREATE TABLE part( part_id NUMBER, part_name VARCHAR2(25), manufacturer_id NUMBER(9), retail_price NUMBER(7,2) NOT NULL, CONSTRAINT part_id_pk PRIMARY KEY(part_id), CONSTRAINT cost_nn NOT NULL(cost), CONSTRAINT FOREIGN KEY (manufacturer_id) REFERENCES manufacturer(id));

Which line will cause an error?Mark for Review

(1) Points

6

7 (*)

8

9

Correct Correct. .Section 10 Lesson 2.

Previous Page 38 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

Page 56: Exit End Ahmed

39. When creating a referential constraint, which keyword(s) identifies the table and column in the parent table? Mark for Review (1) Points

FOREIGN KEY

REFERENCES (*)

ON DELETE CASCADE

ON DELETE SET NULL

Correct Correct

Previous Page 39 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

40. What is produced when a join condition is not specified in a multiple-table query using Oracle proprietary Join syntax? Mark for Review (1) Points

A self-join

An outer join

An equijoin

A Cartesian product (*)

Correct Correct

Previous Page 40 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

Page 57: Exit End Ahmed

41. Which of these SQL functions used to manipulate strings is not a valid regular expression function ? Mark for Review (1) Points

REGEXP_REPLACE

REGEXP_LIKE

REGEXP (*)

REGEXP_SUBSTR

Correct Correct

Previous Page 41 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

42. You need to ensure that the LAST_NAME column does not contain null values. Which type of constraint should you define on the LAST_NAME column?

Mark for Review (1) Points

CHECK

UNIQUE

NOT NULL (*)

PRIMARY KEY

Correct Correct

Previous Page 42 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

Page 58: Exit End Ahmed

43. Evaluate this CREATE TABLE statement:

CREATE TABLE customers (customer_id NUMBER, customer_name VARCHAR2(25), address VARCHAR2(25), city VARCHAR2(25), region VARCHAR2(25), postal_code VARCHAR2(11), CONSTRAINT customer_id_un UNIQUE(customer_id), CONSTRAINT customer_name_nn NOT NULL(customer_name));

Why does this statement fail when executed?Mark for Review

(1) Points

The NUMBER data types require precision values.

UNIQUE constraints must be defined at the column level.

The CREATE TABLE statement does NOT define a PRIMARY KEY.

NOT NULL constraints CANNOT be defined at the table level. (*)

Correct Correct

Previous Page 43 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

44. Which option would you use when creating a view to ensure that no DML operations occur on the view? Mark for Review (1) Points

FORCE

NOFORCE

WITH READ ONLY (*)

WITH ADMIN OPTION

Correct Correct

Page 59: Exit End Ahmed

Previous Page 44 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

45. Evaluate this statement:

CREATE PUBLIC SYNONYM testing FOR chan.testing;

Which task will this statement accomplish?Mark for Review

(1) Points

It recreates the synonym if it already exists.

It forces all users to access TESTING using the synonym.

It allows only the user CHAN to access TESTING using the synonym.

It eliminates the need for all users to qualify TESTING with its schema. (*)

Correct Correct

Previous Page 45 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

46. User CRAIG creates a view named INVENTORY_V, which is based on the INVENTORY table. CRAIG wants to make this view available for querying to all database users. Which of the following actions should CRAIG perform? Mark for Review (1) Points

He is not required to take any action because, by default, all database users can automatically access views.

He should assign the SELECT privilege to all database users for the INVENTORY table.

Page 60: Exit End Ahmed

He should assign the SELECT privilege to all database users for INVENTORY_V view. (*)

He must grant each user the SELECT privilege on both the INVENTORY table and INVENTORY_V view.

Correct Correct. .Section 13 Lesson 2.

Previous Page 46 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

47. What actions can be performed on or with Constraints? Mark for Review

(1) Points

Add, Drop, Enable, Disable, Cascade (*)

Add, Minus, Enable, Disable, Collapse

Add, Subtract, Enable, Cascade

Add, Drop, Disable, Disregard

Correct Correct

Previous Page 47 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

48. You need to add a PRIMARY KEY to the DEPARTMENTS table. Which statement should you use? Mark for Review (1) Points

ALTER TABLE departmentsADD PRIMARY KEY dept_id_pk (dept_id);

Page 61: Exit End Ahmed

ALTER TABLE departmentsADD CONSTRAINT dept_id_pk PK (dept_id);

ALTER TABLE departmentsADD CONSTRAINT dept_id_pk PRIMARY KEY (dept_id);

(*)

ALTER TABLE departmentsADD CONSTRAINT PRIMARY KEY dept_id_pk (dept_id);

Correct Correct

Previous Page 48 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit ExamReview your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

49. Evaluate this CREATE VIEW statement:

CREATE VIEW emp_viewAS SELECT SUM(salary)FROM employees;

Which statement is true?Mark for Review

(1) Points

You cannot update data in the EMPLOYEES table using the EMP_VIEW view. (*)

You can update any data in the EMPLOYEES table using the EMP_VIEW view.

You can delete records from the EMPLOYEES table using the EMP_VIEW view.

You can update only the SALARY column in the EMPLOYEES table using the EMP_VIEW view.

Correct Correct

Previous Page 49 of 50 Next Summary

الصفحة محتويات إلى االستكشاف عناصر تخطيTest: Institute Exit Exam

Page 62: Exit End Ahmed

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Database Programming Sections 10-15(Answer all questions in this section)

50. Which of the following statements is a valid reason for using a view? Mark for Review (1) Points

Views allow access to the data because the view displays all of the columns from the table.

Views provide data independence for infrequent users and application programs. One view can be used to retrieve data from several tables. Views can be used to provide data security. (*)

Views are used when you only want to restrict DML operations using a WITH CHECK OPTION.

Views are not valid unless you have more than one user.

Correct Correct

Previous Page 50 of 50 Summary


Recommended