Ch. 7/P1 Flashcards
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
d. INSERT
SQL command that lets you save your work to disk is ________.
a. UPDATE
b. INSERT
c. COMMIT
d. SELECT
c. COMMIT
The SQL command used to list the contents of a table is ________.
a. SELECT
b. UPDATE
c. INSERT
d. COMMIT
a. SELECT
The SQL command that enables you to make changes in the data is ________.
a. COMMIT
b. INSERT
c. UPDATE
d. SELECT
c. UPDATE
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
d. SQL-2003
________ is/are SQL character data type(s).
a. VARCHAR2 only
b. ALPHANUMERIC
c. CHAR only
d. CHAR and VARCHAR2
d. CHAR and VARCHAR2
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;
b. SELECT * FROM PRODUCT;
In Oracle, the ________ command is used to place a $ in front of a numeric value.
a. CHAR
b. CONVERT
c. DISPLAY
d. FORMAT
d. FORMAT
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’;
b. update PRODUCT set P_INDATE=’2011-02-18’ where P_CODE=’13-Q2/P2’;
Which command is used to restore the table contents?
a. COMMIT; BACKUP;
b. COMMIT; RESTORE;
c. COMMIT; ROLLBACK;
d. ROLLBACK;
d. ROLLBACK;
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’;
b. DELETE FROM table WHERE P_CODE=’2238/QPD’;
Some RDBMSs (like Oracle) will automatically ________ data changes when issuing data definition commands.
a. INVOKE
b. UPDATE
c. COMMIT
d. ROLLBACK
c. COMMIT
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
b. all rows will be deleted
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;
d. SELECT P_CODE, P_DESCRIPT, V_CODE FROM PRODUCT;
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;
d. SELECT * FROM table WHERE V_CODE=21344;