Advertisement
Guest User

Untitled

a guest
May 3rd, 2017
987
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.98 KB | None | 0 0
  1.  
  2. CHAPTER 2
  3.  
  4.  
  5.  
  6. A field is another term for a(n) ____.
  7. Select one:
  8. a.
  9. ​column
  10.  
  11.  
  12. ​A record is another term for a(n) ____.
  13. Select one:
  14. a.
  15. ​row
  16.  
  17.  
  18. ​A(n) ____ is the association between entities.
  19. Select one:
  20. a.
  21. ​relationship
  22.  
  23.  
  24. ​There is a commonly accepted shorthand representation to show the structure of a relational database: After the name of the table, all the columns in the table are listed within a set of ____.
  25. Select one:
  26. c.
  27. ​parentheses
  28.  
  29.  
  30. ​Which of the following is the primary key of the ORDER_LINE (ORDER_NUM, ITEM_NUM, NUM_ORDERED, QUOTED_PRICE) table?
  31. Select one:
  32. a.
  33. ​ORDER_NUM and ITEM_NUM
  34.  
  35.  
  36. ​____ is the duplication of data.
  37. Select one:
  38. d.
  39. Redundancy​
  40.  
  41.  
  42. ​A primary key always comprises a single column.
  43. Select one:
  44. False
  45.  
  46.  
  47. ​An unnormalized relation is a relation that may contain repeating groups.
  48. Select one:
  49. True
  50.  
  51.  
  52. ​Because there is a one-to-many relationship between sales reps and customers in the TAL Distributors database, one sales rep can be associated with zero, one, or more customers.
  53. Select one:
  54. True
  55.  
  56.  
  57. ​The statement "A sales rep's pay class functionally determines his or her pay rate" means that if you know the pay class, you can determine the pay rate.
  58. Select one:
  59. True
  60.  
  61.  
  62.  
  63. CHAPTER 3
  64.  
  65.  
  66.  
  67.  
  68.  
  69. A ____ file is a text file with a .sql extension that contains SQL commands.​
  70. Select one:
  71. c.
  72. ​script
  73.  
  74.  
  75. For any column whose data type is CHAR, values must be enclosed in ____.​
  76. Select one:
  77. a.
  78. ​single quotation marks
  79.  
  80.  
  81. In SQL, table names cannot exceed ____ characters.​
  82. Select one:
  83. c.
  84. ​30
  85.  
  86.  
  87. The ____ command defines a table's structure by listing its columns, data types, and column lengths.​
  88. Select one:
  89. a.
  90. ​CREATE TABLE
  91.  
  92.  
  93. The ____ data type is used to store integers.​
  94. Select one:
  95. a.
  96. ​INT
  97.  
  98.  
  99. The ____ data type stores only the actual character string.​
  100. Select one:
  101. d.
  102. ​VARCHAR
  103.  
  104.  
  105. To delete an entire table, use the ____ command and then re-create the table.​
  106. Select one:
  107. b.
  108. ​DROP TABLE
  109.  
  110.  
  111. To display all the rows and columns in a table, type the word SELECT, followed by a(n) ____, followed by the word FROM and then the name of the table containing the data you want to view.​
  112. Select one:
  113. a.
  114. ​asterisk
  115.  
  116.  
  117. When a script file contains more than one command, each command must end with a(n) ____.​
  118. Select one:
  119. a.
  120. ​semicolon
  121.  
  122.  
  123. Which of the following commands changes the value in a column?​
  124. Select one:
  125. c.
  126. ​UPDATE
  127.  
  128.  
  129. Which of the following is a valid name for a table?​
  130. Select one:
  131. b.
  132. ​TBL_1
  133.  
  134.  
  135. You indicate the end of a command by typing a ____.​
  136. Select one:
  137. b.
  138. ​semicolon
  139.  
  140.  
  141. Dropping a table also deletes any data that you entered into the table.​
  142. Select one:
  143. True
  144.  
  145.  
  146. In SQL Server, execute the sp_columns command to list all the columns in a table.
  147. Select one:
  148. True
  149.  
  150.  
  151. Table names cannot contain spaces.​
  152. Select one:
  153. True
  154.  
  155.  
  156. The data type DECIMAL(5,2) represents a number with three places to the left and two places to the right of the decimal.​
  157. Select one:
  158. True
  159.  
  160.  
  161. The data type indicates the type of data that a column can contain.​
  162. Select one:
  163. True
  164.  
  165.  
  166. To change a value in a table, use the CHANGE command.​
  167. Select one:
  168. False
  169.  
  170.  
  171. To create a table, type the command DESCRIBE TABLE followed by the name of the table to be created and then by the names and data types of the columns that will comprise the table.​
  172. Select one:
  173. False
  174.  
  175.  
  176. To list all the columns in a table, use the LIST COLUMNS command.​
  177. Select one:
  178. False
  179.  
  180.  
  181.  
  182.  
  183. CHAPTER 4
  184.  
  185.  
  186.  
  187. In SQL for Oracle and for SQL Server, the ____ symbol is used as a wildcard to represent any collection of characters.​
  188. Select one:
  189. a.
  190. ​%
  191.  
  192.  
  193. In the SELECT clause, you can use the ____ symbol to indicate that you want to include all columns.​
  194. Select one:
  195. a.
  196. ​*
  197.  
  198.  
  199. Preceding a condition by the ____ operator reverses the truth of the original condition.​
  200. Select one:
  201. b.
  202. ​NOT
  203.  
  204.  
  205. The basic form of the SQL SELECT command is ____.​
  206. Select one:
  207. a.
  208. ​SELECT-FROM-WHERE
  209.  
  210.  
  211. The ____ clause is used to restrict the groups that will be included in a query result.​
  212. Select one:
  213. c.
  214. ​HAVING
  215.  
  216.  
  217. The ____ function calculates a total of the values in a column.​
  218. Select one:
  219. b.
  220. ​SUM
  221.  
  222.  
  223. The ____ function determines the number of rows in a table.​
  224. Select one:
  225. b.
  226. ​COUNT
  227.  
  228.  
  229. The ____ operator is inclusive, meaning that a value equal to either end would be selected.​
  230. Select one:
  231. d.
  232. ​BETWEEN
  233.  
  234.  
  235. The ____ operator uses one or more wildcard characters to test for a pattern match.​
  236. Select one:
  237. b.
  238. ​LIKE
  239.  
  240.  
  241. You use the ____ clause to list data in a specific order.​
  242. Select one:
  243. d.
  244. ​ORDER BY
  245.  
  246.  
  247. A query is a question represented in a way that the DBMS can understand.
  248. Select one:
  249. True
  250.  
  251.  
  252. All SELECT statements require a WHERE clause.​
  253. Select one:
  254. False
  255.  
  256.  
  257. An arithmetic column is a column that does not exist in the database but can be computed using data in existing columns.​
  258. Select one:
  259. False
  260.  
  261.  
  262. It is possible to place one query inside another.​
  263. Select one:
  264. True
  265.  
  266.  
  267. The GROUP BY clause sorts the data in a particular order.​
  268. Select one:
  269. False
  270.  
  271.  
  272. The MIN function determines the minimum value in a column.​
  273. Select one:
  274. True
  275.  
  276.  
  277. The WHERE clause is used to retrieve rows that satisfy some condition.​
  278. Select one:
  279. True
  280.  
  281.  
  282. To specify that query results be listed in a specific order, use the SORT BY clause.​
  283. Select one:
  284. False
  285.  
  286.  
  287. When the OR operator connects simple conditions, the compound condition will be true whenever any one of the simple conditions is true.​
  288. Select one:
  289. True
  290.  
  291.  
  292. You cannot assign names to computed columns.​
  293. Select one:
  294. False
  295.  
  296.  
  297.  
  298.  
  299.  
  300. MIDTERM
  301.  
  302.  
  303.  
  304. At TAL Distributors, there is a ____ relationship between sales reps and customers.
  305. Select one:
  306. c.
  307. ​one-to-many
  308.  
  309.  
  310. ​There is a commonly accepted shorthand representation to show the structure of a relational database: After the name of the table, all the columns in the table are listed within a set of ____.
  311. Select one:
  312. d.
  313. ​parentheses
  314.  
  315.  
  316. ​Which of the following is the primary key of the ORDER_LINE (ORDER_NUM, ITEM_NUM, NUM_ORDERED, QUOTED_PRICE) table?
  317. Select one:
  318. c.
  319. ​ORDER_NUM and ITEM_NUM
  320.  
  321.  
  322. ​____ can occur when there is a column in a table that is dependent on only a portion of the primary key.
  323. Select one:
  324. b.
  325. ​Update anomalies
  326.  
  327.  
  328. ​____ is the duplication of data.
  329. Select one:
  330. d.
  331. Redundancy​
  332.  
  333.  
  334. ​A primary key always comprises a single column.
  335. Select one:
  336. False
  337.  
  338.  
  339. ​An unnormalized relation is a relation that may contain repeating groups.
  340. Select one:
  341. True
  342.  
  343.  
  344. ​Because there is a one-to-many relationship between sales reps and customers in the TAL Distributors database, one sales rep can be associated with zero, one, or more customers.
  345. Select one:
  346. True
  347.  
  348.  
  349. ​Each column in a table of a relational database should have a distinct name.
  350. Select one:
  351. True
  352.  
  353.  
  354. ​In a relational database, relationships are implemented by having common columns in two or more tables.
  355. Select one:
  356. True
  357.  
  358.  
  359. For any column whose data type is CHAR, values must be enclosed in ____.​
  360. Select one:
  361. c.
  362. ​single quotation marks
  363.  
  364.  
  365. In SQL, table names cannot exceed ____ characters.​
  366. Select one:
  367. b.
  368. ​30
  369.  
  370.  
  371. The correct data type for the BALANCE column in the CUSTOMER table is ____.​
  372. Select one:
  373. c.
  374. ​DECIMAL
  375.  
  376.  
  377. The ____ command defines a table's structure by listing its columns, data types, and column lengths.​
  378. Select one:
  379. a.
  380. ​CREATE TABLE
  381.  
  382.  
  383. The ____ data type is used to store integers.​
  384. Select one:
  385. b.
  386. ​INT
  387.  
  388.  
  389. The ____ data type stores only the actual character string.​
  390. Select one:
  391. b.
  392. ​VARCHAR
  393.  
  394.  
  395. To delete an entire table, use the ____ command and then re-create the table.​
  396. Select one:
  397. c.
  398. ​DROP TABLE
  399.  
  400.  
  401. To display all the rows and columns in a table, type the word SELECT, followed by a(n) ____, followed by the word FROM and then the name of the table containing the data you want to view.​
  402. Select one:
  403. c.
  404. ​asterisk
  405.  
  406.  
  407. Use the ____ data type for columns that contain letters and special characters and for columns containing numbers that will not be used in calculations.​
  408. Select one:
  409. c.
  410. ​CHAR
  411.  
  412.  
  413. Which of the following commands changes the value in a column?​
  414. Select one:
  415. b.
  416. ​UPDATE
  417.  
  418.  
  419. Which of the following is a valid name for a table?​
  420. Select one:
  421. d.
  422. ​TBL_1
  423.  
  424.  
  425. You indicate the end of a command by typing a ____.​
  426. Select one:
  427. b.
  428. ​semicolon
  429.  
  430.  
  431. Dropping a table also deletes any data that you entered into the table.​
  432. Select one:
  433. True
  434.  
  435.  
  436. If you added a row that should not be in a table, use a REMOVE command to remove it.​
  437. Select one:
  438. False
  439.  
  440.  
  441. In SQL Server, execute the sp_columns command to list all the columns in a table.
  442. Select one:
  443. True
  444.  
  445.  
  446. Table names cannot contain spaces.​
  447. Select one:
  448. True
  449.  
  450.  
  451. The data type DECIMAL(5,2) represents a number with three places to the left and two places to the right of the decimal.​
  452. Select one:
  453. True
  454.  
  455.  
  456. The data type indicates the type of data that a column can contain.​
  457. Select one:
  458. True
  459.  
  460.  
  461. To create a table, type the command DESCRIBE TABLE followed by the name of the table to be created and then by the names and data types of the columns that will comprise the table.​
  462. Select one:
  463. False
  464.  
  465.  
  466. To list all the columns in a table, use the LIST COLUMNS command.​
  467. Select one:
  468. False
  469.  
  470.  
  471. In SQL for Oracle and for SQL Server, the ____ symbol is used as a wildcard to represent any collection of characters.​
  472. Select one:
  473. a.
  474. ​%
  475.  
  476.  
  477. In SQL, you use the ____ command to query a database.​
  478. Select one:
  479. d.
  480. ​SELECT
  481.  
  482.  
  483. In the SELECT clause, you can use the ____ symbol to indicate that you want to include all columns.​
  484. Select one:
  485. d.
  486. ​*
  487.  
  488.  
  489. Preceding a condition by the ____ operator reverses the truth of the original condition.​
  490. Select one:
  491. b.
  492. ​NOT
  493.  
  494.  
  495. The basic form of the SQL SELECT command is ____.​
  496. Select one:
  497. d.
  498. ​SELECT-FROM-WHERE
  499.  
  500.  
  501. The ____ clause is used to restrict the groups that will be included in a query result.​
  502. Select one:
  503. b.
  504. ​HAVING
  505.  
  506.  
  507. The ____ clause lets you group data on a particular column.​
  508. Select one:
  509. a.
  510. ​GROUP BY
  511.  
  512.  
  513. The ____ operator is inclusive, meaning that a value equal to either end would be selected.​
  514. Select one:
  515. b.
  516. ​BETWEEN
  517.  
  518.  
  519. The ____ operator uses one or more wildcard characters to test for a pattern match.​
  520. Select one:
  521. d.
  522. ​LIKE
  523.  
  524.  
  525. When you use the ____ function, you can use the asterisk (*) to represent any column.​
  526. Select one:
  527. d.
  528. ​COUNT
  529.  
  530.  
  531. You use the ____ clause to list data in a specific order.​
  532. Select one:
  533. d.
  534. ​ORDER BY
  535.  
  536.  
  537. A query is a question represented in a way that the DBMS can understand.
  538. Select one:
  539. True
  540.  
  541.  
  542. After the word FROM in a SELECT statement, you list any conditions (restrictions) that apply to the data you want to retrieve.​
  543. Select one:
  544. False
  545.  
  546.  
  547. All SELECT statements require a WHERE clause.​
  548. Select one:
  549. False
  550.  
  551.  
  552. In a nested query, the outer query is evaluated first.​
  553. Select one:
  554. False
  555.  
  556.  
  557. The UNIQUE operator eliminates duplicate values in a query.​
  558. Select one:
  559. False
  560.  
  561.  
  562. The WHERE clause applies to both rows and groups.​
  563. Select one:
  564. False
  565.  
  566.  
  567. To sort records in descending order, follow the name of the sort key with the REVERSE operator.​
  568. Select one:
  569. False
  570.  
  571.  
  572. When the OR operator connects simple conditions, the compound condition will be true whenever any one of the simple conditions is true.​
  573. Select one:
  574. True
  575.  
  576.  
  577. When you connect two or more simple conditions with the AND operator, each condition must be listed on a separate line.​
  578. Select one:
  579. False
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587. CHAPTER 5
  588.  
  589.  
  590.  
  591.  
  592.  
  593. If you precede the subquery by the ____ operator, the condition is true only if it satisfies all values produced by the subquery.​
  594. Select one:
  595. b.
  596. ​ALL
  597.  
  598.  
  599. If you precede the subquery by the ____ operator, the condition is true only if it satisfies any value (one or more) produced by the subquery.​
  600. Select one:
  601. c.
  602. ​ANY
  603.  
  604.  
  605. In a ____, all rows from the table on the left (the table listed first in the query) will be included regardless of whether they match rows from the table on the right (the table listed second in the query).​
  606. Select one:
  607. c.
  608. ​left outer join
  609.  
  610.  
  611. In a(n) ____ join, all rows from both tables are included regardless of whether they match rows from the other table.​
  612. Select one:
  613. a.
  614. ​full outer
  615.  
  616.  
  617. To qualify a column name, precede the name of the column with the name of the table, followed by a(n) ____.​
  618. Select one:
  619. b.
  620. ​period (.)
  621.  
  622.  
  623. You can precede a subquery with the ____ operator to create a condition that is true if one or more rows are obtained when the subquery is executed.​
  624. Select one:
  625. d.
  626. ​EXISTS
  627.  
  628.  
  629. ​In a full outer join, all rows from both tables will be included regardless of whether they match rows from the other table.
  630. Select one:
  631. True
  632.  
  633.  
  634. ​One reason for using an alias is when you are joining a table to itself.
  635. Select one:
  636. True
  637.  
  638.  
  639. ​When the innermost subquery is evaluated, a permanent table is produced.
  640. Select one:
  641. False
  642.  
  643.  
  644. ​You can join tables by using a condition in the WHERE clause.
  645. Select one:
  646. True
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653. CHAPTER 6
  654.  
  655.  
  656.  
  657. If you have not run the COMMIT command, executing the ____ command will reverse all updates made during the current work session.​
  658. Select one:
  659. a.
  660. ​ROLLBACK
  661.  
  662.  
  663. If you specified ____ for a column when you created a table, then changing a value in a column to null is prohibited.​
  664. Select one:
  665. c.
  666. ​NOT NULL
  667.  
  668.  
  669. The ____ command is permanent.​
  670. Select one:
  671. c.
  672. ​COMMIT
  673.  
  674.  
  675. To delete rows from the database, use the ____ command.​
  676. Select one:
  677. d.
  678. ​DELETE
  679.  
  680.  
  681. What happens if you run a DELETE command that does not contain a WHERE clause?​
  682. Select one:
  683. d.
  684. ​All rows will be deleted from the table.
  685.  
  686.  
  687. Which of the following commands executes a rollback?​
  688. Select one:
  689. a.
  690. ​ROLLBACK;
  691.  
  692.  
  693. Which of the following is a valid SQL command?​
  694. Select one:
  695. d.
  696. ​COMMIT;
  697.  
  698.  
  699. Which of the following is a valid SQL command?​
  700. Select one:
  701. a.
  702. ​DROP TABLE LEVEL1_CUSTOMER;
  703.  
  704.  
  705. You can use the ____ clause of the ALTER TABLE command to change a column that currently rejects null values so that it will accept null values.​
  706. Select one:
  707. c.
  708. ​MODIFY
  709.  
  710.  
  711. You can use the ____ command to create a new table using data in an existing table.​
  712. Select one:
  713. b.
  714. ​CREATE TABLE
  715.  
  716.  
  717. ​In some cases, you might need to change a table's structure in ways that are beyond the capabilities of your DBMS. When that happens, use the RESTRUCTURE command to redesign the table.
  718. Select one:
  719. False
  720.  
  721.  
  722. ​In SQL Server, execute the sp_columns command to list all the columns in a table.
  723. Select one:
  724. True
  725.  
  726.  
  727. ​In SQL Server, the word NULL appears in the results when a column contains a null value.
  728. Select one:
  729. True
  730.  
  731.  
  732. ​It is a good idea to use a SELECT command to display the data you changed to verify that the correct update was made.
  733. Select one:
  734. True
  735.  
  736.  
  737. ​The command, CREATE TABLE AS LEVEL1_CUSTOMER USING CUSTOMER; creates a table called LEVEL1_CUSTOMER that has the same structure as CUSTOMER.
  738. Select one:
  739. False
  740.  
  741.  
  742. ​The DROP TABLE command creates an empty table.
  743. Select one:
  744. False
  745.  
  746.  
  747. ​When necessary, include a WHERE clause into the UPDATE command to indicate the column on which the change is to take place.
  748. Select one:
  749. False
  750.  
  751.  
  752. ​When you add a new column to a table, the default for Oracle, SQL Server, and Access is to accept null values.
  753. Select one:
  754. True
  755.  
  756.  
  757. ​You can use the existing value in a column and a calculation to update a value.
  758. Select one:
  759. True
  760.  
  761.  
  762. ​You cannot commit and roll back data in SQL Server.
  763. Select one:
  764. False
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773. CHAPTER 7
  774.  
  775.  
  776.  
  777. A view is updatable when it is derived from joining two base tables on the ____ of each table.​
  778. Select one:
  779. d.
  780. ​primary key
  781.  
  782.  
  783. The command to delete a view is ____.​
  784. Select one:
  785. a.
  786. ​DROP VIEW
  787.  
  788.  
  789. The correct command to allow user Thompson to delete rows in the CUSTOMER table would be:
  790. GRANT ____ ON CUSTOMER TO THOMPSON.​
  791. Select one:
  792. c.
  793. ​DELETE
  794.  
  795.  
  796. The CREATE VIEW command includes the words CREATE VIEW, followed by the name of the view, the word ____, and then a query.​
  797. Select one:
  798. c.
  799. ​AS
  800.  
  801.  
  802. The database administrator uses the ____ command to revoke privileges from users.​
  803. Select one:
  804. b.
  805. ​REVOKE
  806.  
  807.  
  808. The general form for assigning a foreign key is ADD FOREIGN KEY, the column name(s) of the foreign key, the ____ clause, and then the table name that the foreign key must match.​
  809. Select one:
  810. b.
  811. ​REFERENCES
  812.  
  813.  
  814. The main mechanism for providing access to a database is the ____ command.​
  815. Select one:
  816. a.
  817. ​GRANT
  818.  
  819.  
  820. The privilege ____ can be granted to change data.​
  821. Select one:
  822. a.
  823. ​UPDATE
  824.  
  825.  
  826. The privilege ____ can be granted to change the table structure.​
  827. Select one:
  828. b.
  829. ​ALTER
  830.  
  831.  
  832. The privilege ____ can be granted to retrieve data.​
  833. Select one:
  834. d.
  835. ​SELECT
  836.  
  837.  
  838. Which of the following commands deletes an index?​
  839. Select one:
  840. b.
  841. ​DROP INDEX
  842.  
  843.  
  844. A view can join two or more tables.​
  845. Select one:
  846. True
  847.  
  848.  
  849. A view cannot involve statistics.​
  850. Select one:
  851. False
  852.  
  853.  
  854. An index makes certain types of retrieval more efficient.​
  855. Select one:
  856. True
  857.  
  858.  
  859. If the database structure changes, the user cannot access and use the view.​
  860. Select one:
  861. False
  862.  
  863.  
  864. Normally, when the database administrator grants a particular privilege to a user, the user cannot pass that privilege along to other users.​
  865. Select one:
  866. True
  867.  
  868.  
  869. The DROP VIEW command removes the tables and data on which the view is based.​
  870. Select one:
  871. False
  872.  
  873.  
  874. The GRANT command to indicate that a user has all privileges includes the FULL privilege.​
  875. Select one:
  876. False
  877.  
  878.  
  879. Views furnish a certain amount of security; if users are accessing the database through a view, they cannot access any data that is not included in the view.​
  880. Select one:
  881. True
  882.  
  883.  
  884. Views provide data validation.​
  885. Select one:
  886. False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement