Derek Banas - Data Types Intro Flashcards

1
Q

Numeric Data Types

A
  1. TINYINT
  2. SMALLINT
  3. MEDIUMINT
  4. INT
  5. BIGIN
  6. BOOL
  7. FLOAT
  8. DECIMAL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Date and Time Data Types

A
  1. DATE
  2. DATETIME
  3. TIMESTAMP
  4. TIME
  5. YEAR
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

String Data Types

A
  1. VARCHAR
  2. BLOB
  3. MEDIUMBLOB
  4. LONGBLOB
  5. ENUM
  6. SET
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Limits of TINYINT

A

From: -127

To: 127

Storage: 1 byte

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

Limits of SMALLINT

A

From: -2^15 (-32,768)

To: 2^15 - 1 (32,767)

Storage: 2 bytes

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

Limits of MEDIUMINT

A

From: -2^23 (-8,388,608)

To: 2^23 - 1 (8,388,607)

Storage: 3 bytes

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

Limits of INT

A

From: -2^31 (-2,147,483,648)

To: 2^31 - 1 (2,147,483,647)

Storage: 4 bytes

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

Limits of BIGINT

A

From: -2^63 (-9,223,372,036,854,775,808)

To: 2^63 - 1 (9,223,372,036,854,775,807)

Storage: 8 bytes

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

Limits of BOOL

A

0 OR 1

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

Definition of FLOAT(size, d)

A

A floating point number (has a decimal point). The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter.

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

Definition of DECIMAL(size, d)

A

An exact fixed-point number. The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter. The maximum number for size is 65. The maximum number for d is 30. The default value for size is 10. The default value for d is 0.

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

Limit of TIME

A

Max 838:59:59.000000

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

Limit of YEAR

A

1901 - 2155

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

Definition of BLOB

A

For BLOBs (Binary Large OBjects). Holds up to 65,535 bytes of data.

Blobs are typically images, audio or other multimedia objects, though sometimes binary executable code is stored as a blob. Database support for blobs is not universal.

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

Definition of ENUM

A

A string object that can have only one value, chosen from a list of possible values. You can list up to 65535 values in an ENUM list. If a value is inserted that is not in the list, a blank value will be inserted. The values are sorted in the order you enter them

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

Definition of SET

A

A string object that can have 0 or more values, chosen from a list of possible values. You can list up to 64 values in a SET list

17
Q

Data Constraints

A
  1. NOT NULL
  2. DEFAULT
  3. UNSIGNED
  4. PRIMARY KEY
  5. AUTO_INCREMENT
18
Q

Definition of NOT NULL

A

Must have a value, can’t have a value of NULL

19
Q

Definition of DEFAULT

A

Designate a value when ever a row is created without data

20
Q

Definition of UNSIGNED

A

Can’t use negative values

21
Q

Defitintion of PRIMARY KEY

A

Identified as unique values assigned to a raw

22
Q

Definition of AUTO_INCREMENT

A

Each time a row of data is created you would mark anything that is set to auto increment to NULL, and the database would automatically increemnt that value. Can only use auto increment to one column per table– column must be primary or unique key.

23
Q

1 table should represent 1…

A

real world object

24
Q

Columns store

A

1 piece of information

25
Q

Normalizing databases means:

A

reducing redundant data

26
Q

Primary keys are……………, while foreign keys are………………….. .

A

Primary keys are unique identifiers, while foreign keys are primary keys in another talbe.

27
Q

Conditional Operator: Not Equal to

A

<>

OR
!=