Monday, October 22, 2012

SQL: Create Table

Creating a Table using SQL script is quiete easy. Below is the format using which you can create a Table:

CREATE TABLE table_name
(
column-name1 data-type,
column-name2 data-type,
column-name3 data-type,
column-name4 data-type,
column-name5 data-type,
)

Now lets create a sample table names Student using this format:

CREATE TABLE Student
(
ID int,
First Name varchar(50),
Last Name varchar(50),
Middle Name varchar(50),
Father Name varchar(50),
Address varchar(255),
DateOfBirth datetime
)

So its easier to create any table following this template.


No comments:

Post a Comment