The "Create" Clause

The create clause in mSQL creates a table in your database. If don't yet have a database created please contact us and we'll get you set up.

To create a table you would do the following:

CREATE TABLE table_name (
	col_name	col_type	[not null
	[ , col_name	col_type	[not null
)



An Example:

CREATE TABLE emp_details(
first_name char(15) not null,
last_name char(15) not null,
dept char(20),
emp_id int primary key,
salary int
)


In this example we are creating a table named "emp_details" (Employee Details). We are defining the first and last names and giving them the type "char" (character) with a length of 15 and a "not null" attribute.

We are defining the "dept" (Department) as a 20 length character type.

Finally we are defining the "emp_id" (Employee ID) as an integer and assigning it as the primary key. We also define the "salary" field as an integer.

Having done this we are ready to insert some data into these fields.


mSQL copyright 1996 Hughes Technologies Pty Ltd.



 

OfficeOnWeb
261 Hines Road
Polk. PA 16342
Main Phone: 301-591-1745
FAX (call for number)
Toll free is available for clients only (call for number)
Copyright © 1993-2005 by Office on Web of Evergreen Colorado