SQL | Data Analytics | AI
1.9K subscribers
97 photos
9 files
66 links
SQL, Big Query, Looker and DBT for Data Analytics.

https://medium.com/@khavanski
Download Telegram
๐Ÿ“– SQL For Everything
โค2
Must-know Pandas Functions for Data Analysis
๐Ÿ‘5โค4
Here is a powerful ๐—œ๐—ก๐—ง๐—˜๐—ฅ๐—ฉ๐—œ๐—˜๐—ช ๐—ง๐—œ๐—ฃ to help you land a job!

Most people who are skilled enough would be able to clear technical rounds with ease.

But when it comes to ๐—ฏ๐—ฒ๐—ต๐—ฎ๐˜ƒ๐—ถ๐—ผ๐—ฟ๐—ฎ๐—น/๐—ฐ๐˜‚๐—น๐˜๐˜‚๐—ฟ๐—ฒ ๐—ณ๐—ถ๐˜ rounds, some folks may falter and lose the potential offer.

Many companies schedule a behavioral round with a top-level manager in the organization to understand the culture fit (except for freshers).

One needs to clear this round to reach the salary negotiation round.

Here are some tips to clear such rounds:

1๏ธโƒฃ Once the HR schedules the interview, try to find the LinkedIn profile of the interviewer using the name in their email ID.

2๏ธโƒฃ Learn more about his/her past experiences and try to strike up a conversation on that during the interview.

3๏ธโƒฃ This shows that you have done good research and also helps strike a personal connection.

4๏ธโƒฃ Also, this is the round not just to evaluate if you're a fit for the company, but also to assess if the company is a right fit for you.

5๏ธโƒฃ Hence, feel free to ask many questions about your role and company to get a clear understanding before taking the offer. This shows that you really care about the role you're getting into.
โค4
SQL โ‡† Python โ‡† Excel
โค8๐Ÿ‘2๐Ÿ‘2๐Ÿคฏ1
โœ…SQL Checklist for Data Analysts ๐Ÿ“€๐Ÿง 
1. SQL Basicsโฆ SELECT, WHERE, ORDER BY
โฆ DISTINCT, LIMIT, BETWEEN, INโฆ Aliasing (AS)
2. Filtering & Aggregation
โฆ GROUP BY & HAVINGโฆ COUNT(), SUM(), AVG(), MIN(), MAX()
โฆ NULL handling with COALESCE, IS NULL

3. Joins
โฆ INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN
โฆ Joining multiple tables
โฆ Self Joins

4. Subqueries & CTEs
โฆ Subqueries in SELECT, WHERE, FROM
โฆ WITH clause (Common Table Expressions)
โฆ Nested subqueries

5. Window Functions
โฆ ROW_NUMBER(), RANK(), DENSE_RANK()
โฆ LEAD(), LAG()
โฆ PARTITION BY & ORDER BY within OVER()

6. Data Manipulation
โฆ INSERT, UPDATE, DELETE
โฆ CREATE TABLE, ALTER TABLE
โฆ Constraints: PRIMARY KEY, FOREIGN KEY, NOT NULL

7. Optimization Techniques
โฆ Indexes
โฆ Query performance tips
โฆ EXPLAIN plans

8. Real-World Scenarios
โฆ Writing complex queries for reports
โฆ Customer, sales, and product data
โฆ Time-based analysis (e.g., monthly trends)

9. Tools & Practice Platforms
โฆ MySQL, PostgreSQL, SQL Server
โฆ DB Fiddle, Mode Analytics, LeetCode (SQL), StrataScratch

10. Portfolio & Projects
โฆ Showcase queries on GitHub
โฆ Analyze public datasets (e.g., ecommerce, finance)
โฆ Document business insights
โค6
Why Do Investors Care So Much About LTV:CAC?


https://a16z.com/why-do-investors-care-so-much-about-ltvcac
โค6
Recursive CTE in SQL
โค6๐Ÿ‘2๐Ÿ‘1
๐Ÿš€ Essential SaaS Metrics: What Really Matters?

A SaaS business runs on subscriptions.
Its health = predictable revenue + strong retention + efficient growth.

Here are the core metrics every SaaS founder, operator, and investor should track.

---

## ๐Ÿ’ฐ Core Financial Metrics

๐Ÿ”น MRR / ARR โ€” Monthly / Annual Recurring Revenue
Your primary indicator of predictable revenue.

๐Ÿ”น ARPU โ€” Average Revenue Per User
How much revenue each customer generates on average.

๐Ÿ”น ARR Growth Rate โ€” Percentage increase in ARR
Shows how fast the company is scaling.

๐Ÿ”น Expansion Revenue โ€” Upsells, upgrades, add-ons
The healthiest form of growth comes from existing customers.

๐Ÿ”น Gross Profit Margin
Revenue minus cost of goods sold. Strong SaaS businesses typically operate at 70โ€“90%.

---

