Database processing fundamentals design and implementation 14th edition kroenke test bank

Page 1

Database Processing Fundamentals

Design and Implementation 14th Edition Kroenke Test Bank

Visit to download the full and correct content document: https://testbankdeal.com/dow nload/database-processing-fundamentals-design-and-implementation-14th-edition-kr oenke-test-bank/

Database Processing, 14e (Kroenke)

Chapter 7: SQL for Database Construction and Application Processing

1) The SQL CREATE TABLE statement is used to name a new table and describe the table's columns.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To create and manage table structures using SQL statements

Classification: Concept

2) The SQL keyword CONSTRAINT is used to define one of several types of constraints.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To create and execute SQL constraints

Classification: Concept

3) The SQL keyword PRIMARY KEY is used to designate the column(s) that are the primary key for the table.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To create and execute SQL constraints

Classification: Concept

4) The SQL keyword CONSTRAINT is used to limit column values to specific values.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To create and execute SQL constraints

Classification: Concept

5) The SQL keyword CONSTRAINT can be used in conjunction with the SQL keywords PRIMARY KEY and FOREIGN KEY.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To create and execute SQL constraints

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

1

6) One advantage of using the CONSTRAINT command to define a primary key is that the database designer controls the name of the constraint.

Answer: TRUE

AACSB: Information Technology

Difficulty: Difficult

LO: To create and execute SQL constraints

Classification: Concept

7) The SQL keyword UNIQUE is used to define alternate keys.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To create and execute SQL constraints

Classification: Concept

8) If the table PRODUCT has a column PRICE, and PRICE has the data type Numeric (8,2), the value 98765 stored in that field will be displayed by the DBMS as 98765.00.

Answer: FALSE

AACSB: Information Technology; Application of Knowledge

Difficulty: Difficult

LO: To create and manage table structures using SQL statements

Classification: Application

9) If the table ITEM has a column WEIGHT, and WEIGHT has the data type Numeric (4,2), the value 4321 will be displayed by the DBMS as 43.21.

Answer: TRUE

AACSB: Information Technology; Application of Knowledge

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Application

10) The SQL keyword CHECK is used to limit column values to specific values.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To create and execute SQL constraints

Classification: Concept

11) The SQL keyword MODIFY is used to change the structure, properties or constraints of a table.

Answer: FALSE

AACSB: Information Technology

Difficulty: Easy

LO: To create and manage table structures using SQL statements

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

2

12) Data values to be added to a table are specified by using the SQL VALUES clause.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Concept

13) The SQL keyword DELETE is used to delete a table's structure.

Answer: FALSE

AACSB: Information Technology

Difficulty: Easy

LO: To create and manage table structures using SQL statements

Classification: Concept

14) When the correct SQL command is used to delete a table's structure, the command can only be used with a table that has already had its data removed.

Answer: FALSE

AACSB: Information Technology

Difficulty: Difficult

LO: To create and manage table structures using SQL statements

Classification: Concept

15) One or more rows can be added to a table by using the SQL INSERT statement.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Concept

16) Unless it is being used to copy data from one table to another, the SQL INSERT statement can be used to insert only a single row into a table.

Answer: TRUE

AACSB: Information Technology

Difficulty: Difficult

LO: To create and manage table structures using SQL statements

Classification: Concept

17) Rows in a table can be changed by using the SQL UPDATE statement.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

3

18) The SQL SET keyword is used to specify a new value when changing a column value.

Answer: TRUE

AACSB: Information Technology

Difficulty: Difficult

LO: To create and manage table structures using SQL statements

Classification: Concept

19) The SQL keyword MODIFY is used to change a column value.

Answer: FALSE

AACSB: Information Technology

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Concept

20) Rows can be removed from a table by using the SQL DELETE statement.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Concept

21) An SQL virtual table is called a view.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To understand several uses for SQL views

Classification: Concept

22) The SQL command CREATE USER VIEW is used to create a virtual table.

Answer: FALSE

AACSB: Information Technology

Difficulty: Moderate

LO: To use SQL statements to create, use, and manage views

Classification: Concept

23) SQL views are constructed from SELECT statements.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To use SQL statements to create, use, and manage views

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

4

24) According to the SQL-92 standard, statements used to construct views cannot contain the WHERE clause.

Answer: FALSE

AACSB: Information Technology

Difficulty: Moderate

LO: To use SQL statements to create, use, and manage views

Classification: Concept

25) The SQL command SELECT is used to retrieve view instances.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To use SQL statements to create, use, and manage views

Classification: Concept

26) The values in an SQL view are not always changeable through the view itself.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand several uses for SQL views

