MySQL tutorials

Create a MySQL table with a primary key

contributed by qmchenry on February 8, 2004 under MySQL

A primary key uniquely identify a row in a table. One or more columns may be identified as the primary key. The values in a single column used as the primary key must be unique (like a person’s social security number). When more than one column is used, the combination of column values must be unique.

 

Create a basic MySQL table

contributed by qmchenry on under MySQL

Creating tables in databases is an important first step to storing data. The CREATE TABLE statement is rich and sometimes confusing. This recipe describes the basics of creating a table in MySQL.

 

Drop or delete a table in MySQL

contributed by qmchenry on December 14, 2003 under MySQL

To remove a table from a MySQL database, and remove all of its data, use the following SQL command.

 

Describe the column structure of a MySQL table

contributed by qmchenry on under MySQL

The SQL command ‘describe’ allows you to view the column structure of a MySQL table. It provides a listing of the columns of a table, the type of each column, and additional information on each column.

 

Select a MySQL database to use

contributed by qmchenry on under MySQL

A single instance of MySQL can hold many separate databases. It is important to specify the database to which subsequent commands will be issued.

 

Display a list of databases on a MySQL server

contributed by qmchenry on under MySQL

Use the ’show databases’ command to display the list of dbs on the server.

 

Create a MySQL database

contributed by qmchenry on under MySQL

SQL command used to create to create a db.

 

Determine the version of MySQL server

contributed by qmchenry on under MySQL

How do I tell what version of MySQL server that I am running?