Creating Tables Flashcards
1
Q
- fixed-length character column
- maximum length is 255
- default length is 1 character
A
CHAR
2
Q
- variable-length character data
- maximum length is 65,535
- no default size
A
VARCHAR
3
Q
used for floating/real numbers
A
DECIMAL
4
Q
is the total no. of digits to the left & right of the decimal point
A
p (precision)
5
Q
is the no. of positions to the right
of the decimal point
A
s (scale)
6
Q
stores integer values (whole numbers)
A
INT
7
Q
- stores date and time
- default format is YYYY-MM-DD
A
DATE
8
Q
Rules used to enforce business rules,
practices, and policies – and to ensure
the accuracy and integrity of data.
A
Constraints
9
Q
- determines which column(s)
uniquely identifies each row - can’t be NULL and values must
be unique
A
PRIMARY KEY
10
Q
ensures that if a value is
entered into a specified column of the
child table, it must already exist in
the parent table
A
FOREIGN KEY
11
Q
- ensures that all data values stored
in a specified column are unique - allows NULL values
A
UNIQUE
12
Q
- ensures that a specified condition
is true before the data value is added to a table
A
CHECK
13
Q
used to set a default value for a
specified column
A
DEFAULT
14
Q
ensures that a specified column
cannot contain a NULL value
A
NOT NULL