You are on page 1of 62

. 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 FROM employees ORDER BY DEPT; How will the results differ? Mark for Review (1) Points One of the statements will return a syntax error.

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 Previous

Correct. Page 2 of 50 Next Summary

. 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) 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 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) 4. Evaluate this SELECT statement:

SELECT last_name, first_name, salary FROM 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 Previous

Correct. Page 4 of 50 Next Summary

. Test: Institute Exit Exam 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) 5. 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. Which statement about subqueries is true? Mark for

Correct Previous

Correct Page 5 of 50 Next Summary

. Test: Institute Exit Exam 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) 6. You query the database with this SQL statement:

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

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 Previous

Correct Page 6 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 KEY LAST_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 employees WHERE employee_id = 348; (*) DELETE FROM employees WHERE last_name = jones;

DELETE * FROM employees

WHERE employee_id = 348;

DELETE 'jones' FROM employees;

Correct Previous

Correct Page 7 of 50 Next Summary

. Test: Institute Exit Exam 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) 8. Examine the structures of the PRODUCTS and SUPPLIERS tables:

SUPPLIERS SUPPLIER_ID NUMBER NOT NULL, Primary Key SUPPLIER_NAME VARCHAR2 (25) ADDRESS VARCHAR2 (30) CITY VARCHAR2 (25) REGION VARCHAR2 (10) POSTAL_CODE VARCHAR2 (11) PRODUCTS PRODUCT_ID NUMBER NOT NULL, Primary Key PRODUCT_NAME VARCHAR2 (25) SUPPLIER_ID NUMBER Foreign key to SUPPLIER_ID of the SUPPLIERS table CATEGORY_ID NUMBER QTY_PER_UNIT NUMBER UNIT_PRICE NUMBER (7,2) QTY_IN_STOCK NUMBER QTY_ON_ORDER NUMBER REORDER_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 products WHERE supplier_id IN (SELECT supplier_id FROM suppliers WHERE UPPER(city) = 'ATLANTA'); (*) DELETE FROM products WHERE UPPER(city) = 'ATLANTA';

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

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

Correct Previous

Correct Page 8 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 products VALUES (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 Previous

Correct Page 9 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 products VALUES (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 Previous

Correct Page 9 of 50 Next Summary

. Test: Institute Exit Exam 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)

tables.

10.

Examine the structure of the EMPLOYEE, DEPARTMENT, and ORDERS

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 DATE CUSTOMER_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 Previous

Correct Page 10 of 50 Next Summary

. Test: Institute Exit Exam 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) 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),

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, companyname FROM customers WHERE city = 'Nashville';

SELECT orderid, orderdate, total FROM orders o NATURAL JOIN customers c ON o.custid = c.custid WHERE city = 'Nashville';

SELECT orderid, orderdate, total FROM orders o JOIN customers c ON o.custid = c.custid WHERE city = 'Nashville'; (*) SELECT orderid, orderdate, total FROM orders WHERE city = 'Nashville';

Correct Previous

Correct Page 11 of 50 Next Summary

. Test: Institute Exit Exam 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) 12. Which keyword in a SELECT statement creates an equijoin by specifying a column name common to both tables? Mark for Review (1) Points

A HAVING clause The FROM clause The SELECT clause A USING clause (*)

Correct Previous

Correct Page 12 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct Page 13 of 50 Next Summary

. Test: Institute Exit Exam 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) 14. The PLAYERS and TEAMS tables contain these columns:

PLAYERS PLAYER_ID NUMBER NOT NULL, PRIMARY KEY LAST_NAME VARCHAR2 (30) NOT NULL FIRST_NAME VARCHAR2 (25) NOT NULL

