Docsity

SQL - Most Commonly Used Data Types, Lecture notes of Electronics

Toggle sidebar
bg1
Please see my previous notes: MySQL- Database Creation.
Commonly Used My SQL Data Types
1. CHAR or CHARACTER
2. INT or INTEGER
3. DEC or DECIMAL
4. BLOB
5. DATETIME
6. TIME STAMP
7. TIME
8. VARCHAR
9. DATE
Definition of MySQL Data Types
CHAR(size) 1.
Fixed Length (letters, numbers, special characters).
2. INT(size)
A medium integer. Maximum display is 255.
3. DEC(size, digits)
An exact fixed-point number. Maximum size is 65 and maximum
digits is 30. Size must be always greater than digits.
4. BLOB (size)
Binary Large Objects. Holds up to 65,355 bytes of data.
5. DATETIME
Date and Time combination. Format YYYY-MM-DD hh:mm:ss.
Supported range is from: '1000-01-01 00:00:00' to '9999-12-31
23:59:59'
6. TIMESTAMP
A timestamp. Format: YYYY-MM-DD hh:mm:ss.
Automatic initialization and updating to the current date and time can be
specified using DEFAULT CURRENT_TIMESTAMP and ON UPDATE
CURRENT_TIMESTAMP in the column definition.
Page 1
MySQL
Commonly Used Data Types
pf2

Partial preview of the text

Download SQL - Most Commonly Used Data Types and more Lecture notes Electronics in PDF only on Docsity!

Please see my previous notes: MySQL- Database Creation.

Commonly Used My SQL Data Types

  1. CHAR or CHARACTER
  2. INT or INTEGER
  3. DEC or DECIMAL
  4. BLOB
  5. DATETIME
  6. TIME STAMP
  7. TIME
  8. VARCHAR
  9. DATE

Definition of MySQL Data Types

  1. CHAR(size) Fixed Length (letters, numbers, special characters).
  2. INT(size) A medium integer. Maximum display is 255.
  3. DEC(size, digits) An exact fixed-point number. Maximum size is 65 and maximum digits is 30. Size must be always greater than digits.
  4. BLOB (size) Binary Large Objects. Holds up to 65,355 bytes of data.
  5. DATETIME Date and Time combination. Format YYYY-MM-DD hh:mm:ss. Supported range is from: '1000-01-01 00:00:00' to '9999-12- 23:59:59'
  6. TIMESTAMP A timestamp. Format: YYYY-MM-DD hh:mm:ss. Automatic initialization and updating to the current date and time can be specified using DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP in the column definition. Page 1

MySQL

Commonly Used Data Types

7. TIME

A time. Format: hh:mm:ss. The supported range is from '-838:59:59' to '838:59:59'

  1. VARCHAR(size) A VARIABLE length string (can contain letters, numbers, and special characters). The size parameter specifies the maximum column length in characters - can be from 0 to 65535
  2. DATE A date. Format: YYYY-MM-DD. The supported range is from '1000-01-01' to '9999-12-31' Page 2