Ch. 7/P1 Flashcards

1
Q

The SQL command that lets you insert data into a table, one row at a time, is ________.

a. SELECT
b. COMMIT
c. UPDATE
d. INSERT

A

d. INSERT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

SQL command that lets you save your work to disk is ________.

a. UPDATE
b. INSERT
c. COMMIT
d. SELECT

A

c. COMMIT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The SQL command used to list the contents of a table is ________.

a. SELECT
b. UPDATE
c. INSERT
d. COMMIT

A

a. SELECT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The SQL command that enables you to make changes in the data is ________.

a. COMMIT
b. INSERT
c. UPDATE
d. SELECT

A

c. UPDATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The current fully approved version of standard SQL prescribed by the American National Standards Institute is ________.

a. SQL2
b. SQL-4
c. SQL-99
d. SQL-2003

A

d. SQL-2003

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

________ is/are SQL character data type(s).

a. VARCHAR2 only
b. ALPHANUMERIC
c. CHAR only
d. CHAR and VARCHAR2

A

d. CHAR and VARCHAR2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

To list all the contents of the PRODUCT table you would use ________.

a. SELECT ALL FROM PRODUCT;
b. SELECT * FROM PRODUCT;
c. DISPLAY * FROM PRODUCT;
d. LIST * FROM PRODUCT;

A

b. SELECT * FROM PRODUCT;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In Oracle, the ________ command is used to place a $ in front of a numeric value.

a. CHAR
b. CONVERT
c. DISPLAY
d. FORMAT

A

d. FORMAT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Using MySQL, which command would you use when changing the date in one record of the PRODUCT table?

a. update PRODUCT set P_INDATE=’2011-18-02’ where P_CODE=’13-Q2/P2’;
b. update PRODUCT set P_INDATE=’2011-02-18’ where P_CODE=’13-Q2/P2’;
c. update PRODUCT set P_INDATE=’02-18-2011’ where P_CODE=’13-Q2/P2’;
d. update PRODUCT set P_INDATE=’FEB-18-2011’ where P_CODE=’13-Q2/P2’;

A

b. update PRODUCT set P_INDATE=’2011-02-18’ where P_CODE=’13-Q2/P2’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which command is used to restore the table contents?

a. COMMIT; BACKUP;
b. COMMIT; RESTORE;
c. COMMIT; ROLLBACK;
d. ROLLBACK;

A

d. ROLLBACK;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which command would be used to delete the table row where the P_CODE = ‘2238/QPD’?

a. DELETE ALL table WHEN ‘2238/QPD’=P_CODE;
b. DELETE FROM table WHERE P_CODE=’2238/QPD’;
c. DELETE table WHERE P_CODE=’2238/QPD’;

d.
REMOVE FROM table WHERE P_CODE=’2238/QPD’;

A

b. DELETE FROM table WHERE P_CODE=’2238/QPD’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Some RDBMSs (like Oracle) will automatically ________ data changes when issuing data definition commands.

a. INVOKE
b. UPDATE
c. COMMIT
d. ROLLBACK

A

c. COMMIT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What happens when you issue the DELETE FROM tablename command without specifying a WHERE condition?

a. no rows will be deleted
b. all rows will be deleted
c. the first row will be deleted
d. the last row will be deleted

A

b. all rows will be deleted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which command is used to select partial table contents?

a. SELECT P_CODE, P_DESCRIPT, V_CODE, FROM PRODUCT;
b. SELECT * FROM PRODUCT;
c. SELECT PARTIAL FROM PRODUCT;
d. SELECT P_CODE, P_DESCRIPT, V_CODE FROM PRODUCT;

A

d. SELECT P_CODE, P_DESCRIPT, V_CODE FROM PRODUCT;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which query would be used to output the table contents where the value of V_CODE is equal to 21344?

a. OUTPUT * FROM table WHERE V_CODE=21344;
b. DISPLAY * FROM table V_CODE=21344;
c. SELECT ALL FROM table WHERE V_CODE=21344;
d. SELECT * FROM table WHERE V_CODE=21344;

A

d. SELECT * FROM table WHERE V_CODE=21344;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which query would be used to output the table contents where the value of the character field P_CODE is 1558-QW1?

a. SELECT * FROM table WHERE P_CODE EQUAL TO ‘15558-QW1’;
b. SELECT * FROM table WHERE P_CODE==’1558-QW1’;
c. SELECT * FROM table WHERE P_CODE=’1558-QW1’;
d. SELECT * FROM table IF P_CODE=’1558-QW1’;

A

c. SELECT * FROM table WHERE P_CODE=’1558-QW1’;

17
Q

Which MS Access query command will list all the rows in which the inventory stock dates occur on or after January 20, 2006?

a. SELECT * FROM table WHERE P_CODE >= ‘20-Jan-2006’;
b. SELECT * FROM table WHERE P_CODE => ‘20-Jan-2006’;
c. SELECT * FROM table WHERE P_CODE >= #20-Jan-06#;
d. SELECT * FROM table WHERE P_CODE >= %20-Jan-2006%;

A

c. SELECT * FROM table WHERE P_CODE >= #20-Jan-06#;

18
Q

Which command uses columns and column aliases to determine the total value of each of the products held on hand and displays the results in a column labeled TOTVALUE?

a. SELECT P_DESCRIPT, P_QOH, P_PRICE,P_QOH/P_PRICE AS TOTVALUE
FROM PRODUCT;

b. SELECT P_DESCRIPT, P_QOH, P_PRICE,P_QOH*P_PRICE AS TOTVALUE
FROM PRODUCT;

c. SELECT P_DESCRIPT, P_QOH, P_PRICE,P_QOH-P_PRICE AS TOTVALUE
FROM PRODUCT;

d. SELECT P_DESCRIPT, P_QOH, P_PRICE,P_QOH=P_PRICE AS TOTVALUE
FROM PRODUCT;

A

b. SELECT P_DESCRIPT, P_QOH, P_PRICE,P_QOH*P_PRICE AS TOTVALUE
FROM PRODUCT;

19
Q

A(n) ________ is an alternate name given to a column or table in any SQL statement.

a. data type
b. alias
c. trigger
d. stored function

A

b. alias

20
Q

What is the SQL syntax to list the table contents for either V_CODE = 21344 or V_CODE = 24288?

a. SELECT P_CODE FROM PRODUCT WHERE V_CODE == 21344 OR V_CODE == 24288;
b. SELECT P_CODE FROM PRODUCT WHERE V_CODE = 21344 OR = 24288;
c. SELECT P_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE = 24288;
d. SELECT P_CODE FROM PRODUCT WHERE V_CODE = 21344 AND V_CODE = 24288;

A

c. SELECT P_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE = 24288;

21
Q

The ________ operator is used to check whether an attribute value is null.

a. LIKE
b. IN
c. BETWEEN
d. IS NULL

A

d. IS NULL

22
Q

The ________ operator is used to define a range limit.

a. BETWEEN
b. NULL
c. IN
d. LIKE

A

a. BETWEEN

23
Q

The ________ operator is used to check whether an attribute has a value.

a. IN
b. BETWEEN
c. LIKE
d. EXISTS

A

d. EXISTS