52.

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

A)

SELECT

B)

CREATE

C)

SET

D)

CONSTRAINT

E)

ALTER

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.00

C)

00012345

D)

12345

E)

123450.00

54.

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

A)

SET

B)

CONSTRAINT

C)

CREATE

D)

ALTER

E)

SELECT

55.

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

A)

name of the foreign key

B)

name of the primary key

C)

name of the constraint

D)

A and B

E)

A, B, and C

56.

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

A)

CREATE TABLE CUSTOMER (

CustomerIDIntegerNot Null

LastNameChar(35)Not Null

First NameChar(25)Null

);

ALTER TABLE CUSTOMER

ADD CONSTRAINT CustomerPK PRIMARY KEY (CustomerID);

B)

CREATE TABLE CUSTOMER (

CustomerIDIntegerPrimary Key

LastNameChar(35)Not Null

First NameChar(25)Null

);

C)

CREATE TABLE CUSTOMER (

CustomerIDIntegerNot Null

LastNameChar(35)Not Null

First NameChar(25)Null

CONSTRAINT CustomerPK PRIMARY KEY (CustomerID)

);

D)

either B or C

E)

The authors do not demonstrate a preference for how to define a primary key.

57.

Given the SQL statement

CREATE TABLE SALESREP (

SalesRepNointNOT NULL,

RepNamechar(35)NOT NULL,

HireDatedateNOT NULL,

CONSTRAINTSalesRepPKPRIMARY KEY (SalesRepNo),

CONSTRAINTSalesRepAK1UNIQUE (RepName)

);

we know that ______.

A)

RepName is the primary key

B)

RepName is a candidate key

C)

RepName is a surrogate key

D)

RepName is a foreign key

E)

None of the above is true

58.

The SQL keyword used to limit column values to specific values is ______.

A)

NOT NULL

B)

CONSTRAINT

C)

UNIQUE

D)

CHECK

E)

UPDATE

59.

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

A)

SET

B)

ALTER

C)

SELECT

D)

CREATE

E)

CONSTRAINT

60.

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

A)

DELETE

B)

MODIFY

C)

ALTER

D)

DROP

E)

DISPOSE

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.

E)

A and B

62.

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

A)

SET

B)

DELETE

C)

SELECT

D)

INSERT

E)

UPDATE

63.

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

A)

SELECT

B)

INSERT

C)

UPDATE

D)

MODIFY

E)

CHANGE

64.

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

A)

CHANGE

B)

MODIFY

C)

SET

D)

INSERT

E)

SELECT

65.

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

A)

UPDATE

B)

INSERT

C)

ERASE

D)

SET

E)

DELETE

66.

Based on the tables below, which of the following SQL statements would increase the balance of the Gonzales account by $100 to a total of $450?

GENERAL SALES DATABASE:

SALESREP

SalesRepNo / RepName / HireDate
654 / Jones / 01/02/2005
734 / Smith / 02/03/2007
345 / Chen / 01/25/2004
434 / Johnson / 11/23/2004

CUSTOMER

CustNo / CustName / Balance / SalesRepNo
9870 / Winston / 500 / 345
8590 / Gonzales / 350 / 434
7840 / Harris / 800 / 654
4870 / Miles / 100 / 345

A)

SELECT Gonzales

FROM CUSTOMER

INSERT VALUES PLUS (100) INTO Balance;

B)

UPDATE CUSTOMER

SET Balance = 450

WHERE CustName = 'Gonzales';

C)

INSERT INTO CUSTOMER VALUES PLUS (100)

SELECT Balance

WHERE CustName = 'Gonzales';

D)

INSERT INTO CUSTOMER VALUES (450)

SELECT Balance

WHERE CustName = 'Gonzales';

E)

SELECT Gonzales

FROM CUSTOMER

INSERT VALUES (450) INTO Balance;

67.

An SQL virtual table is called ______.

A)

a CHECK constraint

B)

a trigger

C)

a view

D)

embedded SQL

E)

a stored procedure

68.

The SQL command used to create a virtual table is ______.

A)

CREATE VIEW

B)

VIEW

C)

VTABLE

D)

NEWLOOK

E)

CREATE VTABLE

69.

SQL views are constructed from ______.

A)

SELECT statements

B)

UPDATE statements

C)

VIEW statements

D)

INSERT statements

E)

CREATE statements

70.

According to the SQL-92, statements used to construct views cannot contain ______.

A)

the SELECT clause

