MYSQL Data Type Flashcards
- 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.
SQL
SQL Stands for what?
Structured Query Language
-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.
Numeric Types
What are the two main kinds of numeric types?
- Integer types (whole numbers, without any decimal places or fractional parts
-Floating-point types.
Size : 1 byte
Range (Signed) : -128 to 127
Range (Unsigned) : 0-255
TINYINT
Size : 2 bytes
Range (Signed) : -32768 to 32767
Range (Unsigned) :0 to 65535
SMALLINT
Size : 3 bytes
Range (Signed) : -8388608 to 8388607
Range (Unsigned) :0-16777215
MEDIUMINT
Size : 4 bytes
Range (Signed) : -2147483648 to 2147483647
Range (Unsigned) :0-4294967295
INT
Size : 8 bytes
Range (Signed) : 922337203685477580 to 922337203685477580
Range (Unsigned) :0-1844674407370950000
BIGINT
Size : 4 bytes
Range (Signed) : Varies depending on values
FLOAT
Size : 8 bytes
Range (Signed) : Varies depending on values
DOUBLE
Size : The value of M + 2 byte
Range (Signed) : Varies depending on values
DECIMAL
- 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.
AUTO_INCREMENT
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.
True
-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
CHAR