SQL Programming Resources
76K subscribers
534 photos
13 files
471 links
Find top SQL resources from global universities, cool projects, and learning materials for data analytics.

Admin: @coderfun

Useful links: heylink.me/DataAnalytics

Promotions: @love_data
Download Telegram
Best YouTube Channels to Learn Data Analytics
4
The Secret to learn SQL:
It's not about knowing everything
It's about doing simple things well

What You ACTUALLY Need:

1. SELECT Mastery

* SELECT * LIMIT 10
(yes, for exploration only!)
* COUNT, SUM, AVG
(used every single day)
* Basic DATE functions
(life-saving for reports)
* CASE WHEN

2. JOIN Logic

* LEFT JOIN
(your best friend)
* INNER JOIN
(your second best friend)
* That's it.

3. WHERE Magic
* Basic conditions
* AND, OR operators
* IN, NOT IN
* NULL handling
* LIKE for text search

4. GROUP BY Essentials
* Basic grouping
* HAVING clause
* Multiple columns
* Simple aggregations

Most common tasks:
* Pull monthly sales
* Count unique customers
* Calculate basic metrics
* Filter date ranges
* Join 2-3 tables

Focus on:
* Clean code
* Clear comments
* Consistent formatting
* Proper indentation

Here you can find essential SQL Interview Resources👇
https://t.iss.one/mysqldata

Like this post if you need more 👍❤️

Hope it helps :)

#sql
👍5
SQL Advanced Concepts for Data Analyst Interviews

1. Window Functions: Gain proficiency in window functions like ROW_NUMBER(), RANK(), DENSE_RANK(), NTILE(), and LAG()/LEAD(). These functions allow you to perform calculations across a set of table rows related to the current row without collapsing the result set into a single output.

2. Common Table Expressions (CTEs): Understand how to use CTEs with the WITH clause to create temporary result sets that can be referenced within a SELECT, INSERT, UPDATE, or DELETE statement. CTEs improve the readability and maintainability of complex queries.

3. Recursive CTEs: Learn how to use recursive CTEs to solve hierarchical or recursive data problems, such as navigating organizational charts or bill-of-materials structures.

4. Advanced Joins: Master complex join techniques, including self-joins (joining a table with itself), cross joins (Cartesian product), and using multiple joins in a single query.

5. Subqueries and Correlated Subqueries: Be adept at writing subqueries that return a single value or a set of values. Correlated subqueries, which reference columns from the outer query, are particularly powerful for row-by-row operations.

6. Indexing Strategies: Learn advanced indexing strategies, such as covering indexes, composite indexes, and partial indexes. Understand how to optimize query performance by designing the right indexes and when to use CLUSTERED versus NON-CLUSTERED indexes.

7. Query Optimization and Execution Plans: Develop skills in reading and interpreting SQL execution plans to understand how queries are executed. Use tools like EXPLAIN or EXPLAIN ANALYZE to identify performance bottlenecks and optimize query performance.

8. Stored Procedures: Understand how to create and use stored procedures to encapsulate complex SQL logic into reusable, modular code. Learn how to pass parameters, handle errors, and return multiple result sets from a stored procedure.

9. Triggers: Learn how to create triggers to automatically execute a specified action in response to certain events on a table (e.g., AFTER INSERT, BEFORE UPDATE). Triggers are useful for maintaining data integrity and automating workflows.

10. Transactions and Isolation Levels: Master the use of transactions to ensure that a series of SQL operations are executed as a single unit of work. Understand different isolation levels (READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE) and their impact on data consistency and concurrency.

11. PIVOT and UNPIVOT: Use the PIVOT operator to transform row data into columnar data and UNPIVOT to convert columns back into rows. These operations are crucial for reshaping data for reporting and analysis.

12. Dynamic SQL: Learn how to write dynamic SQL queries that are constructed and executed at runtime. This is useful when the exact SQL query cannot be determined until runtime, such as in scenarios involving user-defined filters or conditional logic.

