Ch. 3 Flashcards

1
Q

________ _____ _______ are commands used to create or modify database tables.

A

data definition language (DDL)

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

A ________ is a defined, self-contained structure in Oracle 11g.

A

database object

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

Database tables are also considered to be database _______.

A

objects

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

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?

A

CREATE TABLE

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

What command creates a table from existing database tables, using the AS clause and subqueries?

A

CREATE TABLE . . . AS

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

What command adds a column to a table?

A

ALTER TABLE . . . ADD

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

What command changes a column size, datatype, or default value?

A

ALTER TABLE . . . MODIFY

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

What command deletes one column from a table?

A

ALTER TABLE . . . DROP COLUMN

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

What command marks a column for deletion at a later time?

A

ALTER TABLE . . . SET UNUSED
OR
SET UNUSED COLUMN

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

What command completes the deletion of a column previously marked with SET UNUSED?

A

DROP UNSED COLUMNS

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

What command changes a table name?

A

RENAME . . . TO

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

What command deletes all table rows, but the table name and column structure remain?

A

TRUNCATE TABLE

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

What command removes an entire table from the Oracle 11g database?

A

DROP TABLE

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

What command permanently deletes a table in the recycle bin?

A

PURGE TABLE

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

What command recovers a dropped table if PURGE option not used when table dropped?

A

FLASHBACK TABLE . . . TO BEFORE DROP

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

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.

A

table and column

17
Q

The names of tables and columns can’t contain any ______ spaces.

A

blank

18
Q

Numbers, the underscore symbol (_), and the number sign (#) are allowed in _____ and ______ names.

A

table and column

19
Q

Each table owned by a user should have a ______ table name, and the column names in each table should be _____.

A

unique

20
Q

What are Oracle 11g “reserved words”, and can’t be used for table or column names?

A

SELECT, DISTINCT, CHAR, and NUMBER

21
Q

What is the description of VARCHAR2(n)?

A

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
22
Q

What is the description of CHAR(n)?

A

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)
23
Q

What is the description of NUMBER(p, s)?

A

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.

24
Q

What is the description of DATE?

A

stores dates

25
Q

A ______ identifies the type of data Oracle 11g is expected to store in a column.

A

datatype

26
Q

A ________ _______ generates a value automatically based on other column values in the table.

A

Virtual Column

27
Q

A ________ can be included to indicate who “owns” the table.

A

Schema

28
Q

A _______ is a SELECT statement used in another SQL command.

A

Subquery