MYSQL Data Type Flashcards

1
Q
  • a computer language for storing, manipulating and retrieving data stored in a relational database.
    -the standard language for Relational Database System. All the Relational Database Management Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as their standard database language.
A

SQL

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

SQL Stands for what?

A

Structured Query Language

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

-Designed for storing any kind of numeric data, kind of numeric data, such as prices, ages, or quantities.
-If the column is numeric and declared numeric and declared UNSIGNED, the range doubles for the given type.

A

Numeric Types

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

What are the two main kinds of numeric types?

A
  • Integer types (whole numbers, without any decimal places or fractional parts
    -Floating-point types.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Size : 1 byte
Range (Signed) : -128 to 127
Range (Unsigned) : 0-255

A

TINYINT

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

Size : 2 bytes
Range (Signed) : -32768 to 32767
Range (Unsigned) :0 to 65535

A

SMALLINT

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

Size : 3 bytes
Range (Signed) : -8388608 to 8388607
Range (Unsigned) :0-16777215

A

MEDIUMINT

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

Size : 4 bytes
Range (Signed) : -2147483648 to 2147483647
Range (Unsigned) :0-4294967295

A

INT

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

Size : 8 bytes
Range (Signed) : 922337203685477580 to 922337203685477580
Range (Unsigned) :0-1844674407370950000

A

BIGINT

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

Size : 4 bytes
Range (Signed) : Varies depending on values

A

FLOAT

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

Size : 8 bytes
Range (Signed) : Varies depending on values

A

DOUBLE

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

Size : The value of M + 2 byte
Range (Signed) : Varies depending on values

A

DECIMAL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  • The value of a newly inserted row into an _________________ column starts at 1 and increases by 1 for every record that is inserted into the table.
  • The column will be added by 1 to the current maximum value. It provides a counter that is useful for creating unique values.
A

AUTO_INCREMENT

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

True or False
As a rule, VARCHAR and CHAR types cannot be used in the same table. MySQL automatically changes the types to VARCHAR when you mix the two.

A

True

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

-It is a fixed length
-If you declare a _________ , all values stored in this column will be 10 bytes long, even if it is only 3 characters long.
-tables that contain these fixed values are processed faster that those that are made up of VARCHAR types

A

CHAR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  • It is a variable length
    -If you declare a _________ and store a value that is only 3 characters long, the total amount of storage space is 4 bytes (the length plus one).
A

VARCHAR

15
Q

-A variable length types that can store large amounts of data
-You would use these types when you want to store images, sounds, or large amounts of text, such as Web pages or documents.
- This type over other types is the ability to store vast amounts of data. You can store entire files with this type.
-the ability to store vast amounts of data. You can store entire files with this type. The disadvantage is that they are processed more slowly, and they take up large amounts of space

A

TEXT AND BLOB

15
Q

What is the type name of this?

Max Size: 255 bytes
Storage: X+1 bytes

A

VARCHAR(X)

16
Q

What is the type name of this?

Max Size: 255 bytes
Storage: X bytes

A

CHAR(X)

17
Q

TEXT DATA TYPE

What is the type name of this?

Max Size: 65535 bytes
Storage: X+2 bytes

A

TEXT

18
Q

TEXT DATA TYPE

What is the type name of this?

Max Size: 255 bytes
Storage: X+1 bytes

A

TINYTEXT

18
Q

TEXT DATA TYPE

What is the type name of this?

Max Size: 1.6MB
Storage: X+3 bytes

A

MEDIUMTEXT

19
Q

TEXT DATA TYPE

What is the type name of this?

Max Size: 4.2GB
Storage: X+4 bytes

A

LONGTEXT

19
Q

BLOB DATA TYPE

What is the type name of this?

Max Size: 255 bytes
Storage: X+2 bytes

A

TINYBLOB

20
Q

BLOB DATA TYPE

What is the type name of this?

Max Size: 65535 bytes
Storage: X+2 bytes

A

BLOB

21
Q

BLOB DATA TYPE

What is the type name of this?

Max Size: 1.6 MB
Storage: X+3 bytes

A

MEDIUMBLOB

22
Q

BLOB DATA TYPE

What is the type name of this?

Max Size: 4.2 MB
Storage: X+4 bytes

A

LONGBLOB