SQL Interview Questions
SQL Interview Questions
SQL
Interview with These
Curated by
Q.1 What are the different types of SQL commands?
SQL Commands
Curated by
Q.2 What are the primary SQL data types?
Curated by
Q.4 What are the different types of joins in SQL?
LEFT JOIN: Returns all rows from the left table and
matching rows from the right.
RIGHT JOIN: Returns all rows from the right table and
matching rows from the left.
From o
T
From Tier III college to
Curated by
Q.5 Explain the difference between INNER JOIN and
OUTER JOIN.
A B A B
Curated by
Q.6 Define primary key and foreign key in sql?
Primary Key:
Foreign Key:
Curated by
Q.7 What is the difference between a subquery and a
JOIN?
Curated by
Q.10 What is a subquery, and how is it different from a
JOIN?
Curated by
Q.11 Defining SQL order of execution.
MT O
LI I / T
FFSE T
or FE R T,
CH/FI S Computed Columns ,
W indow Functions ,R ,A ,A
ow limits liases ggregate
Functions , UN ON NT R
I /I T X PT
E SEC /E CE .
Curated by
Q.12 What is the difference between UNION and UNION
ALL in SQL?
From To
Placed with
Curated by
Q.14 Explain the purpose of the SQL CASE statement.
Curated by
Q.16 What is the purpose of the SQL LIMIT clause?
Curated by
Continue Question No.17
Example :
SELECT name, score, RANK() OVER (ORDER BY score DESC)
AS rank FROM students;
Example :
SELECT name, score, NTILE(4) OVER (ORDER BY score
DESC) AS quartile FROM students;
Example :
SELECT date, revenue, LAG(revenue) OVER (ORDER BY
date) AS prev_revenue FROM sales;
Example :
SELECT category, date, revenue, LAG(revenue) OVER
(PARTITION BY category ORDER BY date) AS prev_revenue
FROM sales;
Example :
SELECT name, score, PERCENT_RANK() OVER (ORDER BY
score DESC) AS percentile FROM students;
Service Based
Saumya
Mishra Company
Curated by
Q.19 How can you calculate the total number of rows in
a table without using the COUNT function?
You can use the SELECT statement with the TOP (or
LIMIT) clause to retrieve the first row and the ORDER BY
clause to order the results. Then, use the row number
of the last row to determine the total number of rows.
Curated by
Q.21 What is the purpose of the BETWEEN operator in SQL?
Curated by
Q.23 Difference between Delete, Truncate and Drop.
1250+ Career
Transitions 350+ Hiring
CTC
If you have the courage to take your When I started looking for a software
career in an analytical direction, Tutort development course, I found Tutort
Academy has the expertise, method, Academy completely matching my
and support to help you. Extremely requirements. Apart from the content
Gunjan Bhadani knowledgeable faculty with a thorough Mohit Agarwal and live classes that they provide,
understanding of the industry. Highly the mentorship program is the cherry
recommended especially for working on the cake.
professionals.
Curated by
Q.24 How do you handle NULL values in SQL queries?
Service Based
Arpita Basak Company
Curated by
Start Your
Upskilling with us
Explore More
www.tutort.net
Watch us on Youtube Read more on Quora
Follow us on