13. Data Partitioning: Understand how to implement data partitioning strategies, such as range partitioning or list partitioning, to manage large tables efficiently. Partitioning can significantly improve query performance and manageability.

14. Temporary Tables: Learn how to create and use temporary tables to store intermediate results within a session. Understand the differences between local and global temporary tables, and when to use them.

15. Materialized Views: Use materialized views to store the result of a query physically and update it periodically. This can drastically improve performance for complex queries that need to be executed frequently.

16. Handling Complex Data Types: Understand how to work with complex data types such as JSON, XML, and arrays. Learn how to store, query, and manipulate these types in SQL databases, including using functions like JSON_EXTRACT(), XMLQUERY(), or array functions.

Here you can find SQL Interview Resources👇
https://t.iss.one/DataSimplifier

Share with credits: https://t.iss.one/sqlspecialist

Hope it helps :)
👍3🎉1
Starting the SQL Learning Series on WhatsApp Channel
👇👇
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v/1075
👍21
Quick Recap of SQL Concepts

1. What is SQL?
SQL (Structured Query Language) is a standard programming language used for managing and manipulating relational databases.

2. What are the different types of SQL commands?
- Data Definition Language (DDL): Used to define the structure of database objects (CREATE, ALTER, DROP).
- Data Manipulation Language (DML): Used to manipulate data in the database (SELECT, INSERT, UPDATE, DELETE).
- Data Control Language (DCL): Used to control access and permissions on database objects (GRANT, REVOKE).

3. What is a database schema?
A database schema is a logical structure that represents the layout of the database, including tables, columns, relationships, constraints, and indexes.

4. What is a primary key?
A primary key is a unique identifier for each record in a table. It ensures that each row in the table is uniquely identified and helps maintain data integrity.

5. What is a foreign key?
A foreign key is a column or set of columns in one table that references the primary key in another table. It establishes a relationship between the two tables.

6. What is normalization in SQL?
Normalization is the process of organizing data in a database to reduce redundancy and dependency by dividing large tables into smaller tables and defining relationships between them.

7. What is an index in SQL?
An index is a data structure that improves the speed of data retrieval operations on a database table. It allows for faster searching and sorting of data based on specific columns.

8. What is a JOIN in SQL?
A JOIN is used to combine rows from two or more tables based on a related column between them. Common types of JOINs include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.

9. What is a subquery in SQL?
A subquery is a query nested within another query. It allows you to perform complex queries by using the result of one query as input for another query.

10. What is the difference between SQL and NoSQL databases?
- SQL databases are relational databases that store data in structured tables with predefined schemas, while NoSQL databases are non-relational databases that store data in flexible, schema-less formats.
- SQL databases use SQL for querying and manipulating data, while NoSQL databases use various query languages or APIs.
- SQL databases are suitable for complex queries and transactions, while NoSQL databases are better for handling large volumes of unstructured data and scaling horizontally.

Hope it helps :)
👍9
Guys, Big Announcement!

I’m launching a Complete SQL Learning Series — designed for everyone — whether you're a beginner, intermediate, or someone preparing for data interviews.

This is a complete step-by-step journey — from scratch to advanced — filled with practical examples, relatable scenarios, and short quizzes after each topic to solidify your learning.

Here’s the 5-Week Plan:

Week 1: SQL Fundamentals (No Prior Knowledge Needed)

- What is SQL? Real-world Use Cases

- Databases vs Tables

- SELECT Queries — The Heart of SQL

- Filtering Data with WHERE

- Sorting with ORDER BY

- Using DISTINCT and LIMIT

- Basic Arithmetic and Column Aliases

Week 2: Aggregations & Grouping

- COUNT, SUM, AVG, MIN, MAX — When and How

- GROUP BY — The Right Way

- HAVING vs WHERE

- Dealing with NULLs in Aggregations

- CASE Statements for Conditional Logic

*Week 3: Mastering JOINS & Relationships*

