Introduction
There are a number of articles available on databases. I have tried writing this article for beginners explaining how to create a database and tables in the Microsoft SQL Server (MSSQL) step by step and in simple language.
Database and DBMS
A database is an organized collection of data. It is the collection of schemas, tables, queries, reports, views and other objects.
As stated by wiki, A database management system (DBMS) is a computer software application that interacts with the user, other applications, and the database itself to capture and analyze data. A general-purpose DBMS is designed to allow the definition, creation, querying, update, and administration of databases. Well-known DBMSs include MySQL, PostgreSQL, Microsoft SQL Server, Oracle, Sybase, SAP HANA, and IBM DB2.
Now, we are going to use Microsoft SQL Server 2008 (MSSQL) for the backend; i.e., database.
Open the MSSQL 2008,
After clicking on the connect button the next window will appear.
Now, we will see steps to create the database in the MSSQL.
Next dialogue box will open.
After clicking on the ‘Ok’ button the database will generate.
There are two methods to create the table.
- Using the SQL query
- Database Designer
First we will see the steps to create the table using the SQL Query,
Method 1
After clicking on the ‘New Query’ option the following window will open so we can write the query there. Now we will see steps to create the table.
We will see how to create the table.
The following window will show the created table.
Now, we will see the steps to create the table using the database designer; i.e., Method 2.
Method 2
After selecting the ‘New table’ option the following window will open.
Further steps are shown in the following window,
Then table will display as follows,