Test 3 Study Guide Flashcards

1
Q

How many characters can a table name contain?

A

A table name can contain up to 30 characters, with no blank spaces.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the special characters that are allowed in a table name?

A

A table name can contain numbers, underscores, and number signs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the four main datatypes? What makes each unique.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the maximum number of columns that can be held in one table?

A

The maximum number of columns in a table is 1,000.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What command can be used to provide the structure of a table?

A

The DESCRIBE command is used to show the structure of a table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What command allows for modifications of an existing table? What commands can be used with it?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What command allows for the recovery of a dropped table?

A

The FLASHBACK command pulls a dropped table back from the recycle bin.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What command deletes a table instead of just sending it to the recycle bin?

A

The PURGE option for DROP TABLE will make sure it’s gone for good.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What command deletes all the rows from a table?

A

The TRUNCATE command deletes all the rows from a table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What constraint is used to ensure that a value being added meets certain criteria?

A

The CHECK command ensures that data being added to a table meets specific criteria.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the constraint naming convention?

A

The constraint naming convention is “tablename_columnname_constrainttype”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When are constraints created?

A

Constraints can be created at table creation, or after.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why are some constraints made at the column level, and others are made at the table level?

A

Table level constraints are necessary when you need to base a restraint on multiple columns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When are table-level restraints not able to be used?

A

Table-level restraints can be used on any restriction save NOT NULL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What happens if a data value violates a constraint?

A

If a data value violates a constraint, the entire row is rejected.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When is ADD used, compared to MODIFY?

A

NOT NULL can only be added as a constraint by MODIFY, otherwise, ADD is appropriate. As with all constraints being added to an existing table, ALTER TABLE is the command used.

17
Q

Where are the two places constraints can be included in the CREATE TABLE command?

A

Constraints can be added in either with the column definition with each column being followed by CONSTRAINT, the constraint name, and the specific constraint, or as a group after the column declarations.