CIS 219 (Oracle PL/SQL) Chapter 3
Which of the following is a valid SQL statement?
CREATE TABLE newname (colA NUMBER, colB DATE);
Which of the following SQL statements was most likely used to create the PROMOTION table?
CREATE TABLE promotion (gift VARCHAR2(15), minretail NUMBER(5, 2), maxretail NUMBER(5, 2)):
Which command instructs Oracle 12c to create a new table from existing data?
CREATE TABLE..AS
Which of the following keywords uses a subquery to create a new table using existing database tables?
CREATE TABLE..AS
A column name can consist of up to 225 characters.
False
A table name can consist of numbers, letters, and blank spaces.
False
If the CREATE TABLE is being used to create a table from existing data, the SUBQUERY keyword must be used.
False
Only one column can be added to an existing table at one time.
False
The ALPHANUMERIC datatype can be used to store characters and numbers to a maximum width of 2000.
False
The ALTER TABLE name can be used to rename a table.
False
The CHAR datatype is used to store variable-length data that can consist of letters and numbers.
False
The DELETE TABLE command can be used to delete all the data stored in a table and release the storage space, yet retain the structure of the table.
False
The DELETE TABLE command can be used to remove a table from a database.
False
The RENAME command can be used to assign a table to a new schema.
False
The default size of a VARCHAR2 column is one character.
False
The default size of the CHAR column is 2.
False
The width of a NUMBER column cannot be changed once it contains data.
False
You cannot specify the width for a(n) NUMBER column.
False
Once a column has been set as UNUSED, which of the following is correct?
It is unavailable and will not be displayed in the table structure.
Which of the following is a valid table name?
MYTABLE
Which of the following is a valid column name?
NEW_COLUMN
Which of the following queries will allow hidden columns to be displayed?
SELECT which specifically references the hidden column.
Which of the following is a valid table name in Oracle 12c?
S_3#
To delete all the rows in a table and free up the storage space that was occupied by those rows, the __________ command should be used.
TRUNCATE TABLE
If a column is defined as NUMBER(5,2), which of the following is true?
The column can store a total of 5 digits, with 3 on the left side of the decimal point, and 2 on the right.
A table that has been dropped without the PURGE option can be retrieved using the FLASHBACK TABLE command.
True
DDL commands are used to create or modify database objects.
True
Every table name within a specific schema must be unique.
True
Once a column as been set as UNUSED, it cannot be recovered.
True
SELECT9 is a valid table name.
True
Seven bytes are allocated in a DATE column to store the century, year, month, day, hour, minute, and second of a date.
True
The DROP COLUMN clause of the ALTER TABLE command can only be used to delete one column at a time.
True
The USER_TAB_COLS data dictionary object contains a column to identify hidden columns.
True
The default format of a DATE column in Oracle 12c is DD-MON-YY.
True
The precision of a NUMBER does not include the decimal point itself in the total number of digits that can be stored in a column.
True
When a column is deleted, the deletion is permanent.
True
Which of the following datatypes refers to variable-length character data, where n represents the maximum length of the column?
VARCHAR2(n)
A __________ column generates values automatically at runtime and may reference values from other columns.
Virtual
Which of the following is displayed by the DESCRIBE command?
column names & not null requirements & datatypes
If a new table is being created based upon a subquery, the subquery must be enclosed in which of the following symbols?
( )
When defining columns for a table in the CREATE TABLE command, the column list must be enclosed in which of the following symbols?
( )
The maximum width of the NUMBER datatype is _________ digits.
38
The column definition of NUMBER(7, 4) indicates a precision of __________.
7
Which of the following commands will increase the size of the CITY column in the CUSTOMERS table from 12 to 20 and increase size of the LASTNAME column from 10 to 14?
ALTER TABLE customers MODIFY (city VARCHAR2(20), lastname VARCHAR2(14));
If the MAXRETAIL column of the PROMOTION table has been set as unused, which of the following commands is valid?
ALTER TABLE promotion DROP UNUSED COLUMNS;
Which of the following commands will set the MINRETAIL column of the PROMOTION table as unused?
ALTER TABLE promotion SET UNUSED (minretail); & ALTER TABLE promotion SET UNUSED COLUMN minretail;
Which of the following commands will drop any columns marked as unused from the TABLEA table?
ALTER TABLE tablea DROP UNUSED COLUMNS;
Which of the following keywords cannot be used to modify an existing table?
ALTER TABLE...AS
Which of the following SQL*Plus commands will display the structure of a table?
DESC
Which of the following commands will display the structure of the CUSTOMERS table?
DESC customers & DESCRIBE customers