Skip to main content

Posts

Section 16 Quiz Database Programming With SQL

                                                      1.       A sequence is a database object. True or False?          Mark for Review (1) Points             True (*)             False 2.       When you alter a sequence, a new increased MAXVALUE can be entered without changing the existing number order. True or False?   Mark for Review (1) Points                                                                                                         True (*)             False 15.       CURRVAL is a pseudocolumn used to refer to a sequence number that the current user has just generated by referencing NEXTVAL. True or False?      Mark for Review (1) Points             True (*)             False 1.         You need to determine the table name and column name(s) on which the SALES_IDX index is defined. Which data dictionary view would you query?            Mark for Review (1) Points             USER_INDEXES             USER_OBJECTS             USER_TABLES        

Section 15 Quiz Database Programming With SQL

1. The EMPLOYEES table contains these columns: EMPLOYEE_ID NUMBER LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) DEPARTMENT_ID NUMBER JOB_ID NUMBER MANAGER_ID NUMBER SALARY NUMBER(9,2) COMMISSOIN NUMBER(7,2) HIRE_DATE DATE Which SELECT statement could be used to display the 10 lowest paid clerks that belong to department 70?  Mark for Review (1) Points                 SELECT ROWNUM "Ranking", last_name||' ,'||first_name "Employee", salary "Salary" FROM (SELECT last_name, first_name, salary      FROM employees      ORDER BY salary) WHERE ROWNUM <=10 AND job_id LIKE 'CLERK' AND department_id = 70;                 SELECT ROWNUM "Ranking",last_name||','||first_name "Employee", salary "Salary" FROM (SELECT last_name, first_name, salary, job_id      FROM employees      WHERE job_id LIKE 'CLERK' AND department_id = 70      ORDER BY salary) WHERE ROWNUM <=10; (*)  

Section 14 Quiz Database Programming With SQL

1.  The LINE_ITEM table contains these columns: LINE_ITEM_ID NUMBER PRIMARY KEY PRODUCT_ID NUMBER(9) FOREIGN KEY references the ID column of the PRODUCT table QUANTITY NUMBER(9) UNIT_PRICE NUMBER(5,2) You need to disable the FOREIGN KEY constraint. Which statement should you use?  Mark for Review (1) Points             ALTER TABLE line_item DELETE CONSTRAINT product_id_fk;             ALTER TABLE line_item DISABLE CONSTRAINT product_id_fk; (*)             ALTER TABLE line_item ENABLE CONSTRAINT product_id_fk;             ALTER TABLE line_item DROP CONSTRAINT product_id_fk; 8.         You need to remove the EMP_FK_DEPT constraint from the EMPLOYEE table in your schema. Which statement should you use?       Mark for Review (1) Points             ALTER TABLE employees DROP CONSTRAINT EMP_FK_DEPT; (*)             ALTER TABLE employees REMOVE CONSTRAINT EMP_FK_DEPT;             DROP CONSTRAINT EMP_FK_DEPT FROM employees;             DELETE CONSTRAINT EMP_FK_DE