I'd recommend taking a look at
The Creating Tables section at SQLCourse.com.
And perhaps a simple example will help. The following SQL statement would work to create a new table named
student with three columns - idNo, fName, and lName - in a MySQL database.
create table student (
idNo varchar(11) not null,
fName varchar(32),
lName varchar(32)
);
This statement specifies that
idNo is a char field up to 11 characters big that is not allowed to be empty (not null).
fName and
lName are fields up to 32 characters each.
Available column types do differ between different database vendors. For example, Oracle has a column type called varchar2, while MySQL does not. So, a table creation statement for one database vendor might not work on another.
When figuring out table creation statements, it can be nice to have the documentation at hand. The documentation for the MySQL Column Types can be found at
http://www.mysql.com/doc/en/Column_types.html Figuring it out?
[ April 26, 2003: Message edited by: Dirk Schreckmann ]