- Understanding Table Relationships (1-to-1, 1-to-Many)

- INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN

- Practical Examples with Two or More Tables

- SELF JOIN & CROSS JOIN — What, When & Why

- Common Join Mistakes & Fixes

Week 4: Advanced SQL Concepts

- Subqueries: Writing Queries Inside Queries

- CTEs (WITH Clause): Cleaner & More Readable SQL

- Window Functions: RANK, DENSE_RANK, ROW_NUMBER

- Using PARTITION BY and ORDER BY

- EXISTS vs IN: Performance and Use Cases


Week 5: Real-World Scenarios & Interview-Ready SQL

- Using SQL to Solve Real Business Problems

- SQL for Sales, Marketing, HR & Product Analytics

- Writing Clean, Efficient & Complex Queries

- Most Common SQL Interview Questions like:

“Find the second highest salary”

“Detect duplicates in a table”

“Calculate running totals”

“Identify top N products per category”

- Practice Challenges Based on Real Interviews

React with ❤️ if you're ready for this series

Join our WhatsApp channel to access it: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v/1075
17👍2😍1
Complete SQL road map
👇👇

1.Intro to SQL
• Definition
• Purpose
• Relational DBs
• DBMS

2.Basic SQL Syntax
• SELECT
• FROM
• WHERE
• ORDER BY
• GROUP BY

3. Data Types
• Integer
• Floating-Point
• Character
• Date
• VARCHAR
• TEXT
• BLOB
• BOOLEAN

4.Sub languages
• DML
• DDL
• DQL
• DCL
• TCL

5. Data Manipulation
• INSERT
• UPDATE
• DELETE

6. Data Definition
• CREATE
• ALTER
• DROP
• Indexes

7.Query Filtering and Sorting
• WHERE
• AND
• OR Conditions
• Ascending
• Descending

8. Data Aggregation
• SUM
• AVG
• COUNT
• MIN
• MAX

9.Joins and Relationships
• INNER JOIN
• LEFT JOIN
• RIGHT JOIN
• Self-Joins
• Cross Joins
• FULL OUTER JOIN

10.Subqueries
• Subqueries used in
• Filtering data
• Aggregating data
• Joining tables
• Correlated Subqueries

11.Views
• Creating
• Modifying
• Dropping Views

12.Transactions
• ACID Properties
• COMMIT
• ROLLBACK
• SAVEPOINT
• ROLLBACK TO SAVEPOINT

13.Stored Procedures
• CREATE PROCEDURE
• ALTER PROCEDURE
• DROP PROCEDURE
• EXECUTE PROCEDURE
• User-Defined Functions (UDFs)

14.Triggers
• Trigger Events
• Trigger Execution and Syntax

15. Security and Permissions
• CREATE USER
• GRANT
• REVOKE
• ALTER USER
• DROP USER

16.Optimizations
• Indexing Strategies
• Query Optimization

17.Normalization
• 1NF(Normal Form)
• 2NF
• 3NF
• BCNF

18.Backup and Recovery
• Database Backups
• Point-in-Time Recovery

19.NoSQL Databases
• MongoDB
• Cassandra etc...
• Key differences

20. Data Integrity
• Primary Key
• Foreign Key

21.Advanced SQL Queries
• Window Functions
• Common Table Expressions (CTEs)

22.Full-Text Search
• Full-Text Indexes
• Search Optimization

23. Data Import and Export
• Importing Data
• Exporting Data (CSV, JSON)
• Using SQL Dump Files

24.Database Design
• Entity-Relationship Diagrams
• Normalization Techniques

25.Advanced Indexing
• Composite Indexes
• Covering Indexes

26.Database Transactions
• Savepoints
• Nested Transactions
• Two-Phase Commit Protocol

27.Performance Tuning
• Query Profiling and Analysis
• Query Cache Optimization

------------------ END -------------------

Some good resources to learn SQL

