iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

SQL Intro

SQL — Structured Query Language — is the language for reading, writing, and shaping data in a relational database. Almost every back-end you'll ever build sits on top of it.

What SQL does

JobStatement
Read rowsSELECT
Add rowsINSERT
Change rowsUPDATE
Remove rowsDELETE
Create / change schemaCREATE, ALTER, DROP
Control transactionsBEGIN, COMMIT, ROLLBACK

Where SQL runs

  • MySQL / MariaDB — the LAMP-stack default, behind countless web apps.
  • PostgreSQL — feature-rich open source DB; favoured for new projects.
  • SQLite — single-file DB embedded in phones, browsers, and Laravel test suites.
  • SQL Server — Microsoft's flagship database.
  • Oracle / Db2 — enterprise heavyweights.

One shape, many flavours

The core grammar — SELECT cols FROM table WHERE cond — is the same everywhere. Differences appear around date functions, paging (LIMIT vs TOP), and JSON support. This tutorial flags those forks where they matter.

Tip: If your laptop has no DB installed, the easiest playground is a SQLite file — one file, zero config. Most examples in this tutorial run unchanged on SQLite.

Example

Example
-- A query reads rows from a table
SELECT * FROM customers;
Try it Yourself »

Exercise

SQL stands for…

Query Language

Test yourself

Q1. SQL stands for…
Q2. Which DB is single-file and embedded?
Q3. Which statement removes rows from a table?

Discussion

Loading…