SQL Home, Introduction & Syntax
This Rishtaara SQL course teaches you step by step — from your first SELECT to building real reports on a sample school database.
SQL HOME — what this course covers
This Rishtaara SQL course teaches you step by step — from your first SELECT to building real reports on a sample school database.
SQL (Structured Query Language) is the standard language for talking to relational databases like MySQL, PostgreSQL, SQL Server, and SQLite.
Real-life example: SQL is like asking a librarian precise questions — 'Show me all books by author X published after 2020' — instead of reading every shelf yourself.
- Part 1 (lessons 1–16): queries — SELECT, JOINs, GROUP BY, and more
- Part 2 (lessons 17–30): databases — CREATE TABLE, constraints, indexes, security
- Practice with /mcq/sql-mcq when you finish a topic block
Introduction — what is SQL?
SQL lets you store, read, update, and delete data in tables. Analysts use it for reports. Developers use it to power apps. Data teams use it every day.
A relational database stores data in tables (rows and columns). Tables link through keys — for example, a student_id in an enrollments table points to a row in students.
Real-life example: A school office keeps a paper register for each class. SQL is the digital register that never loses pages and answers questions in seconds.
-- students: one row per student
CREATE TABLE students (
student_id INT PRIMARY KEY,
full_name VARCHAR(100),
grade_level INT,
city VARCHAR(80)
);
-- courses: subjects offered
CREATE TABLE courses (
course_id INT PRIMARY KEY,
course_name VARCHAR(100),
credits INT
);
-- enrollments: who takes what
CREATE TABLE enrollments (
enrollment_id INT PRIMARY KEY,
student_id INT,
course_id INT,
score DECIMAL(5, 2)
);SQL Syntax — rules of the language
SQL statements end with a semicolon (;). Keywords like SELECT and FROM are not case-sensitive, but writing them in UPPERCASE makes queries easier to read.
Strings use single quotes: 'Delhi'. Numbers do not need quotes. Table and column names usually avoid spaces; use snake_case like full_name.
Real-life example: SQL syntax is like a fixed form at the bank — fill in the right boxes (SELECT columns, FROM table) in the right order, or the clerk rejects it.
SELECT full_name, city
FROM students
WHERE grade_level = 10;-- Read data
SELECT * FROM students;
-- Add data
INSERT INTO students (student_id, full_name, grade_level, city)
VALUES (1, 'Aisha Khan', 10, 'Delhi');
-- Change data
UPDATE students SET city = 'Mumbai' WHERE student_id = 1;
-- Remove data
DELETE FROM students WHERE student_id = 1;