Process to Create Table in SQL
For Creating a New Table: For creating a new table in the SQL Server, you need to follow the following process:
- Type the command i.e. enter the keyword “create table”
- Type the table name
- Insert open parenthesis
- Type first column name
- Enter the data type for that column
- Enter any optional constraints
- Insert closing parenthesis
For example:
Below given is an example that will tell you how to create a new table in SQL:
create table tablename
(column1name datatype [constraint],
column2name datatype [constraint],
column3name datatype [constraint]);
Points to Remember: It is important to remember the following points while performing the process of creating a table in SQL:
- Use open parenthesis before starting the table
- Use a closing parenthesis at the end of the last column definition of the table
- Separate each column definition using a comma
- SQL statements must end with “;”
Make sure that table name and column names start with a letter. They can be followed by letters, numbers, or underscores (limit is 30 characters in length). Always remember that you should not use any SQL reserved keywords as table names or column names (like you must not use keywords like select, create, insert, etc).
Most Common Data types: Following are the most common data types using in SQL:
- char(size): It is the fixed length of the string of characters of the set size. The string size is limited to 255 characters
- date
- number(maxsize): It is the number with a maximum digits specified by “maxsize”
- number(maxdigits, maxright): It is a decimal number with minimum “maxdigits” and with maximum digits to the right of the decimal, “maxright”
- varchar(maxsize): It is a character string with variable length limited to
“maxsize”
Constraints: Constraints are basically the rules for the column. Below mentioned are the possible values:
- Not null: This means that the column values must have some value and they cannot be null
- Primary key: This means that each record is distinctively identified by this column
- Unique key: This means that two values may not be same in the column
SysTools SQL Recovery Software
You are creating a table in SQL Server? And your table get deleted or damaged due to some common issues for database corruption, Then do not get worry at all you can try SysTools SQL Recovery Software to get back your damaged and deleted tables from corrupt SQL Database.




