TGViewer
Data Analytics Data Analytics @sqlspecialist ยท 111K subscribers
Post #2376 7.46K
๐Ÿ”น Top 10 SQL Functions/Commands Commonly Used in Data Analysis ๐Ÿ“Š

1๏ธโƒฃ SELECT
โ€“ Used to retrieve specific columns from a table.
SELECT name, age FROM users;

2๏ธโƒฃ WHERE
โ€“ Filters rows based on a condition.
SELECT * FROM sales WHERE region = 'North';

3๏ธโƒฃ GROUP BY
โ€“ Groups rows that have the same values into summary rows.
SELECT region, SUM(sales) FROM sales GROUP BY region;

4๏ธโƒฃ ORDER BY
โ€“ Sorts the result by one or more columns.
SELECT * FROM customers ORDER BY created_at DESC;

5๏ธโƒฃ JOIN
โ€“ Combines rows from two or more tables based on a related column.
SELECT a.name, b.salary
FROM employees a
JOIN salaries b ON a.id = b.emp_id;

6๏ธโƒฃ COUNT() / SUM() / AVG() / MIN() / MAX()
โ€“ Common aggregate functions for metrics and summaries.
SELECT COUNT(*) FROM orders WHERE status = 'completed';

7๏ธโƒฃ HAVING
โ€“ Filters after a GROUP BY (unlike WHERE, which filters before).
SELECT department, COUNT(*) FROM employees GROUP BY department HAVING COUNT(*) > 10;

8๏ธโƒฃ LIMIT
โ€“ Restricts number of rows returned.
SELECT * FROM products LIMIT 5;

9๏ธโƒฃ CASE
โ€“ Implements conditional logic in queries.
SELECT name,
CASE
WHEN score >= 90 THEN 'A'
WHEN score >= 75 THEN 'B'
ELSE 'C'
END AS grade
FROM students;

๐Ÿ”Ÿ DATE functions (NOW(), DATE_PART(), DATEDIFF(), etc.)
โ€“ Handle and extract info from dates.
SELECT DATE_PART('year', order_date) FROM orders;


Join our WhatsApp channel: https://whatsapp.com/channel/0029VbAbnvPLSmbeFYNdNA29

๐Ÿ‘ Tap โค๏ธ for more!
  • โค 14
  • ๐Ÿ‘ 4
  • ๐Ÿ‘ 3
  • ๐Ÿ”ฅ 1
More from @sqlspecialist
  1. Oct 13, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 9 Guys, let's continue our Data Analyst Interviewโ€ฆ
  2. Oct 13, 2026๐—ง๐—ข๐—ฃ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐—ง๐—ข ๐—•๐—ข๐—ข๐—ฆ๐—ง ๐—ฌ๐—ข๐—จ๐—ฅ ๐—ฆ๐—ž๐—œ๐—Ÿ๐—Ÿ๐—ฆ ๐—œ๐—ก ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ! Explorโ€ฆ
  3. Oct 12, 20268๏ธโƒฃ You receive a dataset with inconsistent date formats. How would you clean it? Sample Aโ€ฆ
  4. Oct 12, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 7 Guys, let's continue our Data Analyst Interviewโ€ฆ
  5. Oct 12, 2026๐Ÿš€ ๐—ช๐—ต๐—ถ๐—ฐ๐—ต ๐—ง๐—ฒ๐—ฐ๐—ต ๐—ฆ๐—ธ๐—ถ๐—น๐—น ๐—ช๐—ถ๐—น๐—น ๐—ฌ๐—ผ๐˜‚ ๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ? Want to builโ€ฆ
  6. Oct 9, 2026โ€œHere, the data is sorted by the second column in descending order and the first five rowsโ€ฆ
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 โ†’