What is Database

Database is the collection of data which is stored in an organized way.

What is RDBMS

RDBMS stands for Relational Database Management System. It is the collection of tables which is related to each other

What is SQL

SQL stands for Structured Query Language. This language is used to interact with Relational Database Management System.

SQL Commands are case sensitive or not

No, sql commands are not case sensitive.

What does Null Represent

Null Represents undefined value

What is distinct

Distinct is used to supress duplicate row in select query

How to sort data in sql

We use order by clause to sort data either in ascending or descending order

What is the default order of sorting in sql

Ascending is the default order

What is Data Integrity

Data integrity ensures that the data which is going to enter in the database is reliable, accurate and consistent. Data integrity maintains the correctness and completeness of data.

What is Constraints

Constraints are the rules which we applied on the table’s column to ensure the data integrity.

What is the use of check constraints

When we want to make a particular column to be restricted for particular data in that case we use check constraints

For example

We want to restrict gender column to take value only either ‘M’ or ‘F’ then we use check constraints in the following manner

create table t7(id int, gender char (1) check (gender in ('M','F'))); 

Take another example in which we have a column age in which we want to add age above 36 then we use check constraints.

create table t8(id int, age int check(age>36)); 

How to create auto increment column in sql server

We use identity in sql server to create auto increment column.

create table emp(id int primary key identity(1,1), name varchar(100), salary int)

What is Stored Procedure

The stored procedure is a set of SQL Statements. It is precompiled object. Stored procedure increases the performance of the database as they are precompiled.

What is trigger

Triggers can be defined as an area of code Which executes in response of a particular action like insert, update, delete, Create, drop etc. Triggers executes automatically.

What is the type of triggers

We have two types of triggers

a) DDL Triggers b) DML Trigger

DML Triggers further categorized in following two category