TEAM_ID NUMBER POSITION VARCHAR2 (25) TEAMS TEAM_ID NUMBER NOT NULL, PRIMARY KEY TEAM_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 t ON (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 players JOIN 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 t ON (p.team_id = t.team_id) WHERE UPPER(p.position) = 'GOAL KEEPER' GROUP BY t.team_name HAVING COUNT(p.player_id) > 3;

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

Correct Previous

Correct Page 14 of 50 Next Summary

. Test: Institute Exit Exam 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)

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 Previous

Correct Page 15 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct Page 16 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct Page 17 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct Page 18 of 50 Next Summary

. Test: Institute Exit Exam 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) 19. Examine the data from the LINE_ITEM table: PRICE 0.10 0.05 0.15 DISCOUNT

LINE_ITEM_ID ORDER_ID PRODUCT_ID 890898 847589 848399 8.99 768385 862459 849869 5.60 867950 985490 945809 5.60 954039 439203 438925 5.25 543949 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 Previous

Correct. .Section 4 Lesson 3. Page 19 of 50 Next Summary

. Test: Institute Exit Exam 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) 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

True (*) False

Correct Previous

Correct. .Section 6 Lesson 4. Page 20 of 50 Next Summary

. Test: Institute Exit Exam 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) '20-MAY-04'? (1) Points 21. Which script displays '01-MAY-04' when the HIRE_DATE value is Mark for Review

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 Previous

Correct Page 21 of 50 Next Summary

. Test: Institute Exit Exam 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) 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

(1) Points ALTER TABLE DROP TABLE MODIFY TRUNCATE TABLE (*)

Correct Previous

Correct Page 22 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct Page 23 of 50 Next Summary

. Test: Institute Exit Exam 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) 24. Evaluate this statement: ALTER TABLE employees SET UNUSED (fax);

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 Previous

Correct Page 24 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous .

Correct Page 25 of 50 Next Summary

Test: Institute Exit Exam 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) 26. tabulated rows. (1) Points CREATE DISTINGUISH (*) COMPUTE COUNT You use GROUPING function to ______ database rows from Mark for Review

Correct Previous

Correct Page 26 of 50 Next Summary

. Test: Institute Exit Exam 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) 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. (*)

Correct Previous

Correct Page 27 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct Page 28 of 50 Next Summary

. Test: Institute Exit Exam 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) 29. The ___________ operator returns all rows from both tables, after eliminating duplicates. Mark for Review (1) Points UNION (*) UNION ALL INTERSECT MINUS

Correct Previous

Correct. .Section 5 Lesson 3. Page 29 of 50 Next Summary

. Test: Institute Exit Exam 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) Review (1) Points 30. Which SELECT statement will return a numeric value? Mark for

SELECT SYSDATE + 600 / 24 FROM employee;

SELECT ROUND(hire_date, DAY) FROM employee;

SELECT (SYSDATE - hire_date) / 7 FROM employee; (*) SELECT SYSDATE - 7 FROM employee;

Correct Previous

Correct Page 30 of 50 Next Summary

. Test: Institute Exit Exam 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) 31. Review (1) Points SELECT p.part_id, t.product_id FROM part p, part t WHERE p.part_id = t.product_id; Which SELECT statement implements a self join? Mark for

(*) SELECT p.part_id, t.product_id FROM part p, product t WHERE p.part_id = t.product_id;

SELECT p.part_id, t.product_id FROM part p, product t WHERE p.part_id = t.product_id (+);

SELECT p.part_id, t.product_id FROM part p, product t WHERE p.part_id =! t.product_id;

Correct Previous

Correct. .Section 3 Lesson 4. Page 31 of 50 Next Summary

. Test: Institute Exit Exam 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) 32. is __________. (1) Points Created Altered All of the above (*) None of the above A DEFAULT value can be specified for a column when the table Mark for Review

Correct Previous

Correct. .Section 7 Lesson 3. Page 32 of 50 Next Summary

. Test: Institute Exit Exam

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 Previous

Correct Page 33 of 50 Next Summary

. Test: Institute Exit Exam 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) 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

Previous

Page 34 of 50

