TGViewer
Machine Learning & Artificial Intelligence | Data Science Free Courses Machine Learning & Artificial Intelligence | Data Science Free Courses @datasciencefree Β· 68.6K subscribers
Post #2293 9.28K
βœ… SQL Clauses Cheat Sheet! πŸ§ πŸ“˜

1️⃣ SELECT – Pick the columns you want
SELECT name, age FROM students;


2️⃣ WHERE – Filter rows based on condition
SELECT * FROM orders WHERE status = 'delivered';


3️⃣ ORDER BY – Sort the results
SELECT * FROM products ORDER BY price DESC;


4️⃣ GROUP BY – Group rows for aggregation
SELECT department, COUNT(*) FROM employees GROUP BY department;


5️⃣ HAVING – Filter groups after aggregation
SELECT department, COUNT(*) FROM employees  
GROUP BY department HAVING COUNT(*) > 5;


6️⃣ LIMIT / TOP – Restrict number of rows 
-- MySQL/PostgreSQL
SELECT * FROM sales LIMIT 10;

-- SQL Server
SELECT TOP 10 * FROM sales;


7️⃣ DISTINCT – Remove duplicates
SELECT DISTINCT city FROM customers;


8️⃣ BETWEEN – Filter within a range
SELECT * FROM invoices WHERE amount BETWEEN 100 AND 500;


9️⃣ IN – Match any from a list
SELECT * FROM users WHERE role IN ('admin', 'manager');


πŸ”Ÿ ALIAS (AS) – Rename columns or tables
SELECT name AS EmployeeName FROM employees;


πŸ’‘ Tip: Combine clauses for powerful queries!

β™₯️ Double Tap if you found this helpful!
  • ❀ 37
  • πŸ‘Œ 5
  • πŸ‘ 1
More from @datasciencefree
  1. Sep 27, 2026Machine Learning Roadmap | |-- Fundamentals | |-- Mathematics | | |-- Linear Algebra | | |…
  2. Sep 24, 2026πŸš€ 𝐁𝐞𝐜𝐨𝐦𝐞 𝐚𝐧 π€πˆ π„π§π π’π§πžπžπ« 𝐒𝐧 πŸπŸŽπŸπŸ” 🎯 Choose Your Learning Track: πŸ’»β€¦
  3. Sep 23, 2026Machine Learning Roadmap
  4. Sep 23, 2026SQL & Python Cheatsheet for Beginners ❀️
  5. Sep 22, 2026#Ad #AI_Models πŸ”₯ GigaChat 3.5 Reasoning [Open-Source] ℹ️ Overview: New LLM that thinks be…
  6. Sep 22, 2026βœ… Programming Languages, Libraries & Tools Every Tech Field Uses πŸ‘¨β€πŸ’»πŸš€ 🧠 DATA SCIENCE &…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook β†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 β†’