Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Back to SQL Notes
Topic #101

What Is SQL? A Practical Introduction

SQL (Structured Query Language) is the language used to talk to a relational database — to create tables, insert data, and ask questions of that data ("give me every order over ₹5,000 placed last month").

What SQL Actually Does

Every relational database — MySQL, PostgreSQL, SQL Server, Oracle, SQLite — understands SQL. You use it to:

  • Define structure — create databases, tables, and relationships (DDL)
  • Insert / modify / remove data (DML)
  • Query data — filter, sort, join, aggregate (DQL)
  • Control access — who can read or write what (DCL)
  • Manage transactions — commit or roll back a set of changes (TCL)

A Quick Example

Sample table employees:

idnamedepartmentsalary
1AmanEngineering65000
2RiyaMarketing52000
3KaranEngineering71000
SELECT name, salary
FROM employees
WHERE department = 'Engineering'
ORDER BY salary DESC;

Output:

namesalary
Karan71000
Aman65000

That one statement reads like an English sentence — which is exactly why SQL has survived, largely unchanged in spirit, since 1974.

The Five Categories of SQL Commands

CategoryStands ForExample Commands
DDLData Definition LanguageCREATE, ALTER, DROP, TRUNCATE
DMLData Manipulation LanguageINSERT, UPDATE, DELETE
DQLData Query LanguageSELECT
DCLData Control LanguageGRANT, REVOKE
TCLTransaction Control LanguageCOMMIT, ROLLBACK, SAVEPOINT

SQL Is Not a Full Programming Language

SQL has no built-in concept of loops or general-purpose logic the way Python or Java does (procedural extensions like PL/pgSQL or T-SQL add that on top). It's a declarative language — you describe what result you want, not the step-by-step logic to get there. The database engine decides how to fetch it.

Where You'll Actually Use SQL

  • Data Analytics — pulling and aggregating data for dashboards and reports
  • Data Science — extracting and shaping data before modelling
  • Backend / Full Stack Development — every app with a database talks to it in SQL under the hood
  • Interviews — SQL rounds are standard for analyst, data science, and backend roles
Learning SQL for Data Analytics or Data Science? This entire notes section is built to take you from this first page to interview-ready. If you want structured, mentor-led practice instead of self-study, see CodingNow's Data Analytics and Data Science courses. Building backend systems instead? Check the Full Stack tracks — SQL is core to all of them.

Common Mistakes

  • Thinking SQL and a database (like MySQL) are the same thing — SQL is the language; MySQL/PostgreSQL/etc. are the engines that implement it
  • Assuming all databases run identical SQL — the core is standardized (ANSI SQL), but each vendor adds its own extensions and quirks

Interview Relevance

Q: "What's the difference between SQL and MySQL?" is a very common opener. Answer: SQL is the standard language for relational databases; MySQL is one specific database management system that implements SQL (with its own extensions).

Practice Question

Without running anything — which SQL command category (DDL/DML/DQL/DCL/TCL) does each of these belong to: CREATE TABLE, UPDATE, SELECT, GRANT, ROLLBACK?

Related SQL Notes

Want to go beyond the notes?

Join CodingNow's SQL course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →