MySQL Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 4.00

Table Column Types for Different Types of Values

This chapter provides tutorial notes on table column types. Topics include column types for character strings, bit strings, exact numbers, approximate numbers, data and time values.

Table Column Types for Character Strings

Table Column Types for Bit Strings

Table Column Types for Exact Numbers

Table Column Types for Approximate Numbers

Table Column Types for Date and Time Values

Conclusion:

  • 4 types of table columns to store character strings: CHAR, VARCHAR, NCHAR and NCHAR VARYING.
  • 2 types of table columns to store bit strings: BIT and BIT VARYING.
  • 4 types of table columns to store exact numbers: NUMERIC, DECIMAL, INTEGER and SMALLINT.
  • 3 types of table columns to store approximate numbers: FLOAT, REAL and DOUBLE PRECISION.
  • 6 types of table columns to store date and time values: TIME, DATE, TIMESTAMP, TIME WITH TIME ZONE, TIMESTAMP WITH TIME ZONE, and INTERVAL.

All notes and examples in chapter are based on SQL-92 and MySQL server.

Table of Contents

 About This Book

 Introduction of SQL

 MySQL 4.0 Introduction and Installation

 Installing MySQL 5.0.2 (Alpha)

 Introduction of MySQL 5.0 Programs

 Perl Programs and MySQL Servers

 PHP Programs and MySQL Servers

 Java Programs and MySQL Servers

 Datatypes and Data Literals

 Operations and Expressions

 Character Strings and Bit Strings

 Commonly Used Functions

Table Column Types for Different Types of Values

 Using DDL to Create Tables and Indexes

 Using DML to Insert, Update and Delete Records

 Using SELECT to Query Database

 Transaction Management and Isolation Levels

 Locks-Used-in-MySQL

 Defining and Calling Stored Procedures

 Variables, Loops and Cursors Used in Stored Procedures

 References

 Printable Copy - PDF Version

Dr. Herong Yang, updated in 2009
Table Column Types for Different Types of Values