Advertisement
Guest User

Manual Geografie Clasa a 12a

a guest
Apr 25th, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 191.42 KB | None | 0 0
  1. Section 12 Quiz
  2. (Answer all questions in this section)
  3.  
  4. 1. A column in a table can be given a default value. This option prevents NULL values from automatically being assigned to the column if a row is inserted without a specified value for the column. True or False ? Mark for Review
  5. (1) Points
  6. True (*)
  7. False
  8.  
  9. 2. In developing the Employees table, you create a column called hire_date. You assign the hire_date column a DATE datatype with a DEFAULT value of 0 (zero). A user can come back later and enter the correct hire_date. This is __________. Mark for Review
  10. (1) Points
  11.  
  12. A great idea. When a new employee record is entered, if no hire_date is specified, the 0 (zero) will be automatically specified.
  13.  
  14. A great idea. When new employee records are entered, they can be added faster by allowing the 0's (zeroes) to be automatically specified.
  15.  
  16. Both a and b are correct.
  17.  
  18. A bad idea. The default value must match the DATE datatype of the column. (*)
  19.  
  20. 3. Aliases can be used with MERGE statements. True or False? Mark for Review
  21. (1) Points
  22. True (*)
  23. False
  24.  
  25. 4. Multi-table inserts can be conditional or unconditional. True or False? Mark for Review
  26. (1) Points
  27. True (*)
  28. False
  29.  
  30. 5. A multi-table insert statement can insert into more than one table. (True or False?) Mark for Review
  31. (1) Points
  32. True (*)
  33. False
  34.  
  35. 6. Which of the following represents the correct syntax for an INSERT statement? Mark for Review
  36. (1) Points
  37. INSERT VALUES INTO customers (3178 J. Smith 123 Main Street Nashville TN 37777;
  38. INSERT INTO customers VALUES '3178' 'J.' 'Smith' '123 Main Street' 'Nashville' 'TN' '37777';
  39.  
  40. INSERT INTO customers VALUES ('3178', 'J.', 'Smith', '123 Main Street', 'Nashville', 'TN', '37777'); (*)
  41.  
  42. INSERT customers VALUES 3178, J., Smith, 123 Main Street, Nashville, TN, 37777;
  43.  
  44. 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:
  45. EMPLOYEE_ID NUMBER(5) PRIMARY KEY
  46. LAST_NAME VARCHAR2(20)
  47. FIRST_NAME VARCHAR2(20)
  48. ADDRESS VARCHAR2(30)
  49. PHONE NUMBER(10)
  50.  
  51. Which DELETE statement will delete the appropriate record without deleting any additional records?
  52.  
  53. Mark for Review
  54. (1) Points
  55.  
  56. DELETE FROM employees
  57. WHERE employee_id = 348;
  58. (*)
  59.  
  60. DELETE FROM employees
  61. WHERE last_name = jones;
  62.  
  63. DELETE 'jones'
  64. FROM employees;
  65.  
  66. DELETE *
  67. FROM employees
  68. WHERE employee_id = 348;
  69.  
  70. 8. The EMPLOYEES table contains the following columns:
  71. EMPLOYEE_ID NUMBER(10) PRIMARY KEY
  72. LAST_NAME VARCHAR2(20)
  73. FAST_NAME VARCHAR2(20)
  74. DEPARTMENT_ID VARCHAR2(20)
  75. HIRE_DATE DATE
  76. SALARY NUMBER(9,2)
  77. BONUS NUMBER(9,2)
  78.  
  79. You want to execute one DML statement to change the salary of all employees in department 10 to equal the new salary of employee number 89898. Currently, all employees in department 10 have the same salary value. Which statement should you execute?
  80.  
  81. Mark for Review
  82. (1) Points
  83.  
  84. UPDATE employees
  85. SET salary = (SELECT salary FROM employees WHERE employee_id = 89898)
  86. WHERE department_id = 10;
  87. (*)
  88.  
  89. UPDATE employees
  90. SET salary = (SELECT salary FROM employees WHERE employee_id = 89898);
  91.  
  92. UPDATE employees
  93. SET salary = SELECT salary FROM employees WHERE employee_id = 89898;
  94.  
  95. UPDATE employees
  96. SET salary = (SELECT salary FROM employees WHERE employee_id = 89898 AND department_id = 10);
  97.  
  98. 9. If the subquery returns one row, how many rows will be deleted from the employees table?
  99. DELETE FROM employees
  100. WHERE department_id =
  101. (SELECT department_id
  102. FROM departments
  103. WHERE department_name LIKE '%Public%');
  104.  
  105. Mark for Review
  106. (1) Points
  107. One row will be deleted, as the subquery only returns one row.
  108. All rows in the employees table will be deleted, no matter the department_id.
  109. All rows in the employees table of employees who work in the given department will be deleted. (*)
  110. No rows will be deleted.
  111.  
  112. 10. What keyword in an UPDATE statement speficies the column that you want to change? Mark for Review
  113. (1) Points
  114. SET (*)
  115. SELECT
  116. WHERE
  117. HAVING
  118.  
  119. 11. To return a table summary on the customers table, which of the following is correct? Mark for Review
  120. (1) Points
  121. DEFINE customers, or DEF customers
  122. SHOW customers, or SEE customers
  123. DISTINCT customers, or DIST customers
  124. DESCRIBE customers, or DESC customers (*)
  125.  
  126. 12. The PRODUCTS table contains these columns:
  127. PRODUCT_ID NUMBER NOT NULL
  128. PRODUCT_NAME VARCHAR2 (25)
  129. SUPPLIER_ID NUMBER NOT NULL
  130. LIST_PRICE NUMBER (7,2)
  131. COST NUMBER (5,2)
  132. QTY_IN_STOCK NUMBER(4)
  133. LAST_ORDER_DT DATE DEFAULT SYSDATE NOT NUL
  134.  
  135. Which INSERT statement will execute successfully?
  136.  
  137. Mark for Review
  138. (1) Points
  139.  
  140. INSERT INTO products(product_id, product_name)
  141. VALUES (2958, 'Cable');
  142.  
  143. INSERT INTO products(product_id, product_name, supplier_id
  144. VALUES (2958, 'Cable', 8690, SYSDATE);
  145.  
  146. INSERT INTO products (product_id, product_name, supplier_id, list_price, cost, qty_in_stock)
  147. VALUES(2958, 'Cable', 8690, 7.09, 4.04, 700) (*)
  148.  
  149. INSERT INTO products
  150. VALUES (2958, 'Cable', 8690, 7.09, 4.04, SYSDATE);
  151.  
  152. 13. Assume all the column names are correct. The following SQL statement will execute which of the following?
  153. INSERT INTO departments
  154. (department_id, department_name, manager_id, location_id)
  155. VALUES (70, 'Public Relations', 100, 1700);
  156.  
  157. Mark for Review
  158. (1) Points
  159. 'Public Relations' will be inserted into the manager_name column.
  160. 70 will be inserted into the department_id column. (*)
  161. 1700 will be inserted into the manager_id column.
  162. 100 will be inserted into the department_id column.
  163.  
  164. 14. You need to copy rows from the EMPLOYEE table to the EMPLOYEE_HIST table. What could you use in the INSERT statement to accomplish this task? Mark for Review
  165. (1) Points
  166. A subquery (*)
  167. A function
  168. A SET clause
  169. An ON clause
  170.  
  171. 15. The STUDENTS table contains these columns:
  172. STU_ID NUMBER(9) NOT NULL
  173. LAST_NAME VARCHAR2 (30) NOT NULL
  174. FIRST_NAME VARCHAR2 (25) NOT NULL
  175. DOB DATE
  176. STU_TYPE_ID VARCHAR2(1) NOT NULL
  177. ENROLL_DATE DATE
  178.  
  179. You create another table, named FT_STUDENTS, with an identical structure.You want to insert all full-time students who have a STU_TYPE_ID value of "F" into the new table. You execute this INSERT statement:
  180.  
  181. INSERT INTO ft_students
  182. (SELECT stu_id, last_name, first_name, dob, stu_type_id, enroll_date
  183. FROM students
  184. WHERE UPPER(stu_type_id) = 'F');
  185.  
  186. What is the result of executing this INSERT statement?
  187.  
  188. Mark for Review
  189. (1) Points
  190. An error occurs because the INSERT statement does NOT contain a VALUES clause.
  191. All full-time students are inserted into the FT_STUDENTS table. (*)
  192. An error occurs because the FT_STUDENTS table already exists.
  193. An error occurs because you CANNOT use a subquery in an INSERT statement.
  194.  
  195. 1. Which of the following statements will add a new customer to the customers table in the Global Fast Foods database? Mark for Review
  196. (1) Points
  197.  
  198. INSERT INTO customers (id, first_name, last_name, address, city, state, zip, phone_number)
  199. VALUES (145, 'Katie', 'Hernandez', '92 Chico Way', 'Los Angeles', 'CA', 98008, 8586667641);
  200. (*)
  201.  
  202. INSERT IN customers (id, first_name, last_name, address, city, state, zip, phone_number);
  203.  
  204. INSERT INTO customers
  205. (id 145, first_name 'Katie', last_name 'Hernandez', address '92 Chico Way', city 'Los Angeles', state 'CA', zip 98008, phone_number 8586667641);
  206.  
  207. INSERT INTO customers (id, first_name, last_name, address, city, state, zip, phone_number)
  208. VALUES ("145", 'Katie', 'Hernandez', '92 Chico Way', 'Los Angeles', 'CA', "98008", "8586667641");
  209.  
  210. 2. Which statement about the VALUES clause of an INSERT statement is true? Mark for Review
  211. (1) Points
  212. To specify a null value in the VALUES clause, use an empty string (" ").
  213.  
  214. Character, date, and numeric data must be enclosed within single quotes in the VALUES clause.
  215. The VALUES clause in an INSERT statement is mandatory in a subquery.
  216.  
  217. If no column list is specified, the values must be listed in the same order that the columns are listed in the table. (*)
  218.  
  219. 3. If the employees table has 7 rows, how many rows are inserted into the copy_emps table with the following statement:
  220. INSERT INTO copy_emps (employee_id, first_name, last_name, salary, department_id)
  221. SELECT employee_id, first_name, last_name, salary, department_id
  222. FROM employees
  223. Mark for Review
  224. (1) Points
  225. No rows, as the SELECT statement is invalid.
  226. 10 rows will be created.
  227. No rows, as you cannot use subqueries in an insert statement.
  228. 7 rows, as no WHERE-clause restricts the rows returned on the subquery. (*)
  229.  
  230. 4. 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
  231. (1) Points
  232. It is not possible to implicitly insert a null value in a column.
  233. Omit the column in the column list. (*)
  234. Use the NULL keyword.
  235. Use the ON clause
  236.  
  237. 5. Insert statements can be combined with subqueries to create more than one row per statement. True or False? Mark for Review
  238. (1) Points
  239. True (*)
  240. False
  241.  
  242. 6. Which statement below will not insert a row of data into a table? Mark for Review
  243. (1) Points
  244.  
  245. INSERT INTO student_table
  246. VALUES (143354, 'Roberts', 'Cameron', 6543);
  247.  
  248. INSERT INTO (id, lname, fname, lunch_num)
  249. VALUES (143354, 'Roberts', 'Cameron', 6543);
  250. (*)
  251.  
  252. INSERT INTO student_table (id, lname, fname, lunch_num)
  253. VALUES (143352, 'Roberts', 'Cameron', DEFAULT);
  254.  
  255. INSERT INTO student_table (id, lname, fname, lunch_num)
  256. VALUES (143354, 'Roberts', 'Cameron', 6543);
  257.  
  258. 7. Aliases can be used with MERGE statements. True or False? Mark for Review
  259. (1) Points
  260. True (*)
  261. False
  262.  
  263. 8. Multi-table inserts are used when the same source data should be inserted into _____________ target table. Mark for Review
  264. (1) Points
  265. A very large
  266. A data warehouse
  267. Ten
  268. More than one (*)
  269.  
  270. 9. The DEFAULT keyword can be used in the following statements: Mark for Review
  271. (1) Points
  272. INSERT and UPDATE (*)
  273. INSERT and DELETE
  274. DELETE and UPDATE
  275. All of the above
  276.  
  277. 10. The default value must match the __________ of the column. Mark for Review
  278. (1) Points
  279. Datatype (*)
  280. Table
  281. Column name
  282. Size
  283.  
  284. 11. One of the sales representatives, Janet Roper, has informed you that she was recently married, and she has requested that you update her name in the employee database. Her new last name is Cooper. Janet is the only person with the last name of Roper that is employed by the company. The EMPLOYEES table contains these columns and all data is stored in lowercase:
  285. EMPLOYEE_ID NUMBER(10) PRIMARY KEY
  286. LAST_NAME VARCHAR2(20)
  287. FIRST_NAME VARCHAR2(20)
  288. DEPARTMENT_ID VARCHAR2 (20)
  289. HIRE_DATE DATE
  290. SALARY NUMBER(10)
  291.  
  292. Which UPDATE statement will accomplish your objective?
  293.  
  294. Mark for Review
  295. (1) Points
  296.  
  297. UPDATE employees
  298. SET cooper = 'last_name'
  299. WHERE last_name = 'roper';
  300.  
  301. UPDATE employees last_name = 'cooper'
  302. WHERE last_name = 'roper';
  303.  
  304. UPDATE employees
  305. SET last_name = 'cooper'
  306. WHERE last_name = 'roper'; (*)
  307.  
  308. UPDATE employees
  309. SET last_name = 'roper'
  310. WHERE last_name = 'cooper';
  311.  
  312. 12. To change an existing row in a table, you can use the UPDATE or INSERT statements. True or False? Mark for Review
  313. (1) Points
  314. True
  315. False (*)
  316.  
  317. 13. One of your employees was recently married. Her employee ID is still 189, however, her last name is now Rockefeller. Which SQL statement will allow you to reflect this change? Mark for Review
  318. (1) Points
  319. INSERT INTO my_employees SET last_name = 'Rockefeller' WHERE employee_ID = 189;
  320. INSERT my_employees SET last_name = 'Rockefeller' WHERE employee_ID = 189;
  321. UPDATE INTO my_employees SET last_name = 'Rockefeller' WHERE employee_ID = 189;
  322. UPDATE my_employees SET last_name = 'Rockefeller' WHERE employee_ID = 189; (*)
  323.  
  324. 14. The TEACHERS and CLASS_ASSIGNMENTS tables contain these columns:
  325. TEACHERS:
  326. TEACHER_ID NUMBER(5)
  327. NAME VARCHAR2(25)
  328. SUBJECT_ID NUMBER(5)
  329. HIRE_DATE DATE
  330. SALARY NUMBER(9,2)
  331.  
  332. CLASS_ASSIGNMENTS:
  333. CLASS_ID NUMBER(5)
  334. TEACHER_ID NUMBER(5)
  335. START_DATE DATE
  336. MAX_CAPACITY NUMBER(3)
  337.  
  338. Which scenario would require a subquery to return the desired results?
  339.  
  340. Mark for Review
  341. (1) Points
  342. You need to display the start date for each class taught by a given teacher.
  343. You need to create a report to display the teachers who were hired more than five years ago.
  344. You need to display the names of the teachers who teach classes that start within the next week.
  345. You need to create a report to display the teachers who teach more classes than the average number of classes taught by each teacher. (*)
  346.  
  347. 15. You need to remove a row from the EMPLOYEES table. Which statement would you use? Mark for Review
  348. (1) Points
  349. UPDATE with a WHERE clause
  350. DELETE with a WHERE clause (*)
  351. MERGE with a WHERE clause
  352. INSERT with a WHERE clause
  353.  
  354. 1. A column in a table can be given a default value. This option prevents NULL values from automatically being assigned to the column if a row is inserted without a specified value for the column. True or False ? Mark for Review
  355. (1) Points
  356. True (*)
  357. False
  358.  
  359. 2. Multi-table inserts are used when the same source data should be inserted into _____________ target table. Mark for Review
  360. (1) Points
  361. A data warehouse
  362. A very large
  363. More than one (*)
  364. Ten
  365.  
  366. 3. In developing the Employees table, you create a column called hire_date. You assign the hire_date column a DATE datatype with a DEFAULT value of 0 (zero). A user can come back later and enter the correct hire_date. This is __________. Mark for Review
  367. (1) Points
  368.  
  369. A great idea. When a new employee record is entered, if no hire_date is specified, the 0 (zero) will be automatically specified.
  370.  
  371. A great idea. When new employee records are entered, they can be added faster by allowing the 0's (zeroes) to be automatically specified.
  372.  
  373. Both a and b are correct.
  374. A bad idea. The default value must match the DATE datatype of the column. (*)
  375.  
  376. 4. Aliases can be used with MERGE statements. True or False? Mark for Review
  377. (1) Points
  378. True (*)
  379. False
  380.  
  381. 5. The MERGE statement first tries to update one or more rows in a table that match the criteria; if no row matches the criteria for the update, a new row will automatically be inserted instead. True or False? Mark for Review
  382. (1) Points
  383. True (*)
  384. False
  385.  
  386. 6. Assume all the column names are correct. The following SQL statement will execute which of the following?
  387. INSERT INTO departments
  388. (department_id, department_name, manager_id, location_id)
  389. VALUES (70, 'Public Relations', 100, 1700);
  390.  
  391. Mark for Review
  392. (1) Points
  393. 100 will be inserted into the department_id column.
  394. 1700 will be inserted into the manager_id column.
  395. 'Public Relations' will be inserted into the manager_name column.
  396. 70 will be inserted into the department_id column. (*)
  397.  
  398. 7. To return a table summary on the customers table, which of the following is correct? Mark for Review
  399. (1) Points
  400. DESCRIBE customers, or DESC customers (*)
  401. DISTINCT customers, or DIST customers
  402. SHOW customers, or SEE customers
  403. DEFINE customers, or DEF customers
  404.  
  405. 8. The PRODUCTS table contains these columns:
  406. PRODUCT_ID NUMBER NOT NULL
  407. PRODUCT_NAME VARCHAR2 (25)
  408. SUPPLIER_ID NUMBER NOT NULL
  409. LIST_PRICE NUMBER (7,2)
  410. COST NUMBER (5,2)
  411. QTY_IN_STOCK NUMBER(4)
  412. LAST_ORDER_DT DATE DEFAULT SYSDATE NOT NUL
  413.  
  414. Which INSERT statement will execute successfully?
  415.  
  416. Mark for Review
  417. (1) Points
  418.  
  419. INSERT INTO products
  420. VALUES (2958, 'Cable', 8690, 7.09, 4.04, SYSDATE);
  421.  
  422. INSERT INTO products(product_id, product_name)
  423. VALUES (2958, 'Cable');
  424.  
  425. INSERT INTO products (product_id, product_name, supplier_id, list_price, cost, qty_in_stock)
  426. VALUES(2958, 'Cable', 8690, 7.09, 4.04, 700) (*)
  427.  
  428. INSERT INTO products(product_id, product_name, supplier_id
  429. VALUES (2958, 'Cable', 8690, SYSDATE);
  430.  
  431. 9. 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
  432. (1) Points
  433. It is not possible to implicitly insert a null value in a column.
  434. Use the NULL keyword.
  435. Omit the column in the column list. (*)
  436. Use the ON clause
  437.  
  438. 10. DML is an acronym that stands for: Mark for Review
  439. (1) Points
  440. Debit Markup Language
  441. Data Markup Language
  442. Data Manipulation Language (*)
  443. Don't Manipulate Language
  444.  
  445. 11. Using your knowledge of the employees table, what would be the result of the following statement:
  446. DELETE FROM employees; Mark for Review
  447. (1) Points
  448. Deletes employee number 100.
  449. All rows in the employees table will be deleted if there are no constraints on the table. (*)
  450. Nothing, no data will be changed.
  451. The first row in the employees table will be deleted.
  452.  
  453. 12. Examine the structures of the PLAYERS, MANAGERS, and TEAMS tables:
  454. PLAYERS:
  455. PLAYER_ID NUMBER Primary Key
  456. LAST_NAME VARCHAR2 (30)
  457. FIRST_NAME VARCHAR2 (25)
  458. TEAM_ID NUMBER
  459. MGR_ID NUMBER
  460. SIGNING_BONUS NUMBER(9,2)
  461. SALARY NUMBER(9,2)
  462.  
  463. MANAGERS:
  464. MANAGER_ID NUMBER Primary Key
  465. LAST_NAME VARCHAR2 (20)
  466. FIRST_NAME VARCHAR2 (20)
  467. TEAM_ID NUMBER
  468.  
  469. TEAMS:
  470. TEAM_ID NUMBER Primary Key
  471. TEAM_NAME VARCHAR2 (20)
  472. OWNER_LAST_NAME VARCHAR2 (20)
  473. OWNER_FIRST_NAME VARCHAR2 (20)
  474.  
  475. Which situation would require a subquery to return the desired result?
  476.  
  477. Mark for Review
  478. (1) Points
  479.  
  480. To display the names of each player on the Lions team
  481. To display the maximum and minimum player salary for each team
  482. To display the names of the managers for all the teams owned by a given owner (*)
  483. To display each player, their manager, and their team name for all teams with an id value greater than 5000
  484.  
  485. 13. You need to update the area code of employees that live in Atlanta. Evaluate this partial UPDATE statement:
  486. UPDATE employee
  487. SET area_code = 770
  488.  
  489. Which of the following should you include in your UPDATE statement to achieve the desired results?
  490.  
  491. Mark for Review
  492. (1) Points
  493.  
  494. WHERE city = 'Atlanta'; (*)
  495. UPDATE city = Atlanta;
  496. SET city = 'Atlanta';
  497. LIKE 'At%';
  498.  
  499. 14. One of the sales representatives, Janet Roper, has informed you that she was recently married, and she has requested that you update her name in the employee database. Her new last name is Cooper. Janet is the only person with the last name of Roper that is employed by the company. The EMPLOYEES table contains these columns and all data is stored in lowercase:
  500. EMPLOYEE_ID NUMBER(10) PRIMARY KEY
  501. LAST_NAME VARCHAR2(20)
  502. FIRST_NAME VARCHAR2(20)
  503. DEPARTMENT_ID VARCHAR2 (20)
  504. HIRE_DATE DATE
  505. SALARY NUMBER(10)
  506.  
  507. Which UPDATE statement will accomplish your objective?
  508.  
  509. Mark for Review
  510. (1) Points
  511.  
  512. UPDATE employees last_name = 'cooper'
  513. WHERE last_name = 'roper';
  514.  
  515. UPDATE employees
  516. SET last_name = 'roper'
  517. WHERE last_name = 'cooper';
  518.  
  519. UPDATE employees
  520. SET cooper = 'last_name'
  521. WHERE last_name = 'roper';
  522.  
  523. UPDATE employees
  524. SET last_name = 'cooper'
  525. WHERE last_name = 'roper'; (*)
  526.  
  527. 15. What would happen if you issued a DELETE statement without a WHERE clause? Mark for Review
  528. (1) Points
  529. All the rows in the table would be deleted. (*)
  530. Only one row would be deleted.
  531. No rows would be deleted.
  532.  
  533. Section 13 Quiz
  534. (Answer all questions in this section)
  535.  
  536. 1. To store time with fractions of seconds, which datatype should be used for a table column? Mark for Review
  537. (1) Points
  538. DATE
  539. INTERVAL DAY TO SECOND
  540. INTERVAL YEAR TO MONTH
  541. TIMESTAMP (*)
  542.  
  543. 2. The ELEMENTS column is defined as:
  544. NUMBER(6,4)
  545. How many digits to the right of the decimal point are allowed for the ELEMENTS column?
  546.  
  547. Mark for Review
  548. (1) Points
  549. Four (*)
  550. Zero
  551. Six
  552. Two
  553.  
  554. 3. The TIMESTAMP data type allows what? Mark for Review
  555. (1) Points
  556. Time to be stored as an interval of years and months.
  557. Time to be stored as a date with fractional seconds. (*)
  558. Time to be stored as an interval of days to hours, minutes and seconds.
  559. None of the above.
  560.  
  561. 4. Which data types stores variable-length character data? Select two. Mark for Review
  562. (1) Points
  563. (Choose all correct answers)
  564. NCHAR
  565. CHAR
  566. CLOB (*)
  567. VARCHAR2 (*)
  568.  
  569. 5. INTERVAL DAY TO SECOND stores a period of time in terms of days, hours, minutes, and seconds. True or False? Mark for Review
  570. (1) Points
  571. True (*)
  572. False
  573.  
  574. 6. A column's data type can always be changed from NUMBER to VARCHAR2 but not from VARCHAR2 to NUMBER, provided the table is empty. True or False? Mark for Review
  575. (1) Points
  576. True
  577. False (*)
  578.  
  579. 7. You can use the ALTER TABLE statement to: Mark for Review
  580. (1) Points
  581. Add a new column
  582. Modify an existing column
  583. Drop a column
  584. All of the above (*)
  585.  
  586. 8. Evaluate this statement:
  587. ALTER TABLE inventory
  588. MODIFY backorder_amount NUMBER(8,2);
  589.  
  590. Which task will this statement accomplish?
  591.  
  592. Mark for Review
  593. (1) Points
  594. Alters the definition of the BACKORDER_AMOUNT column to NUMBER(2,8)
  595. Alters the definition of the BACKORDER_AMOUNT column to NUMBER(8.2)
  596. Alters the definition of the BACKORDER_AMOUNT column to NUMBER(8 2)
  597. Changes the definition of the BACKORDER_AMOUNT column to NUMBER(8,2) (*)
  598. Alters the definition of the BACKORDER_AMOUNT column to NUMBER
  599.  
  600. 9. 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
  601. (1) Points
  602. TRUNCATE TABLE
  603. DELETE TABLE
  604. ALTER TABLE
  605. DROP TABLE (*)
  606.  
  607. 10. When you use ALTER TABLE to add a column, the new column: Mark for Review
  608. (1) Points
  609. Becomes the last column in the table (*)
  610. Becomes the first column in the table
  611. Will not be created because you cannot add a column after the table is created
  612. Can be placed by adding a GROUP BY clause
  613.  
  614. 11. It is possible to create a table by using the CREATE TABLE command in conjunction with a subquery. True or False? Mark for Review
  615. (1) Points
  616. True (*)
  617. False
  618.  
  619. 12. I have a table named School_Friends in my schema. You want to build a table in your schema named School_Friends. This is ______________, because ____________________________________. Mark for Review
  620. (1) Points
  621.  
  622. possible; our data will merge into one table, and we can more easily access our mutual friends information.
  623.  
  624. possible; my schema is separate from yours, and it is okay for us to have like-named tables in our separate schemas. (*)
  625.  
  626. impossible; no matter what, there can never be two tables with the same name, even if they are in separate schemas.
  627.  
  628. impossible; School_Friends is a reserved term in SQL.
  629.  
  630. 13. Which statement about table and column names is true? Mark for Review
  631. (1) Points
  632. Table and column names cannot include special characters.
  633. Table and column names can begin with a letter or a number.
  634. Table and column names must begin with a letter. (*)
  635. If any character other than letters or numbers is used in a table or column name, the name must be enclosed in double quotation marks.
  636.  
  637. 14. You are creating the EMPLOYEES table. This table should contain the COMMISSION_PCT column and use a value of 10 percent if no commission value is provided when a record is inserted. Which line should you include in the CREATE TABLE statement to accomplish this task? Mark for Review
  638. (1) Points
  639. commission_pct NUMBER(4,2) IS DEFAULT 0.10
  640. commission_pct NUMBER(4,2) DEFAULT 0.10 (*)
  641. commission_pct NUMBER(4,2) (DEFAULT, 0.10)
  642. commission_pct NUMBER(4,2) DEFAULT = 0.10
  643.  
  644. 15. Evaluate this CREATE TABLE statement:
  645. 1. CREATE TABLE customer#1 (
  646. 2. cust_1 NUMBER(9),
  647. 3. sales$ NUMBER(9),
  648. 4. 2date DATE DEFAULT SYSDATE);
  649.  
  650. Which line of this statement will cause an error?
  651.  
  652. Mark for Review
  653. (1) Points
  654. 3
  655. 1
  656. 4 (*)
  657. 2
  658.  
  659. 1. The TIMESTAMP data type allows what? Mark for Review
  660. (1) Points
  661. Time to be stored as an interval of years and months.
  662. Time to be stored as a date with fractional seconds. (*)
  663. Time to be stored as an interval of days to hours, minutes and seconds.
  664. None of the above.
  665.  
  666. 2. Which statement about data types is true? Mark for Review
  667. (1) Points
  668. The TIMESTAMP data type is a character data type.
  669. The VARCHAR2 data type should be used for fixed-length character data.
  670. The BFILE data type stores character data up to four gigabytes in the database.
  671. The CHAR data type should be defined with a size that is not too large for the data it contains (or could contain) to save space in the database. (*)
  672.  
  673. 3. INTERVAL DAY TO SECOND stores a period of time in terms of days, hours, minutes, and seconds. True or False? Mark for Review
  674. (1) Points
  675. True (*)
  676. False
  677.  
  678. 4. You are designing a table for the Human Resources department. This table must include a column that contains each employee's hire date. Which data type should you specify for this column? Mark for Review
  679. (1) Points
  680. CHAR
  681. DATE (*)
  682. INTERVAL YEAR TO MONTH
  683. TIMESTAMP
  684.  
  685. 5. To store large amounts of text you should simply create a series of VARCHAR2 columns in a table. True or False? Mark for Review
  686. (1) Points
  687. True
  688. False (*)
  689.  
  690. 6. Which SQL statement below will correctly create the EMP table based on the structure of the EMPLOYEES table? Include only the EMPLOYEE_ID, FIRST_NAME, LAST_NAME, SALARY, and DEPARTMENT_ID columns. Mark for Review
  691. (1) Points
  692.  
  693. CREATE TABLE employee
  694. AS SELECT employee_id, first_name, last_name, salary, department_id
  695. FROM employees;
  696.  
  697. CREATE TABLE emp
  698. AS SELECT employee_id, first_name, last_name, salary, department_id
  699. FROM employees;
  700. (*)
  701.  
  702. CREATE TABLE emp (employee_id, first_name, last_name, salary, department_id);
  703.  
  704. CREATE TABLE emp
  705. SELECT (employee_id, first_name, last_name, salary, department_id FROM employees);
  706.  
  707. 7. Which CREATE TABLE statement will fail? Mark for Review
  708. (1) Points
  709. CREATE TABLE time_date (time NUMBER(9));
  710. CREATE TABLE date_1 (date_1 DATE);
  711. CREATE TABLE date (date_id NUMBER(9)); (*)
  712. CREATE TABLE time (time_id NUMBER(9));
  713.  
  714. 8. I have a table named School_Friends in my schema. You want to build a table in your schema named School_Friends. This is ______________, because ____________________________________. Mark for Review
  715. (1) Points
  716.  
  717. possible; my schema is separate from yours, and it is okay for us to have like-named tables in our separate schemas. (*)
  718.  
  719. possible; our data will merge into one table, and we can more easily access our mutual friends information.
  720.  
  721. impossible; no matter what, there can never be two tables with the same name, even if they are in separate schemas.
  722.  
  723. impossible; School_Friends is a reserved term in SQL.
  724.  
  725. 9. Which statement about table and column names is true? Mark for Review
  726. (1) Points
  727. Table and column names must begin with a letter. (*)
  728. Table and column names can begin with a letter or a number.
  729. If any character other than letters or numbers is used in a table or column name, the name must be enclosed in double quotation marks.
  730. Table and column names cannot include special characters.
  731.  
  732. 10. CREATE TABLE student_table
  733. (id NUMBER(6),
  734. lname VARCHAR(20),
  735. fname VARCHAR(20),
  736. lunch_num NUMBER(4));
  737. Which of the following statements best describes the above SQL statement:
  738.  
  739. Mark for Review
  740. (1) Points
  741. Creates a table named student_table with four columns: id, lname, fname, lunch_num (*)
  742. Creates a table named student_table with four columns: lname, fname, lunch, num
  743. Creates a table named student with four columns: id, lname, fname, lunch_num
  744. Creates a table named student_table with four columns: lname, fname, lunch, num
  745.  
  746. 11. A column's data type can always be changed from NUMBER to VARCHAR2 but not from VARCHAR2 to NUMBER, provided the table is empty. True or False? Mark for Review
  747. (1) Points
  748. True
  749. False (*)
  750.  
  751. 12. You want to issue the following command on a database that includes your company's inventory information:
  752. ALTER TABLE products SET UNUSED COLUMN color;
  753. What will be the result of issuing this command?
  754.  
  755. Mark for Review
  756. (1) Points
  757. The column named COLOR in the table named PRODUCTS will be created.
  758. The column named COLOR in the table named PRODUCTS will be assigned default values.
  759. The column named COLOR in the table named PRODUCTS will be deleted.
  760. The column named COLOR in the table named PRODUCTS will not be returned in subsequent reads of the table by Oracle, as it has been deleted logically. (*)
  761.  
  762. 13. The previous administrator created a table named CONTACTS, which contains outdated data. You want to remove the table and its data from the database. Which statement should you issue? Mark for Review
  763. (1) Points
  764. ALTER TABLE
  765. DROP TABLE (*)
  766. DELETE
  767. TRUNCATE TABLE
  768.  
  769. 14. The FLASHBACK QUERY statement can restore data back to a point in time before the last COMMIT. True or False? Mark for Review
  770. (1) Points
  771. True
  772. False (*)
  773.  
  774. 15. Evaluate this statement:
  775. Which statement about this TRUNCATE TABLE statement is true? Mark for Review
  776. (1) Points
  777. You can produce the same results by issuing the 'DROP TABLE employee' statement.
  778. You can issue this statement to retain the structure of the employees table. (*)
  779. You can reverse this statement by issuing the ROLLBACK statement.
  780. You can produce the same results by issuing the 'DELETE employees' statement.
  781.  
  782. 1. You need to change the name of the EMPLOYEES table to the EMP table. Which statement should you use? Mark for Review
  783. (1) Points
  784. ALTER TABLE employees RENAME TO emp;
  785. RENAME employees emp;
  786. RENAME employees TO emp; (*)
  787. ALTER TABLE employees TO emp;
  788.  
  789. 2. You can use the ALTER TABLE statement to: Mark for Review
  790. (1) Points
  791. Add a new column
  792. Modify an existing column
  793. Drop a column
  794. All of the above (*)
  795.  
  796. 3. The TEAMS table contains these columns:
  797. TEAM_ID NUMBER(4) Primary Key
  798. TEAM_NAME VARCHAR2(20)
  799. MGR_ID NUMBER(9)
  800.  
  801. The TEAMS table is currently empty. You need to allow users to include text characters in the manager identification values. Which statement should you use to implement this?
  802.  
  803. Mark for Review
  804. (1) Points
  805.  
  806. ALTER teams TABLE
  807. MODIFY COLUMN (mgr_id VARCHAR2(15));
  808.  
  809. ALTER TABLE teams
  810. REPLACE (mgr_id VARCHAR2(15));
  811.  
  812. ALTER teams
  813. MODIFY (mgr_id VARCHAR2(15));
  814.  
  815. ALTER TABLE teams
  816. MODIFY (mgr_id VARCHAR2(15));
  817. (*)
  818.  
  819. You CANNOT modify the data type of the MGR_ID column.
  820.  
  821. 4. Evaluate the structure of the EMPLOYEE table:
  822. EMPLOYEE_ID NUMBER(9)
  823. LAST_NAME VARCHAR2(25)
  824. FIRST_NAME VARCHAR2(25)
  825. DEPARTMENT_ID NUMBER(9)
  826. MANAGER_ID NUMBER(9)
  827. SALARY NUMBER(7,2)
  828.  
  829. Which statement should you use to increase the LAST_NAME column length to 35 if the column currently contains 200 records?
  830.  
  831. Mark for Review
  832. (1) Points
  833.  
  834. ALTER TABLE employee
  835. RENAME last_name VARCHAR2(35);
  836.  
  837. ALTER employee TABLE
  838. ALTER COLUMN (last_name VARCHAR2(35));
  839.  
  840. ALTER TABLE employee
  841. MODIFY (last_name VARCHAR2(35));
  842. (*)
  843. You CANNOT increase the width of the LAST_NAME column.
  844.  
  845. 5. Which statement about a column is NOT true? Mark for Review
  846. (1) Points
  847. You can convert a DATE data type column to a VARCHAR2 column.
  848. You can increase the width of a CHAR column.
  849. You can modify the data type of a column if the column contains non-null data. (*)
  850. You can convert a CHAR data type column to the VARCHAR2 data type.
  851.  
  852. 6. Once they are created, external tables are accessed with normal SQL statements. (True or False?) Mark for Review
  853. (1) Points
  854. True (*)
  855. False
  856.  
  857. 7. Evaluate this CREATE TABLE statement:
  858. 1. CREATE TABLE customer#1 (
  859. 2. cust_1 NUMBER(9),
  860. 3. sales$ NUMBER(9),
  861. 4. 2date DATE DEFAULT SYSDATE);
  862.  
  863. Which line of this statement will cause an error?
  864.  
  865. Mark for Review
  866. (1) Points
  867. 4 (*)
  868. 1
  869. 3
  870. 2
  871.  
  872. 8. Which column name is valid? Mark for Review
  873. (1) Points
  874. NUMBER
  875. 1NUMBER
  876. NUMBER_1$ (*)
  877. 1_NUMBER#
  878.  
  879. 9. I have a table named School_Friends in my schema. You want to build a table in your schema named School_Friends. This is ______________, because ____________________________________. Mark for Review
  880. (1) Points
  881. impossible; School_Friends is a reserved term in SQL.
  882.  
  883. impossible; no matter what, there can never be two tables with the same name, even if they are in separate schemas.
  884.  
  885. possible; my schema is separate from yours, and it is okay for us to have like-named tables in our separate schemas. (*)
  886.  
  887. possible; our data will merge into one table, and we can more easily access our mutual friends information.
  888.  
  889. 10. DCL, which is the acronym for Data Control Language, allows: Mark for Review
  890. (1) Points
  891. The ALTER command to be used.
  892. The TRUNCATE command to be used.
  893. A Database Administrator the ability to grant privileges to users. (*)
  894. The CONROL TRANSACTION statement can be used.
  895.  
  896. 11. The TIMESTAMP data type allows what? Mark for Review
  897. (1) Points
  898. Time to be stored as an interval of years and months.
  899. Time to be stored as a date with fractional seconds. (*)
  900. Time to be stored as an interval of days to hours, minutes and seconds.
  901. None of the above.
  902.  
  903. 12. A column that will be used to store binary data up to 4 Gigabytes in size should be defined as which datatype? Mark for Review
  904. (1) Points
  905. LONGRAW
  906. LONG
  907. NUMBER
  908. BLOB (*)
  909.  
  910. 13. Which of the following are valid Oracle datatypes? Mark for Review
  911. (1) Points
  912. TIMESTAMP, LOB, VARCHAR2, NUMBER
  913. DATE, BLOB, LOB, VARCHAR2
  914. DATE, TIMESTAMP WITH LOCAL TIME ZONE, BLOB (*)
  915. SYSDATE, TIMESTAMP, DATE, LOCAL TIME ZONE
  916. 14. Which statement about data types is true? Mark for Review
  917. (1) Points
  918.  
  919. The CHAR data type should be defined with a size that is not too large for the data it contains (or could contain) to save space in the database. (*)
  920.  
  921. The BFILE data type stores character data up to four gigabytes in the database.
  922.  
  923. The VARCHAR2 data type should be used for fixed-length character data.
  924.  
  925. The TIMESTAMP data type is a character data type.
  926.  
  927. 15. Which data types stores variable-length character data? Select two. Mark for Review
  928. (1) Points
  929.  
  930. (Choose all correct answers)
  931.  
  932. NCHAR
  933. VARCHAR2 (*)
  934. CLOB (*)
  935. CHAR
  936.  
  937. 1. INTERVAL DAY TO SECOND stores a period of time in terms of days, hours, minutes, and seconds. True or False? Mark for Review
  938. (1) Points
  939. True (*)
  940. False
  941.  
  942. 2. You are designing a table for the Human Resources department. This table must include a column that contains each employee's hire date. Which data type should you specify for this column? Mark for Review
  943. (1) Points
  944. TIMESTAMP
  945. INTERVAL YEAR TO MONTH
  946. CHAR
  947. DATE (*)
  948.  
  949. 3. To store large amounts of text you should simply create a series of VARCHAR2 columns in a table. True or False? Mark for Review
  950. (1) Points
  951. True
  952. False (*)
  953.  
  954. 4. A column that will be used to store binary data up to 4 Gigabytes in size should be defined as which datatype? Mark for Review
  955. (1) Points
  956. NUMBER
  957. LONGRAW
  958. BLOB (*)
  959. LONG
  960.  
  961. 5. Evaluate this CREATE TABLE statement:
  962. CREATE TABLE sales
  963. ( sales_id NUMBER(9),
  964. customer_id NUMBER(9),
  965. employee_id NUMBER(9),
  966. description VARCHAR2(30),
  967. sale_date TIMESTAMP WITH LOCAL TIME ZONE DEFAULT SYSDATE,
  968. sale_amount NUMBER(7,2));
  969.  
  970. Which business requirement will this statement accomplish?
  971.  
  972. Mark for Review
  973. (1) Points
  974. Description values can range from 0 to 30 characters so the column should be fixed in length.
  975.  
  976. All employee identification values are only 6 digits so the column should be variable in length.
  977.  
  978. Sales identification values could be either numbers or characters, or a combination of both.
  979.  
  980. Today's date should be used if no value is provided for the sale date. (*)
  981.  
  982. 6. Examine the structure of the DONATIONS table.
  983. DONATIONS:
  984. PLEDGE_ID NUMBER
  985. DONOR_ID NUMBER
  986. PLEDGE_DT DATE
  987. AMOUNT_PLEDGED NUMBER (7,2)
  988. AMOUNT_PAID NUMBER (7,2)
  989. PAYMENT_DT DATE
  990.  
  991. You need to reduce the precision of the AMOUNT_PLEDGED column to 5 with a scale of 2 and ensure that when inserting a row into the DONATIONS table without a value for the AMOUNT_PLEDGED column, a price of $10.00 will automatically be inserted. The DONATIONS table currently contains NO records. Which statement is true?
  992.  
  993. Mark for Review
  994. (1) Points
  995. You must use the ADD OR REPLACE option to achieve these results.
  996. You must drop and recreate the DONATIONS table to achieve these results.
  997. Both changes can be accomplished with one ALTER TABLE statement. (*)
  998. You CANNOT decrease the width of the AMOUNT_PLEDGED column.
  999.  
  1000. 7. Which command could you use to quickly remove all data from the rows in a table without deleting the table itself? Mark for Review
  1001. (1) Points
  1002. MODIFY
  1003. ALTER TABLE
  1004. DROP TABLE
  1005. TRUNCATE TABLE (*)
  1006.  
  1007. 8. You need to remove all the rows from the SALES_HIST table. You want to release the storage space, but do not want to remove the table structure. Which statement should you use? Mark for Review
  1008. (1) Points
  1009. The TRUNCATE TABLE statement (*)
  1010. The ALTER TABLE statement
  1011. The DROP TABLE statement
  1012. The DELETE statement
  1013.  
  1014. 9. The FLASHBACK QUERY statement can restore data back to a point in time before the last COMMIT. True or False? Mark for Review
  1015. (1) Points
  1016. True
  1017. False (*)
  1018.  
  1019. 10. 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
  1020. (1) Points
  1021. TRUNCATE TABLE
  1022. DELETE TABLE
  1023. ALTER TABLE
  1024. DROP TABLE (*)
  1025.  
  1026. 11. Evaluate this CREATE TABLE statement:
  1027. CREATE TABLE line_item ( line_item_id NUMBER(9), order_id NUMBER(9), product_id NUMBER(9));
  1028.  
  1029. You are a member of the SYSDBA role, but are logged in under your own schema. You issue this CREATE TABLE statement. Which statement is true?
  1030.  
  1031. Mark for Review
  1032. (1) Points
  1033. You created the table in the SYSDBA schema.
  1034. You created the LINE_ITEM table in the SYS schema.
  1035. You created the LINE_ITEM table in the public schema.
  1036. You created the table in your schema. (*)
  1037.  
  1038. 12. CREATE TABLE bioclass
  1039. (hire_date DATE DEFAULT SYSDATE,
  1040. first_name varchar2(15),
  1041. last_name varchar2(15));
  1042. The above CREATE TABLE statement is acceptable, and will create a Table named bioclass that contains a hire_date, first_name, and last_name column. True or False?
  1043.  
  1044. Mark for Review
  1045. (1) Points
  1046. True (*)
  1047. False
  1048.  
  1049. 13. I have a table named School_Friends in my schema. You want to build a table in your schema named School_Friends. This is ______________, because ____________________________________. Mark for Review
  1050. (1) Points
  1051.  
  1052. possible; my schema is separate from yours, and it is okay for us to have like-named tables in our separate schemas. (*)
  1053.  
  1054. impossible; no matter what, there can never be two tables with the same name, even if they are in separate schemas.
  1055.  
  1056. possible; our data will merge into one table, and we can more easily access our mutual friends information.
  1057.  
  1058. impossible; School_Friends is a reserved term in SQL.
  1059.  
  1060. 14. Given this employee table:
  1061. (employee_id NUMBER(10) NOT NULL,
  1062. first_name VARCHAR2(25) NOT NULL,
  1063. last_name VARCHAR2(30) NOT NULL,
  1064. hire_date DATE DEFAULT sysdate)
  1065.  
  1066. What will be the result in the hire_date column following this insert statement:
  1067.  
  1068. INSERT INTO employees VALUES (10, 'Natacha', 'Hansen', DEFAULT);
  1069.  
  1070. Mark for Review
  1071. (1) Points
  1072.  
  1073. Statement will fail, as you must list the columns into which you are inserting.
  1074. The column for hire_date will be null.
  1075.  
  1076. Statement will work and the hire_date column will have the value of the date when the statement was run. (*)
  1077.  
  1078. The character string SYSDATE.
  1079.  
  1080. 15. Once they are created, external tables are accessed with normal SQL statements. (True or False?) Mark for Review
  1081. (1) Points
  1082. True (*)
  1083. False
  1084.  
  1085. 1. It is possible to create a table by using the CREATE TABLE command in conjunction with a subquery. True or False? Mark for Review
  1086. (1) Points
  1087. True (*)
  1088. False
  1089.  
  1090. 2. You want to create a database table that will contain information regarding products that your company released during 2001. Which name can you assign to the table that you create? Mark for Review
  1091. (1) Points
  1092. 2001_PRODUCTS
  1093. PRODUCTS_(2001)
  1094. PRODUCTS_2001 (*)
  1095. PRODUCTS--2001
  1096.  
  1097. 3. You want to create a table named TRAVEL that is a child of the EMPLOYEES table. Which of the following statements should you issue? Mark for Review
  1098. (1) Points
  1099.  
  1100. CREATE TABLE travel
  1101. (destination_id primary key, departure_date date, return_date date, emp_id REFERENCES employees (emp_id));
  1102.  
  1103. CREATE TABLE travel
  1104. (destination_id number primary key, departure_date date, return_date date, t.emp_id = e.emp_id);
  1105.  
  1106. CREATE TABLE travel
  1107. (destination_id number primary key, departure_date date, return_date date, JOIN emp_id number(10) ON employees (emp_id));
  1108.  
  1109. CREATE TABLE travel
  1110. (destination_id number primary key, departure_date date, return_date date, emp_id number(10) REFERENCES employees (emp_id));
  1111. (*)
  1112.  
  1113. 4. Which statement about table and column names is true? Mark for Review
  1114. (1) Points
  1115.  
  1116. If any character other than letters or numbers is used in a table or column name, the name must be enclosed in double quotation marks.
  1117.  
  1118. Table and column names can begin with a letter or a number.
  1119. Table and column names cannot include special characters.
  1120. Table and column names must begin with a letter. (*)
  1121.  
  1122. 5. DCL, which is the acronym for Data Control Language, allows: Mark for Review
  1123. (1) Points
  1124. The ALTER command to be used.
  1125. The TRUNCATE command to be used.
  1126. A Database Administrator the ability to grant privileges to users. (*)
  1127. The CONROL TRANSACTION statement can be used.
  1128.  
  1129. 6. Evaluate this CREATE TABLE statement:
  1130. CREATE TABLE sales
  1131. (sales_id NUMBER,
  1132. customer_id NUMBER,
  1133. employee_id NUMBER,
  1134. sale_date TIMESTAMP WITH TIME ZONE,
  1135. sale_amount NUMBER(7,2));
  1136.  
  1137. Which statement about the SALE_DATE column is true?
  1138.  
  1139. Mark for Review
  1140. (1) Points
  1141. Data will be stored using a fractional seconds precision of 5.
  1142. Data will be normalized to the client time zone.
  1143. Data stored will not include seconds.
  1144. Data stored in the column will be returned in the database's local time zone. (*)
  1145.  
  1146. 7. A table has a column: RESPONSE_TIME. This is used to store the difference between the time the problem was reported and the time the problem was resolved. Data in the RESPONSE_TIME column needs to be stored in days, hours, minutes and seconds. Which data type should you use? Mark for Review
  1147. (1) Points
  1148. DATETIME
  1149. INTERVAL YEAR TO MONTH
  1150. TIMESTAMP
  1151. INTERVAL DAY TO SECOND (*)
  1152.  
  1153. 8. You are designing a table for the Sales department. You need to include a column that contains each sales total. Which data type should you specify for this column? Mark for Review
  1154. (1) Points
  1155. NUMBER (*)
  1156. VARCHAR2
  1157. DATE
  1158. CHAR
  1159.  
  1160. 9. To store time with fractions of seconds, which datatype should be used for a table column? Mark for Review
  1161. (1) Points
  1162. DATE
  1163. INTERVAL YEAR TO MONTH
  1164. TIMESTAMP (*)
  1165. INTERVAL DAY TO SECOND
  1166.  
  1167. 10. Evaluate this CREATE TABLE statement:
  1168. CREATE TABLE sales
  1169. ( sales_id NUMBER(9),
  1170. customer_id NUMBER(9),
  1171. employee_id NUMBER(9),
  1172. description VARCHAR2(30),
  1173. sale_date TIMESTAMP WITH LOCAL TIME ZONE DEFAULT SYSDATE,
  1174. sale_amount NUMBER(7,2));
  1175.  
  1176. Which business requirement will this statement accomplish?
  1177.  
  1178. Mark for Review
  1179. (1) Points
  1180. Description values can range from 0 to 30 characters so the column should be fixed in length.
  1181.  
  1182. All employee identification values are only 6 digits so the column should be variable in length.
  1183.  
  1184. Sales identification values could be either numbers or characters, or a combination of both.
  1185.  
  1186. Today's date should be used if no value is provided for the sale date. (*)
  1187.  
  1188. 11. RENAME old_name to new_name can be used to: Mark for Review
  1189. (1) Points
  1190. Rename a row.
  1191. Rename a column.
  1192. Rename a table. (*)
  1193. All of the above.
  1194.  
  1195. 12. The data type of a column can never be changed once it has been created. True or False? Mark for Review
  1196. (1) Points
  1197. True
  1198. False (*)
  1199.  
  1200. 13. When you use ALTER TABLE to add a column, the new column: Mark for Review
  1201. (1) Points
  1202. Can be placed by adding a GROUP BY clause
  1203. Will not be created because you cannot add a column after the table is created
  1204. Becomes the first column in the table
  1205. Becomes the last column in the table (*)
  1206.  
  1207. 14. You want to issue the following command on a database that includes your company's inventory information:
  1208. ALTER TABLE products SET UNUSED COLUMN color;
  1209. What will be the result of issuing this command?
  1210.  
  1211. Mark for Review
  1212. (1) Points
  1213. The column named COLOR in the table named PRODUCTS will be deleted.
  1214.  
  1215. The column named COLOR in the table named PRODUCTS will not be returned in subsequent reads of the table by Oracle, as it has been deleted logically. (*)
  1216.  
  1217. The column named COLOR in the table named PRODUCTS will be created.
  1218.  
  1219. The column named COLOR in the table named PRODUCTS will be assigned default values.
  1220.  
  1221. 15. The TEAMS table contains these columns:
  1222. TEAM_ID NUMBER(4) Primary Key
  1223. TEAM_NAME VARCHAR2(20)
  1224. MGR_ID NUMBER(9)
  1225.  
  1226. The TEAMS table is currently empty. You need to allow users to include text characters in the manager identification values. Which statement should you use to implement this?
  1227.  
  1228. Mark for Review
  1229. (1) Points
  1230.  
  1231. ALTER TABLE teams
  1232. MODIFY (mgr_id VARCHAR2(15));
  1233. (*)
  1234.  
  1235. ALTER TABLE teams
  1236. REPLACE (mgr_id VARCHAR2(15));
  1237.  
  1238. You CANNOT modify the data type of the MGR_ID column.
  1239.  
  1240. ALTER teams
  1241. MODIFY (mgr_id VARCHAR2(15));
  1242.  
  1243. ALTER teams TABLE
  1244. MODIFY COLUMN (mgr_id VARCHAR2(15));
  1245.  
  1246. 1. You can use the ALTER TABLE statement to: Mark for Review
  1247. (1) Points
  1248. Add a new column
  1249. Modify an existing column
  1250. Drop a column
  1251. All of the above (*)
  1252.  
  1253. 2. When should you use the SET UNUSED command? Mark for Review
  1254. (1) Points
  1255.  
  1256. You should only use this command if you want the column to still be visible when you DESCRIBE the table.
  1257. You should use it if you think the column may be needed again later.
  1258.  
  1259. You should use it when you need a quick way of dropping a column. (*)
  1260.  
  1261. Never, there is no SET UNUSED command.
  1262.  
  1263. 3. Which command could you use to quickly remove all data from the rows in a table without deleting the table itself? Mark for Review
  1264. (1) Points
  1265. ALTER TABLE
  1266. DROP TABLE
  1267. TRUNCATE TABLE (*)
  1268. MODIFY
  1269.  
  1270. 4. Comments on tables and columns can be stored for documentation by: Mark for Review
  1271. (1) Points
  1272. Using the ALTER TABLE CREATE COMMENT syntax
  1273. Embedding /* comment */ within the definition of the table.
  1274. Using an UPDATE statement on the USER_COMMENTS table
  1275. Using the COMMENT ON TABLE or COMMENT on COLUMN (*)
  1276.  
  1277. 5. Evaluate this statement:
  1278. ALTER TABLE employees SET UNUSED (fax);
  1279. Which task will this statement accomplish?
  1280.  
  1281. Mark for Review
  1282. (1) Points
  1283. Deletes the FAX column
  1284. Frees the disk space used by the data in the FAX column
  1285. Prevents a new FAX column from being added to the EMPLOYEES table
  1286. Prevents data in the FAX column from being displayed, by performing a logical drop of the column (*)
  1287.  
  1288. 6. Examine this CREATE TABLE statement:
  1289. CREATE TABLE emp_load
  1290. (employee_number CHAR(5),
  1291. employee_dob CHAR(20),
  1292. employee_last_name CHAR(20),
  1293. employee_first_name CHAR(15),
  1294. employee_middle_name CHAR(15),
  1295. employee_hire_date DATE)
  1296. ORGANIZATION EXTERNAL
  1297. (TYPE ORACLE_LOADER
  1298. DEFAULT DIRECTORY def_dir1
  1299. ACCESS PARAMETERS
  1300. (RECORDS DELIMITED BY NEWLINE
  1301. FIELDS (employee_number CHAR(2),
  1302. employee_dob CHAR(20),
  1303. employee_last_name CHAR(18),
  1304. employee_first_name CHAR(11),
  1305. employee_middle_name CHAR(11),
  1306. employee_hire_date CHAR(10) date_format DATE mask "mm/dd/yyyy"))
  1307. LOCATION ('info.dat'));
  1308.  
  1309. What kind of table is created here?
  1310.  
  1311. Mark for Review
  1312. (1) Points
  1313. An external table with the data stored in a file outside the database. (*)
  1314. A View.
  1315. An external table with the data stored in a file inside the database.
  1316. None. This is in invalid statement.
  1317.  
  1318. 7. Which SQL statement below will correctly create the EMP table based on the structure of the EMPLOYEES table? Include only the EMPLOYEE_ID, FIRST_NAME, LAST_NAME, SALARY, and DEPARTMENT_ID columns. Mark for Review
  1319. (1) Points
  1320.  
  1321. CREATE TABLE emp
  1322. AS SELECT employee_id, first_name, last_name, salary, department_id
  1323. FROM employees;
  1324. (*)
  1325.  
  1326. CREATE TABLE emp (employee_id, first_name, last_name, salary, department_id);
  1327.  
  1328. CREATE TABLE employee
  1329. AS SELECT employee_id, first_name, last_name, salary, department_id
  1330. FROM employees;
  1331.  
  1332. CREATE TABLE emp
  1333. SELECT (employee_id, first_name, last_name, salary, department_id FROM employees);
  1334.  
  1335. 8. I have a table named School_Friends in my schema. You want to build a table in your schema named School_Friends. This is ______________, because ____________________________________. Mark for Review
  1336. (1) Points
  1337.  
  1338. possible; our data will merge into one table, and we can more easily access our mutual friends information.
  1339.  
  1340. impossible; School_Friends is a reserved term in SQL.
  1341.  
  1342. possible; my schema is separate from yours, and it is okay for us to have like-named tables in our separate schemas. (*)
  1343.  
  1344. impossible; no matter what, there can never be two tables with the same name, even if they are in separate schemas.
  1345.  
  1346. 9. When creating a new table, which of the following naming rules apply. (Choose three) Mark for Review
  1347. (1) Points
  1348. (Choose all correct answers)
  1349.  
  1350. Can have the same name as another object owned by the same user
  1351. Must begin with a letter (*)
  1352. Must contain ONLY A - Z, a - z, 0 - 9, _ (underscore), $, and # (*)
  1353. Must be between 1 to 30 characters long (*)
  1354. Must be an Oracle reserved word
  1355.  
  1356. 10. Which CREATE TABLE statement will fail? Mark for Review
  1357. (1) Points
  1358. CREATE TABLE time_date (time NUMBER(9));
  1359. CREATE TABLE time (time_id NUMBER(9));
  1360. CREATE TABLE date_1 (date_1 DATE);
  1361. CREATE TABLE date (date_id NUMBER(9)); (*)
  1362.  
  1363. 11. INTERVAL DAY TO SECOND stores a period of time in terms of days, hours, minutes, and seconds. True or False? Mark for Review
  1364. (1) Points
  1365. True (*)
  1366. False
  1367.  
  1368. 12. Which of the following are valid Oracle datatypes? Mark for Review
  1369. (1) Points
  1370. DATE, BLOB, LOB, VARCHAR2
  1371. TIMESTAMP, LOB, VARCHAR2, NUMBER
  1372. DATE, TIMESTAMP WITH LOCAL TIME ZONE, BLOB (*)
  1373. SYSDATE, TIMESTAMP, DATE, LOCAL TIME ZONE
  1374.  
  1375. 13. A table has a column: RESPONSE_TIME. This is used to store the difference between the time the problem was reported and the time the problem was resolved. Data in the RESPONSE_TIME column needs to be stored in days, hours, minutes and seconds. Which data type should you use? Mark for Review
  1376. (1) Points
  1377. TIMESTAMP
  1378. INTERVAL YEAR TO MONTH
  1379. DATETIME
  1380. INTERVAL DAY TO SECOND (*)
  1381.  
  1382. 14. You are designing a table for the Sales department. You need to include a column that contains each sales total. Which data type should you specify for this column? Mark for Review
  1383. (1) Points
  1384. CHAR
  1385. NUMBER (*)
  1386. DATE
  1387. VARCHAR2
  1388.  
  1389. 15. Which data types stores variable-length character data? Select two. Mark for Review
  1390. (1) Points
  1391. (Choose all correct answers)
  1392. NCHAR
  1393. CLOB (*)
  1394. CHAR
  1395. VARCHAR2 (*)
  1396.  
  1397. 1. You need to store the SEASONAL data in months and years. Which data type should you use? Mark for Review
  1398. (1) Points
  1399. INTERVAL YEAR TO MONTH (*)
  1400. TIMESTAMP
  1401. INTERVAL DAY TO SECOND
  1402. DATE
  1403.  
  1404. 2. Evaluate this CREATE TABLE statement:
  1405. CREATE TABLE sales
  1406. ( sales_id NUMBER(9),
  1407. customer_id NUMBER(9),
  1408. employee_id NUMBER(9),
  1409. description VARCHAR2(30),
  1410. sale_date TIMESTAMP WITH LOCAL TIME ZONE DEFAULT SYSDATE,
  1411. sale_amount NUMBER(7,2));
  1412.  
  1413. Which business requirement will this statement accomplish?
  1414.  
  1415. Mark for Review
  1416. (1) Points
  1417. Today's date should be used if no value is provided for the sale date. (*)
  1418. Sales identification values could be either numbers or characters, or a combination of both.
  1419. All employee identification values are only 6 digits so the column should be variable in length.
  1420. Description values can range from 0 to 30 characters so the column should be fixed in length.
  1421.  
  1422. 3. The TIMESTAMP data type allows what? Mark for Review
  1423. (1) Points
  1424. Time to be stored as an interval of years and months.
  1425. Time to be stored as a date with fractional seconds. (*)
  1426. Time to be stored as an interval of days to hours, minutes and seconds.
  1427. None of the above.
  1428.  
  1429. 4. Which statement about data types is true? Mark for Review
  1430. (1) Points
  1431. The VARCHAR2 data type should be used for fixed-length character data.
  1432. The CHAR data type should be defined with a size that is not too large for the data it contains (or could contain) to save space in the database. (*)
  1433. The TIMESTAMP data type is a character data type.
  1434. The BFILE data type stores character data up to four gigabytes in the database.
  1435.  
  1436. 5. You are designing a table for the Sales department. You need to include a column that contains each sales total. Which data type should you specify for this column? Mark for Review
  1437. (1) Points
  1438. CHAR
  1439. DATE
  1440. NUMBER (*)
  1441. VARCHAR2
  1442.  
  1443. 6. The TEAMS table contains these columns:
  1444. TEAM_ID NUMBER(4) Primary Key
  1445. TEAM_NAME VARCHAR2(20)
  1446. MGR_ID NUMBER(9)
  1447.  
  1448. The TEAMS table is currently empty. You need to allow users to include text characters in the manager identification values. Which statement should you use to implement this?
  1449.  
  1450. Mark for Review
  1451. (1) Points
  1452.  
  1453. ALTER TABLE teams
  1454. REPLACE (mgr_id VARCHAR2(15));
  1455.  
  1456. ALTER teams TABLE
  1457. MODIFY COLUMN (mgr_id VARCHAR2(15));
  1458.  
  1459. ALTER TABLE teams
  1460. MODIFY (mgr_id VARCHAR2(15));
  1461. (*)
  1462.  
  1463. You CANNOT modify the data type of the MGR_ID column.
  1464.  
  1465. ALTER teams
  1466. MODIFY (mgr_id VARCHAR2(15));
  1467.  
  1468. 7. Evaluate this statement:
  1469. ALTER TABLE inventory
  1470. MODIFY backorder_amount NUMBER(8,2);
  1471.  
  1472. Which task will this statement accomplish?
  1473.  
  1474. Mark for Review
  1475. (1) Points
  1476. Alters the definition of the BACKORDER_AMOUNT column to NUMBER(2,8)
  1477. Alters the definition of the BACKORDER_AMOUNT column to NUMBER
  1478. Alters the definition of the BACKORDER_AMOUNT column to NUMBER(8 2)
  1479. Alters the definition of the BACKORDER_AMOUNT column to NUMBER(8.2)
  1480. Changes the definition of the BACKORDER_AMOUNT column to NUMBER(8,2) (*)
  1481.  
  1482. 8. Which statement about decreasing the width of a column is true? Mark for Review
  1483. (1) Points
  1484.  
  1485. You cannot decrease the width of a character column unless the table in which the column resides is empty.
  1486.  
  1487. When a character column contains data, you can decrease the width of the column if the
  1488. existing data does not violate the new size. (*)
  1489.  
  1490. When a character column contains data, you cannot decrease the width of the column.
  1491.  
  1492. When a character column contains data, you can decrease the width of the column without any restrictions.
  1493.  
  1494. 9. The FLASHBACK QUERY statement can restore data back to a point in time before the last COMMIT. True or False? Mark for Review
  1495. (1) Points
  1496. True
  1497. False (*)
  1498.  
  1499. 10. A column's data type can always be changed from NUMBER to VARCHAR2 but not from VARCHAR2 to NUMBER, provided the table is empty. True or False? Mark for Review
  1500. (1) Points
  1501. True
  1502. False (*)
  1503.  
  1504. 11. Once they are created, external tables are accessed with normal SQL statements. (True or False?) Mark for Review
  1505. (1) Points
  1506. True (*)
  1507. False
  1508.  
  1509. 12. CREATE TABLE student_table
  1510. (id NUMBER(6),
  1511. lname VARCHAR(20),
  1512. fname VARCHAR(20),
  1513. lunch_num NUMBER(4));
  1514. Which of the following statements best describes the above SQL statement:
  1515.  
  1516. Mark for Review
  1517. (1) Points
  1518. Creates a table named student_table with four columns: lname, fname, lunch, num
  1519. Creates a table named student with four columns: id, lname, fname, lunch_num
  1520. Creates a table named student_table with four columns: lname, fname, lunch, num
  1521. Creates a table named student_table with four columns: id, lname, fname, lunch_num (*)
  1522.  
  1523. 13. Which statement about creating a table is true? Mark for Review
  1524. (1) Points
  1525.  
  1526. If no schema is explicitly included in a CREATE TABLE statement, the CREATE TABLE
  1527. statement will fail.
  1528.  
  1529. With a CREATE TABLE statement, a table will always be created in the current user's schema.
  1530.  
  1531. If no schema is explicitly included in a CREATE TABLE statement, the table is created in the current user's schema. (*)
  1532.  
  1533. If a schema is explicitly included in a CREATE TABLE statement and the schema does not exist, it will be created.
  1534.  
  1535. 14. Which SQL statement below will correctly create the EMP table based on the structure of the EMPLOYEES table? Include only the EMPLOYEE_ID, FIRST_NAME, LAST_NAME, SALARY, and DEPARTMENT_ID columns. Mark for Review
  1536. (1) Points
  1537.  
  1538. CREATE TABLE emp
  1539. AS SELECT employee_id, first_name, last_name, salary, department_id
  1540. FROM employees;
  1541. (*)
  1542.  
  1543. CREATE TABLE employee
  1544. AS SELECT employee_id, first_name, last_name, salary, department_id
  1545. FROM employees;
  1546.  
  1547. CREATE TABLE emp (employee_id, first_name, last_name, salary, department_id);
  1548.  
  1549. CREATE TABLE emp
  1550. SELECT (employee_id, first_name, last_name, salary, department_id FROM employees);
  1551.  
  1552. 15. Evaluate this CREATE TABLE statement:
  1553. 1. CREATE TABLE customer#1 (
  1554. 2. cust_1 NUMBER(9),
  1555. 3. sales$ NUMBER(9),
  1556. 4. 2date DATE DEFAULT SYSDATE);
  1557.  
  1558. Which line of this statement will cause an error?
  1559.  
  1560. Mark for Review
  1561. (1) Points
  1562. 2
  1563. 4 (*)
  1564. 1
  1565.  
  1566. 3
  1567.  
  1568.  
  1569.  
  1570. 1. Examine the structures of the PRODUCTS and SUPPLIERS tables.
  1571. PRODUCTS:
  1572. PRODUCT_ID NUMBER NOT NULL, PRIMARY KEY
  1573. PRODUCT_NAME VARCHAR2 (25)
  1574. SUPPLIER_ID NUMBER FOREIGN KEY to SUPPLIER_ID of the SUPPLIER table
  1575. LIST_PRICE NUMBER (7,2)
  1576. COST NUMBER (7,2)
  1577. QTY_IN_STOCK NUMBER
  1578. QTY_ON_ORDER NUMBER
  1579. REORDER_LEVEL NUMBER
  1580. REORDER_QTY NUMBER
  1581.  
  1582. SUPPLIERS:
  1583. SUPPLIER_ID NUMBER NOT NULL, PRIMARY KEY
  1584. SUPPLIER_NAME VARCHAR2 (25)
  1585. ADDRESS VARCHAR2 (30)
  1586. CITY VARCHAR2 (25)
  1587. REGION VARCHAR2 (10)
  1588. POSTAL_CODE VARCHAR2 (11)
  1589.  
  1590. Evaluate this statement:
  1591.  
  1592. ALTER TABLE suppliers
  1593. DISABLE CONSTRAINT supplier_id_pk CASCADE;
  1594.  
  1595. For which task would you issue this statement?
  1596.  
  1597. Mark for Review
  1598. (1) Points
  1599.  
  1600. To disable any dependent integrity constraints on the SUPPLIER_ID column in the PRODUCTS table
  1601.  
  1602. To disable any dependent integrity constraints on the SUPPLIER_ID column in the SUPPLIERS table (*)
  1603.  
  1604. To remove all constraint references to SUPPLIERS table
  1605.  
  1606. To drop the FOREIGN KEY constraint on the PRODUCTS table
  1607.  
  1608. To remove all constraint references to the PRODUCTS table
  1609.  
  1610. 2. The PO_DETAILS table contains these columns:
  1611. PO_NUM NUMBER NOT NULL, Primary Key
  1612. PO_LINE_ID NUMBER NOT NULL, Primary Key
  1613. PRODUCT_ID NUMBER Foreign Key to PRODUCT_ID column of the PRODUCTS table
  1614. QUANTITY NUMBER
  1615. UNIT_PRICE NUMBER(5,2)
  1616.  
  1617. Evaluate this statement:
  1618.  
  1619. ALTER TABLE po_details
  1620. DISABLE CONSTRAINT product_id_pk CASCADE;
  1621.  
  1622. For which task would you issue this statement?
  1623.  
  1624. Mark for Review
  1625. (1) Points
  1626.  
  1627. To disable the PRIMARY KEY and any FOREIGN KEY constraints that are dependent on the PO_NUM column (*)
  1628.  
  1629. To create a new PRIMARY KEY constraint on the PO_NUM column
  1630. To drop and recreate the PRIMARY KEY constraint on the PO_NUM column
  1631. To disable the constraint on the PO_NUM column while creating a PRIMARY KEY index
  1632.  
  1633. 3. Which of the following would definitely cause an integrity constraint error? Mark for Review
  1634. (1) Points
  1635.  
  1636. Using the DELETE command on a row that contains a primary key with a dependent foreign key declared without either an ON DELETE CASCADE or ON DELETE SET NULL. (*)
  1637.  
  1638. Using the UPDATE command on rows based in another table.
  1639. Using a subquery in an INSERT statement.
  1640. Using the MERGE statement to conditionally insert or update rows.
  1641.  
  1642. 4. When dropping a constraint, which keyword(s) specifies that all the referential integrity constraints that refer to the primary and unique keys defined on the dropped columns are dropped as well? Mark for Review
  1643. (1) Points
  1644. CASCADE (*)
  1645. ON DELETE SET NULL
  1646. FOREIGN KEY
  1647. REFERENCES
  1648.  
  1649. 5. All of a user's constraints can be viewed in the Oracle Data Dictionary view called: Mark for Review
  1650. (1) Points
  1651. CONSTRAINTS
  1652. USER_CONSTRAINTS (*)
  1653. TABLE_CONSTRAINTS
  1654. USER_TABLES
  1655.  
  1656. 6. Evaluate the structure of the DONATIONS table.
  1657. DONATIONS:
  1658. PLEDGE_ID NUMBER NOT NULL, Primary Key
  1659. DONOR_ID NUMBER Foreign key to DONOR_ID column of DONORS table
  1660. PLEDGE_DT DATE
  1661. AMOUNT_PLEDGED NUMBER (7,2)
  1662. AMOUNT_PAID NUMBER (7,2)
  1663. PAYMENT_DT DATE
  1664.  
  1665. Which CREATE TABLE statement should you use to create the DONATIONS table?
  1666.  
  1667. Mark for Review
  1668. (1) Points
  1669.  
  1670. CREATE TABLE donations
  1671. (pledge_id NUMBER PRIMARY KEY,
  1672. donor_id NUMBER CONSTRAINT donor_id_fk REFERENCES donors(donor_id),
  1673. pledge_date DATE,
  1674. amount_pledged NUMBER(7,2),
  1675. amount_paid NUMBER(7,2),
  1676. payment_dt DATE);
  1677. (*)
  1678.  
  1679. CREATE TABLE donations
  1680. pledge_id NUMBER PRIMARY KEY,
  1681. donor_id NUMBER FOREIGN KEY donor_id_fk REFERENCES donors(donor_id),
  1682. pledge_date DATE,
  1683. amount_pledged NUMBER(7,2),
  1684. amount_paid NUMBER(7,2),
  1685. payment_dt DATE;
  1686.  
  1687. CREATE TABLE donations
  1688. (pledge_id NUMBER PRIMARY KEY NOT NULL,
  1689. donor_id NUMBER FOREIGN KEY donors(donor_id),
  1690. pledge_date DATE,
  1691. amount_pledged NUMBER(7,2),
  1692. amount_paid NUMBER(7,2),
  1693. payment_dt DATE);
  1694.  
  1695. CREATE TABLE donations
  1696. (pledge_id NUMBER PRIMARY KEY,
  1697. donor_id NUMBER FOREIGN KEY REFERENCES donors(donor_id),
  1698. pledge_date DATE,
  1699. amount_pledged NUMBER,
  1700. amount_paid NUMBER,
  1701. payment_dt DATE);
  1702.  
  1703. 7. Which clause could you use to ensure that cost values are greater than 1.00? Mark for Review
  1704. (1) Points
  1705. CHECK CONSTRAINT part_cost_ck (cost > 1.00)
  1706. CONSTRAINT CHECK cost > 1.00
  1707. CONSTRAINT part_cost_ck CHECK (cost > 1.00) (*)
  1708. CONSTRAINT CHECK part_cost_ck (cost > 1.00)
  1709.  
  1710. 8. What must exist on the Parent table before Oracle will allow you to create a FOREIGN KEY constraint from a Child table? Mark for Review
  1711. (1) Points
  1712.  
  1713. A FOREIGN KEY constraint allows the constrained column to contain values that exist in the primary key column of the parent table.
  1714.  
  1715. A CHECK constraint must exist on the Parent table.
  1716. An index must exist on the Parent table
  1717. A PRIMARY or UNIQUE KEY constraint must exist on the Parent table. (*)
  1718.  
  1719. 9. Evaluate this CREATE TABLE statement:
  1720. CREATE TABLE part(
  1721. part_id NUMBER,
  1722. part_name VARCHAR2(25),
  1723. manufacturer_id NUMBER(9),
  1724. retail_price NUMBER(7,2) NOT NULL,
  1725. CONSTRAINT part_id_pk PRIMARY KEY(part_id),
  1726. CONSTRAINT cost_nn NOT NULL(cost),
  1727. CONSTRAINT FOREIGN KEY (manufacturer_id) REFERENCES manufacturer(id));
  1728. Which line will cause an error?
  1729.  
  1730. Mark for Review
  1731. (1) Points
  1732. 5
  1733. 6
  1734. 7 (*)
  1735. 8
  1736.  
  1737. 10. Which type of constraint by default requires that a column be both unique and not null? Mark for Review
  1738. (1) Points
  1739. UNIQUE
  1740. FOREIGN KEY
  1741. PRIMARY KEY (*)
  1742. CHECK
  1743.  
  1744. 11. You need to ensure that the LAST_NAME column only contains certain character values. No numbers or special characters are allowed.
  1745. Which type of constraint should you define on the LAST_NAME column? Mark for Review
  1746. (1) Points
  1747. CHECK (*)
  1748. PRIMARY KEY
  1749. UNIQUE
  1750. NOT NULL
  1751.  
  1752. 12. Which constraint can only be created at the column level? Mark for Review
  1753. (1) Points
  1754. NOT NULL (*)
  1755. UNIQUE
  1756. FOREIGN KEY
  1757. CHECK
  1758.  
  1759. 13. Evaluate this CREATE TABLE statement:
  1760. CREATE TABLE customers
  1761. (customer_id NUMBER,
  1762. customer_name VARCHAR2(25),
  1763. address VARCHAR2(25),
  1764. city VARCHAR2(25),
  1765. region VARCHAR2(25),
  1766. postal_code VARCHAR2(11),
  1767. CONSTRAINT customer_id_un UNIQUE(customer_id),
  1768. CONSTRAINT customer_name_nn NOT NULL(customer_name));
  1769.  
  1770. Why does this statement fail when executed?
  1771.  
  1772. Mark for Review
  1773. (1) Points
  1774. UNIQUE constraints must be defined at the column level.
  1775. The NUMBER data types require precision values.
  1776. The CREATE TABLE statement does NOT define a PRIMARY KEY.
  1777. NOT NULL constraints CANNOT be defined at the table level. (*)
  1778.  
  1779. 14. 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
  1780. (1) Points
  1781. PRIMARY KEY
  1782. NOT NULL (*)
  1783. UNIQUE
  1784. CHECK
  1785.  
  1786. 15. A table must have at least one not null constraint and one unique constraint. True or False? Mark for Review
  1787. (1) Points
  1788. True
  1789. False (*)
  1790.  
  1791. 1. When dropping a constraint, which keyword(s) specifies that all the referential integrity constraints that refer to the primary and unique keys defined on the dropped columns are dropped as well? Mark for Review
  1792. (1) Points
  1793. REFERENCES
  1794. FOREIGN KEY
  1795. CASCADE (*)
  1796. ON DELETE SET NULL
  1797.  
  1798. 2. You need to remove the EMP_FK_DEPT constraint from the EMPLOYEE table in your schema. Which statement should you use? Mark for Review
  1799. (1) Points
  1800. DROP CONSTRAINT EMP_FK_DEPT FROM employees;
  1801. DELETE CONSTRAINT EMP_FK_DEPT FROM employees;
  1802. ALTER TABLE employees DROP CONSTRAINT EMP_FK_DEPT; (*)
  1803. ALTER TABLE employees REMOVE CONSTRAINT EMP_FK_DEPT;
  1804.  
  1805. 3. What mechamisn does Oracle use in the background to enforce uniqueness in Primary and Unique key constraints? Mark for Review
  1806. (1) Points
  1807. Nothing extra is created when Primary Keys and Unique Keys are created
  1808.  
  1809. Unique key indexes are created in the background by Oracle when Primary key and Unique key constraints are created or enabled (*)
  1810. Internal Pointers
  1811. Ordered Lists
  1812.  
  1813. 4. You successfully create a table named SALARY in your company's database. Now, you want to establish a parent/child relationship between the EMPLOYEES table and the SALARY table by adding a FOREIGN KEY constraint to the SALARY table that references its matching column in the EMPLOYEES table. You have not added any data to the SALARY table. Which of the following statements should you issue? Mark for Review
  1814. (1) Points
  1815.  
  1816. ALTER TABLE salary
  1817. ADD CONSTRAINT fk_employee_id_ FOREIGN KEY salary (employee_id) = employees (employee_id);
  1818.  
  1819. ALTER TABLE salary
  1820. ADD CONSTRAINT fk_employee_id_ FOREIGN KEY
  1821. BETWEEN salary (employee_id) AND employees (employee_id);
  1822.  
  1823. ALTER TABLE salary
  1824. ADD CONSTRAINT fk_employee_id_01 FOREIGN KEY (employee_id)
  1825. REFERENCES employees (employee_id);
  1826. (*)
  1827.  
  1828. ALTER TABLE salary
  1829. FOREIGN KEY CONSTRAINT fk_employee_id_ REFERENCES employees (employee_id);
  1830.  
  1831. 5. What is the syntax for removing a PRIMARY KEY constraint and all its dependent constraints? Mark for Review
  1832. (1) Points
  1833.  
  1834. ALTER TABLE table_name
  1835. DROP CONSTRAINT constraint_name;
  1836.  
  1837. DROP CONSTRAINT table_name (constraint_name);
  1838.  
  1839. ALTER TABLE table_name
  1840. DROP CONSTRAINT constraint_name CASCADE;
  1841. (*)
  1842.  
  1843. ALTER TABLE table_name
  1844. DROP CONSTRAINT FOREIGN KEY CASCADE;
  1845.  
  1846. 6. You need to add a NOT NULL constraint to the COST column in the PART table. Which statement should you use to complete this task? Mark for Review
  1847. (1) Points
  1848.  
  1849. ALTER TABLE part
  1850. MODIFY COLUMN (cost part_cost_nn NOT NULL);
  1851.  
  1852. ALTER TABLE part
  1853. MODIFY (cost CONSTRAINT part_cost_nn NOT NULL);
  1854. (*)
  1855.  
  1856. ALTER TABLE part
  1857. ADD (cost CONSTRAINT part_cost_nn NOT NULL);
  1858.  
  1859. ALTER TABLE part
  1860. MODIFY (cost part_cost_nn NOT NULL);
  1861.  
  1862. 7. 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
  1863. (1) Points
  1864. CHECK
  1865. PRIMARY KEY
  1866. UNIQUE (*)
  1867. NOT NULL
  1868.  
  1869. 8. Which statement about the NOT NULL constraint is true? Mark for Review
  1870. (1) Points
  1871. The NOT NULL constraint requires a column to contain alphanumeric values.
  1872. The NOT NULL constraint can be defined at either the column level or the table level.
  1873. The NOT NULL constraint must be defined at the column level. (*)
  1874. The NOT NULL constraint prevents a column from containing alphanumeric values.
  1875.  
  1876. 9. Which two statements about NOT NULL constraints are true? (Choose two) Mark for Review
  1877. (1) Points
  1878. (Choose all correct answers)
  1879. The NOT NULL constraint requires that every value in a column be unique.
  1880. The Oracle Server creates a name for an unnamed NOT NULL constraint. (*)
  1881. A NOT NULL constraint can be defined at either the table or column level.
  1882.  
  1883. You CANNOT add a NOT NULL constraint to an existing column using the ALTER TABLE
  1884. ADD CONSTRAINT statement. (*)
  1885.  
  1886. Columns with a NOT NULL constraint can contain null values by default.
  1887.  
  1888. 10. What is the highest number of NOT NULL constraints you can have on a table? Mark for Review
  1889. (1) Points
  1890. 5
  1891. 10
  1892. 3
  1893. You can have as many NOT NULL constraints as you have columns in your table. (*)
  1894.  
  1895. 11. Which line of the following code will cause an error:
  1896. CREATE TABLE clients
  1897. (client_number NUMBER(4) CONSTRAINT client_client_num_pk PRIMARY KEY client_number,
  1898. first_name VARCHAR2(14),
  1899. last_name VARCHAR2(13),
  1900. hire_date DATE CONSTRAINT emp_min_hire_date CHECK (hire_date < SYSDATE),
  1901. department_id VARCHAR(3),
  1902. CONSTRAINT clients_dept_id_fk FOREIGN KEY(department_id) REFERENCES departments(department_id));
  1903. Mark for Review
  1904. (1) Points
  1905. Line 2
  1906. Line 3
  1907. Line 5 (*)
  1908. Line 7
  1909.  
  1910. 12. Evaluate the structure of the DONATIONS table.
  1911. DONATIONS:
  1912. PLEDGE_ID NUMBER NOT NULL, Primary Key
  1913. DONOR_ID NUMBER Foreign key to DONOR_ID column of DONORS table
  1914. PLEDGE_DT DATE
  1915. AMOUNT_PLEDGED NUMBER (7,2)
  1916. AMOUNT_PAID NUMBER (7,2)
  1917. PAYMENT_DT DATE
  1918.  
  1919. Which CREATE TABLE statement should you use to create the DONATIONS table?
  1920. Mark for Review
  1921. (1) Points
  1922.  
  1923. CREATE TABLE donations
  1924. (pledge_id NUMBER PRIMARY KEY,
  1925. donor_id NUMBER FOREIGN KEY REFERENCES donors(donor_id),
  1926. pledge_date DATE,
  1927. amount_pledged NUMBER,
  1928. amount_paid NUMBER,
  1929. payment_dt DATE);
  1930.  
  1931. CREATE TABLE donations
  1932. pledge_id NUMBER PRIMARY KEY,
  1933. donor_id NUMBER FOREIGN KEY donor_id_fk REFERENCES donors(donor_id),
  1934. pledge_date DATE,
  1935. amount_pledged NUMBER(7,2),
  1936. amount_paid NUMBER(7,2),
  1937. payment_dt DATE;
  1938.  
  1939. CREATE TABLE donations
  1940. (pledge_id NUMBER PRIMARY KEY NOT NULL,
  1941. donor_id NUMBER FOREIGN KEY donors(donor_id),
  1942. pledge_date DATE,
  1943. amount_pledged NUMBER(7,2),
  1944. amount_paid NUMBER(7,2),
  1945. payment_dt DATE);
  1946.  
  1947. CREATE TABLE donations
  1948. (pledge_id NUMBER PRIMARY KEY,
  1949. donor_id NUMBER CONSTRAINT donor_id_fk REFERENCES donors(donor_id),
  1950. pledge_date DATE,
  1951. amount_pledged NUMBER(7,2),
  1952. amount_paid NUMBER(7,2),
  1953. payment_dt DATE);
  1954. (*)
  1955.  
  1956. 13. A Primary Key that is made up of more than one column is called a: Mark for Review
  1957. (1) Points
  1958. Multiple Primary Key
  1959. Composite Primary Key (*)
  1960. Double Key
  1961. Primary Multi-Key
  1962. None of the Above
  1963.  
  1964. 14. Which of the following FOREIGN KEY Constraint keywords identifies the table and column in the parent table? Mark for Review
  1965. (1) Points
  1966. REFERENTIAL
  1967. ON DELETE CASCADE
  1968. REFERENCES (*)
  1969. RESEMBLES
  1970.  
  1971. 15. What must exist on the Parent table before Oracle will allow you to create a FOREIGN KEY constraint from a Child table? Mark for Review
  1972. (1) Points
  1973.  
  1974. A FOREIGN KEY constraint allows the constrained column to contain values that exist in the primary key column of the parent table.
  1975.  
  1976. A CHECK constraint must exist on the Parent table.
  1977. An index must exist on the Parent table
  1978. A PRIMARY or UNIQUE KEY constraint must exist on the Parent table. (*)
  1979.  
  1980. 1. A composite primary key may only be defined at the table level. True or False? Mark for Review
  1981. (1) Points
  1982. True (*)
  1983. False
  1984.  
  1985. 2. Which of the following FOREIGN KEY Constraint keywords identifies the table and column in the parent table? Mark for Review
  1986. (1) Points
  1987. ON DELETE CASCADE
  1988. REFERENCES (*)
  1989. RESEMBLES
  1990. REFERENTIAL
  1991.  
  1992. 3. You need to enforce a relationship between the LOC_ID column in the FACILITY table and the same column in the MANUFACTURER table. Which type of constraint should you define on the LOC_ID column? Mark for Review
  1993. (1) Points
  1994. NOT NULL
  1995. UNIQUE
  1996. PRIMARY KEY
  1997. FOREIGN KEY (*)
  1998.  
  1999. 4. What must exist on the Parent table before Oracle will allow you to create a FOREIGN KEY constraint from a Child table? Mark for Review
  2000. (1) Points
  2001. A PRIMARY or UNIQUE KEY constraint must exist on the Parent table. (*)
  2002. A FOREIGN KEY constraint allows the constrained column to contain values that exist in the primary key column of the parent table.
  2003. A CHECK constraint must exist on the Parent table.
  2004. An index must exist on the Parent table
  2005.  
  2006. 5. Which constraint type enforces uniqueness? Mark for Review
  2007. (1) Points
  2008. NOT NULL
  2009. PRIMARY KEY (*)
  2010. CHECK
  2011. FOREIGN KEY
  2012.  
  2013. 6. 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
  2014. (1) Points
  2015. UNIQUE (*)
  2016. PRIMARY KEY
  2017. CHECK
  2018. NOT NULL
  2019.  
  2020. 7. Which of the following is not a valid Oracle constraint type? Mark for Review
  2021. (1) Points
  2022. NOT NULL
  2023. EXTERNAL KEY (*)
  2024. UNIQUE KEY
  2025. PRIMARY KEY
  2026.  
  2027. 8. Which statement about constraints is true? Mark for Review
  2028. (1) Points
  2029. NOT NULL constraints can only be specified at the column level. (*)
  2030. A single column can have only one constraint applied.
  2031. PRIMARY KEY constraints can only be specified at the column level.
  2032. UNIQUE constraints are identical to PRIMARY KEY constraints.
  2033.  
  2034. 9. If the employees table has a UNIQUE constraint on the DEPARTMENT_ID column, we can only have one employee per department. True or False? Mark for Review
  2035. (1) Points
  2036. True (*)
  2037. False
  2038.  
  2039. 10. You need to ensure that the LAST_NAME column only contains certain character values. No numbers or special characters are allowed.
  2040. Which type of constraint should you define on the LAST_NAME column? Mark for Review
  2041. (1) Points
  2042. PRIMARY KEY
  2043. NOT NULL
  2044. CHECK (*)
  2045. UNIQUE
  2046.  
  2047. 11. You need to add a NOT NULL constraint to the EMAIL column in the EMPLOYEES table. Which clause should you use? Mark for Review
  2048. (1) Points
  2049. CHANGE
  2050. MODIFY (*)
  2051. ADD
  2052. DISABLE
  2053.  
  2054. 12. You need to remove the EMP_FK_DEPT constraint from the EMPLOYEE table in your schema. Which statement should you use? Mark for Review
  2055. (1) Points
  2056. ALTER TABLE employees DROP CONSTRAINT EMP_FK_DEPT; (*)
  2057. DROP CONSTRAINT EMP_FK_DEPT FROM employees;
  2058. DELETE CONSTRAINT EMP_FK_DEPT FROM employees;
  2059. ALTER TABLE employees REMOVE CONSTRAINT EMP_FK_DEPT;
  2060.  
  2061. 13. You want to disable the FOREIGN KEY constraint that is defined in the EMPLOYEES table on the DEPARTMENT_ID column. The constraint is referenced by the name FK_DEPT_ID_01. Which statement should you issue? Mark for Review
  2062. (1) Points
  2063.  
  2064. ALTER TABLE employees
  2065. DISABLE fk_dept_id_01;
  2066.  
  2067. ALTER TABLE employees
  2068. DISABLE CONSTRAINT fk_dept_id_01;
  2069. (*)
  2070.  
  2071. ALTER TABLE employees
  2072. DISABLE CONSTRAINT 'fk_dept_id_01';
  2073.  
  2074. ALTER TABLE employees
  2075. DISABLE 'fk_dept_id_01';
  2076.  
  2077. 14. All of a user's constraints can be viewed in the Oracle Data Dictionary view called: Mark for Review
  2078. (1) Points
  2079. CONSTRAINTS
  2080. USER_TABLES
  2081. USER_CONSTRAINTS (*)
  2082. TABLE_CONSTRAINTS
  2083.  
  2084. 15. You need to add a PRIMARY KEY constraint on the EMP_ID column of the EMPLOYEES table. Which ALTER TABLE statement should you use? Mark for Review
  2085. (1) Points
  2086.  
  2087. ALTER TABLE employees
  2088. ADD CONSTRAINT PRIMARY KEY (emp_id);
  2089.  
  2090. ALTER TABLE employees
  2091. ADD CONSTRAINT emp_emp_id_pk PRIMARY KEY(emp_id); (*)
  2092.  
  2093. ALTER TABLE employees
  2094. MODIFY CONSTRAINT PRIMARY KEY (emp_id);
  2095.  
  2096. ALTER TABLE employees
  2097. MODIFY emp_id PRIMARY KEY;
  2098.  
  2099. 1. A Primary Key that is made up of more than one column is called a: Mark for Review
  2100. (1) Points
  2101. Multiple Primary Key
  2102. Composite Primary Key (*)
  2103. Double Key
  2104. Primary Multi-Key
  2105. None of the Above
  2106.  
  2107. 2. Evaluate the structure of the DONATIONS table.
  2108. DONATIONS:
  2109. PLEDGE_ID NUMBER NOT NULL, Primary Key
  2110. DONOR_ID NUMBER Foreign key to DONOR_ID column of DONORS table
  2111. PLEDGE_DT DATE
  2112. AMOUNT_PLEDGED NUMBER (7,2)
  2113. AMOUNT_PAID NUMBER (7,2)
  2114. PAYMENT_DT DATE
  2115.  
  2116. Which CREATE TABLE statement should you use to create the DONATIONS table?
  2117.  
  2118. Mark for Review
  2119. (1) Points
  2120.  
  2121. CREATE TABLE donations
  2122. (pledge_id NUMBER PRIMARY KEY,
  2123. donor_id NUMBER CONSTRAINT donor_id_fk REFERENCES donors(donor_id),
  2124. pledge_date DATE,
  2125. amount_pledged NUMBER(7,2),
  2126. amount_paid NUMBER(7,2),
  2127. payment_dt DATE);
  2128. (*)
  2129.  
  2130. CREATE TABLE donations
  2131. (pledge_id NUMBER PRIMARY KEY NOT NULL,
  2132. donor_id NUMBER FOREIGN KEY donors(donor_id),
  2133. pledge_date DATE,
  2134. amount_pledged NUMBER(7,2),
  2135. amount_paid NUMBER(7,2),
  2136. payment_dt DATE);
  2137.  
  2138. CREATE TABLE donations
  2139. pledge_id NUMBER PRIMARY KEY,
  2140. donor_id NUMBER FOREIGN KEY donor_id_fk REFERENCES donors(donor_id),
  2141. pledge_date DATE,
  2142. amount_pledged NUMBER(7,2),
  2143. amount_paid NUMBER(7,2),
  2144. payment_dt DATE;
  2145.  
  2146. CREATE TABLE donations
  2147. (pledge_id NUMBER PRIMARY KEY,
  2148. donor_id NUMBER FOREIGN KEY REFERENCES donors(donor_id),
  2149. pledge_date DATE,
  2150. amount_pledged NUMBER,
  2151. amount_paid NUMBER,
  2152. payment_dt DATE);
  2153.  
  2154. 3. To automatically delete rows in a child table when a parent record is deleted use: Mark for Review
  2155. (1) Points
  2156.  
  2157. ON DELETE SET NULL
  2158. ON DELETE ORPHAN
  2159. ON DELETE CASCADE (*)
  2160. None of the Above
  2161.  
  2162. 4. The employees table contains a foreign key column department_id that references the id column in the departments table. Which of the following constraint modifiers will NOT allow the deletion of id values in the department table? Mark for Review
  2163. (1) Points
  2164. ON DELETE CASCADE
  2165. ON DELETE SET NULL
  2166. Neither A nor B (*)
  2167. Both A and B
  2168.  
  2169. 5. Foreign Key Constraints are also known as: Mark for Review
  2170. (1) Points
  2171. Parental Key Constraints
  2172. Child Key Constraints
  2173. Referential Integrity Constraints (*)
  2174. Multi-Table Constraints
  2175.  
  2176. 6. You disabled the EMPLOYEE_ID_PK PRIMARY KEY constraint on the ID column in the EMPLOYEES table and imported 100 records. You need to enable the constraint and verify that the new and existing ID column values do not violate the PRIMARY KEY constraint. Evaluate this statement:
  2177. ALTER TABLE employees
  2178. ENABLE employee_id_pk;
  2179.  
  2180. Which statement is true?
  2181.  
  2182. Mark for Review
  2183. (1) Points
  2184. The statement will NOT execute because it contains a syntax error. (*)
  2185. The statement will execute, but will ensure that the new ID values are unique.
  2186. The statement will execute, but will not verify that the existing values are unique.
  2187. The statement will achieve the desired result.
  2188. 7. You successfully create a table named SALARY in your company's database. Now, you want to establish a parent/child relationship between the EMPLOYEES table and the SALARY table by adding a FOREIGN KEY constraint to the SALARY table that references its matching column in the EMPLOYEES table. You have not added any data to the SALARY table. Which of the following statements should you issue? Mark for Review
  2189. (1) Points
  2190.  
  2191. ALTER TABLE salary
  2192. ADD CONSTRAINT fk_employee_id_ FOREIGN KEY salary (employee_id) = employees (employee_id);
  2193.  
  2194. ALTER TABLE salary
  2195. FOREIGN KEY CONSTRAINT fk_employee_id_ REFERENCES employees (employee_id);
  2196.  
  2197. ALTER TABLE salary
  2198. ADD CONSTRAINT fk_employee_id_ FOREIGN KEY
  2199. BETWEEN salary (employee_id) AND employees (employee_id);
  2200.  
  2201. ALTER TABLE salary
  2202. ADD CONSTRAINT fk_employee_id_01 FOREIGN KEY (employee_id)
  2203. REFERENCES employees (employee_id);
  2204. (*)
  2205.  
  2206. 8. What is the syntax for removing a PRIMARY KEY constraint and all its dependent constraints? Mark for Review
  2207. (1) Points
  2208.  
  2209. ALTER TABLE table_name
  2210. DROP CONSTRAINT constraint_name;
  2211.  
  2212. ALTER TABLE table_name
  2213. DROP CONSTRAINT constraint_name CASCADE;
  2214. (*)
  2215.  
  2216. ALTER TABLE table_name
  2217. DROP CONSTRAINT FOREIGN KEY CASCADE;
  2218.  
  2219. DROP CONSTRAINT table_name (constraint_name);
  2220.  
  2221. 9. The LINE_ITEM table contains these columns:
  2222. LINE_ITEM_ID NUMBER PRIMARY KEY
  2223. PRODUCT_ID NUMBER(9) FOREIGN KEY references the ID column of the PRODUCT table
  2224. QUANTITY NUMBER(9)
  2225. UNIT_PRICE NUMBER(5,2)
  2226.  
  2227. You need to disable the FOREIGN KEY constraint. Which statement should you use?
  2228.  
  2229. Mark for Review
  2230. (1) Points
  2231.  
  2232. ALTER TABLE line_item
  2233. DROP CONSTRAINT product_id_fk;
  2234.  
  2235. ALTER TABLE line_item
  2236. DISABLE CONSTRAINT product_id_fk;
  2237. (*)
  2238.  
  2239. ALTER TABLE line_item
  2240. ENABLE CONSTRAINT product_id_fk;
  2241.  
  2242. ALTER TABLE line_item
  2243. DELETE CONSTRAINT product_id_fk;
  2244.  
  2245. 10. This SQL command will do what?
  2246. ALTER TABLE employees
  2247. ADD CONSTRAINT emp_manager_fk FOREIGN KEY(manager_id) REFERENCES employees(employee_id);
  2248.  
  2249. Mark for Review
  2250. (1) Points
  2251.  
  2252. Add a FOREIGN KEY constraint to the EMPLOYEES table restricting manager ID to match every employee ID.
  2253.  
  2254. Add a FOREIGN KEY constraint to the EMPLOYEES table indicating that a manager must already be an employee. (*)
  2255.  
  2256. Alter the table employees and disable the emp_manager_fk constraint.
  2257.  
  2258. Alter table employees and add a FOREIGN KEY constraint that indicates each employee ID must be unique.
  2259.  
  2260. 11. You need to ensure that the LAST_NAME column only contains certain character values. No numbers or special characters are allowed.
  2261. Which type of constraint should you define on the LAST_NAME column? Mark for Review
  2262. (1) Points
  2263. PRIMARY KEY
  2264. NOT NULL
  2265. CHECK (*)
  2266. UNIQUE
  2267.  
  2268. 12. Which constraint can only be created at the column level? Mark for Review
  2269. (1) Points
  2270. CHECK
  2271. UNIQUE
  2272. FOREIGN KEY
  2273. NOT NULL (*)
  2274.  
  2275. 13. Evaluate this CREATE TABLE statement:
  2276. CREATE TABLE customers
  2277. (customer_id NUMBER,
  2278. customer_name VARCHAR2(25),
  2279. address VARCHAR2(25),
  2280. city VARCHAR2(25),
  2281. region VARCHAR2(25),
  2282. postal_code VARCHAR2(11),
  2283. CONSTRAINT customer_id_un UNIQUE(customer_id),
  2284. CONSTRAINT customer_name_nn NOT NULL(customer_name));
  2285.  
  2286. Why does this statement fail when executed?
  2287.  
  2288. Mark for Review
  2289. (1) Points
  2290. NOT NULL constraints CANNOT be defined at the table level. (*)
  2291. The CREATE TABLE statement does NOT define a PRIMARY KEY.
  2292. The NUMBER data types require precision values.
  2293. UNIQUE constraints must be defined at the column level.
  2294.  
  2295. 14. Which of the following is not a valid Oracle constraint type? Mark for Review
  2296. (1) Points
  2297. PRIMARY KEY
  2298. UNIQUE KEY
  2299. EXTERNAL KEY (*)
  2300. NOT NULL
  2301.  
  2302. 15. What is the highest number of NOT NULL constraints you can have on a table? Mark for Review
  2303. (1) Points
  2304. 5
  2305. 10
  2306. 3
  2307. You can have as many NOT NULL constraints as you have columns in your table. (*)
  2308.  
  2309. 1. A unique key constraint can only be defined on a not null column. True or False? Mark for Review
  2310. (1) Points
  2311. True
  2312. False (*)
  2313.  
  2314. 2. What is the highest number of NOT NULL constraints you can have on a table? Mark for Review
  2315. (1) Points
  2316. 5
  2317. 10
  2318. 3
  2319. You can have as many NOT NULL constraints as you have columns in your table. (*)
  2320.  
  2321. 3. A table can only have one unique key constraint defined. True or False? Mark for Review
  2322. (1) Points
  2323. True
  2324. False (*)
  2325.  
  2326. 4. Primary Key, Foreign Key, Unique Key, and Check Constraints can be added at which two levels? (Choose two) Mark for Review
  2327. (1) Points
  2328. (Choose all correct answers)
  2329. Dictionary
  2330. Null Field
  2331. Column (*)
  2332. Table (*)
  2333. Row
  2334.  
  2335. 5. You need to ensure that the LAST_NAME column only contains certain character values. No numbers or special characters are allowed.
  2336. Which type of constraint should you define on the LAST_NAME column? Mark for Review
  2337. (1) Points
  2338. NOT NULL
  2339. PRIMARY KEY
  2340. CHECK (*)
  2341. UNIQUE
  2342.  
  2343. 6. You need to remove the EMP_FK_DEPT constraint from the EMPLOYEE table in your schema. Which statement should you use? Mark for Review
  2344. (1) Points
  2345. DROP CONSTRAINT EMP_FK_DEPT FROM employees;
  2346. ALTER TABLE employees REMOVE CONSTRAINT EMP_FK_DEPT;
  2347. DELETE CONSTRAINT EMP_FK_DEPT FROM employees;
  2348. ALTER TABLE employees DROP CONSTRAINT EMP_FK_DEPT; (*)
  2349.  
  2350. 7. What actions can be performed on or with Constraints? Mark for Review
  2351. (1) Points
  2352. Add, Drop, Enable, Disable, Cascade (*)
  2353. Add, Subtract, Enable, Cascade
  2354. Add, Drop, Disable, Disregard
  2355. Add, Minus, Enable, Disable, Collapse
  2356.  
  2357. 8. What is the syntax for removing a PRIMARY KEY constraint and all its dependent constraints? Mark for Review
  2358. (1) Points
  2359.  
  2360. ALTER TABLE table_name
  2361. DROP CONSTRAINT FOREIGN KEY CASCADE;
  2362.  
  2363. DROP CONSTRAINT table_name (constraint_name);
  2364.  
  2365. ALTER TABLE table_name
  2366. DROP CONSTRAINT constraint_name;
  2367.  
  2368. ALTER TABLE table_name
  2369. DROP CONSTRAINT constraint_name CASCADE;
  2370. (*)
  2371.  
  2372. 9. The command to 'switch off' a constraint is: Mark for Review
  2373. (1) Points
  2374. ALTER TABLE PAUSE CONSTRAINT
  2375. ALTER TABLE STOP CONSTRAINTS
  2376. ALTER TABLE DISABLE CONSTRAINT (*)
  2377. ALTER TABLE STOP CHECKING
  2378.  
  2379. 10. Examine the structures of the PRODUCTS and SUPPLIERS tables.
  2380. PRODUCTS:
  2381. PRODUCT_ID NUMBER NOT NULL, PRIMARY KEY
  2382. PRODUCT_NAME VARCHAR2 (25)
  2383. SUPPLIER_ID NUMBER FOREIGN KEY to SUPPLIER_ID of the SUPPLIER table
  2384. LIST_PRICE NUMBER (7,2)
  2385. COST NUMBER (7,2)
  2386. QTY_IN_STOCK NUMBER
  2387. QTY_ON_ORDER NUMBER
  2388. REORDER_LEVEL NUMBER
  2389. REORDER_QTY NUMBER
  2390.  
  2391. SUPPLIERS:
  2392. SUPPLIER_ID NUMBER NOT NULL, PRIMARY KEY
  2393. SUPPLIER_NAME VARCHAR2 (25)
  2394. ADDRESS VARCHAR2 (30)
  2395. CITY VARCHAR2 (25)
  2396. REGION VARCHAR2 (10)
  2397. POSTAL_CODE VARCHAR2 (11)
  2398.  
  2399. Evaluate this statement:
  2400.  
  2401. ALTER TABLE suppliers
  2402. DISABLE CONSTRAINT supplier_id_pk CASCADE;
  2403.  
  2404. For which task would you issue this statement?
  2405.  
  2406. Mark for Review
  2407. (1) Points
  2408. To remove all constraint references to the PRODUCTS table
  2409. To remove all constraint references to SUPPLIERS table
  2410.  
  2411. To disable any dependent integrity constraints on the SUPPLIER_ID column in the PRODUCTS table
  2412.  
  2413. To disable any dependent integrity constraints on the SUPPLIER_ID column in the SUPPLIERS table (*)
  2414.  
  2415. To drop the FOREIGN KEY constraint on the PRODUCTS table
  2416.  
  2417. 11. Which clause could you use to ensure that cost values are greater than 1.00? Mark for Review
  2418. (1) Points
  2419. CONSTRAINT part_cost_ck CHECK (cost > 1.00) (*)
  2420. CONSTRAINT CHECK cost > 1.00
  2421. CHECK CONSTRAINT part_cost_ck (cost > 1.00)
  2422. CONSTRAINT CHECK part_cost_ck (cost > 1.00)
  2423.  
  2424. 12. Which line of the following code will cause an error:
  2425. CREATE TABLE clients
  2426. (client_number NUMBER(4) CONSTRAINT client_client_num_pk PRIMARY KEY client_number,
  2427. first_name VARCHAR2(14),
  2428. last_name VARCHAR2(13),
  2429. hire_date DATE CONSTRAINT emp_min_hire_date CHECK (hire_date < SYSDATE),
  2430. department_id VARCHAR(3),
  2431. CONSTRAINT clients_dept_id_fk FOREIGN KEY(department_id) REFERENCES departments(department_id));
  2432. Mark for Review
  2433. (1) Points
  2434. Line 2
  2435. Line 3
  2436. Line 5 (*)
  2437. Line 7
  2438.  
  2439. 13. A composite primary key may only be defined at the table level. True or False? Mark for Review
  2440. (1) Points
  2441. True (*)
  2442. False
  2443.  
  2444. 14. Evaluate this CREATE TABLE statement:
  2445. CREATE TABLE part(
  2446. part_id NUMBER,
  2447. part_name VARCHAR2(25),
  2448. manufacturer_id NUMBER(9),
  2449. retail_price NUMBER(7,2) NOT NULL,
  2450. CONSTRAINT part_id_pk PRIMARY KEY(part_id),
  2451. CONSTRAINT cost_nn NOT NULL(cost),
  2452. CONSTRAINT FOREIGN KEY (manufacturer_id) REFERENCES manufacturer(id));
  2453. Which line will cause an error?
  2454.  
  2455. Mark for Review
  2456. (1) Points
  2457. 5
  2458. 6
  2459. 7 (*)
  2460. 8
  2461.  
  2462. 15. What must exist on the Parent table before Oracle will allow you to create a FOREIGN KEY constraint from a Child table? Mark for Review
  2463. (1) Points
  2464. A PRIMARY or UNIQUE KEY constraint must exist on the Parent table. (*)
  2465. A CHECK constraint must exist on the Parent table.
  2466.  
  2467. A FOREIGN KEY constraint allows the constrained column to contain values that exist in the primary key column of the parent table.
  2468.  
  2469. An index must exist on the Parent table
  2470.  
  2471. 1. You need to enforce a relationship between the LOC_ID column in the FACILITY table and the same column in the MANUFACTURER table. Which type of constraint should you define on the LOC_ID column? Mark for Review
  2472. (1) Points
  2473. NOT NULL
  2474.  
  2475. FOREIGN KEY (*)
  2476. PRIMARY KEY
  2477. UNIQUE
  2478.  
  2479. 2. A Primary Key that is made up of more than one column is called a: Mark for Review
  2480. (1) Points
  2481. Multiple Primary Key
  2482. Composite Primary Key (*)
  2483. Double Key
  2484. Primary Multi-Key
  2485. None of the Above
  2486.  
  2487. 3. Which of the following best describes the function of a CHECK constraint? Mark for Review
  2488. (1) Points
  2489.  
  2490. A CHECK constraint enforces uniqueness of the values that can be entered in a column or combination of columns.
  2491.  
  2492. A CHECK constraint defines restrictions on the values that can be entered in a column or combination of columns. (*)
  2493.  
  2494. A CHECK constraint is created automatically when a PRIMARY KEY constraint is created.
  2495. A CHECK constraint enforces referential data integrity.
  2496.  
  2497. 4. A composite primary key may only be defined at the table level. True or False? Mark for Review
  2498. (1) Points
  2499. True (*)
  2500. False
  2501.  
  2502. 5. Evaluate this CREATE TABLE statement:
  2503. CREATE TABLE part(
  2504. part_id NUMBER,
  2505. part_name VARCHAR2(25),
  2506. manufacturer_id NUMBER(9),
  2507. retail_price NUMBER(7,2) NOT NULL,
  2508. CONSTRAINT part_id_pk PRIMARY KEY(part_id),
  2509. CONSTRAINT cost_nn NOT NULL(cost),
  2510. CONSTRAINT FOREIGN KEY (manufacturer_id) REFERENCES manufacturer(id));
  2511. Which line will cause an error?
  2512.  
  2513. Mark for Review
  2514. (1) Points
  2515. 5
  2516. 6
  2517. 7 (*)
  2518. 8
  2519.  
  2520. 6. Evaluate this statement:
  2521. ALTER TABLE employees
  2522. ADD CONSTRAINT employee_id PRIMARY KEY;
  2523.  
  2524. Which result will the statement provide?
  2525.  
  2526. Mark for Review
  2527. (1) Points
  2528. An existing constraint on the EMPLOYEES table will be overwritten.
  2529. A constraint will be added to the EMPLOYEES table.
  2530. A syntax error will be returned. (*)
  2531. An existing constraint on the EMPLOYEES table will be enabled.
  2532.  
  2533. 7. The LINE_ITEM table contains these columns:
  2534. LINE_ITEM_ID NUMBER PRIMARY KEY
  2535. PRODUCT_ID NUMBER(9) FOREIGN KEY references the ID column of the PRODUCT table
  2536. QUANTITY NUMBER(9)
  2537. UNIT_PRICE NUMBER(5,2)
  2538.  
  2539. You need to disable the FOREIGN KEY constraint. Which statement should you use?
  2540.  
  2541. Mark for Review
  2542. (1) Points
  2543.  
  2544. ALTER TABLE line_item
  2545. DELETE CONSTRAINT product_id_fk;
  2546.  
  2547. ALTER TABLE line_item
  2548. DISABLE CONSTRAINT product_id_fk;
  2549. (*)
  2550.  
  2551. ALTER TABLE line_item
  2552. ENABLE CONSTRAINT product_id_fk;
  2553.  
  2554. ALTER TABLE line_item
  2555. DROP CONSTRAINT product_id_fk;
  2556.  
  2557. 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
  2558. (1) Points
  2559. ALTER TABLE employees DROP CONSTRAINT EMP_FK_DEPT; (*)
  2560. ALTER TABLE employees REMOVE CONSTRAINT EMP_FK_DEPT;
  2561. DROP CONSTRAINT EMP_FK_DEPT FROM employees;
  2562. DELETE CONSTRAINT EMP_FK_DEPT FROM employees;
  2563.  
  2564. 9. Evaluate this statement
  2565. ALTER TABLE employees
  2566. ENABLE CONSTRAINT emp_id_pk;
  2567.  
  2568. For which task would you issue this statement?
  2569.  
  2570. Mark for Review
  2571. (1) Points
  2572. To add a new constraint to the EMPLOYEES table
  2573. To disable an existing constraint on the EMPLOYEES table
  2574. To activate a new constraint while preventing the creation of a PRIMARY KEY index
  2575.  
  2576. To activate the previously disabled constraint on the EMPLOYEE_ID column while creating a PRIMARY KEY index (*)
  2577.  
  2578. 10. This SQL command will do what?
  2579. ALTER TABLE employees
  2580. ADD CONSTRAINT emp_manager_fk FOREIGN KEY(manager_id) REFERENCES employees(employee_id);
  2581.  
  2582. Mark for Review
  2583. (1) Points
  2584.  
  2585. Alter table employees and add a FOREIGN KEY constraint that indicates each employee ID must be unique.
  2586.  
  2587. Alter the table employees and disable the emp_manager_fk constraint.
  2588.  
  2589. Add a FOREIGN KEY constraint to the EMPLOYEES table restricting manager ID to match every employee ID.
  2590.  
  2591. Add a FOREIGN KEY constraint to the EMPLOYEES table indicating that a manager must already be an employee. (*)
  2592.  
  2593. 11. A column defined as NOT NULL can have a DEFAULT value of NULL. True or False? Mark for Review
  2594. (1) Points
  2595. True
  2596. False (*)
  2597.  
  2598. 12. 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
  2599. (1) Points
  2600. CHECK
  2601. PRIMARY KEY
  2602. NOT NULL (*)
  2603. UNIQUE
  2604.  
  2605. 13. Which constraint can only be created at the column level? Mark for Review
  2606. (1) Points
  2607. UNIQUE
  2608. CHECK
  2609. NOT NULL (*)
  2610. FOREIGN KEY
  2611.  
  2612. 14. 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
  2613. (1) Points
  2614. CHECK
  2615. NOT NULL
  2616. PRIMARY KEY
  2617. UNIQUE (*)
  2618.  
  2619. 15. Which statement about constraints is true? Mark for Review
  2620. (1) Points
  2621. UNIQUE constraints are identical to PRIMARY KEY constraints.
  2622. PRIMARY KEY constraints can only be specified at the column level.
  2623. NOT NULL constraints can only be specified at the column level. (*)
  2624.  
  2625. A single column can have only one constraint applied.
  2626. By Deni Ace at February 11, 2017
  2627.  
  2628.  
  2629. Section 15 Quiz
  2630. (Answer all questions in this section)
  2631.  
  2632. 1. Evaluate this CREATE VIEW statement:
  2633. CREATE VIEW emp_view
  2634. AS SELECT SUM(salary)
  2635. FROM employees;
  2636.  
  2637. Which statement is true?
  2638.  
  2639. Mark for Review
  2640. (1) Points
  2641. You cannot update data in the EMPLOYEES table using the EMP_VIEW view. (*)
  2642. You can update any data in the EMPLOYEES table using the EMP_VIEW view.
  2643. You can update only the SALARY column in the EMPLOYEES table using the EMP_VIEW view.
  2644. You can delete records from the EMPLOYEES table using the EMP_VIEW view.
  2645.  
  2646. 2. Which keyword(s) would you include in a CREATE VIEW statement to create the view whether or not the base table exists? Mark for Review
  2647. (1) Points
  2648. FORCE (*)
  2649. WITH READ ONLY
  2650. NOFORCE
  2651. OR REPLACE
  2652.  
  2653. 3. Views must be used to select data from a table. As soon as a view is created on a table, you can no longer select directly from the table. True or False? Mark for Review
  2654. (1) Points
  2655. True
  2656. False (*)
  2657.  
  2658. 4. A view can be used to keep a history record of old data from the underlying tables, so even if a row is deleted from a table, you can still select the row through the view. True or False? Mark for Review
  2659. (1) Points
  2660. True
  2661. False (*)
  2662.  
  2663. 5. In order to query a database using a view, which of the following statements applies? Mark for Review
  2664. (1) Points
  2665. You can never see all the rows in the table through the view.
  2666. You can retrieve data from a view as you would from any table. (*)
  2667. The tables you are selecting from can be empty, yet the view still returns the original data from those tables.
  2668. Use special VIEW SELECT keywords.
  2669.  
  2670. 6. If a database administrator wants to ensure that changes performed through a view do not violate existing constraints, which clause should he include when creating the view? Mark for Review
  2671. (1) Points
  2672. FORCE
  2673. WITH CHECK OPTION (*)
  2674. WITH READ ONLY
  2675. WITH CONSTRAINT CHECK
  2676.  
  2677. 7. What is the purpose of including the WITH CHECK OPTION clause when creating a view? Mark for Review
  2678. (1) Points
  2679. To keep views form being queried by unauthorized persons
  2680. To make sure that the parent table(s) actually exist
  2681. To make sure that data is not duplicated in the view
  2682.  
  2683. To insure that no rows are updated through the view that would prevent those rows from being returned by the view in the future. (*)
  2684.  
  2685. 8. Only one type of view exists. True or False? Mark for Review
  2686. (1) Points
  2687. True
  2688. False (*)
  2689.  
  2690. 9. For a View created using the WITH CHECK OPTION keywords, which of the following statements are true? Mark for Review
  2691. (1) Points
  2692. Prohibits changing rows not returned by the subquery in the view definition. (*)
  2693. The view will allow the user to check it against the data dictionary
  2694. Prohibits DML actions without administrator CHECK approval
  2695. Allows for DELETES from other tables, including ones not listed in subquery
  2696.  
  2697. 10. You cannot insert data through a view if the view includes ______. Mark for Review
  2698. (1) Points
  2699. A join
  2700. A WHERE clause
  2701. A column alias
  2702. A GROUP BY clause (*)
  2703.  
  2704. 11. When you drop a view, the data it contains is also deleted. True or False? Mark for Review
  2705. (1) Points
  2706. True
  2707. False (*)
  2708.  
  2709. 12. Evaluate this CREATE VIEW statement:
  2710. CREATE VIEW sales_view
  2711. AS SELECT customer_id, region, SUM(sales_amount)
  2712. FROM sales
  2713. WHERE region IN (10, 20, 30, 40)
  2714. GROUP BY region, customer_id;
  2715.  
  2716. Which statement is true?
  2717.  
  2718. Mark for Review
  2719. (1) Points
  2720. You can modify data in the SALES table using the SALES_VIEW view.
  2721. You can only insert records into the SALES table using the SALES_VIEW view.
  2722. The CREATE VIEW statement generates an error.
  2723. You cannot modify data in the SALES table using the SALES_VIEW view. (*)
  2724.  
  2725. 13. 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
  2726. (1) Points
  2727. The AS keyword
  2728. A GROUP BY clause (*)
  2729. A WHERE clause
  2730. The IN keyword
  2731.  
  2732. 14. How do you remove a view? Mark for Review
  2733. (1) Points
  2734. DELETE VIEW view_name
  2735. REMOVE VIEW view_name
  2736. DROP VIEW view_name (*)
  2737. You cannot remove a view
  2738.  
  2739. 15. When you drop a table referenced by a view, the view is automatically dropped as well. True or False? Mark for Review
  2740. (1) Points
  2741. True
  2742. False (*)
  2743.  
  2744. 1. Which statement about an inline view is true? Mark for Review
  2745. (1) Points
  2746. An inline view is a complex view.
  2747. An inline view is a subquery in the FROM clause, often named with an alias. (*)
  2748. An inline view is a schema object.
  2749. An inline view can be used to perform DML operations.
  2750.  
  2751. 2. A Top-N Analysis is capable of ranking a top or bottom set of results. True or False? Mark for Review
  2752. (1) Points
  2753. True (*)
  2754. False
  2755.  
  2756. 3. Which of these Keywords is typically used with a Top-N Analysis? Mark for Review
  2757. (1) Points
  2758. Number
  2759. Rowid
  2760. Rownum (*)
  2761. Sequence
  2762.  
  2763. 4. You must create a view that will display the name, customer identification number, new balance, finance charge, and credit limit of all customers.
  2764. You issue this statement:
  2765. CREATE OR REPLACE VIEW CUST_CREDIT_V
  2766. AS SELECT c.last_name, c.customer_id, a.new_balance, a.finance_charge, a.credit_limit
  2767. FROM customers c, accounts a
  2768. WHERE c.account_id = a.account_id WITH READ ONLY;
  2769.  
  2770. Which type of SQL command can be issued on the CUST_CREDIT_V view?
  2771.  
  2772. Mark for Review
  2773. (1) Points
  2774.  
  2775. SELECT (*)
  2776. UPDATE
  2777. DELETE
  2778. INSERT
  2779.  
  2780. 5. Evaluate this CREATE VIEW statement:
  2781. CREATE VIEW sales_view
  2782. AS SELECT customer_id, region, SUM(sales_amount)
  2783. FROM sales
  2784. WHERE region IN (10, 20, 30, 40)
  2785. GROUP BY region, customer_id;
  2786.  
  2787. Which statement is true?
  2788.  
  2789. Mark for Review
  2790. (1) Points
  2791. You can only insert records into the SALES table using the SALES_VIEW view.
  2792. You can modify data in the SALES table using the SALES_VIEW view.
  2793. You cannot modify data in the SALES table using the SALES_VIEW view. (*)
  2794. The CREATE VIEW statement generates an error.
  2795.  
  2796. 6. You administer an Oracle database. Jack manages the Sales department. He and his employees often find it necessary to query the database to identify customers and their orders. He has asked you to create a view that will simplify this procedure for himself and his staff. The view should not accept INSERT, UPDATE, or DELETE operations. Which of the following statements should you issue? Mark for Review
  2797. (1) Points
  2798.  
  2799. CREATE VIEW sales_view
  2800. AS (SELECT c.companyname, c.city, o.orderid, o. orderdate, o.total
  2801. FROM customers c, orders o
  2802. WHERE c.custid = o.custid)
  2803. WITH READ ONLY;
  2804. (*)
  2805.  
  2806. CREATE VIEW sales_view
  2807. AS (SELECT c.companyname, c.city, o.orderid, o. orderdate, o.total
  2808. FROM customers c, orders o
  2809. WHERE c.custid = o.custid);
  2810.  
  2811. CREATE VIEW sales_view
  2812. AS (SELECT companyname, city, orderid, orderdate, total
  2813. FROM customers, orders
  2814. WHERE custid = custid)
  2815. WITH READ ONLY;
  2816.  
  2817. CREATE VIEW sales_view
  2818. (SELECT c.companyname, c.city, o.orderid, o. orderdate, o.total
  2819. FROM customers c, orders o
  2820. WHERE c.custid = o.custid)
  2821. WITH READ ONLY;
  2822.  
  2823. 7. You cannot insert data through a view if the view includes ______. Mark for Review
  2824. (1) Points
  2825. A WHERE clause
  2826. A GROUP BY clause (*)
  2827. A column alias
  2828. A join
  2829.  
  2830. 8. For a View created using the WITH CHECK OPTION keywords, which of the following statements are true? Mark for Review
  2831. (1) Points
  2832. Prohibits DML actions without administrator CHECK approval
  2833. The view will allow the user to check it against the data dictionary
  2834. Prohibits changing rows not returned by the subquery in the view definition. (*)
  2835. Allows for DELETES from other tables, including ones not listed in subquery
  2836.  
  2837. 9. Which statement about performing DML operations on a view is true? Mark for Review
  2838. (1) Points
  2839.  
  2840. You can perform DML operations on a view that contains columns defined by expressions, such as COST + 1.
  2841.  
  2842. You can perform DML operations on simple views. (*)
  2843.  
  2844. You can perform DML operations on a view that contains the WITH READ ONLY option.
  2845.  
  2846. You cannot perform DML operations on a view that contains the WITH CHECK OPTION clause.
  2847.  
  2848. 10. Which option would you use when creating a view to ensure that no DML operations occur on the view? Mark for Review
  2849. (1) Points
  2850. NOFORCE
  2851. FORCE
  2852. WITH ADMIN OPTION
  2853. WITH READ ONLY (*)
  2854.  
  2855. 11. Unlike tables, views contain no data of their own. True or False? Mark for Review
  2856. (1) Points
  2857. True (*)
  2858. False
  2859.  
  2860. 12. Views must be used to select data from a table. As soon as a view is created on a table, you can no longer select directly from the table. True or False? Mark for Review
  2861. (1) Points
  2862. True
  2863. False (*)
  2864.  
  2865. 13. A view can be used to keep a history record of old data from the underlying tables, so even if a row is deleted from a table, you can still select the row through the view. True or False? Mark for Review
  2866. (1) Points
  2867. True
  2868. False (*)
  2869.  
  2870. 14. Which of the following statements is a valid reason for using a view? Mark for Review
  2871. (1) Points
  2872. Views are used when you only want to restrict DML operations using a WITH CHECK OPTION.
  2873.  
  2874. 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. (*)
  2875.  
  2876. Views are not valid unless you have more than one user.
  2877.  
  2878. Views allow access to the data because the view displays all of the columns from the table.
  2879.  
  2880. 15. You need to create a view on the SALES table, but the SALES table has not yet been created. Which statement is true? Mark for Review
  2881. (1) Points
  2882.  
  2883. You can create the table and the view at the same time using the FORCE option.
  2884. You must create the SALES table before creating the view.
  2885.  
  2886. You can use the FORCE option to create the view before the SALES table has been created. (*)
  2887.  
  2888. By default, the view will be created even if the SALES table does not exist.
  2889.  
  2890. 1. Which of the following keywords cannot be used when creating a view? Mark for Review
  2891. (1) Points
  2892. HAVING
  2893. WHERE
  2894. ORDER BY (*)
  2895. They are all valid keywords when creating views.
  2896.  
  2897. 2. A view can contain a select statement with a subquery. True or False? Mark for Review
  2898. (1) Points
  2899. True (*)
  2900. False
  2901.  
  2902. 3. You need to create a view on the SALES table, but the SALES table has not yet been created. Which statement is true? Mark for Review
  2903. (1) Points
  2904. You must create the SALES table before creating the view.
  2905. By default, the view will be created even if the SALES table does not exist.
  2906. You can create the table and the view at the same time using the FORCE option.
  2907.  
  2908. You can use the FORCE option to create the view before the SALES table has been created. (*)
  2909.  
  2910. 4. The FACULTY table contains these columns:
  2911. FACULTYID VARCHAR2(5) NOT NULL PRIMARY KEY
  2912. FIRST_NAME VARCHAR2(20)
  2913. LAST_NAME VARCHAR2(20)
  2914. ADDRESS VARCHAR2(35)
  2915. CITY VARCHAR2(15)
  2916. STATE VARCHAR2(2)
  2917. ZIP NUMBER(9)
  2918. TELEPHONE NUMBER(10)
  2919. STATUS VARCHAR2(2) NOT NULL
  2920.  
  2921. The COURSE table contains these columns:
  2922.  
  2923. COURSEID VARCHAR2(5) NOT NULL PRIMARY KEY
  2924. SUBJECT VARCHAR2(5)
  2925. TERM VARCHAR2(6)
  2926. FACULTYID VARCHAR2(5) NOT NULL FOREIGN KEY
  2927.  
  2928. 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?
  2929.  
  2930. Mark for Review
  2931. (1) Points
  2932.  
  2933. CREATE VIEW pt_view AS
  2934. (SELECT first_name, last_name, status, courseid, subject, term
  2935. FROM faculty f, course c
  2936. WHERE f.facultyid = c.facultyid);
  2937. (*)
  2938.  
  2939. CREATE VIEW pt_view IN (SELECT first_name, last_name, status, courseid, subject, term
  2940. FROM faculty course);
  2941.  
  2942. CREATE VIEW
  2943. (SELECT first_name, last_name, status, courseid, subject, term
  2944. FROM faculty, course
  2945. WHERE facultyid = facultyid);
  2946.  
  2947. CREATE VIEW pt_view
  2948. ON (SELECT first_name, last_name, status, courseid, subject, term
  2949. FROM faculty f and course c
  2950. WHERE f.facultyid = c.facultyid);
  2951.  
  2952. 5. What is one advantage of using views? Mark for Review
  2953. (1) Points
  2954. To be able to store the same data in more than one place
  2955. To provide data dependence
  2956. To provide restricted data access (*)
  2957.  
  2958. 6. You administer an Oracle database. Jack manages the Sales department. He and his employees often find it necessary to query the database to identify customers and their orders. He has asked you to create a view that will simplify this procedure for himself and his staff. The view should not accept INSERT, UPDATE, or DELETE operations. Which of the following statements should you issue? Mark for Review
  2959. (1) Points
  2960.  
  2961. CREATE VIEW sales_view
  2962. AS (SELECT c.companyname, c.city, o.orderid, o. orderdate, o.total
  2963. FROM customers c, orders o
  2964. WHERE c.custid = o.custid)
  2965. WITH READ ONLY;
  2966. (*)
  2967.  
  2968. CREATE VIEW sales_view
  2969. AS (SELECT companyname, city, orderid, orderdate, total
  2970. FROM customers, orders
  2971. WHERE custid = custid)
  2972. WITH READ ONLY;
  2973.  
  2974. CREATE VIEW sales_view
  2975. (SELECT c.companyname, c.city, o.orderid, o. orderdate, o.total
  2976. FROM customers c, orders o
  2977. WHERE c.custid = o.custid)
  2978. WITH READ ONLY;
  2979.  
  2980. CREATE VIEW sales_view
  2981. AS (SELECT c.companyname, c.city, o.orderid, o. orderdate, o.total
  2982. FROM customers c, orders o
  2983. WHERE c.custid = o.custid);
  2984.  
  2985. 7. You can create a view if the view subquery contains an inline view. True or False? Mark for Review
  2986. (1) Points
  2987. True (*)
  2988. False
  2989.  
  2990. 8. For a View created using the WITH CHECK OPTION keywords, which of the following statements are true? Mark for Review
  2991. (1) Points
  2992. Prohibits DML actions without administrator CHECK approval
  2993. The view will allow the user to check it against the data dictionary
  2994. Prohibits changing rows not returned by the subquery in the view definition. (*)
  2995. Allows for DELETES from other tables, including ones not listed in subquery
  2996.  
  2997. 9. Only one type of view exists. True or False? Mark for Review
  2998. (1) Points
  2999. True
  3000. False (*)
  3001.  
  3002. 10. What is the purpose of including the WITH CHECK OPTION clause when creating a view? Mark for Review
  3003. (1) Points
  3004. To make sure that data is not duplicated in the view
  3005.  
  3006. To insure that no rows are updated through the view that would prevent those rows from being returned by the view in the future. (*)
  3007.  
  3008. To keep views form being queried by unauthorized persons
  3009. To make sure that the parent table(s) actually exist
  3010.  
  3011. 11. The EMPLOYEES table contains these columns:
  3012. EMPLOYEE_ID NUMBER
  3013. LAST_NAME VARCHAR2(25)
  3014. FIRST_NAME VARCHAR2(25)
  3015. DEPARTMENT_ID NUMBER
  3016. JOB_ID NUMBER
  3017. MANAGER_ID NUMBER
  3018. SALARY NUMBER(9,2)
  3019. COMMISSOIN NUMBER(7,2)
  3020. HIRE_DATE DATE
  3021.  
  3022. Which SELECT statement could be used to display the 10 lowest paid clerks that belong to department 70?
  3023.  
  3024. Mark for Review
  3025. (1) Points
  3026.  
  3027. SELECT ROWNUM "Ranking", last_name||' ,'||first_name "Employee", salary "Salary"
  3028. FROM (SELECT last_name, first_name, salary
  3029. FROM employees
  3030. ORDER BY salary)
  3031. WHERE ROWNUM <=10 AND job_id LIKE 'CLERK' AND department_id = 70;
  3032.  
  3033. SELECT ROWNUM "Ranking",last_name||','||first_name "Employee", salary "Salary"
  3034. FROM (SELECT last_name, first_name, salary, job_id
  3035. FROM employees
  3036. WHERE job_id LIKE 'CLERK' AND department_id = 70
  3037. ORDER BY salary)
  3038. WHERE ROWNUM <=10;
  3039. (*)
  3040.  
  3041. SELECT ROWNUM "Ranking", last_name||' ,'||first_name "Employee", salary "Salary"
  3042. FROM (SELECT last_name, first_name, salary, job_id, dept_id
  3043. FROM employees
  3044. WHERE ROWNUM <=10
  3045. ORDER BY salary)
  3046. WHERE job_id LIKE 'CLERK' AND department_id = 70;
  3047.  
  3048. The only way is to use the data dictionary.
  3049.  
  3050. 12. Which of the following describes a top-N query? Mark for Review
  3051. (1) Points
  3052.  
  3053. A top-N query returns a limited result set, returning data based on highest or lowest criteria. (*)
  3054.  
  3055. A top-N query returns a result set that is sorted according to the specified column values.
  3056. A top-N query returns the top 15 records from the specified table.
  3057. A top-N query returns the bottom 15 records from the specified table.
  3058.  
  3059. 13. Which statement about an inline view is true? Mark for Review
  3060. (1) Points
  3061. An inline view is a subquery in the FROM clause, often named with an alias. (*)
  3062. An inline view can be used to perform DML operations.
  3063. An inline view is a complex view.
  3064. An inline view is a schema object.
  3065.  
  3066. 14. Which of these is not a valid type of View? Mark for Review
  3067. (1) Points
  3068. INLINE
  3069. COMPLEX
  3070. SIMPLE
  3071. ONLINE (*)
  3072.  
  3073. 15. You must create a view that will display the name, customer identification number, new balance, finance charge, and credit limit of all customers.
  3074. You issue this statement:
  3075. CREATE OR REPLACE VIEW CUST_CREDIT_V
  3076. AS SELECT c.last_name, c.customer_id, a.new_balance, a.finance_charge, a.credit_limit
  3077. FROM customers c, accounts a
  3078. WHERE c.account_id = a.account_id WITH READ ONLY;
  3079.  
  3080. Which type of SQL command can be issued on the CUST_CREDIT_V view?
  3081.  
  3082. Mark for Review
  3083. (1) Points
  3084. UPDATE
  3085. INSERT
  3086. DELETE
  3087.  
  3088. SELECT (*)
  3089.  
  3090. Section 16 Quiz Database Programming With SQL
  3091. Section 16 Quiz
  3092. (Answer all questions in this section)
  3093.  
  3094. 1. Sequences can be used to: (Choose three) Mark for Review
  3095. (1) Points
  3096. (Choose all correct answers)
  3097. Generate a range of numbers and optionally cycle through them again (*)
  3098. Set a fixed interval between successively generated numbers. (*)
  3099. Ensure primary key values will be unique and consecutive
  3100. Guarantee that no primary key values are unused
  3101. Ensure primary key values will be unique even though gaps may exist (*)
  3102.  
  3103. 2. Evaluate this CREATE SEQUENCE statement:
  3104. CREATE SEQUENCE line_item_id_seq INCREMENT BY -1;
  3105.  
  3106. Which statement is true?
  3107.  
  3108. Mark for Review
  3109. (1) Points
  3110. The statement will not execute successfully.
  3111. The minimum value of the LINE_ITEM_ID_SEQ will be the smallest possible integer value.
  3112. The starting value of the LINE_ITEM_ID_SEQ sequence will by -1.
  3113. The sequence will generate sequential descending values. (*)
  3114.  
  3115. 3. Examine the code for creating this sequence:
  3116. CREATE SEQUENCE track_id_seq
  3117. INCREMENT BY 10
  3118. START WITH 1000 MAXVALUE 10000
  3119. What are the first three values that would be generated by the sequence?
  3120.  
  3121. Mark for Review
  3122. (1) Points
  3123. 0, 1, 2
  3124. 1000, 1010, 1020 (*)
  3125. 1100, 1200, 1300
  3126. 100010011002
  3127.  
  3128. 4. You create a CUSTOMERS table in which CUSTOMER_ID is designated as a primary key. You want the values that are entered into the CUSTOMER_ID column to be generated automatically. Which of the following actions should you perform? Mark for Review
  3129. (1) Points
  3130.  
  3131. Do nothing. Oracle automatically generates unique values for columns that are defined as primary keys.
  3132.  
  3133. Specify a UNIQUE constraint on the CUSTOMER_ID column.
  3134. Create a synonym.
  3135. Create a sequence. (*)
  3136.  
  3137. 5. You need to retrieve the next available value for the SALES_IDX sequence.
  3138. Which would you include in your SQL statement? Mark for Review
  3139. (1) Points
  3140. sales_idx.CURRVAL
  3141. sales_idx.NEXTVAL (*)
  3142. sales_idx.NEXT
  3143. sales_idx
  3144.  
  3145. 6. Which statement would you use to modify the EMP_ID_SEQ sequence used to populate the EMPLOYEE_ID column in the EMPLOYEES table? Mark for Review
  3146. (1) Points
  3147.  
  3148. ALTER SEQUENCE emp_id_seq; (*)
  3149. ALTER TABLE employees ;
  3150. CREATE SEQUENCE emp_id_seq;
  3151. ALTER SEQUENCE emp_id_seq.employee_id;
  3152.  
  3153. 7. Why do gaps in sequences occur? Mark for Review
  3154. (1) Points
  3155. A rollback is executed
  3156. The system crashes
  3157. The sequence is used in another table
  3158. All of the above (*)
  3159.  
  3160. 8. You create a sequence with the following statement:
  3161. CREATE SEQUENCE my_emp_seq;
  3162.  
  3163. Which of the following statements about this sequence are true? (Choose two)
  3164.  
  3165. Mark for Review
  3166. (1) Points
  3167. (Choose all correct answers)
  3168. The sequence will not cache a range of numbers in memory.
  3169. MAXVALUE is 10^27 for an ascending sequence. (*)
  3170. When the sequence exceeds its maximum value it will continue to generate numbers starting with MINVALUE.
  3171. MINVALUE is equal to 1. (*)
  3172.  
  3173. 9. The EMPLOYEES table has an index named LN_IDX on the LAST_NAME column. You want to change this index so that it is on the FIRST_NAME column instead. Which SQL statement will do this? Mark for Review
  3174. (1) Points
  3175. ALTER INDEX ln_idx ON employees(first_name);
  3176. ALTER INDEX ln_idx TO employees(first_name);
  3177. ALTER INDEX ln_idx TO fn_idx ON employees(first_name);
  3178. None of the above; you cannot ALTER an index. (*)
  3179.  
  3180. ‘;10. User Mary's schema contains an EMP table. Mary has Database Administrator privileges and executes the following statement:
  3181. CREATE PUBLIC SYNONYM emp FOR mary.emp;
  3182.  
  3183. User Susan now needs to SELECT from Mary's EMP table. Which of the following SQL statements can she use? (Choose two)
  3184.  
  3185. Mark for Review
  3186. (1) Points
  3187.  
  3188. (Choose all correct answers)
  3189. SELECT * FROM emp; (*)
  3190. SELECT * FROM mary.emp; (*)
  3191. CREATE SYNONYM marys_emp FOR mary(emp);
  3192. SELECT * FROM emp.mary;
  3193.  
  3194. 11. Barry creates a table named INVENTORY. Pam must be able to query the same table. Barry wants to enable Pam to query the table without being required to specify the table's schema. Which of the following should Barry create? Mark for Review
  3195. (1) Points
  3196. A view
  3197. A synonym (*)
  3198. An index
  3199. A schema
  3200.  
  3201. 12. 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
  3202. (1) Points
  3203. USER_OBJECTS
  3204. USER_INDEXES
  3205. USER_IND_COLUMNS (*)
  3206. USER_TABLES
  3207.  
  3208. 13. The following indexes exist on the EMPLOYEES table:
  3209. A unique index on the EMPLOYEE_ID primary key column
  3210. A non-unique index on the JOB_ID column
  3211. A composite index on the FIRST_NAME and LAST_NAME columns.
  3212. If the EMPLOYEES table is dropped, which indexes are automatically dropped at the same time?
  3213.  
  3214. Mark for Review
  3215. (1) Points
  3216. EMP_ID only
  3217. JOB_ID only
  3218. DEPT_ID only
  3219. EMP_ID and JOB_ID
  3220. All Indexes (*)
  3221.  
  3222. 14. Unique indexes are automatically created on columns that have which two types of constraints? Mark for Review
  3223. (1) Points
  3224. NOT NULL and UNIQUE
  3225. UNIQUE and PRIMARY KEY (*)
  3226. UNIQUE and FOREIGN KEY
  3227. PRIMARY KEY and FOREIGN KEY
  3228.  
  3229. 15. The EMPLOYEES table contains these columns:
  3230. EMPLOYEE_ID NUMBER NOT NULL, Primary Key
  3231. LAST_NAME VARCHAR2 (20)
  3232. FIRST_NAME VARCHAR2 (20)
  3233. DEPARTMENT_ID NUMBER Foreign Key to PRODUCT_ID column of the PRODUCT table
  3234. HIRE_DATE DATE DEFAULT SYSDATE
  3235. SALARY NUMBER (8,2) NOT NULL
  3236.  
  3237. On which column is an index automatically created for the EMPLOYEES table?
  3238.  
  3239. Mark for Review
  3240. (1) Points
  3241. DEPARTMENT_ID
  3242. HIRE_DATE
  3243. EMPLOYEE_ID (*)
  3244. LAST_NAME
  3245. SALARY
  3246.  
  3247. 1. Evaluate this CREATE SEQUENCE statement:
  3248. CREATE SEQUENCE order_id_seq NOCYCLE NOCACHE;
  3249.  
  3250. Which statement is true?
  3251.  
  3252. Mark for Review
  3253. (1) Points
  3254. The sequence will start with 1. (*)
  3255. The sequence preallocates values and retains them in memory.
  3256. The sequence has no maximum value.
  3257. The sequence will continue to generate values after reaching its maximum value.
  3258.  
  3259. 2. In order to be able to generate primary key values that are not likely to contain gaps, which phrase should be included in the sequence creation statement? Mark for Review
  3260. (1) Points
  3261. MAXVALUE
  3262. CACHE
  3263. NOCACHE (*)
  3264.  
  3265. 3. You need to retrieve the next available value for the SALES_IDX sequence.
  3266. Which would you include in your SQL statement? Mark for Review
  3267. (1) Points
  3268. sales_idx.CURRVAL
  3269. sales_idx.NEXT
  3270. sales_idx
  3271. sales_idx.NEXTVAL (*)
  3272.  
  3273. 4. Evaluate this statement:
  3274. CREATE SEQUENCE sales_item_id_seq
  3275. START WITH 101 MAXVALUE 9000090 CYCLE;
  3276.  
  3277. Which statement about this CREATE SEQUENCE statement is true?
  3278.  
  3279. Mark for Review
  3280. (1) Points
  3281. The sequence will generate sequence numbers starting with 101, but will not reuse numbers.
  3282. The statement fails because no INCREMENT BY value is specified.
  3283. The sequence will generate decrementing sequence numbers starting at 101.
  3284. The sequence will reuse numbers and will start with 101. (*)
  3285.  
  3286. 5. You created the LOCATION_ID_SEQ sequence to generate sequential values for the LOCATION_ID column in the MANUFACTURERS table. You issue this statement:
  3287. ALTER TABLE manufacturers
  3288. MODIFY (location_id NUMBER(6));
  3289.  
  3290. Which statement about the LOCATION_ID_SEQ sequence is true?
  3291.  
  3292. Mark for Review
  3293. (1) Points
  3294. The sequence is unchanged. (*)
  3295. The current value of the sequence is reset to zero.
  3296. The sequence is deleted and must be recreated.
  3297. The current value of the sequence is reset to the sequence's START WITH value.
  3298.  
  3299. 6. Which dictionary view would you query to display the number most recently generated by a sequence? Mark for Review
  3300. (1) Points
  3301. USER_CURRVALUES
  3302. USER_TABLES
  3303. USER_SEQUENCES (*)
  3304. USER_OBJECTS
  3305.  
  3306. 7. Why do gaps in sequences occur? Mark for Review
  3307. (1) Points
  3308. A rollback is executed
  3309. The system crashes
  3310. The sequence is used in another table
  3311. All of the above (*)
  3312.  
  3313. 8. Nextval and Currval are known as column aliases. True or False? Mark for Review
  3314. (1) Points
  3315. True
  3316. False (*)
  3317.  
  3318. 9. Which of the following is created automatically by Oracle when a UNIQUE integrity constraint is created? Mark for Review
  3319. (1) Points
  3320. A PRIMARY KEY constraint
  3321. A FOREIGN KEY constraint
  3322. An index (*)
  3323. A CHECK constraint
  3324.  
  3325. 10. Which statement would you use to remove the LAST_NAME_IDX index on the LAST_NAME column of the EMPLOYEES table? Mark for Review
  3326. (1) Points
  3327. DROP INDEX last_name_idx(last_name);
  3328.  
  3329. ALTER TABLE employees
  3330. DROP INDEX last_name_idx;
  3331.  
  3332. DROP INDEX last_name_idx(employees.last_name);
  3333.  
  3334. DROP INDEX last_name_idx;(*)
  3335.  
  3336. 11. The following indexes exist on the EMPLOYEES table:
  3337. A unique index on the EMPLOYEE_ID primary key column
  3338. A non-unique index on the JOB_ID column
  3339. A composite index on the FIRST_NAME and LAST_NAME columns.
  3340. If the EMPLOYEES table is dropped, which indexes are automatically dropped at the same time?
  3341.  
  3342. Mark for Review
  3343. (1) Points
  3344. EMP_ID only
  3345. JOB_ID only
  3346. DEPT_ID only
  3347. EMP_ID and JOB_ID
  3348. All Indexes (*)
  3349.  
  3350. 12. All tables must have indexes on them otherwise they cannot be queried. True or False? Mark for Review
  3351. (1) Points
  3352. True
  3353. False (*)
  3354.  
  3355. 13. Which of the following SQL statements shows a correct syntax example of creating a synonym accessible to all users of a database? Mark for Review
  3356. (1) Points
  3357. CREATE UNRESTRICTED SYNONYM emp FOR EMPLOYEES
  3358. CREATE PUBLIC SYNONYM emp FOR EMPLOYEES (*)
  3359. CREATE SHARED SYNONYM emp FOR EMPLOYEES
  3360. CREATE SYNONYM emp FOR EMPLOYEES
  3361.  
  3362. 14. What is the correct syntax for creating an index? Mark for Review
  3363. (1) Points
  3364. CREATE index_name INDEX ON table_name.column_name;
  3365. CREATE INDEX ON table_name(column_name);
  3366. CREATE OR REPLACE INDEX index_name ON table_name(column_name);
  3367. CREATE INDEX index_name ON table_name(column_name); (*)
  3368.  
  3369. 15. The EMPLOYEES table contains these columns:
  3370. EMPLOYEE_ID NUMBER NOT NULL, Primary Key
  3371. LAST_NAME VARCHAR2 (20)
  3372. FIRST_NAME VARCHAR2 (20)
  3373. DEPARTMENT_ID NUMBER Foreign Key to PRODUCT_ID column of the PRODUCT table
  3374. HIRE_DATE DATE DEFAULT SYSDATE
  3375. SALARY NUMBER (8,2) NOT NULL
  3376.  
  3377. On which column is an index automatically created for the EMPLOYEES table?
  3378.  
  3379. Mark for Review
  3380. (1) Points
  3381. LAST_NAME
  3382. EMPLOYEE_ID (*)
  3383. DEPARTMENT_ID
  3384. HIRE_DATE
  3385. SALARY
  3386.  
  3387. 1. What is the correct syntax for creating a private synonym d_sum for the view DEPT_SUM_VU? Mark for Review
  3388. (1) Points
  3389.  
  3390. CREATE d_sum SYNONYM
  3391. FOR dept_sum_vu;
  3392.  
  3393. CREATE SYNONYM d_sum
  3394. FOR dept_sum_vu;(*)
  3395.  
  3396. CREATE SYNONYM d_sum
  3397. ON dept_sum_vu;
  3398.  
  3399. UPDATE dept_sum_vu
  3400. ON SYNONYM d_sum;
  3401.  
  3402. 2. What kind of INDEX is created by Oracle when you create a primary key? Mark for Review
  3403. (1) Points
  3404. UNIQUE INDEX (*)
  3405. NONUNIQUE INDEX
  3406. INDEX
  3407. Oracle cannot create indexes automatically.
  3408.  
  3409. 3. Indexes can be used to speed up queries. True or False? Mark for Review
  3410. (1) Points
  3411. True (*)
  3412. False
  3413.  
  3414. 4. When creating an index on one or more columns of a table, which of the following statements are true?
  3415. (Choose two) Mark for Review
  3416. (1) Points
  3417. (Choose all correct answers)
  3418.  
  3419. You should create an index if one or more columns are frequently used together in a join condition. (*)
  3420.  
  3421. You should create an index if the table is large and most queries are expected to retrieve less than 2 to 4 percent of the rows. (*)
  3422.  
  3423. You should create an index if the table is very small.
  3424.  
  3425. You should always create an index on tables that are frequently updated.
  3426.  
  3427. 5. The CUSTOMERS table exists in user Mary's schema. Which statement should you use to create a synonym for all database users on the CUSTOMERS table? Mark for Review
  3428. (1) Points
  3429. CREATE PUBLIC SYNONYM cust ON mary.customers;
  3430. CREATE PUBLIC SYNONYM cust FOR mary.customers;(*)
  3431. CREATE SYNONYM cust ON mary.customers FOR PUBLIC;
  3432. CREATE SYNONYM cust ON mary.customers;
  3433. GRANT SELECT ON cust TO PUBLIC;
  3434.  
  3435. 6. Which of the following best describes the function of an index? Mark for Review
  3436. (1) Points
  3437. An index can run statement blocks when DML actions occur against a table.
  3438. An index can reduce the time required to grant multiple privileges to users.
  3439. An index can prevent users from viewing certain data in a table.
  3440. An index can increase the performance of SQL queries that search large tables. (*)
  3441.  
  3442. 7. Which of the following is created automatically by Oracle when a UNIQUE integrity constraint is created? Mark for Review
  3443. (1) Points
  3444. A PRIMARY KEY constraint
  3445. An index (*)
  3446. A CHECK constraint
  3447. A FOREIGN KEY constraint
  3448.  
  3449. 8. Which statement would you use to modify the EMP_ID_SEQ sequence used to populate the EMPLOYEE_ID column in the EMPLOYEES table? Mark for Review
  3450. (1) Points
  3451. ALTER TABLE employees ;
  3452. CREATE SEQUENCE emp_id_seq;
  3453. ALTER SEQUENCE emp_id_seq; (*)
  3454. ALTER SEQUENCE emp_id_seq.employee_id;
  3455.  
  3456. 9. The ALTER SEQUENCE statement can be used to: Mark for Review
  3457. (1) Points
  3458. Change the maximum value to a lower number than was last used
  3459. Change the amount a sequence increments each time a number is generated (*)
  3460. Change the START WITH value of a sequence
  3461. Change the name of the sequence
  3462.  
  3463. 10. A sequence is a database object. True or False? Mark for Review
  3464. (1) Points
  3465. True (*)
  3466. False
  3467.  
  3468. 11. You issue this statement:
  3469. ALTER SEQUENCE po_sequence INCREMENT BY 2;
  3470.  
  3471. Which statement is true?
  3472.  
  3473. Mark for Review
  3474. (1) Points
  3475. Sequence numbers will be cached.
  3476. Future sequence numbers generated will increase by 2 each time a number is generated. (*)
  3477. If the PO_SEQUENCE sequence does not exist, it will be created.
  3478. The statement fails if the current value of the sequence is greater than the START WITH value.
  3479.  
  3480. 12. Sequences can be used to: (Choose three) Mark for Review
  3481. (1) Points
  3482. (Choose all correct answers)
  3483. Generate a range of numbers and optionally cycle through them again (*)
  3484. Guarantee that no primary key values are unused
  3485. Set a fixed interval between successively generated numbers. (*)
  3486. Ensure primary key values will be unique even though gaps may exist (*)
  3487. Ensure primary key values will be unique and consecutive
  3488.  
  3489. 13. Evaluate this CREATE SEQUENCE statement:
  3490. CREATE SEQUENCE line_item_id_seq CYCLE;
  3491.  
  3492. Which statement is true?
  3493.  
  3494. Mark for Review
  3495. (1) Points
  3496. The sequence cannot be used with more than one table.
  3497. The sequence preallocates values and retains them in memory.
  3498. The sequence cannot generate additional values after reaching its maximum value.
  3499. The sequence will continue to generate values after the maximum sequence value has been generated. (*)
  3500.  
  3501. 14. Evaluate this CREATE SEQUENCE statement:
  3502. CREATE SEQUENCE order_id_seq NOCYCLE NOCACHE;
  3503.  
  3504. Which statement is true?
  3505.  
  3506. Mark for Review
  3507. (1) Points
  3508. The sequence will start with 1. (*)
  3509. The sequence will continue to generate values after reaching its maximum value.
  3510. The sequence has no maximum value.
  3511. The sequence preallocates values and retains them in memory.
  3512.  
  3513. 15. You created the LOCATION_ID_SEQ sequence to generate sequential values for the LOCATION_ID column in the MANUFACTURERS table. You issue this statement:
  3514. ALTER TABLE manufacturers
  3515. MODIFY (location_id NUMBER(6));
  3516.  
  3517. Which statement about the LOCATION_ID_SEQ sequence is true?
  3518.  
  3519. Mark for Review
  3520. (1) Points
  3521. The current value of the sequence is reset to the sequence's START WITH value.
  3522. The sequence is deleted and must be recreated.
  3523. The current value of the sequence is reset to zero.
  3524. The sequence is unchanged. (*)
  3525.  
  3526. 1. Creating a sequence with NOCACHE ensures that all numbers in the sequence's range will be used successfully. True or False? Mark for Review
  3527. (1) Points
  3528. True
  3529. False (*)
  3530.  
  3531. 2. Which of the following best describes the function of the NEXTVAL virtual column? Mark for Review
  3532. (1) Points
  3533.  
  3534. The NEXTVAL virtual column displays the order in which Oracle retrieves row data from a table.
  3535.  
  3536. The NEXTVAL virtual column returns the integer that was most recently supplied by the sequence.
  3537.  
  3538. The NEXTVAL virtual column increments a sequence by a predetermined value. (*)
  3539.  
  3540. The NEXTVAL virtual column displays only the physical locations of the rows in a table.
  3541.  
  3542. 3. Evaluate this CREATE SEQUENCE statement:
  3543. CREATE SEQUENCE line_item_id_seq INCREMENT BY -1;
  3544.  
  3545. Which statement is true?
  3546.  
  3547. Mark for Review
  3548. (1) Points
  3549. The minimum value of the LINE_ITEM_ID_SEQ will be the smallest possible integer value.
  3550. The starting value of the LINE_ITEM_ID_SEQ sequence will by -1.
  3551. The statement will not execute successfully.
  3552. The sequence will generate sequential descending values. (*)
  3553.  
  3554. 4. Why do gaps in sequences occur? Mark for Review
  3555. (1) Points
  3556. A rollback is executed
  3557. The system crashes
  3558. The sequence is used in another table
  3559. All of the above (*)
  3560.  
  3561. 5. When used in a CREATE SEQUENCE statement, which keyword specifies that a range of sequence values will be preloaded into memory? Mark for Review
  3562. (1) Points
  3563. LOAD
  3564. NOCYCLE
  3565. NOCACHE
  3566. CACHE (*)
  3567. MEMORY
  3568.  
  3569. 6. Which pseudocolumn returns the latest value supplied by a sequence? Mark for Review
  3570. (1) Points
  3571. NEXT
  3572. CURRENT
  3573. NEXTVAL
  3574. CURRVAL (*)
  3575.  
  3576. 7. Which statement would you use to remove the EMP_ID_SEQ sequence? Mark for Review
  3577. (1) Points
  3578. ALTER SEQUENCE emp_id_seq;
  3579. DROP SEQUENCE emp_id_seq; (*)
  3580. REMOVE SEQUENCE emp_id_seq;
  3581. DELETE SEQUENCE emp_id_seq;
  3582.  
  3583. 8. Evaluate this statement:
  3584. CREATE SEQUENCE line_item_id_seq
  3585. MINVALUE 100 MAXVALUE 130 INCREMENT BY -10 CYCLE;
  3586.  
  3587. What will be the first five numbers generated by this sequence?
  3588.  
  3589. Mark for Review
  3590. (1) Points
  3591. 130120110100130
  3592. The fifth number cannot be generated.
  3593. 100110120130100
  3594. The CREATE SEQUENCE statement will fail because a START WITH value was not specified. (*)
  3595.  
  3596. 9. The CLIENTS table contains these columns:
  3597. CLIENT_ID NUMBER(4) NOT NULL PRIMARY KEY
  3598. LAST_NAME VARCHAR2(15)
  3599. FIRST_NAME VARCHAR2(10)
  3600. CITY VARCHAR2(15)
  3601. STATE VARCHAR2(2)
  3602.  
  3603. You want to create an index named ADDRESS_INDEX on the CITY and STATE columns of the CLIENTS table. You execute this statement:
  3604.  
  3605. CREATE INDEX clients
  3606. ON address_index (city, state);
  3607.  
  3608. Which result does this statement accomplish?
  3609.  
  3610. Mark for Review
  3611. (1) Points
  3612. An index named CLIENTS is created on the CITY and STATE columns.
  3613. An index named CLIENTS_INDEX is created on the CLIENTS table.
  3614. An error message is produced, and no index is created. (*)
  3615. An index named ADDRESS_INDEX is created on the CITY and STATE columns.
  3616.  
  3617. 10. In SQL what is a synonym? Mark for Review
  3618. (1) Points
  3619. A table with the same number of columns as another table
  3620. A table with the same name as another view
  3621. A different name for a table, view, or other database object (*)
  3622. A table that must be qualified with a username
  3623.  
  3624. 11. Indexes can be used to speed up queries. True or False? Mark for Review
  3625. (1) Points
  3626. True (*)
  3627. False
  3628.  
  3629. 12. Barry creates a table named INVENTORY. Pam must be able to query the same table. Barry wants to enable Pam to query the table without being required to specify the table's schema. Which of the following should Barry create? Mark for Review
  3630. (1) Points
  3631. An index
  3632. A view
  3633. A synonym (*)
  3634. A schema
  3635.  
  3636. 13. The EMPLOYEES table contains these columns:
  3637. EMPLOYEE_ID NUMBER NOT NULL, Primary Key
  3638. LAST_NAME VARCHAR2 (20)
  3639. FIRST_NAME VARCHAR2 (20)
  3640. DEPARTMENT_ID NUMBER Foreign Key to PRODUCT_ID column of the PRODUCT table
  3641. HIRE_DATE DATE DEFAULT SYSDATE
  3642. SALARY NUMBER (8,2) NOT NULL
  3643.  
  3644. On which column is an index automatically created for the EMPLOYEES table?
  3645.  
  3646. Mark for Review
  3647. (1) Points
  3648. EMPLOYEE_ID (*)
  3649. LAST_NAME
  3650. HIRE_DATE
  3651. SALARY
  3652. DEPARTMENT_ID
  3653.  
  3654. 14. The following indexes exist on the EMPLOYEES table:
  3655. A unique index on the EMPLOYEE_ID primary key column
  3656. A non-unique index on the JOB_ID column
  3657. A composite index on the FIRST_NAME and LAST_NAME columns.
  3658. If the EMPLOYEES table is dropped, which indexes are automatically dropped at the same time?
  3659.  
  3660. Mark for Review
  3661. (1) Points
  3662. EMP_ID only
  3663. JOB_ID only
  3664. DEPT_ID only
  3665. EMP_ID and JOB_ID
  3666. All Indexes (*)
  3667.  
  3668. 15. You want to speed up the following query by creating an index:
  3669. SELECT * FROM employees WHERE (salary * 12) > 100000;
  3670.  
  3671. Which of the following will achieve this?
  3672.  
  3673. Mark for Review
  3674. (1) Points
  3675. Create an index on (salary).
  3676. Create a function_based index on ((salary * 12) > 100000).
  3677. Create a composite index on (salary,12).
  3678. Create a function-based index on (salary * 12). (*)
  3679.  
  3680. 1. Which of the following SQL statements will display the index name, table name, and the uniqueness of the index for all indexes on the EMPLOYEES table? Mark for Review
  3681. (1) Points
  3682.  
  3683. SELECT index_name, table_name, uniqueness
  3684. FROM user_indexes
  3685. WHERE index = EMPLOYEES;
  3686.  
  3687. CREATE index_name, table_name, uniqueness
  3688. FROM user_indexes
  3689. WHERE table_name = 'EMPLOYEES';
  3690.  
  3691. SELECT index_name, table_name, uniqueness
  3692. FROM 'EMPLOYEES';
  3693.  
  3694. SELECT index_name, table_name, uniqueness
  3695. FROM user_indexes
  3696. WHERE table_name = 'EMPLOYEES';
  3697. (*)
  3698.  
  3699. 2. Which statement would you use to remove the LAST_NAME_IDX index on the LAST_NAME column of the EMPLOYEES table? Mark for Review
  3700. (1) Points
  3701. DROP INDEX last_name_idx(last_name);
  3702.  
  3703. ALTER TABLE employees
  3704. DROP INDEX last_name_idx;
  3705.  
  3706. DROP INDEX last_name_idx(employees.last_name);
  3707.  
  3708. DROP INDEX last_name_idx;
  3709. (*)
  3710.  
  3711. 3. Indexes can be used to speed up queries. True or False? Mark for Review
  3712. (1) Points
  3713. True (*)
  3714. False
  3715.  
  3716. 4. As user Julie, you issue this statement:
  3717. CREATE SYNONYM emp FOR sam.employees;
  3718.  
  3719. Which task was accomplished by this statement?
  3720.  
  3721. Mark for Review
  3722. (1) Points
  3723. You created a public synonym on the EMPLOYEES table owned by user Sam.
  3724. You created a public synonym on the EMP table owned by user Sam.
  3725. You created a private synonym on the EMPLOYEES table that you own.
  3726. You created a private synonym on the EMPLOYEES table owned by user Sam. (*)
  3727. 5. For which column would you create an index? Mark for Review
  3728. (1) Points
  3729. A column that is updated frequently
  3730. A column that is infrequently used as a query search condition
  3731. A column which has only 4 distinct values.
  3732. A column with a large number of null values (*)
  3733.  
  3734. 6. You want to create a composite index on the FIRST_NAME and LAST_NAME columns of the EMPLOYEES table. Which SQL statement will accomplish this task? Mark for Review
  3735. (1) Points
  3736.  
  3737. CREATE INDEX fl_idx ON employees(first_name);
  3738. CREATE INDEX fl_idx ON employees(last_name);
  3739.  
  3740. CREATE INDEX fl_idx
  3741. ON employees(first_name || last_name);
  3742.  
  3743. CREATE INDEX fl_idx
  3744. ON employees(first_name), employees(last_name);
  3745.  
  3746. CREATE INDEX fl_idx
  3747. ON employees(first_name,last_name);
  3748. (*)
  3749.  
  3750. 7. What kind of INDEX is created by Oracle when you create a primary key? Mark for Review
  3751. (1) Points
  3752. UNIQUE INDEX (*)
  3753. NONUNIQUE INDEX
  3754. INDEX
  3755. Oracle cannot create indexes automatically.
  3756.  
  3757. 8. When creating a sequence, which keyword or option specifies the minimum sequence value? Mark for Review
  3758. (1) Points
  3759. CYCLE
  3760. MINVALUE (*)
  3761. MAXVALUE
  3762. NOMAXVALUE
  3763.  
  3764. 9. You create a CUSTOMERS table in which CUSTOMER_ID is designated as a primary key. You want the values that are entered into the CUSTOMER_ID column to be generated automatically. Which of the following actions should you perform? Mark for Review
  3765. (1) Points
  3766. Specify a UNIQUE constraint on the CUSTOMER_ID column.
  3767.  
  3768. Create a sequence. (*)
  3769.  
  3770. Do nothing. Oracle automatically generates unique values for columns that are defined as primary keys.
  3771.  
  3772. Create a synonym.
  3773.  
  3774. 10. Evaluate this statement:
  3775. CREATE SEQUENCE sales_item_id_seq
  3776. START WITH 101 MAXVALUE 9000090 CYCLE;
  3777.  
  3778. Which statement about this CREATE SEQUENCE statement is true?
  3779.  
  3780. Mark for Review
  3781. (1) Points
  3782.  
  3783. The sequence will generate sequence numbers starting with 101, but will not reuse numbers.
  3784. The sequence will reuse numbers and will start with 101. (*)
  3785. The statement fails because no INCREMENT BY value is specified.
  3786. The sequence will generate decrementing sequence numbers starting at 101.
  3787.  
  3788. 11. Creating a sequence with NOCACHE ensures that all numbers in the sequence's range will be used successfully. True or False? Mark for Review
  3789. (1) Points
  3790. True
  3791. False (*)
  3792.  
  3793. 12. When used in a CREATE SEQUENCE statement, which keyword specifies that a range of sequence values will be preloaded into memory? Mark for Review
  3794. (1) Points
  3795. NOCYCLE
  3796. NOCACHE
  3797. CACHE (*)
  3798. LOAD
  3799. MEMORY
  3800.  
  3801. 13. A sequence is a database object. True or False? Mark for Review
  3802. (1) Points
  3803. True (*)
  3804. False
  3805.  
  3806. 14. When you alter a sequence, a new increased MAXVALUE can be entered without changing the existing number order. True or False? Mark for Review
  3807. (1) Points
  3808.  
  3809.  
  3810. True (*)
  3811. False
  3812.  
  3813. 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
  3814. (1) Points
  3815. True (*)
  3816. False
  3817.  
  3818. 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
  3819. (1) Points
  3820. USER_INDEXES
  3821. USER_OBJECTS
  3822. USER_TABLES
  3823. USER_IND_COLUMNS (*)
  3824.  
  3825. 2. The CLIENTS table contains these columns:
  3826. CLIENT_ID NUMBER(4) NOT NULL PRIMARY KEY
  3827. LAST_NAME VARCHAR2(15)
  3828. FIRST_NAME VARCHAR2(10)
  3829. CITY VARCHAR2(15)
  3830. STATE VARCHAR2(2)
  3831.  
  3832. You want to create an index named ADDRESS_INDEX on the CITY and STATE columns of the CLIENTS table. You execute this statement:
  3833.  
  3834. CREATE INDEX clients
  3835. ON address_index (city, state);
  3836.  
  3837. Which result does this statement accomplish?
  3838.  
  3839. Mark for Review
  3840. (1) Points
  3841. An index named CLIENTS is created on the CITY and STATE columns.
  3842. An index named CLIENTS_INDEX is created on the CLIENTS table.
  3843. An index named ADDRESS_INDEX is created on the CITY and STATE columns.
  3844. An error message is produced, and no index is created. (*)
  3845.  
  3846. 3. What is the correct syntax for creating a private synonym d_sum for the view DEPT_SUM_VU? Mark for Review
  3847. (1) Points
  3848.  
  3849. UPDATE dept_sum_vu
  3850. ON SYNONYM d_sum;
  3851.  
  3852. CREATE SYNONYM d_sum
  3853. ON dept_sum_vu;
  3854.  
  3855. CREATE d_sum SYNONYM
  3856. FOR dept_sum_vu;
  3857.  
  3858. CREATE SYNONYM d_sum
  3859. FOR dept_sum_vu;
  3860. (*)
  3861.  
  3862. 4. All tables must have indexes on them otherwise they cannot be queried. True or False? Mark for Review
  3863. (1) Points
  3864. True
  3865. False (*)
  3866.  
  3867. 5. As user Julie, you issue this statement:
  3868. CREATE SYNONYM emp FOR sam.employees;
  3869.  
  3870. Which task was accomplished by this statement?
  3871.  
  3872. Mark for Review
  3873. (1) Points
  3874. You created a public synonym on the EMP table owned by user Sam.
  3875. You created a private synonym on the EMPLOYEES table that you own.
  3876. You created a private synonym on the EMPLOYEES table owned by user Sam. (*)
  3877. You created a public synonym on the EMPLOYEES table owned by user Sam.
  3878.  
  3879. 6. Which of the following SQL statements will display the index name, table name, and the uniqueness of the index for all indexes on the EMPLOYEES table? Mark for Review
  3880. (1) Points
  3881.  
  3882. SELECT index_name, table_name, uniqueness
  3883. FROM 'EMPLOYEES';
  3884.  
  3885. SELECT index_name, table_name, uniqueness
  3886. FROM user_indexes
  3887. WHERE index = EMPLOYEES;
  3888.  
  3889. SELECT index_name, table_name, uniqueness
  3890. FROM user_indexes
  3891. WHERE table_name = 'EMPLOYEES';
  3892. (*)
  3893.  
  3894. CREATE index_name, table_name, uniqueness
  3895. FROM user_indexes
  3896. WHERE table_name = 'EMPLOYEES';
  3897.  
  3898. 7. Which of the following is created automatically by Oracle when a UNIQUE integrity constraint is created? Mark for Review
  3899. (1) Points
  3900. An index (*)
  3901. A CHECK constraint
  3902. A PRIMARY KEY constraint
  3903. A FOREIGN KEY constraint
  3904.  
  3905. 8. Examine the code for creating this sequence:
  3906. CREATE SEQUENCE track_id_seq
  3907. INCREMENT BY 10
  3908. START WITH 1000 MAXVALUE 10000
  3909. What are the first three values that would be generated by the sequence?
  3910.  
  3911. Mark for Review
  3912. (1) Points
  3913. 100010011002
  3914. 1000, 1010, 1020 (*)
  3915. 0, 1, 2
  3916. 1100, 1200, 1300
  3917.  
  3918. 9. In order to be able to generate primary key values that are not likely to contain gaps, which phrase should be included in the sequence creation statement? Mark for Review
  3919. (1) Points
  3920. NOCACHE (*)
  3921. CACHE
  3922. MAXVALUE
  3923.  
  3924. 10. Which keyword is used to modify a sequence? Mark for Review
  3925. (1) Points
  3926. Alter (*)
  3927. Update
  3928. Change
  3929. Create
  3930.  
  3931. 11. Evaluate this statement:
  3932. SELECT po_itemid_seq.CURRVAL
  3933. FROM dual;
  3934.  
  3935. What does this statement accomplish?
  3936.  
  3937. Mark for Review
  3938. (1) Points
  3939. It displays the current value of the PO_ITEM_ID_SEQ sequence. (*)
  3940. It displays the next available value of the PO_ITEM_ID_SEQ sequence.
  3941. It resets the current value of the PO_ITEM_ID_SEQ sequence.
  3942. It sets the current value of the PO_ITEM_ID_SEQ sequence to the value of the PO_ITEMID column.
  3943.  
  3944. 12. Which is the correct syntax for specifying a maximum value in a sequence? Mark for Review
  3945. (1) Points
  3946. Maxval
  3947. Max_value
  3948. Maxvalue (*)
  3949. Maximumvalue
  3950.  
  3951. 13. Which statement would you use to remove the EMP_ID_SEQ sequence? Mark for Review
  3952. (1) Points
  3953. DELETE SEQUENCE emp_id_seq;
  3954. DROP SEQUENCE emp_id_seq; (*)
  3955. REMOVE SEQUENCE emp_id_seq;
  3956. ALTER SEQUENCE emp_id_seq;
  3957.  
  3958. 14. When you alter a sequence, a new increased MAXVALUE can be entered without changing the existing number order. True or False? Mark for Review
  3959. (1) Points
  3960. True (*)
  3961. False
  3962.  
  3963. 15. A gap can occur in a sequence because a user generated a number from the sequence and then rolled back the transaction. True or False? Mark for Review
  3964. (1) Points
  3965. True (*)
  3966.  
  3967. False
  3968.  
  3969. Section 17 Quiz
  3970. (Answer all questions in this section)
  3971.  
  3972. 1. Regular expressions used as check constraints are another way to ensure data is formatted correctly prior to being written into the database table. True or False? Mark for Review
  3973. (1) Points
  3974. True (*)
  3975. False
  3976.  
  3977. 2. Regular expressions are a method of describing both simple and complex patterns for searching and manipulating. True or False? Mark for Review
  3978. (1) Points
  3979. True (*)
  3980. False
  3981.  
  3982. 3. REGULAR EXPRESSIONS can be used as part of a contraint definition. (True or False?) Mark for Review
  3983. (1) Points
  3984. True (*)
  3985. False
  3986.  
  3987. 4. A role can be granted to another role. True or False? Mark for Review
  3988. (1) Points
  3989. True (*)
  3990. False
  3991.  
  3992. 5. Which of the following simplifies the administration of privileges? Mark for Review
  3993. (1) Points
  3994. A role (*)
  3995. A trigger
  3996. An index
  3997. A view
  3998.  
  3999. 6. Which keyword would you use to grant an object privilege to all database users? Mark for Review
  4000. (1) Points
  4001. ADMIN
  4002. PUBLIC (*)
  4003. ALL
  4004. USERS
  4005.  
  4006. 7. 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
  4007. (1) Points
  4008.  
  4009. He is not required to take any action because, by default, all database users can automatically access views.
  4010.  
  4011. He must grant each user the SELECT privilege on both the INVENTORY table and INVENTORY_V view.
  4012.  
  4013. He should assign the SELECT privilege to all database users for INVENTORY_V view. (*)
  4014.  
  4015. He should assign the SELECT privilege to all database users for the INVENTORY table.
  4016.  
  4017. 8. If you are granted privileges to your friend's object, by default you may also grant access to this same object to other users. True or False? Mark for Review
  4018. (1) Points
  4019. True
  4020. False (*)
  4021.  
  4022. 9. Which data dictionary view shows which system privileges have been granted to a user? Mark for Review
  4023. (1) Points
  4024.  
  4025. USER_SYSTEM_PRIVS
  4026. USER_TAB_PRIVS
  4027. USER_SYS_PRIVS (*)
  4028. USER_SYSTEM_PRIVILEGES
  4029.  
  4030. 10. A Schema is a collection of Objects such as Tables, Views, and Sequences. True or False? Mark for Review
  4031. (1) Points
  4032. True (*)
  4033. False
  4034.  
  4035. 11. The database administrator wants to allow user Marco to create new tables in his own schema. Which privilege should be granted to Marco? Mark for Review
  4036. (1) Points
  4037. CREATE OBJECT
  4038. CREATE ANY TABLE
  4039. CREATE TABLE (*)
  4040. SELECT
  4041.  
  4042. 12. You are the database administrator. You want to create a new user JONES with a password of MARK, and allow this user to create his own tables. Which of the following should you execute? Mark for Review
  4043. (1) Points
  4044.  
  4045. CREATE USER jones IDENTIFIED BY mark;
  4046. GRANT CREATE SESSION TO jones;
  4047.  
  4048. CREATE USER jones IDENTIFIED BY mark;
  4049. GRANT CREATE SESSION TO jones;
  4050. GRANT CREATE TABLE TO jones;
  4051. (*)
  4052.  
  4053. CREATE USER jones IDENTIFIED BY mark;
  4054. GRANT CREATE TABLE TO jones;
  4055.  
  4056. GRANT CREATE SESSION TO jones;
  4057. GRANT CREATE TABLE TO jones;
  4058.  
  4059. 13. Which Object Privilege (other than Alter) can be granted to a Sequence? Mark for Review
  4060. (1) Points
  4061. INSERT
  4062. DELETE
  4063. UPDATE
  4064. SELECT (*)
  4065.  
  4066. 14. Object privileges are: Mark for Review
  4067. (1) Points
  4068. Required to gain access to the database.
  4069. Required to manipulate the content of objects in the database. (*)
  4070. Named groups of related privileges given to a user.
  4071. A collection of objects, such as tables, views, and sequences.
  4072.  
  4073. 15. The following table shows some of the output from one of the data dictionary views. Which view is being queried?
  4074. USERNAME PRIVILEGE ADMIN_OPTION
  4075. USCA_ORACLE_SQL01_S08 CREATE VIEW NO
  4076. USCA_ORACLE_SQL01_S08 CREATE TABLE NO
  4077. USCA_ORACLE_SQL01_S08 CREATE SYNONYM NO
  4078. USCA_ORACLE_SQL01_S08 CREATE TRIGGER NO
  4079. USCA_ORACLE_SQL01_S08 CREATE SEQUENCE NO
  4080. USCA_ORACLE_SQL01_S08 CREATE DATABASE NO
  4081. Mark for Review
  4082. (1) Points
  4083. user_tab_privs_recd (lists object privileges granted to the user)
  4084. role_sys_privs (lists system privileges granted to roles)
  4085. role_tab_privs (lists table privileges granted to roles)
  4086. user_sys_privs (lists system privileges granted to the user) (*)
  4087.  
  4088. 1. Which of the following best describes a role in an Oracle database? Mark for Review
  4089. (1) Points
  4090. A role is a type of system privilege.
  4091. A role is a name for a group of privileges. (*)
  4092. A role is the part that a user plays in querying the database.
  4093. A role is an object privilege which allows a user to update a table.
  4094.  
  4095. 2. A schema is: Mark for Review
  4096. (1) Points
  4097. A named group of related privileges given to a user.
  4098. A collection of objects, such as tables, views, and sequences. (*)
  4099. Required to gain access to the database.
  4100. Required to manipulate the content of objects in the database.
  4101.  
  4102. 3. System privileges are: Mark for Review
  4103. (1) Points
  4104. Required to manipulate the content of objects in the database.
  4105. Named groups of related privileges given to a user.
  4106. Required to gain access to the database. (*)
  4107. A collection of objects, such as tables, views, and sequences.
  4108.  
  4109. 4. You grant user AMY the CREATE SESSION privilege. Which type of privilege have you granted to AMY? Mark for Review
  4110. (1) Points
  4111. A user privilege
  4112. An object privilege
  4113. An access privilege
  4114. A system privilege (*)
  4115.  
  4116. 5. User ADAM has successfully logged on to the database in the past, but today he receives an error message stating that (although he has entered his password correctly) he cannot log on. What is the most likely cause of the problem? Mark for Review
  4117. (1) Points
  4118. One or more object privileges have been REVOKEd from Adam.
  4119. ADAM's user account has been removed from the database.
  4120. ADAM's CREATE USER privilege has been revoked.
  4121. ADAM's CREATE SESSION privilege has been revoked. (*)
  4122.  
  4123. 6. Which of the following are system privileges?
  4124. (Choose two) Mark for Review
  4125. (1) Points
  4126. (Choose all correct answers)
  4127. INDEX
  4128. UPDATE
  4129. CREATE TABLE (*)
  4130. CREATE SYNONYM (*)
  4131.  
  4132. 7. _________________ are special characters that have a special meaning, such as a wildcard character, a repeating character, a non-matching character, or a range of characters. You can use several of these symbols in pattern matching. Mark for Review
  4133. (1) Points
  4134. Reference checks
  4135. Clip Art
  4136. Alphanumeric values
  4137. Meta characters (*)
  4138.  
  4139. 8. Regular expressions used as check constraints are another way to ensure data is formatted correctly prior to being written into the database table. True or False? Mark for Review
  4140. (1) Points
  4141. True (*)
  4142. False
  4143.  
  4144. 9. REGULAR EXPRESSIONS does exactly the same as LIKE--no more and no less. (True or False?) Mark for Review
  4145. (1) Points
  4146. True
  4147. False (*)
  4148.  
  4149. 10. A role can be granted to another role. True or False? Mark for Review
  4150. (1) Points
  4151. True (*)
  4152. False
  4153.  
  4154. 11. Which of the following best describes the purpose of the REFERENCES object privilege on a table? Mark for Review
  4155. (1) Points
  4156. It allows the user to create new tables which contain the same data as the referenced table.
  4157. It allows a user's session to read from the table but only so that foreign key constraints can be checked.
  4158. It allows a user to refer to the table in a SELECT statement.
  4159. It allows a user to create foreign key constraints on the table. (*)
  4160.  
  4161. 12. When a user is logged into one database, he is restricted to working with objects found in that database. True or False? Mark for Review
  4162. (1) Points
  4163. True
  4164. False (*)
  4165.  
  4166. 13. What Oracle feature simplifies the process of granting and revoking privileges? Mark for Review
  4167. (1) Points
  4168. Object
  4169. Data dictionary
  4170. Role (*)
  4171. Schema
  4172.  
  4173. 14. Which of the following statements about granting object privileges is false? Mark for Review
  4174. (1) Points
  4175. Object privileges can only be granted through roles. (*)
  4176.  
  4177. An object owner can grant any object privilege on the object to any other user or role of the database.
  4178.  
  4179. To grant privileges on an object, the object must be in your own schema, or you must have been granted the object privileges WITH GRANT OPTION.
  4180.  
  4181. The owner of an object automatically acquires all object privileges on that object.
  4182.  
  4183. 15. When granting an object privilege, which option would you include to allow the grantee to grant the privilege to another user? Mark for Review
  4184. (1) Points
  4185. WITH GRANT OPTION (*)
  4186. WITH ADMIN OPTION
  4187. PUBLIC
  4188. FORCE
  4189.  
  4190. 1. Which of the following best describes a role in an Oracle database? Mark for Review
  4191. (1) Points
  4192. A role is a name for a group of privileges. (*)
  4193. A role is a type of system privilege.
  4194. A role is an object privilege which allows a user to update a table.
  4195. A role is the part that a user plays in querying the database.
  4196.  
  4197. 2. Which of the following are system privileges?
  4198. (Choose two) Mark for Review
  4199. (1) Points
  4200. (Choose all correct answers)
  4201. CREATE SYNONYM (*)
  4202. UPDATE
  4203. CREATE TABLE (*)
  4204. INDEX
  4205.  
  4206. 3. User ADAM has successfully logged on to the database in the past, but today he receives an error message stating that (although he has entered his password correctly) he cannot log on. What is the most likely cause of the problem? Mark for Review
  4207. (1) Points
  4208. ADAM's CREATE USER privilege has been revoked.
  4209. One or more object privileges have been REVOKEd from Adam.
  4210. ADAM's user account has been removed from the database.
  4211. ADAM's CREATE SESSION privilege has been revoked. (*)
  4212.  
  4213. 4. Which of the following are object privileges? (Choose two) Mark for Review
  4214. (1) Points
  4215. (Choose all correct answers)
  4216. CREATE TABLE
  4217. INSERT (*)
  4218. SELECT (*)
  4219. DROP TABLE
  4220.  
  4221. 5. By Controlling User Access with Oracle Database Security, you can give access to specific Objects in the Database. True or False? Mark for Review
  4222. (1) Points
  4223. True (*)
  4224. False
  4225.  
  4226. 6. User JAMES has created a CUSTOMERS table and wants to allow all other users to SELECT from it. Which command should JAMES use to do this? Mark for Review
  4227. (1) Points
  4228. CREATE PUBLIC SYNONYM customers FOR james.customers;
  4229. GRANT SELECT ON customers TO ALL;
  4230. GRANT SELECT ON customers TO PUBLIC; (*)
  4231. GRANT customers(SELECT) TO PUBLIC;
  4232.  
  4233. 7. Parentheses are not used to identify the sub expressions within the expression. True or False? Mark for Review
  4234. (1) Points
  4235. True
  4236. False (*)
  4237.  
  4238. 8. REGULAR EXPRESSIONS can be used on CHAR, CLOB, and VARCHAR2 datatypes? (True or False) Mark for Review
  4239. (1) Points
  4240. True (*)
  4241. False
  4242.  
  4243. 9. REGULAR EXPRESSIONS does exactly the same as LIKE--no more and no less. (True or False?) Mark for Review
  4244. (1) Points
  4245. True
  4246. False (*)
  4247.  
  4248. 10. Roles are: Mark for Review
  4249. (1) Points
  4250. Required to gain access to the database.
  4251. Named groups of related privileges given to a user or another role. (*)
  4252. A collection of objects, such as tables, views, and sequences.
  4253. Required to manipulate the content of objects in the database.
  4254.  
  4255. 11. Which data dictionary view shows which system privileges have been granted to a user? Mark for Review
  4256. (1) Points
  4257. USER_SYS_PRIVS (*)
  4258. USER_SYSTEM_PRIVS
  4259. USER_SYSTEM_PRIVILEGES
  4260. USER_TAB_PRIVS
  4261.  
  4262. 12. Which statement would you use to remove an object privilege granted to a user? Mark for Review
  4263. (1) Points
  4264. ALTER USER
  4265. REMOVE
  4266. DROP
  4267. REVOKE (*)
  4268.  
  4269. 13. You need to grant user BOB SELECT privileges on the EMPLOYEES table. You want to allow BOB to grant this privileges to other users. Which statement should you use? Mark for Review
  4270. (1) Points
  4271.  
  4272. GRANT SELECT ON employees TO bob;
  4273. GRANT SELECT ON employees TO bob WITH ADMIN OPTION;
  4274. GRANT SELECT ON employees TO bob WITH GRANT OPTION; (*)
  4275. GRANT SELECT ON employees TO PUBLIC WITH GRANT OPTION;
  4276.  
  4277. 14. If you are granted privileges to your friend's object, by default you may also grant access to this same object to other users. True or False? Mark for Review
  4278. (1) Points
  4279. True
  4280. False (*)
  4281.  
  4282. 15. User BOB's schema contains an EMPLOYEES table. BOB executes the following statement:
  4283. GRANT SELECT ON employees TO mary WITH GRANT OPTION;
  4284.  
  4285. Which of the following statements can MARY now execute successfully? (Choose two)
  4286.  
  4287. Mark for Review
  4288. (1) Points
  4289. (Choose all correct answers)
  4290. DROP TABLE bob.employees;
  4291. GRANT SELECT ON bob.employees TO PUBLIC; (*)
  4292. REVOKE SELECT ON bob.employees FROM bob;
  4293. SELECT FROM bob.employees; (*)
  4294.  
  4295. 1. REGULAR EXPRESSIONS can be used as part of a contraint definition. (True or False?) Mark for Review
  4296. (1) Points
  4297. True (*)
  4298. False
  4299.  
  4300. 2. Select the correct REGULAR EXPRESSION functions: (Choose two) Mark for Review
  4301. (1) Points
  4302. (Choose all correct answers)
  4303. REGEXP_INSTR, REGEXP_SUBSTR (*)
  4304. REGEXP_LIKE, REGEXP_NEAR
  4305. REGEXP_LIKE, REGEXP_REPLACE (*)
  4306. REGEXP_REPLACE, REGEXP_REFORM
  4307.  
  4308. 3. Which of these SQL functions used to manipulate strings is NOT a valid regular expression function ? Mark for Review
  4309. (1) Points
  4310. REGEXP_LIKE
  4311. REGEXP (*)
  4312. REGEXP_REPLACE
  4313. REGEXP_SUBSTR
  4314.  
  4315. 4. By Controlling User Access with Oracle Database Security, you can give access to specific Objects in the Database. True or False? Mark for Review
  4316. (1) Points
  4317. True (*)
  4318. False
  4319.  
  4320. 5. You want to grant privileges to user CHAN that will allow CHAN to update the data in the EMPLOYEES table. Which type of privileges will you grant to CHAN? Mark for Review
  4321. (1) Points
  4322. User privileges
  4323. Administrator privileges
  4324. System privileges
  4325. Object privileges (*)
  4326.  
  4327. 6. Which of the following privileges must be assigned to a user account in order for that user to connect to an Oracle database? Mark for Review
  4328. (1) Points
  4329. ALTER SESSION
  4330. OPEN SESSION
  4331. CREATE SESSION (*)
  4332. RESTRICTED SESSION
  4333.  
  4334. 7. The following table shows some of the output from one of the data dictionary views. Which view is being queried?
  4335. USERNAME PRIVILEGE ADMIN_OPTION
  4336. USCA_ORACLE_SQL01_S08 CREATE VIEW NO
  4337. USCA_ORACLE_SQL01_S08 CREATE TABLE NO
  4338. USCA_ORACLE_SQL01_S08 CREATE SYNONYM NO
  4339. USCA_ORACLE_SQL01_S08 CREATE TRIGGER NO
  4340. USCA_ORACLE_SQL01_S08 CREATE SEQUENCE NO
  4341. USCA_ORACLE_SQL01_S08 CREATE DATABASE NO
  4342. Mark for Review
  4343. (1) Points
  4344. user_sys_privs (lists system privileges granted to the user) (*)
  4345. role_tab_privs (lists table privileges granted to roles)
  4346. user_tab_privs_recd (lists object privileges granted to the user)
  4347. role_sys_privs (lists system privileges granted to roles)
  4348.  
  4349. 8. Which of the following best describes a role in an Oracle database? Mark for Review
  4350. (1) Points
  4351. A role is the part that a user plays in querying the database.
  4352. A role is a type of system privilege.
  4353. A role is an object privilege which allows a user to update a table.
  4354. A role is a name for a group of privileges. (*)
  4355.  
  4356. 9. You create a view named EMPLOYEES_VIEW on a subset of the EMPLOYEES table. User AUDREY needs to use this view to create reports. Only you and Audrey should have access to this view. Which of the following actions should you perform? Mark for Review
  4357. (1) Points
  4358. GRANT SELECT ON employees AND employees_view TO audrey;
  4359. GRANT SELECT ON employees_view TO public;
  4360. GRANT SELECT ON employees_view TO audrey; (*)
  4361. Do nothing. As a database user, Audrey's user account has automatically been granted the SELECT privilege for all database objects.
  4362.  
  4363. 10. 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
  4364. (1) Points
  4365. He should assign the SELECT privilege to all database users for the INVENTORY table.
  4366. He should assign the SELECT privilege to all database users for INVENTORY_V view. (*)
  4367. He is not required to take any action because, by default, all database users can automatically access views.
  4368. He must grant each user the SELECT privilege on both the INVENTORY table and INVENTORY_V view.
  4369.  
  4370. 11. Scott King owns a table called employees. He issues the following statement:
  4371. GRANT select ON employees TO PUBLIC;
  4372. Allison Plumb has been granted CREATE SESSION by the DBA. She logs into the database and issues the following statement:
  4373. GRANT ᅠselect ON ᅠscott_king.employees TO jennifer_cho;
  4374.  
  4375. True or False: Allison's statement will fail.
  4376.  
  4377. Mark for Review
  4378. (1) Points
  4379. True (*)
  4380. False
  4381.  
  4382. 12. A role can be granted to another role. True or False? Mark for Review
  4383. (1) Points
  4384. True (*)
  4385. False
  4386.  
  4387. 13. Which of the following statements about granting object privileges is false? Mark for Review
  4388. (1) Points
  4389. Object privileges can only be granted through roles. (*)
  4390. An object owner can grant any object privilege on the object to any other user or role of the database.
  4391. To grant privileges on an object, the object must be in your own schema, or you must have been granted the object privileges WITH GRANT OPTION.
  4392. The owner of an object automatically acquires all object privileges on that object.
  4393.  
  4394. 14. Which keyword would you use to grant an object privilege to all database users? Mark for Review
  4395. (1) Points
  4396. ALL
  4397. PUBLIC (*)
  4398. ADMIN
  4399. USERS
  4400.  
  4401. 15. When a user is logged into one database, he is restricted to working with objects found in that database. True or False? Mark for Review
  4402. (1) Points
  4403. True
  4404. False (*)
  4405.  
  4406. 1. A Schema is a collection of Objects such as Tables, Views, and Sequences. True or False? Mark for Review
  4407. (1) Points
  4408. True (*)
  4409. False
  4410.  
  4411. 2. Which Object Privilege (other than Alter) can be granted to a Sequence? Mark for Review
  4412. (1) Points
  4413. INSERT
  4414. UPDATE
  4415. DELETE
  4416. SELECT (*)
  4417.  
  4418. 3. The following table shows some of the output from one of the data dictionary views. Which view is being queried?
  4419. USERNAME PRIVILEGE ADMIN_OPTION
  4420. USCA_ORACLE_SQL01_S08 CREATE VIEW NO
  4421. USCA_ORACLE_SQL01_S08 CREATE TABLE NO
  4422. USCA_ORACLE_SQL01_S08 CREATE SYNONYM NO
  4423. USCA_ORACLE_SQL01_S08 CREATE TRIGGER NO
  4424. USCA_ORACLE_SQL01_S08 CREATE SEQUENCE NO
  4425. USCA_ORACLE_SQL01_S08 CREATE DATABASE NO
  4426. Mark for Review
  4427. (1) Points
  4428. role_sys_privs (lists system privileges granted to roles)
  4429. user_sys_privs (lists system privileges granted to the user) (*)
  4430. role_tab_privs (lists table privileges granted to roles)
  4431. user_tab_privs_recd (lists object privileges granted to the user)
  4432.  
  4433. 4. What system privilege must be held in order to login to an Oracle database? Mark for Review
  4434. (1) Points
  4435. CREATE LOGIN
  4436. CREATE SESSION (*)
  4437. CREATE LOGON
  4438. No special privilege is needed; if your username exists in the database, you can login.
  4439.  
  4440. 5. Which of the following best describes a role in an Oracle database? Mark for Review
  4441. (1) Points
  4442. A role is an object privilege which allows a user to update a table.
  4443. A role is a name for a group of privileges. (*)
  4444. A role is a type of system privilege.
  4445. A role is the part that a user plays in querying the database.
  4446.  
  4447. 6. Which of the following Object Privileges can be granted on an individual column on a table? (Choose two) Mark for Review
  4448. (1) Points
  4449. (Choose all correct answers)
  4450. Delete
  4451. Select
  4452. Update (*)
  4453. References (*)
  4454.  
  4455. 7. REGULAR EXPRESSIONS can be used on CHAR, CLOB, and VARCHAR2 datatypes? (True or False) Mark for Review
  4456. (1) Points
  4457. True (*)
  4458. False
  4459.  
  4460. 8. Parentheses are not used to identify the sub expressions within the expression. True or False? Mark for Review
  4461. (1) Points
  4462. True
  4463. False (*)
  4464.  
  4465. 9. REGULAR EXPRESSIONS does exactly the same as LIKE--no more and no less. (True or False?) Mark for Review
  4466. (1) Points
  4467. True
  4468. False (*)
  4469.  
  4470. 10. Which of the following best describes the purpose of the REFERENCES object privilege on a table? Mark for Review
  4471. (1) Points
  4472. It allows a user to create foreign key constraints on the table. (*)
  4473. It allows a user to refer to the table in a SELECT statement.
  4474. It allows a user's session to read from the table but only so that foreign key constraints can be checked.
  4475. It allows the user to create new tables which contain the same data as the referenced table.
  4476.  
  4477. 11. 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
  4478. (1) Points
  4479. He should assign the SELECT privilege to all database users for the INVENTORY table.
  4480. He is not required to take any action because, by default, all database users can automatically access views.
  4481. He must grant each user the SELECT privilege on both the INVENTORY table and INVENTORY_V view.
  4482. He should assign the SELECT privilege to all database users for INVENTORY_V view. (*)
  4483.  
  4484. 12. Which statement would you use to remove an object privilege granted to a user? Mark for Review
  4485. DROP
  4486. REMOVE
  4487. REVOKE (*)
  4488. ALTER USER
  4489.  
  4490. 13. Roles are: Mark for Review
  4491. (1) Points
  4492. Named groups of related privileges given to a user or another role. (*)
  4493. A collection of objects, such as tables, views, and sequences.
  4494. Required to gain access to the database.
  4495. Required to manipulate the content of objects in the database.
  4496.  
  4497. 14. Which of the following statements about granting object privileges is false? Mark for Review
  4498. (1) Points
  4499.  
  4500. An object owner can grant any object privilege on the object to any other user or role of the database.
  4501. The owner of an object automatically acquires all object privileges on that object.
  4502. Object privileges can only be granted through roles. (*)
  4503. To grant privileges on an object, the object must be in your own schema, or you must have been granted the object privileges WITH GRANT OPTION.
  4504.  
  4505. 15. Which statement would you use to grant a role to users? Mark for Review
  4506. (1) Points
  4507. ASSIGN
  4508. ALTER USER
  4509. CREATE USER
  4510.  
  4511. GRANT (*)
  4512. By Deni Ace at February 11, 2017
  4513. Labels: database, Database programming with SQL, programming, quiz, section 17, sql
  4514. 4 comments:
  4515.  
  4516. Ordinary Oracle Student28 April 2017 at 08:48
  4517. Forgot these questions.
  4518.  
  4519. 1. User CHANG has been granted SELECT, UPDATE, INSERT, and DELETE privileges on the EMPLOYEES table. You now want to prevent Chang from adding or deleting rows from the table, while still allowing him to read and modify existing rows. Which statement should you use to do this? Mark for Review
  4520. (1) Points
  4521.  
  4522.  
  4523. REVOKE INSERT AND DELETE ON employees FROM chang;
  4524.  
  4525.  
  4526. REMOVE INSERT, DELETE ON employees FROM chang;
  4527.  
  4528.  
  4529. REVOKE ALL ON employees FROM chang;
  4530.  
  4531.  
  4532. REVOKE INSERT, DELETE ON employees FROM chang; (*)
  4533.  
  4534. 2. Which of the following is NOT a database object? Mark for Review
  4535. (1) Points
  4536.  
  4537.  
  4538. Table
  4539.  
  4540.  
  4541. Sequence
  4542.  
  4543.  
  4544. View
  4545.  
  4546.  
  4547. Subquery (*)
  4548.  
  4549. 3.Which statement would you use to add privileges to a role? Mark for Review
  4550. (1) Points
  4551.  
  4552.  
  4553. ASSIGN
  4554.  
  4555.  
  4556. ALTER ROLE
  4557.  
  4558.  
  4559. GRANT (*)
  4560.  
  4561.  
  4562. CREATE ROLE
  4563.  
  4564. 4.Which of the following statements is true? Mark for Review
  4565. (1) Points
  4566.  
  4567.  
  4568. Database Links allow users to work on remote database objects without having to log into the other database. (*)
  4569.  
  4570.  
  4571. Database Links can be created by any user of a database. You do not need any special privileges to create them.
  4572.  
  4573.  
  4574. Database Links are pointers to another schema in the same database.
  4575.  
  4576.  
  4577. Database Links are never used in the real world.
  4578.  
  4579. Reply
  4580. Replies
  4581.  
  4582. Deni Ace31 July 2017 at 11:04
  4583. thank you ^_^
  4584.  
  4585. Reply
  4586.  
  4587. Ordinary Oracle Student28 April 2017 at 09:08
  4588. Forgot these as well
  4589.  
  4590. 1.Which of the following are object privileges? (Choose two) Mark for Review
  4591. (1) Points
  4592.  
  4593. (Choose all correct answers)
  4594.  
  4595.  
  4596. CREATE TABLE
  4597.  
  4598.  
  4599. INSERT (*)
  4600.  
  4601.  
  4602. DROP TABLE
  4603.  
  4604.  
  4605. SELECT (*)
  4606.  
  4607. 2.What Oracle feature simplifies the process of granting and revoking privileges? Mark for Review
  4608. (1) Points
  4609.  
  4610.  
  4611. Role (*)
  4612.  
  4613.  
  4614. Schema
  4615.  
  4616.  
  4617. Data dictionary
  4618.  
  4619.  
  4620. Object
  4621.  
  4622. Section 18 Quiz
  4623. (Answer all questions in this section)
  4624.  
  4625. 1. Steven King's row in the EMPLOYEES table has EMPLOYEE_ID = 100 and SALARY = 24000. A user issues the following statements in the order shown:
  4626. UPDATE employees
  4627. SET salary = salary * 2
  4628. WHERE employee_id = 100;
  4629. COMMIT;
  4630.  
  4631. UPDATE employees
  4632. SET salary = 30000
  4633. WHERE employee_id = 100;
  4634.  
  4635. The user's database session now ends abnormally. What is now King's salary in the table?
  4636.  
  4637. Mark for Review
  4638. (1) Points
  4639. 78000
  4640. 30000
  4641. 24000
  4642. 48000 (*)
  4643.  
  4644. 2. Table MYTAB contains only one column of datatype CHAR(1). A user executes the following statements in the order shown.
  4645. INSERT INTO mytab VALUES ('A');
  4646. INSERT INTO mytab VALUES ('B');
  4647. COMMIT;
  4648. INSERT INTO mytab VALUES ('C');
  4649. ROLLBACK;
  4650.  
  4651. Which rows does the table now contain?
  4652.  
  4653. Mark for Review
  4654. (1) Points
  4655. A, B, and C
  4656. A and B (*)
  4657. C
  4658. None of the above
  4659.  
  4660. 3. If Oracle crashes, your changes are automatically rolled back. True or False? Mark for Review
  4661. (1) Points
  4662. True (*)
  4663. False
  4664.  
  4665. 4. Examine the following statements:
  4666. UPDATE employees SET salary = 15000;
  4667. SAVEPOINT upd1_done;
  4668. UPDATE employees SET salary = 22000;
  4669. SAVEPOINT upd2_done;
  4670. DELETE FROM employees;
  4671.  
  4672. You want to retain all the employees with a salary of 15000; What statement would you execute next?
  4673.  
  4674. Mark for Review
  4675. (1) Points
  4676. ROLLBACK;
  4677. ROLLBACK TO SAVEPOINT upd1_done; (*)
  4678. ROLLBACK TO SAVEPOINT upd2_done;
  4679. ROLLBACK TO SAVE upd1_done;
  4680. There is nothing you can do; either all changes must be rolled back, or none of them can be rolled back.
  4681.  
  4682. 5. COMMIT saves all outstanding data changes? True or False? Mark for Review
  4683. (1) Points
  4684. True (*)
  4685. False
  4686.  
  4687. 6. Examine the following statements:
  4688. INSERT INTO emps SELECT * FROM employees; -- 107 rows inserted.
  4689. SAVEPOINT Ins_Done;
  4690. DELETE employees; -- 107 rows deleted
  4691. SAVEPOINT Del_Done;
  4692. UPDATE emps SET last_name = 'Smith';
  4693.  
  4694. How would you undo the last Update only?
  4695.  
  4696. Mark for Review
  4697. (1) Points
  4698. ROLLBACK to SAVEPOINT Del_Done; (*)
  4699. COMMIT Del_Done;
  4700. There is nothing you can do.
  4701. ROLLBACK UPDATE;
  4702.  
  4703. 7. Examine the following statements:
  4704. INSERT INTO emps SELECT * FROM employees; -- 107 rows inserted.
  4705. SAVEPOINT Ins_Done;
  4706. CREATE INDEX emp_lname_idx ON employees(last_name);
  4707. UPDATE emps SET last_name = 'Smith';
  4708.  
  4709. What happens if you issue a Rollback statement?
  4710.  
  4711. Mark for Review
  4712. (1) Points
  4713.  
  4714. The update of last_name is undone, but the insert was committed by the CREATE INDEX statement. (*)
  4715.  
  4716. Both the UPDATE and the INSERT will be rolled back.
  4717. The INSERT is undone but the UPDATE is committed.
  4718. Nothing happens.
  4719.  
  4720. 8. Which SQL statement is used to remove all the changes made by an uncommitted transaction? Mark for Review
  4721. (1) Points
  4722. REVOKE;
  4723. ROLLBACK TO SAVEPOINT;
  4724. ROLLBACK; (*)
  4725. UNDO;
  4726.  
  4727. 9. You need not worry about controlling your transactions. Oracle does it all for you. True or False? Mark for Review
  4728. (1) Points
  4729. True
  4730. False (*)
  4731.  
  4732. 10. When you logout of Oracle, your data changes are automatically rolled back. True or False? Mark for Review
  4733. (1) Points
  4734. True
  4735. False (*)
  4736.  
  4737. 11. User BOB's CUSTOMERS table contains 20 rows. BOB inserts two more rows into the table but does not COMMIT his changes. User JANE now executes:
  4738. SELECT COUNT(*) FROM bob.customers;
  4739.  
  4740. What result will JANE see?
  4741.  
  4742. Mark for Review
  4743. (1) Points
  4744. 22
  4745. 20 (*)
  4746. JANE will receive an error message because she is not allowed to query the table while BOB is updating it.
  4747. 2
  4748.  
  4749. 12. Which of the following best describes the term "read consistency"? Mark for Review
  4750. (1) Points
  4751. It prevents other users from querying a table while updates are being executed on it
  4752.  
  4753. It prevents other users from seeing changes to a table until those changes have been committed (*)
  4754.  
  4755. It prevents users from querying tables on which they have not been granted SELECT privilege
  4756. It ensures that all changes to a table are automatically committed
  4757.  
  4758. 13. A transaction makes several successive changes to a table. If required, you want to be able to rollback the later changes while keeping the earlier changes. What must you include in your code to do this? Mark for Review
  4759. (1) Points
  4760. An object privilege
  4761. An update statement
  4762. A savepoint (*)
  4763. A sequence
  4764. A database link
  4765.  
  4766. 14. If a database crashes, all uncommitted changes are automatically rolled back. True or False? Mark for Review
  4767. (1) Points
  4768. True (*)
  4769. False
  4770.  
  4771. 15. If UserB has privileges to see the data in a table, as soon as UserA has entered data into that table, UserB can see that data. True or False? Mark for Review
  4772. (1) Points
  4773. True
  4774. False (*)
  4775.  
  4776. 1. Table MYTAB contains only one column of datatype CHAR(1). A user executes the following statements in the order shown.
  4777. INSERT INTO mytab VALUES ('A');
  4778. INSERT INTO mytab VALUES ('B');
  4779. COMMIT;
  4780. INSERT INTO mytab VALUES ('C');
  4781. ROLLBACK;
  4782.  
  4783. Which rows does the table now contain?
  4784.  
  4785. Mark for Review
  4786. (1) Points
  4787. A, B, and C
  4788. A and B (*)
  4789. C
  4790. None of the above
  4791.  
  4792. 2. If UserB has privileges to see the data in a table, as soon as UserA has entered data into that table, UserB can see that data. True or False? Mark for Review
  4793. (1) Points
  4794. True
  4795. False (*)
  4796.  
  4797. 3. User BOB's CUSTOMERS table contains 20 rows. BOB inserts two more rows into the table but does not COMMIT his changes. User JANE now executes:
  4798. SELECT COUNT(*) FROM bob.customers;
  4799.  
  4800. What result will JANE see?
  4801.  
  4802. Mark for Review
  4803. (1) Points
  4804. JANE will receive an error message because she is not allowed to query the table while BOB is updating it.
  4805. 2
  4806. 20 (*)
  4807. 22
  4808.  
  4809. 4. Examine the following statements:
  4810. INSERT INTO emps SELECT * FROM employees; -- 107 rows inserted.
  4811. SAVEPOINT Ins_Done;
  4812. CREATE INDEX emp_lname_idx ON employees(last_name);
  4813. UPDATE emps SET last_name = 'Smith';
  4814.  
  4815. What happens if you issue a Rollback statement?
  4816.  
  4817. Mark for Review
  4818. (1) Points
  4819.  
  4820. The update of last_name is undone, but the insert was committed by the CREATE INDEX
  4821. statement. (*)
  4822. Both the UPDATE and the INSERT will be rolled back.
  4823. The INSERT is undone but the UPDATE is committed.
  4824. Nothing happens.
  4825.  
  4826. 5. Steven King's row in the EMPLOYEES table has EMPLOYEE_ID = 100 and SALARY = 24000. A user issues the following statements in the order shown:
  4827. UPDATE employees
  4828. SET salary = salary * 2
  4829. WHERE employee_id = 100;
  4830. COMMIT;
  4831.  
  4832. UPDATE employees
  4833. SET salary = 30000
  4834. WHERE employee_id = 100;
  4835.  
  4836. The user's database session now ends abnormally. What is now King's salary in the table?
  4837.  
  4838. Mark for Review
  4839. (1) Points
  4840. 24000
  4841. 30000
  4842. 48000 (*)
  4843. 78000
  4844.  
  4845. 6. When you logout of Oracle, your data changes are automatically rolled back. True or False? Mark for Review
  4846. (1) Points
  4847. True
  4848. False (*)
  4849.  
  4850. 7. Which of the following best describes the term "read consistency"? Mark for Review
  4851. (1) Points
  4852.  
  4853. It prevents users from querying tables on which they have not been granted SELECT privilege
  4854.  
  4855. It prevents other users from querying a table while updates are being executed on it
  4856.  
  4857. It prevents other users from seeing changes to a table until those changes have been committed (*)
  4858. It ensures that all changes to a table are automatically committed
  4859.  
  4860. 8. Examine the following statements:
  4861. INSERT INTO emps SELECT * FROM employees; -- 107 rows inserted.
  4862. SAVEPOINT Ins_Done;
  4863. DELETE employees; -- 107 rows deleted
  4864. SAVEPOINT Del_Done;
  4865. UPDATE emps SET last_name = 'Smith';
  4866.  
  4867. How would you undo the last Update only?
  4868.  
  4869. Mark for Review
  4870. (1) Points
  4871. ROLLBACK UPDATE;
  4872. There is nothing you can do.
  4873. COMMIT Del_Done;
  4874. ROLLBACK to SAVEPOINT Del_Done; (*)
  4875.  
  4876. 9. If a database crashes, all uncommitted changes are automatically rolled back. True or False? Mark for Review
  4877. (1) Points
  4878. True (*)
  4879. False
  4880.  
  4881. 10. A transaction makes several successive changes to a table. If required, you want to be able to rollback the later changes while keeping the earlier changes. What must you include in your code to do this? Mark for Review
  4882. (1) Points
  4883. An update statement
  4884. A savepoint (*)
  4885. A database link
  4886. An object privilege
  4887. A sequence
  4888.  
  4889. 11. You need not worry about controlling your transactions. Oracle does it all for you. True or False? Mark for Review
  4890. (1) Points
  4891. True
  4892. False (*)
  4893.  
  4894. 12. If Oracle crashes, your changes are automatically rolled back. True or False? Mark for Review
  4895. (1) Points
  4896. True (*)
  4897. False
  4898.  
  4899. 13. Which SQL statement is used to remove all the changes made by an uncommitted transaction? Mark for Review
  4900. (1) Points
  4901. ROLLBACK; (*)
  4902. UNDO;
  4903. REVOKE;
  4904. ROLLBACK TO SAVEPOINT;
  4905.  
  4906. 14. COMMIT saves all outstanding data changes? True or False? Mark for Review
  4907. (1) Points
  4908. True (*)
  4909. False
  4910.  
  4911. 15. Examine the following statements:
  4912. UPDATE employees SET salary = 15000;
  4913. SAVEPOINT upd1_done;
  4914. UPDATE employees SET salary = 22000;
  4915. SAVEPOINT upd2_done;
  4916. DELETE FROM employees;
  4917.  
  4918. You want to retain all the employees with a salary of 15000; What statement would you execute next?
  4919.  
  4920. Mark for Review
  4921. (1) Points
  4922. ROLLBACK;
  4923. ROLLBACK TO SAVEPOINT upd1_done; (*)
  4924. ROLLBACK TO SAVEPOINT upd2_done;
  4925. ROLLBACK TO SAVE upd1_done;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement