A table is just like a container of data in the form of rows and columns. Tables are database objects that contain data in the database.
The rows run horizontally and represent each record. The columns run vertically and represent a specificĀ field. The rows and columns intersect, forming a grid. The intersection of the rows and columns definesĀ each cell in the table.
A standard user-defined table can have up to 1,024 columns. The number of rows in the table is limited only by the storage capacity of the server.
How to Create TABLE in SQL Server?
A table can be created in a database by using SQL Server Management Studio GUI(Graphical User Interface) or by using T-SQL.
CREATE TABLE Using T-SQL
CREATE TABLE is used to create the table, tblEmplyee is the name of the table, then we enclose all the fields/columns along with data type and constraints(optional) within round braces.
EmpID INT PRIMARY KEY is the first column, INT is the data type and PRIMARY KEY is the constraint,
EmpFirstName is the second column, NVARCHAR(20) is the data type and NOT NULL is the constraint
EmpLastName is the third column, NVARCHAR(20) is the data type and in this column constraint is NULL, which is default constraint
and so on…

CREATE TABLE Using SQL Server GUI(Graphical User Interface)
- Open SQL Server Management Studio and click on connect.

- Expand Databases, Expand HR database(for this demo) and right click on Tables go to New and click on Table.

- A table design will open with three columns (Column Name, Data Type and Allow Nulls), Where you fill it with required fields as shown in the image below.

- Now to make the EmpID as the Primary Key, right-click on the arrow button on the left side of EmpID column and select Set Primary Key.

- Now, to save the table, right-click on the dbo. Table_1 tab and click on Save Table_1.

- Change the table name, tblEmployee and click on OK button.

- Table name will be changed and saved, now you can see in the Object explorer in HR database under Tables.

Recommended Readings
- Advanced SQL Queries For Practice With Solution
- SQL Queries For Practice With Solution
- SQL Interview Questions and Answers
- STORED PROCEDURE in SQL Server
- How To Join Tables Data in SQL Server
- How to use Transaction in SQL Stored Procedure
- Difference Between IN and NOT IN Operators in SQL
- How To Modify Date in SQL Using DATEADD
- How To Get Year From Date in SQL Server
- How To Get Month From Date in SQL Server
- How To Get Day From Date in SQL Server
- How To Use ROW_NUMBER Function in SQL
- Date and Time Functions in SQL Server
- How To Find Nth Highest Salary in SQL Server
- How to Backup Table Using SELECT INTO Statement
- How To Use HAVING Clause in SQL Server
- Aggregate Functions in SQL Server
- How To Group Data Using Group By in SQL Server
- How To Truncate Table in SQL Server
- How To Delete Data From Table in SQL Server
- How To Update Table Data in SQL Server
- How To Sort Data Using Order By Clause in SQL
- How To Select Distinct Records in SQL Server
- How to Filter Data From Table in SQL Server
- Round Off Values Using Ceiling and Floor in SQL
- How To Find Square Root Of A Number in SQL Server
- How To Select Data From Table in SQL Server
- How To Insert Data in SQL Server Table
- How To Add NOT NULL Constraint in SQL Server
- How To Add Check Constraint on SQL Server Table
- How To Add Default Constraint on SQL Server Table
- Unique Key Constraint in SQL Server
- How to add Foreign Key Constraint in SQL Server
- How To Add Identity To SQL Server Table Column
- How to add Primary Key Constraint in SQL Server
- How To Create Alter and Drop Table in SQL Server
- How To Create Alter and Drop Database in SQL