Chapter 4 - Slides Flashcards

(50 cards)

1
Q

What are the naming conventions of a table and column name?

A
  1. Must begin with a letter
  2. Upto 30 characters long
  3. Alphanumeric, and can use $/_/#
  4. Spaces and Hyphens cannot be used
  5. Must be unique
  6. Cannot be an Oracle server-reserved word.
  7. Case insensitive.
  8. Should be short and meaningful
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False? Data types help to optimize storage space.

A

True

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

The ____ type is a character data type to store variablelength alphanumeric data in a column.

A

VARCHAR2

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

What is the maximum allowable size for a VARCHAR2 type?

A

4000 Characters

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

_____ is the most appropriate type for a column whose

values do not have a fixed length

A

VARCHAR2

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

True or False? If a VARCHAR2 value is longer than the specified size is entered, the longer values are truncated.

A

False, an error is generated

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

True or False? The CHAR data type uses the storage more efficiently and processes data faster than the VARCHAR2 type.

A

True

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

The maximum allowable size for a CHAR type character is:

A

2000 characters

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

True or False? If a Char value longer than the specified size is entered, however, an
error is generated. The longer values are not truncated.

A

True

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

When a number type is used for a column, its
precision and scale can be specified optionally, using
the general syntax:

A

fieldname NUMBER [([precision,][scale])]

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

The precision value includes:.

A

only the digits, and does
not include formatting characters, such as the
currency symbol, commas, or the decimal point

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

_____ is the total number of significant digits in the number, both to the left and to the right of the decimal
point. It n can range from 1 to 38.

A

Precision

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

a _____ requires 1 to 22 bytes.

A

NUMBER

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

What are the three Number data subtypes:

A

Integer
Fixed-Point
Floating Point

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

The scale value for number can range from __ to __.

A

-84 to 127

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

A FLOAT value is represented internally as NUMBER. The precision p can range from _ to _ binary digits.

A

1 to 126

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

A FLOAT value requires

from _ to __ bytes

A

1 to 22

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

The DATE data type is used for storing date and time

values. The range of allowable dates is between

A

January 1, 4712 B.C. and December 31, 9999 A.D.

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

True or False? There is no need to specify size for the DATE type.

A

True

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

The default date format is

A

DD-MON-YY HH:MM:SS A.M.

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

The ___ type is used for variable-length character

data up to 2 gigabytes.

22
Q

The ___ type is similar to CHAR but uses 2-byte

binary encoding for each character

23
Q

True or False? The CHAR type is useful for character sets such as
the Japanese Kanji, which has thousands of different
characters

A

False, it is NCHAR

24
Q

____ is used to store binary data up to 4 gigabytes.

A

BLOB (Binary Large Object) date type

25
____ is used to store singlebyte character data up to 4 gigabytes.
CLOB (Character Large Object) data type
26
___ uses 2-byte character codes.
NCLOB (character large object) data type
27
____ references to a binary file that is external to the database and is maintained by the operating system’s file system.
BFILE (Binary File type)
28
___ or ____ are used for raw binary data of length size bytes.
RAW or LONG_RAW
29
___, use when you are using an unique row address of a row.
ROWID
30
____ enforce rules on tables
Constraints
31
There are two types of constraints:
Integrity and Value Constraints
32
What is an integrity constraint?
define both the primary | key and the foreign key with the table and primary key it references
33
What is a value constraint?
define if NULL values are | disallowed, if UNIQUE values are required, and if only certain set of values are allowed in a column
34
The general convention used for naming constraints is
__ | ie. dept_deptno_pk
35
If you do not name a constraint, the Oracle server will ______
generate a name for it by using SYS_Cn format, where | n is any unique number
36
_____ references a single column and is defined along with the definition of the column.
A Column-level Constraint
37
_____ references one or more columns and is defined separately from the definitions of the columns.
A Table-level Contraint
38
What is the general syntax of a Column level Constraint?
column datatype [CONSTRAINT constraint_name] constraint_type
39
What is the general syntax of a Table level Constraint?
[CONSTRAINT constraint_name] constraint_type (Column, . . .)
40
CONSTRAINT dept_deptid_pk PRIMARY KEY(DeptId) is an example of?
Primary Key Constraint
41
The _____ constraint is also known as the referential integrity constraint.
FOREIGN KEY
42
The ______ constraint ensures that the column has a value and the value is not a null (unknown or blank) value
NOT NULL
43
The _____ constraint requires that every value in a | column or set of columns be unique.
UNIQUE
44
The ____ constraint defines a condition that every | row must satisfy.
CHECK
45
True or False? The A NOT NULL constraint can be declared as a CHECK constraint.
True
46
A CREATE TABLE statement may have an optional | ______ clause
STORAGE
47
The ____ clause is used to allocate initial diskspace for the table at the time of creation with INITIAL parameter, and also to allocate additional space with NEXT parameter in case the table runs out of allocated initial space.
STORAGE
48
To display all columns, type the following statement:
SELECT * FROM USER_TABLES;
49
You can get information about STORAGE clauses' | attributes by:
using data dictionary view
50
slide 37
slide 37