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 ππ
β 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 ππ
β€1π1
You don't need to know everything about every data tool. Focus on what will help land you your job.
For Excel:
- IFS (all variations)
- XLOOKUP
- IMPORTRANGE (in GSheets)
- Pivot Tables
- Dynamic functions like TODAY()
For SQL:
- Sum
- Group By
- Window Functions
- CTEs
- Joins
For Tableau:
- Calculated Columns
- Sets
- Groups
- Formatting
For Power BI:
- Power Query for data transformation
- DAX (Data Analysis Expressions) for creating custom calculations
- Relationships between tables
- Creating interactive and dynamic dashboards
- Utilizing slicers and filters effectively
I have created Resources for Data Analyst ππ
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
For Excel:
- IFS (all variations)
- XLOOKUP
- IMPORTRANGE (in GSheets)
- Pivot Tables
- Dynamic functions like TODAY()
For SQL:
- Sum
- Group By
- Window Functions
- CTEs
- Joins
For Tableau:
- Calculated Columns
- Sets
- Groups
- Formatting
For Power BI:
- Power Query for data transformation
- DAX (Data Analysis Expressions) for creating custom calculations
- Relationships between tables
- Creating interactive and dynamic dashboards
- Utilizing slicers and filters effectively
I have created Resources for Data Analyst ππ
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
β€4
Most people learn SQL just enough to pull some data. But if you really understand it, you can analyze massive datasets without touching Excel or Python.
Here are 8 game-changing SQL concepts that will make you a data pro:
π
1. Stop pulling raw data. Start pulling insights.
The biggest mistake? Running a query that gives you everything and then filtering it later.
Good analysts donβt pull raw data. They shape the data before it even reaches them.
2. βSELECT β is a rookie move.
Pulling all columns is lazy and slow.
A pro only selects what they need.
βοΈ Fewer columns = Faster queries
βοΈ Less noise = Clearer insights
The more precise your query, the less time you waste cleaning data.
3. GROUP BY is your best friend.
You donβt need 100,000 rows of transactions. What you need is:
βοΈ Sales per region
βοΈ Average order size per customer
βοΈ Number of signups per month
Grouping turns chaotic data into useful summaries.
4. Joins = Connecting the dots.
Your most important data is split across multiple tables.
Want to know how much each customer spent? You need to join:
βοΈ Customer info
βοΈ Order history
βοΈ Payments
Joins = unlocking hidden insights.
5. Window functions will blow your mind.
They let you:
βοΈ Rank customers by total purchases
βοΈ Calculate rolling averages
βοΈ Compare each row to the overall trend
Itβs like pivot tables, but way more powerful.
6. CTEs will save you from spaghetti SQL.
Instead of writing a 50-line nested query, break it into steps.
CTEs (Common Table Expressions) make your SQL:
βοΈ Easier to read
βοΈ Easier to debug
βοΈ Reusable
Good SQL is clean SQL.
7. Indexes = Speed.
If your queries take forever, your database is probably doing unnecessary work.
Indexes help databases find data faster.
If you work with large datasets, this is a game changer.
SQL isnβt just about pulling data. Itβs about analyzing, transforming, and optimizing it.
Master these 7 concepts, and youβll never look at SQL the same way again.
Join us on WhatsApp: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Here are 8 game-changing SQL concepts that will make you a data pro:
π
1. Stop pulling raw data. Start pulling insights.
The biggest mistake? Running a query that gives you everything and then filtering it later.
Good analysts donβt pull raw data. They shape the data before it even reaches them.
2. βSELECT β is a rookie move.
Pulling all columns is lazy and slow.
A pro only selects what they need.
βοΈ Fewer columns = Faster queries
βοΈ Less noise = Clearer insights
The more precise your query, the less time you waste cleaning data.
3. GROUP BY is your best friend.
You donβt need 100,000 rows of transactions. What you need is:
βοΈ Sales per region
βοΈ Average order size per customer
βοΈ Number of signups per month
Grouping turns chaotic data into useful summaries.
4. Joins = Connecting the dots.
Your most important data is split across multiple tables.
Want to know how much each customer spent? You need to join:
βοΈ Customer info
βοΈ Order history
βοΈ Payments
Joins = unlocking hidden insights.
5. Window functions will blow your mind.
They let you:
βοΈ Rank customers by total purchases
βοΈ Calculate rolling averages
βοΈ Compare each row to the overall trend
Itβs like pivot tables, but way more powerful.
6. CTEs will save you from spaghetti SQL.
Instead of writing a 50-line nested query, break it into steps.
CTEs (Common Table Expressions) make your SQL:
βοΈ Easier to read
βοΈ Easier to debug
βοΈ Reusable
Good SQL is clean SQL.
7. Indexes = Speed.
If your queries take forever, your database is probably doing unnecessary work.
Indexes help databases find data faster.
If you work with large datasets, this is a game changer.
SQL isnβt just about pulling data. Itβs about analyzing, transforming, and optimizing it.
Master these 7 concepts, and youβll never look at SQL the same way again.
Join us on WhatsApp: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
β€5