1.Tutorial & Courses
• Learn SQL: https://bit.ly/3FxxKPz
• Udacity: imp.i115008.net/AoAg7K

2. YouTube Channel's
• FreeCodeCamp:rb.gy/pprz73
• Programming with Mosh: rb.gy/g62hpe

3. Books
• SQL in a Nutshell: https://t.iss.one/DataAnalystInterview/158

4. SQL Interview Questions
https://t.iss.one/sqlanalyst/72?single

Join @free4unow_backup for more free resourses

ENJOY LEARNING 👍👍
👍121
🔅 Most important SQL commands
3
𝐒𝐐𝐋 𝐂𝐚𝐬𝐞 𝐒𝐭𝐮𝐝𝐢𝐞𝐬 𝐟𝐨𝐫 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰:

Join for more: https://t.iss.one/sqlanalyst

1. Danny’s Diner:
Restaurant analytics to understand the customer orders pattern.
Link: https://8weeksqlchallenge.com/case-study-1/

2. Pizza Runner
Pizza shop analytics to optimize the efficiency of the operation
Link: https://8weeksqlchallenge.com/case-study-2/

3. Foodie Fie
Subscription-based food content platform
Link: https://lnkd.in/gzB39qAT

4. Data Bank: That’s money
Analytics based on customer activities with the digital bank
Link: https://lnkd.in/gH8pKPyv

5. Data Mart: Fresh is Best
Analytics on Online supermarket
Link: https://lnkd.in/gC5bkcDf

6. Clique Bait: Attention capturing
Analytics on the seafood industry
Link: https://lnkd.in/ggP4JiYG

7. Balanced Tree: Clothing Company
Analytics on the sales performance of clothing store
Link: https://8weeksqlchallenge.com/case-study-7

8. Fresh segments: Extract maximum value
Analytics on online advertising
Link: https://8weeksqlchallenge.com/case-study-8
👍5
Advanced Questions Asked by Big 4

📊 Excel Questions
1. How do you use Excel to forecast future trends based on historical data? Describe a scenario where you built a forecasting model.
2. Can you explain how you would automate repetitive tasks in Excel using VBA (Visual Basic for Applications)? Provide an example of a complex macro you created.
3. Describe a time when you had to merge and analyze data from multiple Excel workbooks. How did you ensure data integrity and accuracy?

🗄 SQL Questions
1. How would you design a database schema for a new e-commerce platform to efficiently handle large volumes of transactions and user data?
2. Describe a complex SQL query you wrote to solve a business problem. What was the problem, and how did your query help resolve it?
3. How do you ensure data integrity and consistency in a multi-user database environment? Explain the techniques and tools you use.

🐍 Python Questions
1. How would you use Python to automate data extraction from various APIs and combine the data for analysis? Provide an example.
2. Describe a machine learning project you worked on using Python. What was the objective, and how did you approach the data preprocessing, model selection, and evaluation?
3. Explain how you would use Python to detect and handle anomalies in a dataset. What techniques and libraries would you employ?

📈 Power BI Questions
1. How do you create interactive dashboards in Power BI that can dynamically update based on user inputs? Provide an example of a dashboard you built.
2. Describe a scenario where you used Power BI to integrate data from non-traditional sources (e.g., web scraping, APIs). How did you handle the data transformation and visualization?
3. How do you ensure the performance and scalability of Power BI reports when dealing with large datasets? Describe the techniques and best practices you follow.


💡 Tips for Success:
Understand the business context: Tailor your answers to show how your technical skills solve real business problems.
Provide specific examples: Highlight your past experiences with concrete examples.
Stay updated: Continuously learn and adapt to new tools and methodologies.

I have curated best 80+ top-notch Data Analytics Resources 👇👇
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02

Hope it helps :)
👍6
SQL Joins – Essential Concepts 🚀

1️⃣ What Are SQL Joins?

SQL Joins are used to combine rows from two or more tables based on a related column.

2️⃣ Types of Joins

INNER JOIN: Returns only matching rows from both tables.
SELECT * FROM TableA INNER JOIN TableB ON TableA.id = TableB.id;

LEFT JOIN (LEFT OUTER JOIN): Returns all rows from the left table and matching rows from the right table.
SELECT * FROM TableA LEFT JOIN TableB ON TableA.id = TableB.id;

RIGHT JOIN (RIGHT OUTER JOIN): Returns all rows from the right table and matching rows from the left table.
SELECT * FROM TableA RIGHT JOIN TableB ON TableA.id = TableB.id;

FULL JOIN (FULL OUTER JOIN): Returns all rows when there is a match in either table.
SELECT * FROM TableA FULL JOIN TableB ON TableA.id = TableB.id;


3️⃣ Self Join

A table joins with itself to compare rows.
SELECT A.name, B.name FROM Employees A JOIN Employees B ON A.manager_id = B.id;

4️⃣ Cross Join

Returns the Cartesian product of both tables (every row from Table A pairs with every row from Table B).
SELECT * FROM TableA CROSS JOIN TableB;

5️⃣ Joins with Multiple Conditions

Using multiple columns for matching.
SELECT * FROM TableA INNER JOIN TableB ON TableA.id = TableB.id AND TableA.type = TableB.type;

6️⃣ Using Aliases in Joins

Shortens table names for better readability.
SELECT A.name, B.salary FROM Employees A INNER JOIN Salaries B ON A.id = B.emp_id;

7️⃣ Handling NULLs in Joins

Use COALESCE(column, default_value) to replace NULL values.

IS NULL to filter unmatched rows in LEFT or RIGHT JOINs.


Free SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v

React with ❤️ for free resources

Share with credits: https://t.iss.one/sqlspecialist

Hope it helps :)
👍6🎉1
Complete SQL Topics for Data Analysts 😄👇

1. Introduction to SQL:
- Basic syntax and structure
- Understanding databases and tables

2. Querying Data:
- SELECT statement
- Filtering data using WHERE clause
- Sorting data with ORDER BY

3. Joins:
- INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN
- Combining data from multiple tables

4. Aggregation Functions:
- GROUP BY
- Aggregate functions like COUNT, SUM, AVG, MAX, MIN

5. Subqueries:
- Using subqueries in SELECT, WHERE, and HAVING clauses

6. Data Modification:
- INSERT, UPDATE, DELETE statements
- Transactions and Rollback

7. Data Types and Constraints:
- Understanding various data types (e.g., INT, VARCHAR)
- Using constraints (e.g., PRIMARY KEY, FOREIGN KEY)

8. Indexes:
- Creating and managing indexes for performance optimization

9. Views:
- Creating and using views for simplified querying

10. Stored Procedures and Functions:
- Writing and executing stored procedures
- Creating and using functions

11. Normalization:
- Understanding database normalization concepts

12. Data Import and Export:
- Importing and exporting data using SQL

13. Window Functions:
- ROW_NUMBER(), RANK(), DENSE_RANK(), and others

14. Advanced Filtering:
- Using CASE statements for conditional logic

15. Advanced Join Techniques:
- Self-joins and other advanced join scenarios

16. Analytical Functions:
- LAG(), LEAD(), OVER() for advanced analytics

17. Working with Dates and Times:
- Date and time functions and formatting

18. Performance Tuning:
- Query optimization strategies

19. Security:
- Understanding SQL injection and best practices for security

20. Handling NULL Values:
- Dealing with NULL values in queries

Ensure hands-on practice on these topics to strengthen your SQL skills.

Since SQL is one of the most essential skill for data analysts, I have decided to teach each topic daily in this channel for free. Like this post if you want me to continue this SQL series 👍♥️

Share with credits: https://t.iss.one/sqlspecialist

Hope it helps :)
👍101
📌 SQL Cheatsheet — Quick Reference Guide

Whether you’re just starting out with databases or you need a handy reminder while coding, keep this sheet in your pocket and query with confidence!