Next

Summary

. Test: Institute Exit Exam 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) 35. The FACULTY table contains these columns: FACULTYID VARCHAR2(5) NOT NULL PRIMARY KEY FIRST_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 KEY SUBJECT 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_view ON (SELECT first_name, last_name, status, courseid, subject, term FROM faculty f and course c WHERE f.facultyid = c.facultyid);

CREATE VIEW pt_view IN subject, term FROM faculty course);

(SELECT first_name, last_name, status, courseid,

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

(*)

Correct Previous

Correct Page 35 of 50 Next Summary

. Test: Institute Exit Exam 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) view? (1) Points HAVING WHERE ORDER BY They are all valid keywords when creating views. (*) 36. Which of the following keywords cannot be used when creating a Mark for Review

Correct Previous

Correct Page 36 of 50 Next Summary

. Test: Institute Exit Exam 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) 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.amount FROM customers c, orders o WHERE c.custid = o.custid ORDER BY amount DESC, companyname;

SELECT c.custid, c.companyname, o.orderdate, o. custid, o.amount FROM customers c, orders o WHERE c.custid = o.custid ORDER BY companyname, amount DESC; (*) SELECT c.custid, c.companyname, o.orderdate, o. custid, o.amount FROM customers c, orders o WHERE c.custid = o.custid ORDER BY companyname, amount;

SELECT c.custid, c.companyname, o.orderdate, o. custid, o.amount FROM customers c, orders o WHERE c.custid = o.custid ORDER BY companyname ASC, amount ASC;

Correct Previous

Correct Page 37 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct Page 38 of 50 Next Summary

. Test: Institute Exit Exam

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) or False? (1) Points True False (*) 39. A table can only have one unique key constraint defined. True Mark for Review

Correct Previous

Correct Page 39 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct Page 40 of 50 Next Summary

. Test: Institute Exit Exam 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)

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 Previous

Correct Page 41 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct. .Section 13 Lesson 3. Page 42 of 50 Next Summary

. Test: Institute Exit Exam 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) 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 Previous

Correct Page 43 of 50 Next Summary

. Test: Institute Exit Exam 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) 44. Review (1) Points CHECK FOREIGN KEY PRIMARY KEY (*) NOT NULL Which constraint type enforces uniqueness? Mark for

Correct Previous .

Correct Page 44 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 45 of 50 Next Summary

. Test: Institute Exit Exam 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) 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.

Correct Previous

Correct Page 46 of 50 Next Summary

. Test: Institute Exit Exam 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) 47. The PO_DETAILS table contains these columns:

PO_NUM NUMBER NOT NULL, Primary Key PO_LINE_ID NUMBER NOT NULL, Primary Key PRODUCT_ID NUMBER Foreign Key to PRODUCT_ID column of the PRODUCTS table QUANTITY NUMBER UNIT_PRICE NUMBER(5,2) Evaluate this statement: ALTER TABLE po_details DISABLE 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 Previous

Correct Page 47 of 50 Next Summary

. Test: Institute Exit Exam 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) 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

USER_CONS_COLUMNS (*) CONSTRAINTS_ALL_COLUMNS SYS_DATA_DICT_COLUMNS US_CON_SYS

Correct Previous

Correct Page 48 of 50 Next Summary

. Test: Institute Exit Exam 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) 49. Evaluate this CREATE VIEW statement:

CREATE VIEW sales_view AS SELECT customer_id, region, SUM(sales_amount) FROM sales WHERE 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 Previous

Correct Page 49 of 50 Next Summary

Test: Institute Exit Exam 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. 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 Previous

Correct Page 50 of 50 Summary

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. 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_name FROM players WHERE position_id >=6900 ORDER BY last_name, first_name; (*) SELECT last_name, first_name FROM players

WHERE position_id > 6900 ORDER BY last_name, first_name;

SELECT last_name, first_name FROM players WHERE position_id <= 6900 ORDER BY last_name, first_name;

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

