How to create a database table with Mini SQL (mSQL)
by Developer's Daily
 

Creating a database table with Mini SQL (mSQL) is very simple. All you have to do is use the msql command.

Let's assume that you want to create a new database table named Customer in the database named contact_mgr.  At the Unix command line, type:

msql contact_mgr


In the msql utility, create the table in mSQL with the usual SQL syntax.  Then type \g (mSQL's go command), and then type \q when you're ready to quit.  The sequence of commands in the msql utility looks like this:

create table Customer
(cnum    integer,
first_name    char(20),
last_name    char(20) )

\g

\q


At this point you'll be returned to the Unix command line.

This command created a database table named Customer in the database named contact_mgr.  The Customer table contains three fields named cnum, first_name, and last_name.
 
 

Other locations on the Developer's Daily web site

We invite you to visit other free educational resources on our web site: