Flashcards in Ch. 3 Deck (28):
________ _____ _______ are commands used to create or modify database tables.
data definition language (DDL)
A ________ is a defined, self-contained structure in Oracle 11g.
Database tables are also considered to be database _______.
What is the command that creates a new table in the database. The user names the columns and identifies the type of data to be stored?
What command creates a table from existing database tables, using the AS clause and subqueries?
CREATE TABLE . . . AS
What command adds a column to a table?
ALTER TABLE . . . ADD
What command changes a column size, datatype, or default value?
ALTER TABLE . . . MODIFY
What command deletes one column from a table?
ALTER TABLE . . . DROP COLUMN
What command marks a column for deletion at a later time?
ALTER TABLE . . . SET UNUSED
SET UNUSED COLUMN
What command completes the deletion of a column previously marked with SET UNUSED?
DROP UNSED COLUMNS
What command changes a table name?
RENAME . . . TO
What command deletes all table rows, but the table name and column structure remain?
What command removes an entire table from the Oracle 11g database?
What command permanently deletes a table in the recycle bin?
What command recovers a dropped table if PURGE option not used when table dropped?
FLASHBACK TABLE . . . TO BEFORE DROP
The names of ________ and _______ can be up to 30 characters and must begin with a letter. These limitations apply only to a ______ or _______ name, not to data in a column.
table and column
The names of tables and columns can't contain any ______ spaces.
Numbers, the underscore symbol (_), and the number sign (#) are allowed in _____ and ______ names.
table and column
Each table owned by a user should have a ______ table name, and the column names in each table should be _____.
What are Oracle 11g "reserved words", and can't be used for table or column names?
SELECT, DISTINCT, CHAR, and NUMBER
What is the description of VARCHAR2(n)?
Variable-length Character data, and the n represents the column's max length.
-Max is 4000 characters
-no default size for this datatype
-minimum value must be specified
-can contain letters, numbers or symbols
What is the description of CHAR(n)?
Fixed-length character column, the n represents the column's length.
-default size is 1
-max size is 2000
-can contain number, letters or symbols
-if fewer than (n) are entered, spaces are added to the right to force the data to reach a length of (n)
What is the description of NUMBER(p, s)?
Numeric column. The p indicates Precision, the total number of digits to the left and right of the decimal position, to a maximum of 38 digits.
- the s, or Scale, indicates the number of positions to the right of the decimal.
What is the description of DATE?
A ______ identifies the type of data Oracle 11g is expected to store in a column.
A ________ _______ generates a value automatically based on other column values in the table.
A ________ can be included to indicate who "owns" the table.