SQL Resources TP
1.34K subscribers
69 photos
4 files
111 links
Download Telegram
Practice these 5 intermediate SQL interview questions today!

1. Write a SQL query for cumulative sum of salary of each employee from Jan to July. (Column name – Emp_id, Month, Salary).

2. Write a SQL query to display year on year growth for each product. (Column name – transaction_id, Product_id, transaction_date, spend). Output will have year, product_id & yoy_growth.

3. Write a SQL query to find the numbers which consecutively occurs 3 times. (Column name – id, numbers)

4. Write a SQL query to find the days when temperature was higher than its previous dates. (Column name – Days, Temp)

5. Write a SQL query to find the nth highest salary from the table emp. (Column name – id, salary)

SQL Relational Database Free Course Here: https://tinyurl.com/42nau8jx

Learn & Practice SQL (https://bit.ly/4kNb15x)

SQL Topics for Data Analysts (https://t.me/sqlresourcestp/83)

SQL Udacity Course (https://udacity.com/course/sql-for-data-analysis--ud198)

Download SQL Cheatsheet (https://t.me/sqlresourcestp/4)

Also try to apply what you learn through hands-on projects or challenges.

ENJOY LEARNING 👍👍

More Resources Here
https://whatsapp.com/channel/0029VahGttK5a24AXAJDjm2R

Like this post if you need more 👍❤️

Hope it helps :)
REMOTE JOBS

Remote Webflow & Wordpress Developer Job at The Sher Agency(Texas, USA)
https://kenyatrends.co.ke/so8e

Remote Senior Backend Software Developer Job at Missive(Quebec, Canada)
https://kenyatrends.co.ke/x8a6

Remote Online English Teacher Job at Native Camp (Japan)
https://kenyatrends.co.ke/nbcg

Remote Senior iOS Developer Job at Neybox Digital Ltd. (Limassol, Cyprus, EUROPE)
https://kenyatrends.co.ke/bs6u

Remote Golang Engineer Job at Canonical, United Kingdom(UK)
https://kenyatrends.co.ke/csjm
SQL for everything 💪
𝟯 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝗯𝘆 𝗚𝗼𝗼𝗴𝗹𝗲, 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 & 𝗟𝗶𝗻𝗸𝗲𝗱𝗜𝗻 🚀💻

Upskill with these amazing free courses from top platforms! 🌟

1️⃣ Generative AI by Google: Dive into AI fundamentals and applications.

2️⃣ Training for DevOps Engineers: Master DevOps tools and practices with Microsoft.

3️⃣ Career Essentials in Data Analysis: Build data analysis skills with Microsoft & LinkedIn.

𝐋𝐢𝐧𝐤 👇:-

https://tinyurl.com/3w3xu4sh

Don’t miss this opportunity to elevate your expertise. 🎓
Most Asked SQL Interview Questions at MAANG Companies🔥🔥

Preparing for an SQL Interview at MAANG Companies? Here are some crucial SQL Questions you should be ready to tackle:

1. How do you retrieve all columns from a table?

SELECT * FROM table_name;

2. What SQL statement is used to filter records?

SELECT * FROM table_name
WHERE condition;

The WHERE clause is used to filter records based on a specified condition.

3. How can you join multiple tables? Describe different types of JOINs.

SELECT columns
FROM table1
JOIN table2 ON table1.column = table2.column
JOIN table3 ON table2.column = table3.column;

Types of JOINs:

1. INNER JOIN: Returns records with matching values in both tables

SELECT * FROM table1
INNER JOIN table2 ON table1.column = table2.column;

2. LEFT JOIN: Returns all records from the left table & matched records from the right table. Unmatched records will have NULL values.

SELECT * FROM table1
LEFT JOIN table2 ON table1.column = table2.column;

3. RIGHT JOIN: Returns all records from the right table & matched records from the left table. Unmatched records will have NULL values.

SELECT * FROM table1
RIGHT JOIN table2 ON table1.column = table2.column;

4. FULL JOIN: Returns records when there is a match in either left or right table. Unmatched records will have NULL values.

SELECT * FROM table1
FULL JOIN table2 ON table1.column = table2.column;

4. What is the difference between WHERE & HAVING clauses?

WHERE: Filters records before any groupings are made.

SELECT * FROM table_name
WHERE condition;

HAVING: Filters records after groupings are made.

SELECT column, COUNT(*)
FROM table_name
GROUP BY column
HAVING COUNT(*) > value;

5. How do you calculate average, sum, minimum & maximum values in a column?

Average: SELECT AVG(column_name) FROM table_name;

Sum: SELECT SUM(column_name) FROM table_name;

Minimum: SELECT MIN(column_name) FROM table_name;

Maximum: SELECT MAX(column_name) FROM table_name;

Here you can find essential SQL Interview Resources👇
https://t.me/sqlresourcestp

Like this post if you need more 👍❤️

Hope it helps :)
𝗚𝗲𝘁 𝗬𝗼𝘂𝗿 𝗗𝗿𝗲𝗮𝗺 𝗝𝗼𝗯 𝗜𝗻 𝗔𝗺𝗮𝘇𝗼𝗻, 𝗚𝗼𝗼𝗴𝗹𝗲, 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁, 𝗡𝗩𝗜𝗗𝗜𝗔, 𝗮𝗻𝗱 𝗠𝗲𝘁𝗮 (𝗙𝗮𝗰𝗲𝗯𝗼𝗼𝗸) 𝘄𝗶𝘁𝗵 𝘁𝗵𝗲𝘀𝗲 𝗰𝗼𝗺𝗽𝗿𝗲𝗵𝗲𝗻𝘀𝗶𝘃𝗲 𝗿𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 🚀💻

1️⃣  Amazon Interviewing Guide
2️⃣  Google Interview Tips
3️⃣  Microsoft Hiring Tips
4️⃣  NVIDIA Hiring Process
5️⃣  Meta Onsite SWE Prep Guide

𝐋𝐢𝐧𝐤👇:-

https://tinyurl.com/3rj868rf

Crack Interview & Get Your Dream Job In Top MNCs
👍1
BACK-END DEVELOPER REMOTE JOBS 👇👇

Remote BackEnd Engineer (Node.js) Job at Popcorn Labs, Inc
https://kenyatrends.co.ke/s16j

Remote Engineering Technical Lead - Node.js
https://kenyatrends.co.ke/s16j

Remote Senior Backend Software Developer Job at Missive(Quebec, Canada)
https://kenyatrends.co.ke/x8a6

Remote Backend Engineer (Python) Job at Search Atlas
https://kenyatrends.co.ke/0vlb

Remote Senior Backend Engineer Job at CardNexus
https://kenyatrends.co.ke/wjpd

Remote Mid-level PHP Developer for B2B SaaS Job at Gymdesk
https://kenyatrends.co.ke/kzeg
𝟒 𝐌𝐢𝐜𝐫𝐨𝐬𝐨𝐟𝐭 𝐅𝐫𝐞𝐞 𝐂𝐨𝐮𝐫𝐬𝐞𝐬: 𝐈𝐧-𝐃𝐞𝐦𝐚𝐧𝐝🚀💻

- Artificial Intelligence (AI)
- Internet Of Things (IoT)
- Machine Learning (ML)
- Data Science

🌟 Globally Recognized Certification
🌟 100% FREE – No Hidden Costs!
🌟 Boost Your Resume & Career

  𝐄𝐧𝐫𝐨𝐥𝐥 𝐟𝐨𝐫 𝐅𝐑𝐄𝐄 👇:-

https://tinyurl.com/mrujyamb

🎯 Learn. Get Certified. Shine Bright!🎓
The SQL Mindmap
SQL Aggregate Functions
👍1
SQL Interview Questions !!

🎗 Write a query to find all employees whose salaries exceed the company's average salary.
🎗 Write a query to retrieve the names of employees who work in the same department as 'John Doe'.
🎗 Write a query to display the second highest salary from the Employee table without using the MAX function twice.
🎗 Write a query to find all customers who have placed more than five orders.
🎗 Write a query to count the total number of orders placed by each customer.
🎗 Write a query to list employees who joined the company within the last 6 months.
🎗 Write a query to calculate the total sales amount for each product.
🎗 Write a query to list all products that have never been sold.
🎗 Write a query to remove duplicate rows from a table.
🎗 Write a query to identify the top 10 customers who have not placed any orders in the past year.

Here you can find essential SQL Interview Resources👇
https://t.me/sqlresourcestp/40

Like this post if you need more 👍❤️

Hope it helps :)

More Resources Here
https://whatsapp.com/channel/0029VahGttK5a24AXAJDjm2R
𝐌𝐢𝐜𝐫𝐨𝐬𝐨𝐟𝐭 𝐅𝐑𝐄𝐄 𝐂𝐞𝐫𝐭𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧 𝐂𝐨𝐮𝐫𝐬𝐞𝐬!🚀💻

Supercharge your career with 5 FREE Microsoft certification courses designed to boost your data analytics skills!

𝐄𝐧𝐫𝐨𝐥𝐥 𝐅𝐨𝐫 𝐅𝐑𝐄𝐄👇 :-

https://tinyurl.com/2r7bcaz6

- Earn certifications to showcase your skills

Don’t wait—start your journey to success today!
Here are SQL interview questions:

Basic SQL Questions

1.⁠ ⁠What is SQL, and what is its purpose?
2.⁠ ⁠Write a SQL query to retrieve all records from a table.
3.⁠ ⁠How do you select specific columns from a table?
4.⁠ ⁠What is the difference between WHERE and HAVING clauses?
5.⁠ ⁠How do you sort data in ascending/descending order?

SQL Query Questions

1.⁠ ⁠Write a SQL query to retrieve the top 10 records from a table based on a specific column.
2.⁠ ⁠How do you join two tables based on a common column?
3.⁠ ⁠Write a SQL query to retrieve data from multiple tables using subqueries.
4.⁠ ⁠How do you use aggregate functions (SUM, AVG, MAX, MIN)?
5.⁠ ⁠Write a SQL query to retrieve data from a table for a specific date range.

SQL Optimization Questions

1.⁠ ⁠How do you optimize SQL query performance?
2.⁠ ⁠What is indexing, and how does it improve query performance?
3.⁠ ⁠How do you avoid full table scans?
4.⁠ ⁠What is query caching, and how does it work?
5.⁠ ⁠How do you optimize SQL queries for large datasets?

SQL Joins and Subqueries

1.⁠ ⁠Explain the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN.
2.⁠ ⁠Write a SQL query to retrieve data from two tables using a subquery.
3.⁠ ⁠How do you use EXISTS and IN operators in SQL?
4.⁠ ⁠Write a SQL query to retrieve data from multiple tables using a self-join.
5.⁠ ⁠Explain the concept of correlated subqueries.

SQL Data Modeling

1.⁠ ⁠Explain the concept of normalization and denormalization.
2.⁠ ⁠How do you design a database schema for a given application?
3.⁠ ⁠What is data redundancy, and how do you avoid it?
4.⁠ ⁠Explain the concept of primary and foreign keys.
5.⁠ ⁠How do you handle data inconsistencies and anomalies?

SQL Advanced Questions

1.⁠ ⁠Explain the concept of window functions (ROW_NUMBER, RANK, etc.).
2.⁠ ⁠Write a SQL query to retrieve data using Common Table Expressions (CTEs).
3.⁠ ⁠How do you use dynamic SQL?
4.⁠ ⁠Explain the concept of stored procedures and functions.
5.⁠ ⁠Write a SQL query to retrieve data using pivot tables.

SQL Scenario-Based Questions

1.⁠ ⁠You have two tables, Orders and Customers. Write a SQL query to retrieve all orders for customers from a specific region.
2.⁠ ⁠You have a table with duplicate records. Write a SQL query to remove duplicates.
3.⁠ ⁠You have a table with missing values. Write a SQL query to replace missing values with a default value.
4.⁠ ⁠You have a table with data in an incorrect format. Write a SQL query to correct the format.
5.⁠ ⁠You have two tables with different data types for a common column. Write a SQL query to join the tables.

SQL Behavioral Questions

1.⁠ ⁠Can you explain a time when you optimized a slow-running SQL query?
2.⁠ ⁠How do you handle database errors and exceptions?
3.⁠ ⁠Can you describe a complex SQL query you wrote and why?
4.⁠ ⁠How do you stay up-to-date with new SQL features and best practices?
5.⁠ ⁠Can you walk me through your process for troubleshooting SQL issues?

Best Resources to learn SQL 👇

SQL Topics for Data Analysts (https://t.me/sqlresourcestp/83)

Learn & Practice SQL (https://bit.ly/4kNb15x)

SQL Udacity Course (https://udacity.com/course/sql-for-data-analysis--ud198)

Download SQL Cheatsheet (https://t.me/sqlresourcestp/4)

Also try to apply what you learn through hands-on projects or challenges.

ENJOY LEARNING 👍👍

More Resources Here
https://whatsapp.com/channel/0029VahGttK5a24AXAJDjm2R

Like this post if you need more 👍❤️

Hope it helps :)
1
𝐍𝐕𝐈𝐃𝐈𝐀 𝐅𝐑𝐄𝐄 𝐀𝐈 𝐂𝐞𝐫𝐭𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧 𝐂𝐨𝐮𝐫𝐬𝐞𝐬 🚀💻

Transform your skills with these cutting-edge courses by NVIDIA.

Check out the following NVIDIA FREE AI Certification Courses

𝐋𝐢𝐧𝐤👇:- 

https://tinyurl.com/5hessh3t

Enroll For FREE & Get Certified 🎓
SQL Data Types
𝟱 𝗦𝗤𝗟 𝗠𝘆𝘁𝗵𝘀 𝗗𝗲𝗯𝘂𝗻𝗸𝗲𝗱 𝗪𝗵𝗮𝘁 𝗕𝗲𝗴𝗶𝗻𝗻𝗲𝗿𝘀 𝗢𝗳𝘁𝗲𝗻 𝗚𝗲𝘁 𝗪𝗿𝗼𝗻𝗴
SQL is super powerful, but some myths around it can trip up beginners. Let’s clear up five common misunderstandings and set the record straight:

𝗠𝘆𝘁𝗵 𝟭: 𝗦𝗤𝗟 𝗶𝘀 𝗷𝘂𝘀𝘁 𝗳𝗼𝗿 𝗽𝘂𝗹𝗹𝗶𝗻𝗴 𝗱𝗮𝘁𝗮.
✦ 𝗥𝗲𝗮𝗹𝗶𝘁𝘆: Nope, it’s not just for that! SQL can also create, modify, and manage databases, control access, and maintain data consistency.
✦ 𝗙𝗶𝘅 𝗶𝘁: Explore all the features of SQL, like DDL (for database design), DCL (for access control), and TCL (for transactions). It's more than just SELECT!

𝗠𝘆𝘁𝗵 𝟮: 𝗨𝘀𝗶𝗻𝗴 𝗦𝗘𝗟𝗘𝗖𝗧 * 𝗶𝘀 𝗳𝗶𝗻𝗲.
✦ 𝗥𝗲𝗮𝗹𝗶𝘁𝘆: It might be easy, but it’s not efficient. Pulling all columns wastes memory and slows down performance.
✦ 𝗙𝗶𝘅 𝗶𝘁: Only select the columns you actually need. It’s faster and cleaner.
Not great - SELECT * FROM employees;
Better - SELECT employee_id, name, department FROM employees;

𝗠𝘆𝘁𝗵 𝟯: 𝗦𝗤𝗟 𝗰𝗮𝗻'𝘁 𝗵𝗮𝗻𝗱𝗹𝗲 𝗰𝗼𝗺𝗽𝗹𝗲𝘅 𝗮𝗻𝗮𝗹𝘆𝘀𝗶𝘀.
✦ 𝗥𝗲𝗮𝗹𝗶𝘁𝘆: SQL can do way more than basic queries! With concepts like window functions and CTEs, you can handle really complex data analysis.
✦ 𝗙𝗶𝘅 𝗶𝘁: Learn advanced SQL features like window functions (ROW_NUMBER(), RANK()) and CTEs to up your game.
Example - Ranking employees by salary within their department
WITH ranked_salaries AS (SELECT employee_id, salary, department,
ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS rank FROM employees)
SELECT * FROM ranked_salaries WHERE rank = 1;

𝗠𝘆𝘁𝗵 𝟰: 𝗦𝗹𝗼𝘄 𝗾𝘂𝗲𝗿𝗶𝗲𝘀 𝗮𝗿𝗲 𝗮𝗹𝘄𝗮𝘆𝘀 𝘁𝗵𝗲 𝗱𝗮𝘁𝗮𝗯𝗮𝘀𝗲’𝘀 𝗳𝗮𝘂𝗹𝘁.
✦ 𝗥𝗲𝗮𝗹𝗶𝘁𝘆: It’s usually inefficient queries causing the slowdown. Things like missing indexes or unoptimized code can be the culprit.
✦ 𝗙𝗶𝘅 𝗶𝘁: Use indexes properly, avoid complex calculations in WHERE clauses, and check your query execution plan to spot bottlenecks.

𝗠𝘆𝘁𝗵 𝟱: 𝗦𝗤𝗟 𝗶𝘀 𝗼𝘂𝘁𝗱𝗮𝘁𝗲𝗱 𝗮𝗻𝗱 𝘄𝗶𝗹𝗹 𝗯𝗲 𝗿𝗲𝗽𝗹𝗮𝗰𝗲𝗱 𝘀𝗼𝗼𝗻.
✦ 𝗥𝗲𝗮𝗹𝗶𝘁𝘆: SQL is here to stay! Despite the rise of NoSQL, SQL remains the backbone for structured data.
✦ 𝗙𝗶𝘅 𝗶𝘁: Stay current and explore how SQL integrates with big data platforms and cloud databases. It’s more relevant than ever.

Don’t let these myths hold you back. SQL is powerful, and when you understand it fully, you can do amazing things with your data.

SQL Relational Database Free Course Here: https://tinyurl.com/42nau8jx

Learn & Practice SQL (https://bit.ly/4kNb15x)

SQL Topics for Data Analysts (https://t.me/sqlresourcestp/83)

SQL Udacity Course (https://udacity.com/course/sql-for-data-analysis--ud198)

Download SQL Cheatsheet (https://t.me/sqlresourcestp/4)

Also try to apply what you learn through hands-on projects or challenges.

ENJOY LEARNING 👍👍

More Resources Here
https://whatsapp.com/channel/0029VahGttK5a24AXAJDjm2R

Like this post if you need more 👍❤️

Hope it helps :)
1🔥1