🔍
👶 Kids📝 Blog About Contact 🚀 Get Started Free

SQL – Introduction

Understand the core concepts of relational databases and how SQL interacts with them.

A relational database stores data in tables — just like a well-organized spreadsheet. Each table has columns (fields) that define the type of data, and rows (records) that hold the actual values. The magic happens when you relate tables to each other using shared keys, which lets you answer complex questions without duplicating data everywhere.

SQL was designed in the 1970s to be readable like plain English. The query SELECT name FROM students WHERE grade = 'A' reads almost like asking a question out loud: “Give me the names of students whose grade is A.” That readability is intentional — SQL was built for humans, not compilers.

Core Database Concepts

  • Table: A collection of related data (like a spreadsheet tab)
  • Row / Record: A single data entry
  • Column / Field: A category of data (name, age, city)
  • Primary Key: A unique identifier for each row
  • Foreign Key: A column that links to another table’s primary key

Try It Yourself — Interactive SQL Editor

Edit the query below and click Run Query ▶ to see live results powered by SQLite running directly in your browser.

SQLite – edit & run
Results
← Click Run Query ▶ to see results

Key Points

  • Relational databases avoid data duplication through normalization
  • Tables are linked via primary and foreign keys
  • SQL is the standard interface for all relational databases
  • SQLite (used here) is the most widely deployed database engine in the world

Pro Tip from CodesCompiler: The best way to learn SQL is to break things intentionally — modify the query above, change the WHERE conditions, try different columns. Every error teaches you something the docs cannot.

In the next lesson, we continue exploring SQL’s powerful feature set to build your database mastery.