SQL Create Table




Create is used to define new tables.

Syntax :

The above syntax can be used for creating tables with the primary key. Here field1 is the column name, Type is the data type of the column-like int, char, varchar etc. and width specifies the maximum length of the column of the table.


The syntax for creating a table with a composite primary key.


The Employee_id column is of int type and will hold integers. Rest all are of type varchar and will hold characters. For Name maximum number of characters can be 25 whereas for Address maximum number of characters can be 50.

A creation of a  table using PHP script: 


Previous articleSQL Delete Statement
Next articleSQL Drop Table
Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.