SQL Server is Microsoft’s premier data platform. While its core is a relational database engine, it also includes many other subsystems and capabilities that go far beyond just a relational database. In this tutorial, I’ll explain how to create a database.
While not everyone realizes this at first, SQL Server provides business intelligence using Analysis Services, reports from Reporting Services, data integration using Integration Services, data validation with Master Data Services, business continuity using Azure and Availability Groups, and more. These are all of the features that businesses require from an enterprise data platform.
Databases are the primary containers for your relational database objects. SQL Server lets you create your own user databases, and some of the main relational database objects include tables, schema, indexes, views, logins, and roles. In addition, SQL Server provides a number of built-in system databases including the master, model, msdb and tempdb databases.
SQL Server databases and database objects like tables can be created in a variety of ways. SQL Server Management Studio’s (SSMS) Object Explorer has a menu option that enables you to create a table interactively.
However, the most basic way to create databases and other database objects is by executing Transact-SQL (T-SQL) commands. T-SQL commands are text-based, and they’re usually executed using either the SSMS Query Editor or Azure Data Studio.
Creating a SQL Server database using T-SQL command is pretty straightforward. You can do it by using the CREATE DATABASE command like the one below:
CREATE DATABASE myDatabase;
This T-SQL command created a database named myDatabase. As you might guess, you can specify the number of additional parameters.
In this article, I detailed the basics of using databases, which are core components of the SQL Server relational database engine. Now you have created your first table, check out this article on Petri for using the SQL CREATE TABLE statement to add a table to your database.