What is Database

Consider the database as a container which contains several type of objects such as tables, views and many more. These objects helps database to store data in an organised fashion.

There are two types of databases available.

  • System Databases: These databases are used by SQL Server itself to perform its functionality such as logging transactions.
  • User Databases: These are created by users (us). Users can store and organize data using various type of objects.

What is T-SQL?

T-SQL is a language that is used to manipulate and query data from SQL Server databases. We can think of T-SQL as super set of SQL(Structured Query Language). It contains a lot of helpful features to implement logic in database development. It holds two types of statements called DDL (Data Definition Language) and DML (Data manipulation Language).

Let’s create database using T-SQL. As we are going to create database so this syntax will be part of DDL(Data Definition Language).

CREATE DATABASE DatabaseName;

database name should be a meaningful name such as AddressBook

This statement will create database and two files namely .mdf and .ldf files for data storage and log storage respectively.