Classification: Concept

27) SQL views can be used to hide columns.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To understand several uses for SQL views

Classification: Concept

28) SQL views can be used to provide a level of insulation between data processed by applications and the data actually stored in the database tables.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand several uses for SQL views

Classification: Concept

29) If the values in an SQL view are changeable through the view itself, the SQL command UPDATE is used to change the values.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To use SQL statements to create, use, and manage views

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

5

30) The values in an SQL view are always changeable through the view itself.

Answer: FALSE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand several uses for SQL views

Classification: Concept

31) SQL views are updatable when the view is based on a single table with no computed columns, and all non-null columns are present in the view.

Answer: TRUE

AACSB: Information Technology

Difficulty: Difficult

LO: To understand several uses for SQL views

Classification: Concept

32) Because SQL statements are table-oriented, whereas programs are variable-oriented, the results of SQL statements used in programs are treated as pseudofiles.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how SQL is used in application programming

Classification: Concept

33) A set of SQL statements stored in an application written in a standard programming language is called embedded SQL.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To understand how SQL is used in application programming

Classification: Concept

34) Because SQL statements are table-oriented, whereas programs are variable-oriented, the results of SQL statements used in programs are accessed using an SQL cursor.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how SQL is used in application programming

Classification: Concept

35) A stored program that is attached to a table or view is called a stored procedure.

Answer: FALSE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how to create and use stored procedures

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

6

36) SQL triggers use the ANSI SQL keywords BEFORE, INSTEAD OF, and AFTER.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how to create and use triggers

Classification: Concept

37) SQL triggers can be used with SQL operations INSERT, UPDATE, and DELETE.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how to create and use triggers

Classification: Concept

38) SQL triggers can be used when the DBMS receives an INSERT request.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To understand how to create and use triggers

Classification: Concept

39) SQL triggers are used for providing default values, validity checking, updating views, and performing referential integrity actions.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how SQL is used in application programming

Classification: Concept

40) The Oracle DBMS supports the SQL BEFORE trigger.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how to create and use triggers

Classification: Concept

41) The SQL Server DBMS supports the SQL BEFORE trigger.

Answer: FALSE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how to create and use triggers

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

7

42) SQL triggers can be used when the DBMS receives an update request.

Answer: TRUE

AACSB: Information Technology

Difficulty: Easy

LO: To understand how to create and use triggers

Classification: Concept

43) To set a column value to an initial value that is selected according to some complicated business logic, you would use the SQL DEFAULT constraint with the CREATE TABLE command.

Answer: FALSE

AACSB: Information Technology

Difficulty: Difficult

LO: To create and execute SQL constraints

Classification: Concept

44) SQL triggers are created using the SQL ADD TRIGGER statement.

Answer: FALSE

AACSB: Information Technology

Difficulty: Difficult

LO: To understand how to create and use triggers

Classification: Concept

45) If the values in an SQL view are not changeable through the view itself, you may still be able to update the view by using unique application logic. In this case, the specific logic is placed in an INSTEAD OF trigger.

Answer: TRUE

AACSB: Information Technology

Difficulty: Difficult

LO: To understand how to create and use triggers

Classification: Concept

46) If a trigger is being written to enforce referential integrity actions, you cannot use an INSTEAD OF trigger.

Answer: FALSE

AACSB: Information Technology

Difficulty: Difficult

LO: To understand how to create and use triggers

Classification: Concept

47) When a trigger is fired, the DBMS makes the appropriate data available to the trigger code.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how to create and use triggers

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

8

48) A stored program that is stored within the database and compiled when used is called a trigger.

Answer: FALSE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand SQL/Persistent Stored Modules (SQL/PSM)

Classification: Concept

49) Stored procedures have the advantage of greater security, decreased network traffic, SQL optimized by the DBMS compiler, and code sharing.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand SQL/Persistent Stored Modules (SQL/PSM)

Classification: Concept

50) Unlike application code, stored procedures are never distributed to the client computers.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how SQL is used in application programming

Classification: Concept

51) Because SQL stored procedures allow and encourage code sharing among developers, stored procedures give database application developers the advantages of less work, standardized processing, and specialization among developers.

Answer: TRUE

AACSB: Information Technology

Difficulty: Moderate

LO: To understand how SQL is used in application programming

Classification: Concept

52) Which SQL keyword is used to name a new table and describe the table's columns?

A) SET

B) CREATE

C) SELECT

D) ALTER

Answer: B

AACSB: Information Technology

Difficulty: Easy

LO: To create and manage table structures using SQL statements

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

9

53) If the table PRODUCT has a column PRICE that has the data type Numeric (8,2), the value 12345 will be displayed by the DBMS as ________.

