Test 3 Study Guide Flashcards
How many characters can a table name contain?
A table name can contain up to 30 characters, with no blank spaces.
What are the special characters that are allowed in a table name?
A table name can contain numbers, underscores, and number signs.
What are the four main datatypes? What makes each unique.
VARCHAR2- Characters, up to 4000 in length, with no default size, and can contain up to it’s set limit in characters.
CHAR - Up to 2000 characters, and when its size is set, if less characters are added to it, spaces are added to the right.
NUMBER - No limits (apparently), takes two values, the 2nd determining precision.
DATE - Duh.
What is the maximum number of columns that can be held in one table?
The maximum number of columns in a table is 1,000.
What command can be used to provide the structure of a table?
The DESCRIBE command is used to show the structure of a table.
What command allows for modifications of an existing table? What commands can be used with it?
ALTER TABLE allows for the modification of existing tables, and the commands ADD, MODIFY, and DROP COLUMN go along with it, after specifying the table name.
What command allows for the recovery of a dropped table?
The FLASHBACK command pulls a dropped table back from the recycle bin.
What command deletes a table instead of just sending it to the recycle bin?
The PURGE option for DROP TABLE will make sure it’s gone for good.
What command deletes all the rows from a table?
The TRUNCATE command deletes all the rows from a table.
What constraint is used to ensure that a value being added meets certain criteria?
The CHECK command ensures that data being added to a table meets specific criteria.
What is the constraint naming convention?
The constraint naming convention is “tablename_columnname_constrainttype”.
When are constraints created?
Constraints can be created at table creation, or after.
Why are some constraints made at the column level, and others are made at the table level?
Table level constraints are necessary when you need to base a restraint on multiple columns.
When are table-level restraints not able to be used?
Table-level restraints can be used on any restriction save NOT NULL.
What happens if a data value violates a constraint?
If a data value violates a constraint, the entire row is rejected.