Create Database in SQL:
What is SQL?
The language most commonly used to communicate with a database is called SQL, Structured Query Language, and pronounced: “ess-que-el” or “sequel”. It is the standard language adopted for all relational database management systems (RDBMS). It was developed in a prototype RDBMS, called “System R” developed by IBM in mid-1970. ANSI, i.e. the American National Standards Institute adopted SQL as a standard language for RDBMS in October 1986. The key features of SQL are-
- Non-procedural language.
- Unified language.
- A common language for all relational databases.
Key Capabilities of SQL:
- SQL can create and access a database.
- SQL can execute queries against a database.
- SQL can retrieve data from a database.
- SQL can insert new records into a database.
- SQL can delete records from a database.
- SQL can update records in an existing database.
- SQL is easy to learn.
- SQL works with database programs like Dbase IV, FoxPro, MS Access, DB2, MS SQL Server, Oracle, Sybase, etc.
- SQL is not case sensitive, i.e. both capital and small letters are recognized by it.
The standard SQL commands such as SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, etc. can be used to accomplish almost everything that one needs to do with a database.
How Does SQL Work?
SQL is oriented around relational databases. It eliminates a lot of unnecessary detailed work you would have to do if you were using a general-purpose programming language. Commands in SQL (called statements) can operate on the entire table as a single object and can treat any quantity of information extracted or derived from tables as a single unit.
Advantages of SQL:
- SQL is simple and easy to learn but still can answer complex problems and queries.
- Besides being a query language, it can also be used to create databases, delete and insert data in databases, and control access to the data in databases.
- All SQL operations are performed at a set level, i.e. one SELECT command can retrieve data from multiple rows, and one MODIFY command modifies multiple rows at a time. This feature makes SQL a very powerful language compared to other languages where one command can process only a single record at a time.
- Increased acceptance and availability of SQL enables the end users to use the various types of database management systems.
- It has a strong theoretical base and the expected results are well defined without any type of ambiguity.
- SQL provides a greater degree of abstraction freedom compared to any other procedural language.
How To Create Database in SQL:
To create Database in SQL, we need to install SQL Server and Microsoft SQL Server Management Studio.
|SQL Server Installation:|
Click Here to download the SQL Server setup. You can download any edition according to your need. I have selected a developer edition for this example.
Go to the folder where the SQL Server setup is saved.
Right-click on the SQL Server setup (SQL2019-SSEI-Dev) and select the option “Run as administrator” as shown in Fig.
Select an installation type for SQL Server according to your need. I have selected a Basic setup for this example.
Accept Microsoft SQL Server License Terms to install SQL Server.
After that click on the “Install” button to install the SQL Server as shown in Fig.
Now the system starts installing the SQL Server setup as shown in fig.
Now SQL Server Developer Edition is installed successfully as shown below.
|Microsoft SQL Server Management Studio Installation:|
Click Here to download the Microsoft SQL Server Management Studio setup.
Go to the folder where the Microsoft SQL Server Management Studio setup is saved.
Right-click on the Microsoft SQL Server Management Studio setup (SSMS-Setup-ENU) and select the option “Run as administrator” as shown in Fig.
After that new window is opened and click on the “Install” button to install the Microsoft SQL Server Management Studio as shown in Fig.
Now the system starts installing the Microsoft SQL Server Management Studio setup as shown in fig.
After finishing the above step, restart the system. A system restart is required to complete the Microsoft SQL Server Management Studio setup as shown in fig.
|Create Database in SQL:|
Select Microsoft SQL Server Management Studio as shown in Fig.
Now Microsoft SQL Server Management Studio is opened as shown below. If the server name is not automatically picked up then click on the “Browse for more” option.
Expand the Database Engine field and select the server to connect to and then click ok.
After the server name is added, click on connect button so that we can connect to SQL Server.
In the object explorer, Right-click on DATABASE and select the option “New Database”.
After that enter the database name. To create the database by accepting all default values and click OK.
New Database created i.e. “Test Database 001”.