A) 123.45

B) 12345

C) 12345.00

D) 123450.00

Answer: A

AACSB: Information Technology; Application of Knowledge

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Application

54) Which SQL keyword is used to impose restrictions on a table, data or relationship?

A) SET

B) CREATE

C) SELECT

D) CONSTRAINT

Answer: D

AACSB: Information Technology

Difficulty: Easy

LO: To create and execute SQL constraints

Classification: Concept

55) One advantage of using the CONSTRAINT phrase to define a primary key is that the database designer controls the ________.

A) name of the table

B) name of the foreign key field

C) name of the constraint

D) name of the primary key field

Answer: C

AACSB: Information Technology

Difficulty: Difficult

LO: To create and execute SQL constraints

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

10

56) Which of the following illustrates the authors' preferred style of defining a primary key?

A) CREATE TABLE CUSTOMER (

CustomerID Integer Primary Key

LastName Char(35) Not Null

First Name Char(25) Null

);

B) CREATE TABLE CUSTOMER (

CustomerID Integer Not Null

LastName Char(35) Not Null

First Name Char(25) Null

CONSTRAINT CustomerPK PRIMARY KEY (CustomerID)

);

C) CREATE TABLE CUSTOMER (

CustomerID Integer Not Null

LastName Char(35) Not Null

First Name Char(25) Null );

ALTER TABLE CUSTOMER

ADD CONSTRAINT CustomerPK PRIMARY KEY (CustomerID);

D) Both B and C are correct

Answer: B

AACSB: Information Technology; Application of Knowledge

Difficulty: Difficult

LO: To create and execute SQL constraints

Classification: Application

57) Given the SQL statement

CREATE TABLE SALESREP (

SalesRepNo int NOT NULL, RepName char(35) NOT NULL, HireDate date NOT NULL,

CONSTRAINT SalesRepPK PRIMARY KEY (SalesRepNo), CONSTRAINT SalesRepAK1 UNIQUE (RepName) );

we know that ________.

A) RepName is the primary key

B) RepName is a foreign key

C) RepName is a candidate key

D) RepName is a surrogate key

Answer: C

AACSB: Information Technology; Application of Knowledge

Difficulty: Difficult

LO: To create and execute SQL constraints

Classification: Application

Copyright © 2016 Pearson Education, Inc.

11

58) The SQL keyword used to limit column values to specific values is ________.

A) CONSTRAINT

B) CHECK

C) NOT NULL

D) UNIQUE

Answer: B

AACSB: Information Technology

Difficulty: Moderate

LO: To create and execute SQL constraints

Classification: Concept

59) Which SQL keyword is used to change the structure, properties or constraints of a table?

A) SET

B) CREATE

C) SELECT

D) ALTER

Answer: D

AACSB: Information Technology

Difficulty: Easy

LO: To create and manage table structures using SQL statements

Classification: Concept

60) Which SQL keyword is used to delete a table's structure?

A) DELETE

B) DROP

C) DISPOSE

D) ALTER

Answer: B

AACSB: Information Technology

Difficulty: Easy

LO: To create and manage table structures using SQL statements

Classification: Concept

61) When the correct SQL command is used to delete a table's structure, what happens to the data in the table?

A) If the deleted table was a parent table, the data is added to the appropriate rows of the child table.

B) If the deleted table was a child table, the data is added to the appropriate rows of the parent table.

C) The data in the table is also deleted.

D) Nothing because there was no data in the table since only an empty table can be deleted.

Answer: C

AACSB: Information Technology

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

12

62) Which SQL keyword is used to add one or more rows of data to a table?

A) DELETE

B) INSERT

C) SELECT

D) UPDATE

Answer: B

AACSB: Information Technology

Difficulty: Easy

LO: To create and manage table structures using SQL statements

Classification: Concept

63) Which SQL keyword is used to change one or more rows in a table?

A) MODIFY

B) INSERT

C) SELECT

D) UPDATE

Answer: D

AACSB: Information Technology

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Concept

64) Which SQL keyword is used to change the values of an entire column?

A) CHANGE

B) INSERT

C) SELECT

D) SET

Answer: D

AACSB: Information Technology

Difficulty: Difficult

LO: To create and manage table structures using SQL statements

Classification: Concept

65) Which keyword is used to remove one or more rows from a table?

A) DELETE

B) INSERT

C) ERASE

D) SET

Answer: A

AACSB: Information Technology

Difficulty: Moderate

LO: To create and manage table structures using SQL statements

Classification: Concept

Copyright © 2016 Pearson Education, Inc.

13

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.