Correct Page 1 of 50

Correct! See Section 17 Lesson 3. Next Summary

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. When using the LIKE condition, which symbol represents any sequence of none, one or more characters? Mark for Review (1) Points _ % (*) # &

Correct Previous

Correct. Page 2 of 50 Next Summary

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)

3.

Evaluate this SELECT statement:

SELECT last_name, first_name, salary FROM 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 Previous

Correct. Page 3 of 50 Next Summary

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) 4. Evaluate this SELECT statement:

SELECT * FROM employees WHERE salary > 30000 AND department_id = 10 OR 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

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

Correct Previous

Correct. Page 4 of 50 Next Summary

Test: Institute Exit Exam 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) 5. 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. Which best describes the TO_CHAR function? Mark for

Correct Previous

Correct Page 5 of 50 Next Summary

Test: Institute Exit Exam 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) Review (1) Points 6. Which statement about the COUNT function is true? Mark for

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

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 Previous

Correct Page 6 of 50 Next Summary

Test: Institute Exit Exam 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) 7. tabulated rows. (1) Points CREATE DISTINGUISH (*) COMPUTE COUNT You use GROUPING function to ______ database rows from Mark for Review

Correct Previous

Correct Page 7 of 50 Next Summary

Test: Institute Exit Exam 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) 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

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 Previous

Correct Page 8 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 9 of 50 Next Summary

Test: Institute Exit Exam 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) 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

DROP TABLE MODIFY TRUNCATE TABLE (*)

Correct Previous

Correct Page 10 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct. .Section 8 Lesson 3. Page 11 of 50 Next Summary

Test: Institute Exit Exam 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) 12. Evaluate the structure of the EMPLOYEE table:

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

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 employee MODIFY (employee_id VARCHAR2(9));

ALTER TABLE employee REPLACE (employee_id VARCHAR2(9));

ALTER employee TABLE MODIFY COLUMN (employee_id VARCHAR2(15));

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

Correct Previous

Correct Page 12 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 13 of 50 Next Summary

Test: Institute Exit Exam 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) 14. STYLE_ID 895840 968950 869506 809090 890890 857689 758960 The STYLES table contains this data: CATEGORY 85940 85909 89690 89098 89789 11.00 86979 COST 12.00 10.00 15.00 10.00 14.00

STYLE_NAME SANDAL SANDAL SANDAL LOAFER LOAFER HEEL 85940 SANDAL

Evaluate this SELECT statement: SELECT style_id, style_name, category, cost FROM styles WHERE style_name LIKE 'SANDAL' AND NVL(cost, 0) < 15.00 ORDER BY category, cost; Which result will the query provide? Mark for Review (1) Points

STYLE_ID 895840 968950 758960

STYLE_NAME SANDAL SANDAL SANDAL

CATEGORY 85940 85909 86979

COST 12.00 10.00

STYLE_ID 895840 968950 869506 758960

STYLE_NAME SANDAL SANDAL SANDAL SANDAL

CATEGORY 85909 85909 89690 86979

COST 12.00 10.00 15.00

STYLE_ID 895840 968950 758960 869506

STYLE_NAME SANDAL SANDAL SANDAL SANDAL

CATEGORY 85909 85909 86979 89690

COST 12.00 10.00 15.00

STYLE_ID 968950 895840 758960

STYLE_NAME SANDAL SANDAL SANDAL

CATEGORY 85909 85940 86979

COST 10.00 12.00

(*)

Correct Previous

Correct Page 14 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 15 of 50 Next Summary

Test: Institute Exit Exam 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) 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_name FROM products WHERE cost > (SELECT AVG(cost) FROM product); (*)

SELECT product_name FROM products WHERE cost > AVG(cost);

SELECT AVG(cost), product_name FROM products WHERE cost > AVG(cost) GROUP by product_name;

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

Correct Previous

