Chapter 3 - Table Creation & Management

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which of the following is not a correct statement? A. A table can be modified only if it doesn't contain any rows of data B. The maximum number of characters in a table name is 30 C. You can add more than one column at a time to a table D. You can't recover data contained in a table that has been truncated.

A. A table can be modified only if it doesn't contain any rows of data

Which of the following commands changes a table's name from OLDNAME to NEWNAME? A. RENAME oldname TO newname; B. RENAME table FROM oldname TO newname; C. ALTER TABLE oldname MODIFY TO newname; D. CREATE TABLE newname (SELECT * FROM oldname);

A. RENAME oldname TO newname;

Which of the following is not a valid statement? A. You can change the name of a table only if it doesn't contain any data B. You can change the length of a column that doesn't contain any data C. You can delete a column that doesn't contain any data D. You can add a column to a table

A. You can change the name of a table only if it doesn't contain any data

Which of the following characters can be used in a table name? A. _ B. ( C. % D. !

A. _

Which of the following SQL statements changes the size of the Title column in the BOOKS table from the current length of 30 characters to the length of 35 characters? A. ALTER TABLE books CHANGE title VARCHAR(35); B. ALTER TABLE books MODIFY (title VARCHAR2(35)); C. ALTER TABLE books MODIFY title (VARCHAR2(35)); D. ALTER TABLE books MODIFY (title VARCHAR2(+5));

B. ALTER TABLE books MODIFY (title VARCHAR2(35));

Which of the following commands drops any columns marked as unused from the SECUSTOMERORDERS table? A. DROP COLUMN FROM secustomerorders WHERE column_status= UNUSED; B. ALTER TABLE secustomerorders DROP UNUSED COLUMNS; C. ALTER TABLE secustomerorders DROP (unused); D. DROP UNUSED COLUMNS;

B. ALTER TABLE secustomerorders DROP UNUSED COLUMNS;

Which of the following is true? A. All data in a table can be recovered if the table is dropped with the PURGE option. B. All data in a table can be recovered from the recycle bin if the table is dropped. C. All data in a table is lost if the table is dropped. D. All of the above statements are true.

B. All data in a table can be recovered from the recycle bin if the table is dropped.

Which of the following is a valid table name? A. 9NEWTABLE B. DATE9 C. NEW"TABLE D. None of the above are valid table names

B. DATE9

Which of the following commands removes all data from a table but leaves the table's structure intact? A. ALTER TABLE secustomerorders DROP UNUSED COLUMNS; B. TRUNCATE TABLE secustomerorders; C. DELETE TABLE secustomerorders; D. DROP TABLE secustomerorders;

B. TRUNCATE TABLE secustomerorders;

Which of the following is a correct statement? A. You can restore the data deleted with the DROP COLUMN clause, but not the data deleted with the SET UNUSED clause B. You can't create empty tables -- all tables must contain at least three rows of data C. A table can contain a maximum of 1000 columns D. The maximum length of a table name is 265 characters

C. A table can contain a maximum of 1000 columns

Which of the following is a valid SQL statement? A. ALTER TABLE secustomersspent ADD DATE lastorder; B. ALTER TABLE secustomerorders DROP retail; C. CREATE TABLE newtable AS (SELECT * FROM customers); D. ALTER TABLE drop column;

C. CREATE TABLE newtable AS (SELECT * FROM customers);

Which object in the data dictionary enables you to verify DEFAULT column settings? A. DEFALUT_COLUMNS B. DEF_TAB_COLUMNS C. USER_TAB_COLUMNS D. None of the above

C. USER_TAB_COLUMNS

Which of the following statements is correct? A. A table can contain a maximum of only one column marked as unused. B. You can delete a table by removing all columns in the table. C. Using the SET UNUSED clause allows you to free up storage space used by a column. D. None of the above statements are correct.

C. Using the SET UNUSED clause allows you to free up storage space used by a column.

Which of the following commands is valid? A. RENAME customer# TO customernumber FROM customers; B. ALTER TABLE customers RENAME customer# TO customernum; C. DELETE TABLE customers; D. ALTER TABLE customers DROP UNUSED COLUMNS;

D. ALTER TABLE customers DROP UNUSED COLUMNS;

Which of the following is not a valid SQL statement? A. CREATE TABLE anothernewtable (newtable ID VARCHAR2(2)); B. CREATE TABLE anothernewtable (date, anotherdate) AS (SELECT orderdate, shipdate FROM orders); C. CREATE TABLE anothernewtable (firstdate, seconddate) AS (SELECT orderdate, shipdate FROM orders); D. All of the above are valid statements

D. All of the above are valid statements

Which of the following commands creates a new table containing two columns? A. CREATE TABLE newname (col1 DATE, col2 VARCHAR2); B. CREATE TABLE newname AS (SELECT title, retail, cost FROM books); C. CREATE TABLE newname (col1, col2); D. CREATE TABLE newname (col1 DATE DEFAULT SYSDATE, col2 VARCHAR2(1));

D. CREATE TABLE newname (col1 DATE DEFAULT SYSDATE, col2 VARCHAR2(1));

Which of the following commands creates a new table containing a virtual column? A. CREATE TABLE newtable AS (SELECT order#, title, quantity, retail FROM orders); B. CREATE TABLE newtable (price NUMBER(3), total NUMBER(8,2)); C. CREATE TABLE newtable (calc1 NUMBER(4), calc2 NUMBER(4); D. CREATE TABLE newtable (cola NUMBER(3), colb NUMBER(3), colc AS (cola+colb));

D. CREATE TABLE newtable (cola NUMBER(3), colb NUMBER(3), colc AS (cola+colb));

Which of the following is true? A. If you truncate a table, you can't add new data to the table B. If you change the default value of an existing column, all existing rows containing a NULL value in the same column are set to the new DEFAULT value C. If you delete a column from a table, you can't add a column to the table with the same name as the previously deleted column. D. If you add a column to an existing table, it's always added as the last column of the table.

D. If you add a column to an existing table, it's always added as the last column of the table.

Which of the following is a valid datatype? A. CHAR3 B. VARCHAR4(3) C. NUM D. NUMBER

D. NUMBER

The dafault width of a VARCHAR2 field is: A. 1 B. 30 C. 255 D. None- there's no default width for a VARCHAR2 field

D. None- there's no default width for a VARCHAR2 field


Conjuntos de estudio relacionados

Chapter 27: Growth and Development of the Preschooler - ML6

View Set

Intro to Theatre - Notes and quizes for the final exam Chapter 10-17

View Set

Unit 2 - Debt, Bonds, Money Market Instruments

View Set

Latin American History - Unit 3 Vocabulary (Ch. 4, 5, & 6)

View Set

History Alive - 7th Grade - Chapter 23: Maya Quiz

View Set