We're making some improvements. Some features may be temporarily unavailable.
beginner15 min

Introduction to Databases

What is SQL, relational databases, and setting up your first table

What is a Database?

A database is an organized collection of data stored electronically. Think of it as a super-powered spreadsheet that can handle millions of rows efficiently.

Relational Databases

The most common type is the relational database — data is organized into tables (like sheets in a spreadsheet) with rows (records) and columns (fields). Tables can be related to each other through keys.

What is SQL?

SQL (Structured Query Language, pronounced "sequel" or "S-Q-L") is the standard language for working with relational databases. Every major database system speaks SQL: MySQL, PostgreSQL, SQLite, SQL Server, Oracle.

Creating Your First Table

Output
Run your code to see output here

Key Concepts

  • Table — a collection of related data (e.g., students)
  • Row — a single record (e.g., one student)
  • Column — a field in the record (e.g., name, email)
  • Primary Key — a unique identifier for each row (id)
  • Foreign Key — a column that references a primary key in another table

Why Use a Database?

  • Scale — handle millions of records efficiently
  • Querying — ask complex questions with SQL
  • Integrity — enforce rules (no duplicate emails, required fields)
  • Concurrent access — multiple users/apps can use it simultaneously
  • Backup & recovery — protect your data

Check Your Understanding

What does SQL stand for?

In the next lesson, we'll learn how to retrieve exactly the data you need with SELECT, WHERE, and more.

Questions & Discussion

Sign in to ask a question or join the discussion.

Loading comments...