1. Home
  2. Computing & Technology
  3. PHP / MySQL

MySQL Tutorial: Create SQL Tables

By Angela Bradley, About.com

3 of 4

SQL Query Window in phpMyAdmin

Perhaps a quicker way to add a table is by clicking on the small "SQL" button on the left hand side below the phpMyAdmin logo. This will bring up a query window where we can type our commands. You should run this command:

CREATE TABLE people (name VARCHAR(30), age INTEGER, height FLOAT, date DATETIME)

As you can see, the command "CREATE TABLE" does exactly that, creates a table which we have called "people". Then inside the ( brackets ) we tell it what columns to make. The first is called "name" and is VARCAR, the 30 indicates we are allowing up to 30 characters. The second, "age" is an INTEGER, the third "height" is a FLOAT and the forth "date" is DATETIME.

Regardless of which method you chose, if you would like to see a breakdown of what you just did click on the "people" link that now appears on the left hand side of your screen. On the right you should now see the fields you added, their data types, and other information.

Index: MySQL Tutorial: Create SQL Tables

  1. Create Tables in phpMyAdmin
  2. Adding Rows and Columns
  3. SQL Query Window in phpMyAdmin
  4. Using Command Lines

3 of 4

Explore PHP / MySQL

More from About.com

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Learn MySQL
  5. SQL Query Window - phpMyAdmin tutorial - SQL commands phpMyAdmin

©2008 About.com, a part of The New York Times Company.

All rights reserved.