0% found this document useful (0 votes)
2 views2 pages

SQL Interview

The document outlines key differences in SQL concepts such as WHERE vs. HAVING, various types of JOINs, and aggregate functions. It also presents real-world SQL questions for practice, including queries to find top customers, calculate growth rates, and identify duplicates. Additionally, it includes basic string and date function-related questions to enhance SQL skills.

Uploaded by

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

SQL Interview

The document outlines key differences in SQL concepts such as WHERE vs. HAVING, various types of JOINs, and aggregate functions. It also presents real-world SQL questions for practice, including queries to find top customers, calculate growth rates, and identify duplicates. Additionally, it includes basic string and date function-related questions to enhance SQL skills.

Uploaded by

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

Key Differences:

1- WHERE vs. HAVING


2- UNION vs. UNION ALL
3-INNER JOIN vs. LEFT JOIN vs. RIGHT JOIN vs. FULL JOIN
4-RANK() vs. DENSE_RANK() vs. ROW_NUMBER()
5-EXCEPT (MINUS) vs. INTERSECT
6-Subqueries vs. CTEs
7-JOINs vs. Subqueries
8-Aggregate functions with GROUP BY vs. Window functions
9-Temporary Table vs Table Variable
10-COALESCE vs. ISNULL
11-CHAR vs. VARCHAR
12-DELETE vs. TRUNCATE vs. DROP
13-Stored Procedures vs. User-Defined Functions
14- VIEWs vs MATERLIZED VIEW
15- PRIMARY KEY vs UNIQUE KEY

Real-World SQL Questions and Scenarios for your practice.

1-Find the top 5 customers with the highest average order value in the
last quarter.
2-Identify customers who have made purchases in consecutive months.
3- Calculate the month-over-month growth rate of sales revenue.
4- Identify duplicate records in a table and remove them.
5- Find nth Highest Salary.
6- Find the employee who have salary more than his manager.
7- Find the customers who have placed orders in both 2022 and 2023.
8-Calculate the running total of sales for each product category.
9- Retrieve the first order date for each customer.
10- List all customers who have made more than 3 orders.
11- Find the customers who have the same last name.
12- Create a query to find the top 3 products in each category by sales.

Some Basic STRING & DATE functions related questions:

1-Extract the month from a date column.


2- Convert a string date to a date format.
3-Replace all null values in a column with a specific value.
4-Concatenate two string columns.
5-Split a comma separated string into individual values.
6-Find the longest string in a column.
7-Create a query to find the percentage of total sales for each product.
8- Find the average time between customer orders.
9- Identify customers who have churned (not placed an order in the last 6
months).
10-Find the number of customers who joined each month/Quarter etc.

You might also like