How to use MySQL 5.0. Part 1: Start and Create |
||||||||||||
This article and tutorial describes and demonstrates how you can:
-
[ click here ] Start the MySQL Command Line Client
-
[ click here ] Create and use a new Database in MySQL
-
[ click here ] Create and a new MySQL 5.0 table
-
[ click here ] List available tables in a MySQL 5.0 database
-
[ click here ] Display information about tables in a MySQL 5.0 database
-
[ click here ] Create a windows application to read MySQL.
Start MySQL Client
| Steps To Start the MySQL Command Line Client | Visual Demonstration |
|---|---|
|
[ return to top ]
How do I create a new Database in MySQL 5.0?
Create and start using the Database
| Steps to Create and use a new MySQL Database | Visual Demonstration |
|---|---|
|
Syntax:
CREATE DATABASE IF NOT EXISTS db_name
[ return to top ]
How do I create a new Table in MySQL 5.0?
Create a new table
| Steps to Create a new table in MySQL | Visual Demonstration |
|---|---|
|
Syntax:
CREATE TABLE IF NOT EXISTS tbl_name ( column definitions,..., primary key(idcolumn)) ;
where ( column definitions,..., primary key(idcolumn)) describes a list of columns and the primary key
| Type | Description | Example |
|---|---|---|
| AUTO_INCREMENT | Automatically increments when new records added, use only with numeric types like INT | id int auto_increment |
| INT | Numeric Integer data type | customer_no int |
| DOUBLE | Numeric double precision floating point data type, includes total number of numbers and number of numbers to the right of the decimal point. The example represents 7.2 or seven numbers to the left and two numbers to the right of the decimal .. for a total of nine numbers. | dollars_spent double(9,2) |
| VARCHAR | Text data type, includes length of text in parens. This is a variable length string that can be up to 65,535 in length! | customer_note varchar(64000) |
[ return to top ]
Retrieve a list of tables in the current Database
Show Tables
| Steps to List Tables in MySQL | Visual Demonstration |
|---|---|
|
Syntax:
SHOW TABLES
[ return to top ]
Display information about a MySQL table
Describe Table
| Steps to List Tables in MySQL | Visual Demonstration |
|---|---|
|
Syntax:
DESCRIBE tbl_name
[ return to top ]


















