Ch. 3 Flashcards Preview

Oracle 11g SQL > Ch. 3 > Flashcards

Flashcards in Ch. 3 Deck (28):
1

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

data definition language (DDL)

2

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

database object

3

Database tables are also considered to be database _______.

objects

4

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?

CREATE TABLE

5

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

CREATE TABLE . . . AS

6

What command adds a column to a table?

ALTER TABLE . . . ADD

7

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

ALTER TABLE . . . MODIFY

8

What command deletes one column from a table?

ALTER TABLE . . . DROP COLUMN

9

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

ALTER TABLE . . . SET UNUSED
OR
SET UNUSED COLUMN

10

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

DROP UNSED COLUMNS

11

What command changes a table name?

RENAME . . . TO

12

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

TRUNCATE TABLE

13

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

DROP TABLE

14

What command permanently deletes a table in the recycle bin?

PURGE TABLE

15

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

FLASHBACK TABLE . . . TO BEFORE DROP

16

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

17

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

blank

18

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

table and column

19

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

unique

20

What are Oracle 11g "reserved words", and can't be used for table or column names?

SELECT, DISTINCT, CHAR, and NUMBER

21

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

22

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)

23

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.

24

What is the description of DATE?

stores dates

25

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

datatype

26

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

Virtual Column

27

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

Schema

28

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

Subquery