0% found this document useful (0 votes)
7 views5 pages

SQL Interview Questions Part 1 1709953139

The document provides an introduction to SQL and presents the top 30 SQL interview questions, focusing on data retrieval and manipulation from an Employees table. It includes sample SQL queries for tasks such as retrieving employee names, calculating average salary, and sorting data. The document is part of a series, with a note to follow for additional parts.

Uploaded by

VAIBHAV BHAMARE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

SQL Interview Questions Part 1 1709953139

The document provides an introduction to SQL and presents the top 30 SQL interview questions, focusing on data retrieval and manipulation from an Employees table. It includes sample SQL queries for tasks such as retrieving employee names, calculating average salary, and sorting data. The document is part of a series, with a note to follow for additional parts.

Uploaded by

VAIBHAV BHAMARE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Anil Patel Architect - Data

Engineering & Analytics


@anilpatel Career Transition Coach

Top 30

SQL Interview Questions

Part - 1
Anil Patel Architect - Data
Engineering & Analytics
@anilpatel Career Transition Coach

Introduction
SQL (Structured Query Language) is a programming language used for managing and
manipulating relational databases. It allows users to interact with databases by performing
tasks like querying data, inserting records, updating information, and deleting entries,
making it essential for handling data effectively in various applications.

Table : Employees

ID Name Department Salary

1. Brayden IT 52000

2. Chris HR 54000

3. Ailani Marketing 65000

4. Dalton Finance 68000

5. Lara IT 46000

6. Anala Finance 71000

7. Marshall HR 42000

8. Ishana Marketing 59000


Anil Patel Architect - Data
Engineering & Analytics
@anilpatel Career Transition Coach

Q1. Retrieve names of all employees

SELECT Name
FROM Employees ;

Q2. Retrieve all data from the Employees Table

SELECT *
FROM Employees ;

Q3. Calculate the average salary of all employees

SELECT AVG ( Salary )


FROM Employees ;

Q4. Retrieve specific columns for employees in HR


Department

SELECT ID, Name, Salary


FROM Employees
WHERE Department = ' HR ' ;
Anil Patel Architect - Data
Engineering & Analytics
@anilpatel Career Transition Coach

Q5. Retrieve the maximum salary from the Employees


Table

SELECT MAX( Salary )


FROM Employees ;

Q6. Retrieve all data from the Employees Table sorted


by salary in descending order

SELECT *
FROM Employees
ORDER BY Salary DESC ;

Q7. Count the total number of rows in the Employees


Table

SELECT COUNT(*)
FROM Employees ;
Anil Patel Architect - Data
Engineering & Analytics
@anilpatel Career Transition Coach

Q8. Retrieve the minimum salary from the Employees


Table

SELECT MIN( Salary )


FROM Employees ;

Q9. Retrieve unique departments from the Employees


Table

SELECT DISTINCT
FROM Employees ;

Q10. Calculate the total sum of all salaries in the


Employees Table

SELECT SUM( Salary )


FROM Employees ;

Don't forget to Follow for Part - 2 and Part - 3 !

You might also like