100+ SQL Interview Questions and Answers For All Roles

Spread the love

SQL Stands for structure query language. It’s very important for handling databases. If you are looking for sql interview questions for testers,developers, experienced professionals. pdf, oracle, mysql, business analyst, etc. Here is the list 100+ SQL interview questions and answers to crack the interview easily.

What is DBMS ?

DBMS is stands for data base management system.  It is a software system used to create, store, and manage the databases.

What are popular database management systems or softwares or tools ?

Oracle, Mysql, Microsoft SQL server, Ms access, Postgresql, MongoDB, DB2 etc.

How many types of DBMS ?

We have four types of DBMS are there . Here is the list.
Relational Database Management Systems.
Hierarchical Database Management Systems.
Network Database Management Systems.
Object-oriented Database Management Systems.

What is RDBMS ?

RDBMS stands for Relational Database Management Systems. It is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd.

What is Data Warehouse ?

What is SQL ?

What is Table ?

What is Row  in Table ?

What is Column in Table ?

What is Primary Key ?

What is Foreign Key ?

What is Unique Key ?

How many types of sql commands are available ?

DDL – Data Definition Language

DML – Data Manipulation Language

DQL – Data Query Language

DCL – Data Control Language

TCL – Transaction Control Language

What are DDL Commands in SQL?

Create, Alter:, Drop, Truncate, Rename.

What are DML Commands in SQL?

Select, Insert, Update, Delete

What are DCL Commands in SQL?

Grante, Deny, Revoke

What are TCL Commands in SQL?

Commit, Rollback

What are different Clauses used in SQL?

Where, Having, Groupby, Using

What is Where clause in sql ? when we can use it ?

What is Having clause in sql ? when we can use it ?

What is Groupby clause in sql ? when we can use it ?

What is difference between having clause and groupby ?

What is Using clause in sql ? when we can use it ?

What is order by in sql ? when we can use it ?

What are transaction and its controls?

What is aggregate functions ? how many types of aggregate functions  are in sql ?

How many types of scalar functions available in sql ? What are those ?

What is difference between delete and truncate ?

What is difference between drop and truncate ?

What are sql constraints ?

Why do we use SQL constraints? When we will use them ?

What is Joins in SQL ?

How many Types of joins in SQL ?

  • Left Join
  • Right Join
  • Inner Join
  • Full Outer Join

What is difference between SQL, MySQL ?

What is difference between SQL, PLSQL ?

What is relationship ? How many types of relationships are available in sql ?

What is Normalization ?

How many types of Normalizations in SQL ?

What is Denormalization ?

What is View ?

What are advantages of views ?

What is Index ?

How many types of Indexes are available in SQL ?

What is the difference between clustered and non-clustered indexes?

What is Clustering ?

What is sub query ?

What are the types of subquery?

What is correlated or Synchronized Subquery ?

What is nested query ?

What is data integrity ?

What is autoincement in sql ? How can you do it ?

What is commit in sql ? When we will use it ?

What is check constraint ?

What is rollback in sql ? When we will use it ?

What are sql previliges ?

What is difference between global variables and local variables ?

What is query to perform search with empid or emp name ?

What is CTE ?

What is Collation?

What is Referential Integrity?

What is Case Function?

What are comments in sql ?

What is schema ?

How can you avoid duplicates in data ?

What is difference between rename and alias ?

What is difference between primary key and foreign key ?

What is difference between primary key and unique key ?

How many foreign keys can we have for one table ?

How many primary keys can we have for one table ?

What is transaction ?

What are properties of transaction ?

How can you sort a column data in sql ?

How can you rename a column in the output of SQL query?

What is trigger in sql ?

What is stored procedure in sql ?

What is identity in sql ?

What is the use of NVL function?

What is regular expression in sql ? How to use it ? When to use it ?

Difference Between Stored Procedure & Functions?

What is Temp Table? When we can use it ?

What is difference NULL , NOT NULL ?

Testing :

What is white box testing in dbms ?

What is black box testing in dbms ?

Optimization :

How can you optimize sql query ?

How can you calculate sql query execution time ?

Can you connect 2 sql servers to fetch data from 2 servers ?

Security :

What is sql injection ?

How can you avoid sql injection ?

How can you protect your database from hackers ?

SQL interview questions to write sql queries.

In realtime, Facetoface interview for freshers or experienced persons, some companies will directly ask to write query on paper. You need to perfect on writing

I am taking one example, The company has a 100 employees it’s running from last 5 years, Some people or experienced and some people freshers. The starting exp is 0 and maximum is 10. Employee salaries starts from 10,000 to 1,00,000

  1. Can you write query to create a employee table ?
  2. Can you write query to Insert values employee ?
  3. Can you insert a employee without his id ?
  4. Can you write a query to update values in database for single column?
  5. Can you write a query to display top 10 salaries of employees ?
  6. Can you write a query to display 3 most highest salary for this company ?
  7. Can you write a query to display to display freshers in company ?
  8. Can you write a query to display to retrieve highest experienced employee in company ?
  9. Can you write a query to display to retrieve old employee  employee in company ?
  10. Can you write a query to how many no of employees left in this company ?
  11. Can you write a query to how many no of employees left in this company ?
  12. Can you write a query to get employees iteration rate in this company ?
  13. Can you write a query to display freshers and above 5 years experience employees in company ?
  14. What is current burning rate for company with all employees salaries for monthly ?
  15. How many male employees in company ? what is avg salary for them ?
  16. How many female employees in company ? what is avg salary for them ?
  17. How many 5+ exp employees in company ? what is avg salary for them ?
  18. How many persons join to our company in the last month ?
  19. Who is the new employee in our company ?
  20. Which employee has highest exp in our company ?

Write the sql queries to comments, you will get confidence for your interview .

Author: admin

Leave a Reply

Your email address will not be published. Required fields are marked *