📊 𝟭𝟬𝟬% 𝗙𝗥𝗘𝗘 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗖𝗼𝘂𝗿𝘀𝗲😍
✅ Free Online Course
💡 Industry-Relevant Skills
🎓 Certification Included
Upskill now and Get Certified 🎓
𝐋𝐢𝐧𝐤 👇:-
https://pdlink.in/497MMLw
Get the Govt. of India Incentives on course completion🏆
✅ Free Online Course
💡 Industry-Relevant Skills
🎓 Certification Included
Upskill now and Get Certified 🎓
𝐋𝐢𝐧𝐤 👇:-
https://pdlink.in/497MMLw
Get the Govt. of India Incentives on course completion🏆
Here are some commonly asked SQL interview questions along with brief answers:
1. What is SQL?
- SQL stands for Structured Query Language, used for managing and manipulating relational databases.
2. What are the types of SQL commands?
- SQL commands can be broadly categorized into four types: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), and Transaction Control Language (TCL).
3. What is the difference between CHAR and VARCHAR data types?
- CHAR is a fixed-length character data type, while VARCHAR is a variable-length character data type. CHAR will always occupy the same amount of storage space, while VARCHAR will only use the necessary space to store the actual data.
4. What is a primary key?
- A primary key is a column or a set of columns that uniquely identifies each row in a table. It ensures data integrity by enforcing uniqueness and can be used to establish relationships between tables.
5. What is a foreign key?
- A foreign key is a column or a set of columns in one table that refers to the primary key in another table. It establishes a relationship between two tables and ensures referential integrity.
6. What is a JOIN in SQL?
- JOIN is used to combine rows from two or more tables based on a related column between them. There are different types of JOINs, including INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.
7. What is the difference between INNER JOIN and OUTER JOIN?
- INNER JOIN returns only the rows that have matching values in both tables, while OUTER JOIN (LEFT, RIGHT, FULL) returns all rows from one or both tables, with NULL values in columns where there is no match.
8. What is the difference between GROUP BY and ORDER BY?
- GROUP BY is used to group rows that have the same values into summary rows, typically used with aggregate functions like SUM, COUNT, AVG, etc., while ORDER BY is used to sort the result set based on one or more columns.
9. What is a subquery?
- A subquery is a query nested within another query, used to return data that will be used in the main query. Subqueries can be used in SELECT, INSERT, UPDATE, and DELETE statements.
10. What is normalization in SQL?
- Normalization is the process of organizing data in a database to reduce redundancy and dependency. It involves dividing large tables into smaller tables and defining relationships between them to improve data integrity and efficiency.
Around 90% questions will be asked from sql in data analytics interview, so please make sure to practice SQL skills using websites like stratascratch. ☺️💪
1. What is SQL?
- SQL stands for Structured Query Language, used for managing and manipulating relational databases.
2. What are the types of SQL commands?
- SQL commands can be broadly categorized into four types: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), and Transaction Control Language (TCL).
3. What is the difference between CHAR and VARCHAR data types?
- CHAR is a fixed-length character data type, while VARCHAR is a variable-length character data type. CHAR will always occupy the same amount of storage space, while VARCHAR will only use the necessary space to store the actual data.
4. What is a primary key?
- A primary key is a column or a set of columns that uniquely identifies each row in a table. It ensures data integrity by enforcing uniqueness and can be used to establish relationships between tables.
5. What is a foreign key?
- A foreign key is a column or a set of columns in one table that refers to the primary key in another table. It establishes a relationship between two tables and ensures referential integrity.
6. What is a JOIN in SQL?
- JOIN is used to combine rows from two or more tables based on a related column between them. There are different types of JOINs, including INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.
7. What is the difference between INNER JOIN and OUTER JOIN?
- INNER JOIN returns only the rows that have matching values in both tables, while OUTER JOIN (LEFT, RIGHT, FULL) returns all rows from one or both tables, with NULL values in columns where there is no match.
8. What is the difference between GROUP BY and ORDER BY?
- GROUP BY is used to group rows that have the same values into summary rows, typically used with aggregate functions like SUM, COUNT, AVG, etc., while ORDER BY is used to sort the result set based on one or more columns.
9. What is a subquery?
- A subquery is a query nested within another query, used to return data that will be used in the main query. Subqueries can be used in SELECT, INSERT, UPDATE, and DELETE statements.
10. What is normalization in SQL?
- Normalization is the process of organizing data in a database to reduce redundancy and dependency. It involves dividing large tables into smaller tables and defining relationships between them to improve data integrity and efficiency.
Around 90% questions will be asked from sql in data analytics interview, so please make sure to practice SQL skills using websites like stratascratch. ☺️💪
❤3
Which condition correctly finds rows where city is missing?
Anonymous Quiz
24%
A. city = NULL
11%
B. city != NULL
58%
C. city IS NULL
7%
D. city = ''
❤3
What is the result of this query?
SELECT COUNT(city) FROM customers;
SELECT COUNT(city) FROM customers;
Anonymous Quiz
28%
A. Counts all rows
13%
B. Counts only rows where city is NULL
56%
C. Counts only rows where city is NOT NULL
3%
D. Returns error
❤2
You want to show 0 instead of NULL for total sales. Which function should you use?
Anonymous Quiz
32%
A. ISNULL
8%
B. NVL
48%
C. COALESCE
12%
D. NULLIF
❤3
In a LEFT JOIN, why do unmatched rows show NULL values?
Anonymous Quiz
4%
A. Because data is deleted
4%
B. Because INNER JOIN is used
78%
C. Because matching rows don’t exist in the right table
14%
D. Because NULL is a default value
❤3
𝗧𝗼𝗽 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻𝘀 𝗢𝗳𝗳𝗲𝗿𝗲𝗱 𝗕𝘆 𝗜𝗜𝗧 𝗥𝗼𝗼𝗿𝗸𝗲𝗲, 𝗜𝗜𝗠 & 𝗠𝗜𝗧😍
Placement Assistance With 5000+ Companies
𝗠𝗮𝗰𝗵𝗶𝗻𝗲 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝘄𝗶𝘁𝗵
𝗣𝘆𝘁𝗵𝗼𝗻 :- https://pdlink.in/4khp9E5
𝗕𝘂𝘀𝗶𝗻𝗲𝘀𝘀 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 𝗪𝗶𝘁𝗵 𝗔𝗜 :- https://pdlink.in/4qkC4GP
𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 𝗪𝗶𝘁𝗵 𝗔𝗜 :- https://pdlink.in/4rwqIAm
Hurry..Up👉 Only Limited Seats Available
Placement Assistance With 5000+ Companies
𝗠𝗮𝗰𝗵𝗶𝗻𝗲 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝘄𝗶𝘁𝗵
𝗣𝘆𝘁𝗵𝗼𝗻 :- https://pdlink.in/4khp9E5
𝗕𝘂𝘀𝗶𝗻𝗲𝘀𝘀 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 𝗪𝗶𝘁𝗵 𝗔𝗜 :- https://pdlink.in/4qkC4GP
𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 𝗪𝗶𝘁𝗵 𝗔𝗜 :- https://pdlink.in/4rwqIAm
Hurry..Up👉 Only Limited Seats Available
SQL Interview Questions for 0-1 year of Experience (Asked in Top Product-Based Companies).
Sharpen your SQL skills with these real interview questions!
Q1. Customer Purchase Patterns -
You have two tables, Customers and Purchases: CREATE TABLE Customers ( customer_id INT PRIMARY KEY, customer_name VARCHAR(255) ); CREATE TABLE Purchases ( purchase_id INT PRIMARY KEY, customer_id INT, product_id INT, purchase_date DATE );
Assume necessary INSERT statements are already executed.
Write an SQL query to find the names of customers who have purchased more than 5 different products within the last month. Order the result by customer_name.
Q2. Call Log Analysis -
Suppose you have a CallLogs table: CREATE TABLE CallLogs ( log_id INT PRIMARY KEY, caller_id INT, receiver_id INT, call_start_time TIMESTAMP, call_end_time TIMESTAMP );
Assume necessary INSERT statements are already executed.
Write a query to find the average call duration per user. Include only users who have made more than 10 calls in total. Order the result by average duration descending.
Q3. Employee Project Allocation - Consider two tables, Employees and Projects:
CREATE TABLE Employees ( employee_id INT PRIMARY KEY, employee_name VARCHAR(255), department VARCHAR(255) ); CREATE TABLE Projects ( project_id INT PRIMARY KEY, lead_employee_id INT, project_name VARCHAR(255), start_date DATE, end_date DATE );
Assume necessary INSERT statements are already executed.
The goal is to write an SQL query to find the names of employees who have led more than 3 projects in the last year. The result should be ordered by the number of projects led.
Sharpen your SQL skills with these real interview questions!
Q1. Customer Purchase Patterns -
You have two tables, Customers and Purchases: CREATE TABLE Customers ( customer_id INT PRIMARY KEY, customer_name VARCHAR(255) ); CREATE TABLE Purchases ( purchase_id INT PRIMARY KEY, customer_id INT, product_id INT, purchase_date DATE );
Assume necessary INSERT statements are already executed.
Write an SQL query to find the names of customers who have purchased more than 5 different products within the last month. Order the result by customer_name.
Q2. Call Log Analysis -
Suppose you have a CallLogs table: CREATE TABLE CallLogs ( log_id INT PRIMARY KEY, caller_id INT, receiver_id INT, call_start_time TIMESTAMP, call_end_time TIMESTAMP );
Assume necessary INSERT statements are already executed.
Write a query to find the average call duration per user. Include only users who have made more than 10 calls in total. Order the result by average duration descending.
Q3. Employee Project Allocation - Consider two tables, Employees and Projects:
CREATE TABLE Employees ( employee_id INT PRIMARY KEY, employee_name VARCHAR(255), department VARCHAR(255) ); CREATE TABLE Projects ( project_id INT PRIMARY KEY, lead_employee_id INT, project_name VARCHAR(255), start_date DATE, end_date DATE );
Assume necessary INSERT statements are already executed.
The goal is to write an SQL query to find the names of employees who have led more than 3 projects in the last year. The result should be ordered by the number of projects led.
❤3
🎓 𝗨𝗽𝘀𝗸𝗶𝗹𝗹 𝗪𝗶𝘁𝗵 𝗚𝗼𝘃𝗲𝗿𝗻𝗺𝗲𝗻𝘁-𝗔𝗽𝗽𝗿𝗼𝘃𝗲𝗱 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝗙𝗼𝗿 𝟭𝟬𝟬% 𝗙𝗥𝗘𝗘 😍
✅ AI & ML
✅ Cloud Computing
✅ Cybersecurity
✅ Data Analytics & Full Stack Development
Earn industry-recognized certificates and boost your career 🚀
𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:-
https://pdlink.in/4qgtrxU
Get the Govt. of India Incentives on course completion🏆
✅ AI & ML
✅ Cloud Computing
✅ Cybersecurity
✅ Data Analytics & Full Stack Development
Earn industry-recognized certificates and boost your career 🚀
𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:-
https://pdlink.in/4qgtrxU
Get the Govt. of India Incentives on course completion🏆
SQL Interview Trap 🚨 Consecutive Orders Logic
You have a table:
orders
order_id | customer_id | order_date | amount
👉 Question:
Find customers who placed orders on 3 or more consecutive days,
but return only the first date of each such streak per customer.
⚠️ No temp tables.
⚠️ Assume multiple orders per day are possible.
🧠 Most candidates fail because they:
- Forget to handle multiple orders on the same day
- Misuse ROW_NUMBER()
- Miss the date gap logic
✅ Correct SQL Solution:
WITH distinct_orders AS (
SELECT DISTINCT customer_id, order_date
FROM orders
),
grp AS (
SELECT
customer_id,
order_date,
order_date - INTERVAL '1 day' *
ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date) AS grp_id
FROM distinct_orders
)
SELECT
customer_id,
MIN(order_date) AS streak_start_date
FROM grp
GROUP BY customer_id, grp_id
HAVING COUNT(*) >= 3;
💡 Why this works (Interview Gold):
- DISTINCT removes same-day duplicates
- ROW_NUMBER() creates a sequence
- Date minus row number groups consecutive dates
- HAVING COUNT(*) >= 3 filters valid streaks
🔥 React with 🔥 if this bent your brain
📌 Follow the channel for REAL interview-level SQL Content
You have a table:
orders
order_id | customer_id | order_date | amount
👉 Question:
Find customers who placed orders on 3 or more consecutive days,
but return only the first date of each such streak per customer.
⚠️ No temp tables.
⚠️ Assume multiple orders per day are possible.
🧠 Most candidates fail because they:
- Forget to handle multiple orders on the same day
- Misuse ROW_NUMBER()
- Miss the date gap logic
✅ Correct SQL Solution:
WITH distinct_orders AS (
SELECT DISTINCT customer_id, order_date
FROM orders
),
grp AS (
SELECT
customer_id,
order_date,
order_date - INTERVAL '1 day' *
ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date) AS grp_id
FROM distinct_orders
)
SELECT
customer_id,
MIN(order_date) AS streak_start_date
FROM grp
GROUP BY customer_id, grp_id
HAVING COUNT(*) >= 3;
💡 Why this works (Interview Gold):
- DISTINCT removes same-day duplicates
- ROW_NUMBER() creates a sequence
- Date minus row number groups consecutive dates
- HAVING COUNT(*) >= 3 filters valid streaks
🔥 React with 🔥 if this bent your brain
📌 Follow the channel for REAL interview-level SQL Content
1❤5
𝗛𝘂𝗿𝗿𝘆..𝗨𝗽...... 𝗟𝗮𝘀𝘁 𝗗𝗮𝘁𝗲 𝗶𝘀 𝗔𝗽𝗽𝗿𝗼𝗮𝗰𝗵𝗶𝗻𝗴
AI & Data Science Certification Program By IIT Roorkee 😍
🎓 IIT Roorkee E&ICT Certification
💻 Hands-on Projects
📈 Career-Focused Curriculum
Receive Placement Assistance with 5,000+ Companies
Deadline: 8th February 2026
𝗥𝗲𝗴𝗶𝘀𝘁𝗲𝗿 𝗙𝗼𝗿 𝗦𝗰𝗵𝗼𝗹𝗮𝗿𝘀𝗵𝗶𝗽 𝗧𝗲𝘀𝘁👇 :-
https://pdlink.in/49UZfkX
✅ Limited seats only.
AI & Data Science Certification Program By IIT Roorkee 😍
🎓 IIT Roorkee E&ICT Certification
💻 Hands-on Projects
📈 Career-Focused Curriculum
Receive Placement Assistance with 5,000+ Companies
Deadline: 8th February 2026
𝗥𝗲𝗴𝗶𝘀𝘁𝗲𝗿 𝗙𝗼𝗿 𝗦𝗰𝗵𝗼𝗹𝗮𝗿𝘀𝗵𝗶𝗽 𝗧𝗲𝘀𝘁👇 :-
https://pdlink.in/49UZfkX
✅ Limited seats only.
✅ Essential Tools for Data Analytics 📊🛠️
🔣 1️⃣ Excel / Google Sheets
• Quick data entry & analysis
• Pivot tables, charts, functions
• Good for early-stage exploration
💻 2️⃣ SQL (Structured Query Language)
• Work with databases (MySQL, PostgreSQL, etc.)
• Query, filter, join, and aggregate data
• Must-know for data from large systems
🐍 3️⃣ Python (with Libraries)
• Pandas – Data manipulation
• NumPy – Numerical analysis
• Matplotlib / Seaborn – Data visualization
• OpenPyXL / xlrd – Work with Excel files
📊 4️⃣ Power BI / Tableau
• Create dashboards and visual reports
• Drag-and-drop interface for non-coders
• Ideal for business insights & presentations
📁 5️⃣ Google Data Studio
• Free dashboard tool
• Connects easily to Google Sheets, BigQuery
• Great for real-time reporting
🧪 6️⃣ Jupyter Notebook
• Interactive Python coding
• Combine code, text, and visuals in one place
• Perfect for storytelling with data
🛠️ 7️⃣ R Programming (Optional)
• Popular in statistical analysis
• Strong in academic and research settings
☁️ 8️⃣ Cloud & Big Data Tools
• Google BigQuery, Snowflake – Large-scale analysis
• Excel + SQL + Python still work as a base
💡 Tip:
Start with Excel + SQL + Python (Pandas) → Add BI tools for reporting.
💬 Tap ❤️ for more!
🔣 1️⃣ Excel / Google Sheets
• Quick data entry & analysis
• Pivot tables, charts, functions
• Good for early-stage exploration
💻 2️⃣ SQL (Structured Query Language)
• Work with databases (MySQL, PostgreSQL, etc.)
• Query, filter, join, and aggregate data
• Must-know for data from large systems
🐍 3️⃣ Python (with Libraries)
• Pandas – Data manipulation
• NumPy – Numerical analysis
• Matplotlib / Seaborn – Data visualization
• OpenPyXL / xlrd – Work with Excel files
📊 4️⃣ Power BI / Tableau
• Create dashboards and visual reports
• Drag-and-drop interface for non-coders
• Ideal for business insights & presentations
📁 5️⃣ Google Data Studio
• Free dashboard tool
• Connects easily to Google Sheets, BigQuery
• Great for real-time reporting
🧪 6️⃣ Jupyter Notebook
• Interactive Python coding
• Combine code, text, and visuals in one place
• Perfect for storytelling with data
🛠️ 7️⃣ R Programming (Optional)
• Popular in statistical analysis
• Strong in academic and research settings
☁️ 8️⃣ Cloud & Big Data Tools
• Google BigQuery, Snowflake – Large-scale analysis
• Excel + SQL + Python still work as a base
💡 Tip:
Start with Excel + SQL + Python (Pandas) → Add BI tools for reporting.
💬 Tap ❤️ for more!
❤2