## ๐Ÿ” Retention & Customer Success Metrics

๐Ÿ”น Churn Rate (Logo & Revenue)
Percentage of customers or revenue lost during a period. Lower = stronger stability.

๐Ÿ”น Net Dollar Retention (NDR / NRR)
Revenue retained from existing customers including upgrades/downgrades.
If >100%, your revenue grows even without acquiring new customers.

๐Ÿ”น NPS (Net Promoter Score)
Measures customer loyalty and likelihood to recommend.

๐Ÿ”น Usage / Activation Rate
How actively customers use your product. Low usage today = churn tomorrow.

---

## ๐Ÿ“ˆ Acquisition & Efficiency Metrics

๐Ÿ”น CAC (Customer Acquisition Cost)
Total sales & marketing spend required to acquire a new customer.

๐Ÿ”น LTV / CLV (Customer Lifetime Value)
Total revenue expected from a customer over their lifecycle.

๐Ÿ”น LTV-to-CAC Ratio
Measures ROI on acquisition. Ideal benchmark: 3:1 or higher.

๐Ÿ”น CAC Payback Period
Months required to recover acquisition costs. Ideally < 12 months.

๐Ÿ”น Rule of 40
Revenue growth rate + profit margin should exceed 40%.
A strong benchmark for balanced growth.

---

## ๐Ÿ”ฅ Additional Stability Metrics

โ€ข Cash Runway โ€” How long the company can operate before running out of cash
โ€ข Customer Concentration โ€” Revenue dependence on a few major customers
โ€ข Burn Multiple โ€” Efficiency of growth relative to cash burned

---

๐Ÿ“Œ SaaS isnโ€™t just about growth.
Itโ€™s about *predictable, efficient, and sustainable growth.*

Track the right metrics. Build with discipline. Scale with confidence.
โค5
SQL execution order๐Ÿ“ˆ

One day at an interview you will be asked this question
โค4๐Ÿ‘2
โค3
What is difference between COUNT and COUNT (DISTINCT) ?
๐Ÿฅฐ3๐Ÿ’ฉ1
AnalyticsEngineeringSQLdbt.pdf
10.3 MB
Rui Machado / Analytics Engineering with SQL and dbt
๐Ÿ‘4โค2๐Ÿ”ฅ2๐Ÿ‘2๐Ÿ˜1
Key Differences between List and Tuple in #Python
โค6
๐Ÿ”ฐ The 4 Types of SQL Joins

SQL joins combine rows from two or more tables based on a related column. Here are the different types of joins you can use:

1โƒฃ Inner Join
Returns only the matching rows between both tables. It keeps common data only.

๐Ÿ”ข Left Join
Returns all rows from the left table and matching rows from the right table. If a row in the left table doesnโ€™t have a match in the right table, the right tableโ€™s columns will contain NULL values in that row.

๐Ÿ”ข Right Join
Returns all rows from the right table and matching rows from the left table. If no matching record exists in the left table for a record in the right table, the columns from the left table in the result will contain NULL values.

๐Ÿ”ข FULL OUTER JOIN
Returns all rows from both tables, filling in NULL for missing matches.
๐Ÿ‘6โค2
๐Ÿ”ฅ Top 8 SQL Tricks Every Data Person Should Know

1๏ธโƒฃ QUALIFY instead of subqueries
Filter window function results directly โ€” no wrapping needed:
QUALIFY ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY created_at DESC) = 1

2๏ธโƒฃ EXCEPT in SELECT * (BigQuery)
Grab everything but the noise:
SELECT * EXCEPT (raw_payload, _synced_at) FROM t

3๏ธโƒฃ COUNT(DISTINCT x) vs APPROX_COUNT_DISTINCT(x)
On billions of rows, approximate counts are 10x faster and usually accurate within ~1%.

4๏ธโƒฃ NULL-safe comparisons
a = b is NULL when either side is NULL. Use IS NOT DISTINCT FROM (or <=> in MySQL) to compare safely.

5๏ธโƒฃ Window frames are not all the same
ORDER BY inside OVER() silently changes the default frame to RANGE UNBOUNDED PRECEDING โ†’ CURRENT ROW. Running totals? Fine. Full-partition aggregates? Bug.

6๏ธโƒฃ Anti-joins done right
NOT EXISTS beats NOT IN โ€” the latter returns nothing if the subquery contains a single NULL. ๐Ÿ˜ฌ

7๏ธโƒฃ GROUP BY ALL
Stop counting column positions. Group by every non-aggregated column automatically (BigQuery, Snowflake, DuckDB).

8๏ธโƒฃ CTEs โ‰  optimization
In some engines CTEs are inlined, in others materialized. If a CTE is referenced twice and it's heavy โ€” check the query plan, don't assume.



#SQL #BigQuery #DataEngineering #Analytics
โค5๐Ÿ‘2๐Ÿ”ฅ1
Channel name was changed to ยซSQL | Data Analytics | AIยป