SQL Interview Questions
1. What is SQL?
Structured Query Language is a database tool which is used to create
and access database to support software application.
2. What are different types of statements supported by SQL?
3. What is DBMS?
A Database Management System (DBMS) is a program that controls
creation, maintenance and use of a database.
,DBMS can be termed as File Manager that manages data in a database
rather than saving it in file systems.
4. What is RDBMS?
RDBMS stands for Relational Database Management System. RDBMS
store the data into the collection of tables, which is related by common
fields between the columns of the table. It also provides relational
operators to manipulate the data stored into the tables.
Example: SQL Server.
5. Why do we use SQL constraints? Which constraints we can use while
creating database in SQL?
Constraints are used to set the rules for all records in the table. If any
constraints get violated then it can abort the action that caused it.
Constraints are defined while creating the database itself with CREATE
TABLE statement or even after the table is created once with ALTER
TABLE statement.
There are 5 major constraints are used in SQL, such as
NOT NULL: That indicates that the column must have some value and
cannot be left null
UNIQUE: This constraint is used to ensure that each row and column
has unique value and no value is being repeated in any other row or
column
PRIMARY KEY: This constraint is used in association with NOT NULL
and UNIQUE constraints such as on one or the combination of more
than one column to identify the particular record with a unique identity.
FOREIGN KEY: It is used to ensure the referential integrity of data in the
table and also matches the value in one table with another using Primary
Key
CHECK: It is used to ensure whether the value in columns fulfills the
specified condition
6. What are different JOINS used in SQL?
,
,
1. What is SQL?
Structured Query Language is a database tool which is used to create
and access database to support software application.
2. What are different types of statements supported by SQL?
3. What is DBMS?
A Database Management System (DBMS) is a program that controls
creation, maintenance and use of a database.
,DBMS can be termed as File Manager that manages data in a database
rather than saving it in file systems.
4. What is RDBMS?
RDBMS stands for Relational Database Management System. RDBMS
store the data into the collection of tables, which is related by common
fields between the columns of the table. It also provides relational
operators to manipulate the data stored into the tables.
Example: SQL Server.
5. Why do we use SQL constraints? Which constraints we can use while
creating database in SQL?
Constraints are used to set the rules for all records in the table. If any
constraints get violated then it can abort the action that caused it.
Constraints are defined while creating the database itself with CREATE
TABLE statement or even after the table is created once with ALTER
TABLE statement.
There are 5 major constraints are used in SQL, such as
NOT NULL: That indicates that the column must have some value and
cannot be left null
UNIQUE: This constraint is used to ensure that each row and column
has unique value and no value is being repeated in any other row or
column
PRIMARY KEY: This constraint is used in association with NOT NULL
and UNIQUE constraints such as on one or the combination of more
than one column to identify the particular record with a unique identity.
FOREIGN KEY: It is used to ensure the referential integrity of data in the
table and also matches the value in one table with another using Primary
Key
CHECK: It is used to ensure whether the value in columns fulfills the
specified condition
6. What are different JOINS used in SQL?
,
,