---

-- 1️⃣  Database Basics
CREATE DATABASE db_name;
USE db_name;

-- 2️⃣ Tables
CREATE TABLE table_name (col1 datatype, col2 datatype);
DROP TABLE table_name;
ALTER TABLE table_name ADD column_name datatype;

-- 3️⃣ Insert Data
INSERT INTO table_name (col1, col2) VALUES (val1, val2);

-- 4️⃣ Select Queries
SELECT * FROM table_name;
SELECT col1, col2 FROM table_name;
SELECT * FROM table_name WHERE condition;

-- 5️⃣ Update Data
UPDATE table_name SET col1 = value1 WHERE condition;

-- 6️⃣ Delete Data
DELETE FROM table_name WHERE condition;

-- 7️⃣ Joins
SELECT * FROM table1
INNER JOIN table2 ON table1.col = table2.col;
SELECT * FROM table1
LEFT JOIN table2 ON table1.col = table2.col;
SELECT * FROM table1
RIGHT JOIN table2 ON table1.col = table2.col;

-- 8️⃣ Aggregations
SELECT COUNT(*) FROM table_name;
SELECT SUM(col) FROM table_name;
SELECT col, COUNT(*) FROM table_name GROUP BY col;

-- 9️⃣ Sorting & Limiting
SELECT * FROM table_name ORDER BY col ASC; -- or DESC
SELECT * FROM table_name LIMIT n;

-- 🔟 Indexes
CREATE INDEX idx_name ON table_name (col);
DROP INDEX idx_name;

-- 1️⃣1️⃣ Subqueries
SELECT * FROM table_name
WHERE col IN (SELECT col FROM other_table);

-- 1️⃣2️⃣ Views
CREATE VIEW view_name AS
SELECT * FROM table_name;
DROP VIEW view_name;
👍173🎉3
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.
👍31
1. What is the difference between the RANK() and DENSE_RANK() functions?

The RANK() function in the result set defines the rank of each row within your ordered partition. If both rows have the same rank, the next number in the ranking will be the previous rank plus a number of duplicates. If we have three records at rank 4, for example, the next level indicated is 7. The DENSE_RANK() function assigns a distinct rank to each row within a partition based on the provided column value, with no gaps. If we have three records at rank 4, for example, the next level indicated is 5.

2. Explain One-hot encoding and Label Encoding. How do they affect the dimensionality of the given dataset?

One-hot encoding is the representation of categorical variables as binary vectors. Label Encoding is converting labels/words into numeric form. Using one-hot encoding increases the dimensionality of the data set. Label encoding doesn’t affect the dimensionality of the data set. One-hot encoding creates a new variable for each level in the variable whereas, in Label encoding, the levels of a variable get encoded as 1 and 0.

3. Explain the Difference Between Tableau Worksheet, Dashboard, Story, and Workbook in Tableau?

Tableau uses a workbook and sheet file structure, much like Microsoft Excel.
A workbook contains sheets, which can be a worksheet, dashboard, or a story.
A worksheet contains a single view along with shelves, legends, and the Data pane.
A dashboard is a collection of views from multiple worksheets.
A story contains a sequence of worksheets or dashboards that work together to convey information.

4. How can you split a column into 2 or more columns?

You can split a column into 2 or more columns by following the below steps:
1. Select the cell that you want to split. Then, navigate to the Data tab, after that, select Text to Columns. 2. Select the delimiter. 3. Choose the column data format and select the destination you want to display the split. 4. The final output will look like below where the text is split into multiple columns.

5. Do you wanna make your career in Data Science & Analytics but don't know how to start ?

https://t.iss.one/sqlspecialist/851

Here are free resources that will make you technically strong enough to crack any Data Analyst and also learn Pro Career Growth Hacks to land on your Dream Job.
👍4👏21
Interviewer: You mentioned that you had reduced cloud storage costs by 50%.

Candidate: Yeah!

Interviewer: How?