Correct Page 16 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 17 of 50 Next Summary

Test: Institute Exit Exam 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) 18. Below find the structures of the PRODUCTS and VENDORS tables:

PRODUCTS PRODUCT_ID NUMBER PRODUCT_NAME VARCHAR2 (25) VENDOR_ID NUMBER CATEGORY_ID NUMBER VENDORS VENDOR_ID NUMBER VENDOR_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_name FROM products p LEFT OUTER JOIN vendors v ON p.vendor_id = v.vendor_id ORDER BY p.product_name;

SELECT p.product_name, v.vendor_name FROM products p JOIN vendors v ON (vendor_id) ORDER BY p.product_name;

SELECT p.product_name, v.vendor_name FROM products p NATURAL JOIN vendors v ORDER BY p.product_name; (*) SELECT p.product_name, v.vendor_name FROM products p JOIN vendors v USING (p.vendor_id) ORDER BY p.product_name;

SELECT p.product_name, v.vendor_name FROM products p

JOIN vendors v USING (vendor_id) ORDER BY p.product_name; (*)

Correct Previous

Correct Page 18 of 50 Next Summary

Test: Institute Exit Exam 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) subquery? (1) Points ALL ANY = (*) > 19. Which operator or keyword cannot be used with a multiple-row Mark for Review

Correct Previous

Correct Page 19 of 50 Next Summary

Test: Institute Exit Exam 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) 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);

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

Correct Previous

Correct Page 20 of 50 Next Summary

Test: Institute Exit Exam 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) columns: 21. The TEACHERS and CLASS_ASSIGNMENTS tables contain these

TEACHERS TEACHER_ID NUMBER(5) NAME VARCHAR2(25) SUBJECT_ID NUMBER(5) HIRE_DATE DATE SALARY NUMBER(9,2) CLASS_ASSIGNMENTS CLASS_ID NUMBER(5) TEACHER_ID NUMBER(5) START_DATE DATE MAX_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

Previous

Page 21 of 50

Next

Summary

Test: Institute Exit Exam 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) 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 KEY LAST_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 employees WHERE employee_id = 348; (*) DELETE FROM employees WHERE last_name = jones;

DELETE * FROM employees WHERE employee_id = 348;

DELETE 'jones' FROM employees;

Correct Previous

Correct Page 22 of 50 Next Summary

Test: Institute Exit Exam 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)

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 Previous

Correct. .Section 5 Lesson 3. Page 23 of 50 Next Summary

Test: Institute Exit Exam 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) Review (1) Points 24. Which SELECT statement implements a self join? Mark for

SELECT p.part_id, t.product_id FROM part p, part t WHERE p.part_id = t.product_id; (*) SELECT p.part_id, t.product_id FROM part p, product t WHERE p.part_id = t.product_id;

SELECT p.part_id, t.product_id FROM part p, product t WHERE p.part_id = t.product_id (+);

SELECT p.part_id, t.product_id FROM part p, product t WHERE p.part_id =! t.product_id;

Correct Previous

Correct Page 24 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 25 of 50 Next Summary

Test: Institute Exit Exam 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) 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

Previous

Page 26 of 50

Next

Summary

Test: Institute Exit Exam 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) 27. The VENDORS table contains these columns:

VENDOR_ID NUMBER Primary Key NAME VARCHAR2(30) LOCATION_ID NUMBER ORDER_DT DATE ORDER_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 Previous

Correct Page 27 of 50 Next Summary

Test: Institute Exit Exam 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) 28. You issue this SQL statement:

SELECT ROUND (1282.248, -2) FROM dual; What value does this statement produce? Mark for Review (1) Points

1200 1282 1282.25 1300 (*)

Correct Previous

Correct. .Section 1 Lesson 2. Page 28 of 50 Next Summary

Test: Institute Exit Exam 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) 29. The default value must match the __________ of the column. Mark for Review (1) Points Table Size Datatype (*) Column name