B)

the WHERE clause

C)

the FROM clause

D)

the ORDER BY clause

E)

SQL view statements can use all of the listed clauses.

71.

Which SQL statement is used to retrieve view instances?

A)

UPDATE

B)

DELETE

C)

INSERT

D)

SELECT

E)

CREATE

72.

SQL views are used ______.

A)

to provide a level of indirection between data processed by applications and the data actually stored in the database tables

B)

to hide columns

C)

to hide complicated SQL statements

D)

to show results of computed columns

E)

SQL views are used for all of the above.

73.

If the values in an SQL view are changeable through the view itself, which SQL statement is used to change the values?

A)

SELECT

B)

INSERT

C)

UPDATE

D)

DELETE

E)

CREATE

74.

SQL views are always updatable when ______.

A)

the view is based on a single table with no computed columns, and all non-null columns are present in the view

B)

the view is based on any number of tables, with or without computed columns, and the INSTEAD OF trigger is defined for the view

C)

the view is based on multiple tables, the update is being done on the most subordinate table, and the rows of that table can be uniquely identified

D)

A and B

E)

A, B, and C

75.

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

A)

a view

B)

a trigger

C)

a stored procedure

D)

a CHECK constraint

E)

embedded SQL

76.

Because SQL statements are set-oriented, whereas programs are element-oriented, the results of SQL statements used in programs are treated as ______.

A)

columns

B)

tables

C)

files

D)

rows

E)

pseudofiles

77.

Because SQL statements are table-oriented, whereas programs are element-oriented, the results of SQL statements used in programs are accessed using ______.

A)

an SQL cursor

B)

an SQL trigger

C)

an SQL stored procedure

D)

standard programming tools

E)

custom written programming tools

78.

A stored program that is attached to a table or view is called ______.

A)

a stored procedure

B)

a CHECK constraint

C)

a trigger

D)

a view

E)

embedded SQL

79.

Which of the following is not an ANSI SQL trigger?

A)

BEFORE INSERT

B)

INSTEAD OF UPDATE

C)

INSTEAD OF CONSTRAINT

D)

AFTER DELETE

E)

BEFORE UPDATE

80.

Which of the following is an SQL trigger Oracle supports?

A)

AFTER

B)

INSTEAD OF

C)

BEFORE

D)

B and C only

E)

A, B, and C

81.

Which of the following is an SQL trigger Microsoft SQL Server supports?

A)

BEFORE

B)

INSTEAD OF

C)

AFTER

D)

B and C only

E)

A, B, and C

82.

SQL triggers can be used when the DBMS receives a(n) ______request.

A)

DELETE

B)

INSERT

C)

UPDATE

D)

A and B

E)

A, B, and C

83.

SQL triggers are used for ______.

A)

providing default values

B)

validity checking

C)

updating views

D)

A and B

E)

A, B, and C

84.

When a trigger is fired, the DBMS makes the appropriate data available to ______.

A)

the application code

B)

the stored procedure code

C)

the SQL interpreter

D)

the trigger code

E)

the embedded SQL code

85.

SQL triggers are created using ______.

A)

the SQL TRIGGER statement

B)

the SQL CONSTRAINT TRIGGER statement

C)

the SQL ADD CONSTRAINT TRIGGER statement

D)

the SQL ADD TRIGGER statement

E)

the SQL CREATE TRIGGER statement

86.

To set a column value to an initial value that is selected according to some business logic, you would use:

A)

the SQL DEFAULT constraint with the CREATE TABLE command.

B)

an SQL view.

C)

an SQL stored procedure.

D)

an SQL trigger.

E)

embedded SQL.

87.

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 ______.

A)

an AFTER trigger

B)

a BEFORE trigger

C)

an INSTEAD OF trigger

D)

Depending on the specific logic, either A or B can be used.

E)

Depending on the specific logic, any of A, B, or C can be used.

88.

A stored program that is attached to the database is called ______.

A)

a view

B)

embedded SQL

C)

a trigger

D)

a CHECK constraint

E)

a stored procedure

89.

Stored procedures have the advantage of ______.

A)

decreased network traffic

B)

code sharing

C)

SQL optimized by the DBMS compiler

D)

greater security

E)

All of the above

90.

Because SQL stored procedures allow and encourage code sharing among developers, stored procedures give database application developers the advantages of ______.

A)

less work

B)

specialization among developers

C)

standardized processing

D)

A and B

E)

A, B, and C