Candidate: 𝐃𝐄𝐋𝐄𝐓𝐄 * 𝐟𝐫𝐨𝐦 𝐂𝐔𝐒𝐓𝐎𝐌𝐄𝐑𝐒 𝐰𝐡𝐞𝐫𝐞 𝐢𝐝%𝟐==𝟎
🤣9👍3
Here are some essential SQL tips for beginners 👇👇

◆ Primary Key = Unique Key + Not Null constraint
◆ To perform case insensitive search use UPPER() function ex. UPPER(customer_name) LIKE ‘A%A’
◆ LIKE operator is for string data type
◆ COUNT(*), COUNT(1), COUNT(0) all are same
◆ All aggregate functions ignore the NULL values
◆ Aggregate functions MIN, MAX, SUM, AVG, COUNT are for int data type whereas STRING_AGG is for string data type
◆ For row level filtration use WHERE and aggregate level filtration use HAVING
◆ UNION ALL will include duplicates where as UNION excludes duplicates 
◆ If the results will not have any duplicates, use UNION ALL instead of UNION
◆ We have to alias the subquery if we are using the columns in the outer select query
◆ Subqueries can be used as output with NOT IN condition.
◆ CTEs look better than subqueries. Performance wise both are same.
◆ When joining two tables , if one table has only one value then we can use 1=1 as a condition to join the tables. This will be considered as CROSS JOIN.
◆ Window functions work at ROW level.
◆ The difference between RANK() and DENSE_RANK() is that RANK() skips the rank if the values are the same.
◆ EXISTS works on true/false conditions. If the query returns at least one value, the condition is TRUE. All the records corresponding to the conditions are returned.

Like for more 😄😄
2👍2
Key SQL Concepts for Data Analyst Interviews

1. Joins: Understand how to use INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN to combine data from different tables, ensuring you can retrieve the needed information from relational databases.

2. Group By and Aggregate Functions: Master GROUP BY along with aggregate functions like COUNT(), SUM(), AVG(), MAX(), and MIN() to summarize data and generate meaningful reports.

3. Data Filtering: Use WHERE, HAVING, and CASE statements to filter and manipulate data effectively, enabling precise data extraction based on specific conditions.

4. Subqueries: Employ subqueries to retrieve data nested within other queries, allowing for more complex data retrieval and analysis scenarios.

5. Window Functions: Leverage window functions such as ROW_NUMBER(), RANK(), DENSE_RANK(), and LAG() to perform calculations across a set of table rows, returning result sets with contextual calculations.

6. Data Types: Ensure proficiency in choosing and handling various SQL data types (VARCHAR, INT, DATE, etc.) to store and query data accurately.

7. Indexes: Learn how to create and manage indexes to speed up the retrieval of data from databases, particularly in tables with large volumes of records.

8. Normalization: Apply normalization principles to organize database tables efficiently, reducing redundancy and improving data integrity.

9. CTEs and Views: Utilize Common Table Expressions (CTEs) and Views to write modular, reusable, and readable queries, making complex data analysis tasks more manageable.

10. Data Import/Export: Know how to import and export data between SQL databases and other tools like BI tools to facilitate comprehensive data analysis workflows.

Here you can find SQL Interview Resources👇
https://t.iss.one/DataSimplifier

Share with credits: https://t.iss.one/sqlspecialist

Hope it helps :)
👍3🎉1
If you have ever given an SQL interview some of the questions would be definitely from below list :

1- How to find duplicates in a table
2- How to delete duplicates from a table
3- Difference between union and union all
4- Difference between rank,row_number and dense_rank
5- Find records in a table which are not present in another table
6- Find second highest salary employees in each department
7- Find employees with salary more than their manager's salary
8- Difference between inner and left join
9- update a table and swap gender values.

If not exact at least flavor of these questions are always asked in interviews irrespective of your experience level
👍4🎉2
Do not wait till you've mastered SQL till you apply to your first Data Analyst Job.

You can do both at the same time.
2