ITEC 370 Practice Test Chapter 3

Which of the following characters can be used in a table name?
a. the dash character -
b. the underline _
c. the question mark ?
d. the percent sign %

b. the underline _

Which of the following is NOT a valid Oracle data type?
a. CHAR(9)
b. VARCHAR2(3)
c. DATE(15)
d. NUMBER(8,8)

c. Date(15)

Which of the following SQL statements creates a new table with a virtual column?
a. CREATE TABLE newbooks
(retail NUMBER(5,2),
cost NUMBER(5,2),
profit AS (retail-cost));
b. CREATE TABLE newbooks
(retail NUMBER(5,2),
cost NUMBER(5,2),
(retail-cost) AS pro

a. CREATE TABLE newbooks
(retail NUMBER(5,2),
cost NUMBER(5,2),
profit AS (retail-cost));

True or false: Setting a column unused frees up storage space used by the column.

False

Which of the following commands will change a table's name from BOOKS to INVENTORY?
a. ALTER TABLE books MODIFY TO inventory;
b. RENAME TABLE FROM books TO inventory;
c. CREATE TABLE inventory AS SELECT * FROM books;
d. RENAME books TO inventory;

d. RENAME books TO inventory;

What is the maximum number of columns in an Oracle 11g table?
a. 1000
b. 256
c. 30
d. unlimited

a. 1000

True or false: A table can contain only one unused column.

False

What is the maximum number of characters in a table name?
a. 30
b. 1000
c. 256
d. 8

a. 30

Which of the following SQL statements correctly creates a table with two columns?
a. CREATE TABLE table_B
(today DATE, value NUMBER(999.99));
b. CREATE TABLE table#c
(today DATE DEFAULT SYSDATE, value NUMBER);
c. CREATE TABLE tableD
(today DATE, value VAR

b. CREATE TABLE table#c
(today DATE DEFAULT SYSDATE, value NUMBER)

True or false: You can NOT recover data from a table that has been truncated.

True

After which of the following commands can you use the FLASHBACK command to recover the data?
a. DROP TABLE author;
b. TRUNCATE TABLE author;
c. DROP TABLE author PURGE;
d. ALTER TABLE author DROP COLUMN *;

a. DROP TABLE author;

Which of the following is a valid SQL statement?
a. ALTER TABLE customers
DROP UNUSED COLUMNS;
b. ALTER TABLE customers
DROP COLUMN lastname, firstname;
c. DELETE TABLE customers;
d. ALTER TABLE customers
RENAME customer# TO customer_num;

a. ALTER TABLE customers
DROP UNUSED COLUMNS;

Which of the following is a valid table name?
a. #9TABLE
b. TABLE#9
c. None of these are valid table names.
d. 9TABLE#

b. TABLE#9

If you add a column to a table, where does it appear in relation to existing columns?
a. As the last column in the table.
b. As the first column in the table.
c. To the left of the currently selected column.
d. In alphabetical order.

a. As the last column in the table.

Which of the following is a valid SQL statement?
a. ALTER TABLE books DROP COLUMN retail;
b. ALTER TABLE books DROP COLUMN retail, cost;
c. ALTER TABLE books DROP retail;
d. ALTER TABLE books DROP *;

a. ALTER TABLE books DROP COLUMN retail;

Which of the following commands will delete all the data from oldtable but leave the table's structure intact?
a. DELETE TABLE oldtable;
b. TRUNCATE TABLE oldtable;
c. DROP TABLE oldtable;
d. ALTER TABLE oldtable
DROP UNUSED COLUMNS;

TRUNCATE TABLE oldtable;

True or false: You can add more than one column at a time to a table.

True

What is the default width for the NUMBER data type?
a. 38 digits
b. None--there is no default width for a NUMBER field.
c. 9 digits
d. 1 digit

a. 38 digits

Which of the following is NOT a valid SQL statement?
a. CREATE TABLE newcustomers AS
(SELECT * FROM customers);
b. CREATE TABLE newtable1 (tablekey VARCHAR2(12));
c. All of these statements are valid.
d. CREATE TABLE newtable2 (odate, sdate, o#)
AS (SELEC

c. All of these statements are valid.

Which of the following commands drops unused columns from the customers table?
a. ALTER TABLE customers DROP UNUSED COLUMNS;
b. DROP TABLE customers
WHERE COLUMN IS UNUSED;
c. TRUNCATE TABLE customers;
d. ALTER TABLE customers
DROP COLUMN
WHERE COLUMN IS

ALTER TABLE customers DROP UNUSED COLUMNS;