Correct Previous

Correct. .Section 7 Lesson 3. Page 29 of 50 Next Summary

Test: Institute Exit Exam 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) 30. Review (1) Points The <> operator is NOT a valid SQL operator. Which statement about the <> operator is true? Mark for

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 Previous

Correct Page 30 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 31 of 50 Next Summary

Test: Institute Exit Exam 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) 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

SELECT e.last_name, e.department_id, d.department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);

SELECT e.last_name, e.department_id, d.department_name FROM employees e NATURAL JOIN departments d;

SELECT e.last_name, e.department_id, d.department_name FROM employees e LEFT OUTER JOIN departments d ON (e.department_id = d.department_id); (*) SELECT e.last_name, e.department_id, d.department_name FROM employees e JOIN departments d USING (e.department_id = d.department_id);

Correct Previous

Correct Page 32 of 50 Next Summary

Test: Institute Exit Exam 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 SELECT statement:

SELECT SYSDATE + 30 FROM 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.

Correct Previous

Correct. .Section 1 Lesson 3. Page 33 of 50 Next Summary

Test: Institute Exit Exam 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) 34. 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. Which statement about the GROUP BY clause is true? Mark for

Correct Previous

Correct Page 34 of 50 Next Summary

Test: Institute Exit Exam 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) 35. You want to create plan to grant access to this view to Sales employees to be able to update you plan to name SALESREP_VIEW. What statement? Mark for Review (1) Points The AS keyword A WHERE clause The IN keyword a view based on the SALESREP table. You members of the Sales department. You want the SALESREP table through the view, which should not be specified in your CREATE VIEW

A GROUP BY clause (*)

Correct Previous

Correct Page 35 of 50 Next Summary

Test: Institute Exit Exam 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) Review (1) Points CHECK FOREIGN KEY PRIMARY KEY (*) NOT NULL 36. Which constraint type enforces uniqueness? Mark for

Correct Previous

Correct Page 36 of 50 Next Summary

Test: Institute Exit Exam 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) key column? (1) Points 37. What is an attribute of data that is entered into a primary Mark for Review

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.

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 Previous

Correct Page 37 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct. .Section 10 Lesson 2. Page 38 of 50 Next Summary

Test: Institute Exit Exam 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. 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 Previous

Correct Page 39 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 40 of 50 Next Summary

Test: Institute Exit Exam 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)

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 Previous

Correct Page 41 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 42 of 50 Next Summary

Test: Institute Exit Exam 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)

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 Previous

Correct Page 43 of 50 Next Summary

Test: Institute Exit Exam 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) 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

Previous

Page 44 of 50

Next

Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 45 of 50 Next Summary

Test: Institute Exit Exam 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) 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.

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 Previous

Correct. .Section 13 Lesson 2. Page 46 of 50 Next Summary

Test: Institute Exit Exam 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) 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 Previous

Correct Page 47 of 50 Next Summary

Test: Institute Exit Exam 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) 48. You need to add a PRIMARY KEY to the DEPARTMENTS table. Which statement should you use? Mark for Review (1) Points ALTER TABLE departments ADD PRIMARY KEY dept_id_pk (dept_id);

ALTER TABLE departments ADD CONSTRAINT dept_id_pk PK (dept_id);

ALTER TABLE departments ADD CONSTRAINT dept_id_pk PRIMARY KEY (dept_id); (*) ALTER TABLE departments ADD CONSTRAINT PRIMARY KEY dept_id_pk (dept_id);

Correct Previous

Correct Page 48 of 50 Next Summary

Test: Institute Exit Exam 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) 49. Evaluate this CREATE VIEW statement:

CREATE VIEW emp_view AS 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 Previous

Correct Page 49 of 50 Next Summary

Test: Institute Exit Exam

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) a view? (1) Points 50. Which of the following statements is a valid reason for using Mark for Review

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 Previous

Correct Page 50 of 50 Summary

You might also like