TGViewer
Data Science Portfolio - Kaggle Datasets & AI Projects | Artificial Intelligence Data Science Portfolio - Kaggle Datasets & AI Projects | Artificial Intelligence @dataportfolio · 38K subscribers
Post #772 1.31K
SQL Basics for Data Analysts

SQL (Structured Query Language) is used to retrieve, manipulate, and analyze data stored in databases.

1️⃣ Understanding Databases & Tables

Databases store structured data in tables.

Tables contain rows (records) and columns (fields).

Each column has a specific data type (INTEGER, VARCHAR, DATE, etc.).

2️⃣ Basic SQL Commands

Let's start with some fundamental queries:

🔹 SELECT – Retrieve Data

SELECT * FROM employees; -- Fetch all columns from 'employees' table SELECT name, salary FROM employees; -- Fetch specific columns 

🔹 WHERE – Filter Data

SELECT * FROM employees WHERE department = 'Sales'; -- Filter by department SELECT * FROM employees WHERE salary > 50000; -- Filter by salary 


🔹 ORDER BY – Sort Data

SELECT * FROM employees ORDER BY salary DESC; -- Sort by salary (highest first) SELECT name, hire_date FROM employees ORDER BY hire_date ASC; -- Sort by hire date (oldest first) 


🔹 LIMIT – Restrict Number of Results

SELECT * FROM employees LIMIT 5; -- Fetch only 5 rows SELECT * FROM employees WHERE department = 'HR' LIMIT 10; -- Fetch first 10 HR employees 


🔹 DISTINCT – Remove Duplicates

SELECT DISTINCT department FROM employees; -- Show unique departments 


Mini Task for You: Try to write an SQL query to fetch the top 3 highest-paid employees from an "employees" table.

You can find free SQL Resources here
👇👇
https://t.me/mysqldata

Like this post if you want me to continue covering all the topics! 👍❤️

Share with credits: https://t.me/sqlspecialist

Hope it helps :)

#sql
  • ❤ 2
More from @dataportfolio
  1. Oct 9, 2026How to Build an Impressive Data Analysis Portfolio As a data analyst, your portfolio is yo…
  2. Sep 20, 2026🌐 Data Science Tools & Their Use Cases 📊🔍 🔹 Python ➜ Core language for scripting, anal…
  3. Sep 19, 2026🤖 GigaChat 3.5 Reasoning 🎯 Thinks before answering: breaks problems into stages, builds…
  4. Sep 14, 2026✅ Data Science Interview Questions with Answers Part-4 • 31. Why is Python popular in data…
  5. Sep 14, 2026✅ Data Science Interview Questions with Answers Part-3 21. How do you handle missing value…
  6. Sep 14, 2026✅ Data Science Interview Questions with Answers Part-2 11. What is the difference between…
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 →