SQL & Databases: Tutorial, Projects & Course Syllabus
SQL querying, schema design, joins, indexing and database fundamentals.
Who this is for
Students, analysts and developers
Before you start
SQLite 3 or a compatible relational database; basic SELECT statements.
Find students with no completed lessons using SQL
A LEFT JOIN preserves unmatched rows from the left table.
Conditions on the joined table belong in ON when you need to preserve rows without matches. COUNT(column) ignores NULL values.
Set up your practice environment
Execute the following in a fresh local SQLite database, not a production database.
CREATE TABLE student (id INTEGER PRIMARY KEY, name TEXT);
CREATE TABLE lesson (id INTEGER PRIMARY KEY, student_id INTEGER, done INTEGER);
INSERT INTO student VALUES (1,'A'),(2,'B'),(3,'C');
INSERT INTO lesson VALUES (1,1,1),(2,1,1),(3,2,0);
SELECT s.name, COUNT(l.id) AS completed
FROM student s LEFT JOIN lesson l
ON s.id=l.student_id AND l.done=1
GROUP BY s.id,s.name ORDER BY s.id;Expected result
Walk through the example
- A has two matching completed lessons.
- B has a lesson, but it is incomplete; C has no lessons.
- COUNT(l.id) returns zero for the null-extended rows.
Common mistake
Moving l.done=1 into WHERE filters out unmatched rows and changes the intended outer join.
Try it yourself
Return only students with zero completed lessons.
Reveal suggested solution
Add HAVING COUNT(l.id)=0 after GROUP BY and before ORDER BY. The result is B and C.
Portfolio project brief
Build a synthetic learning reporting database with foreign keys, indexes and reports for attendance and outstanding lessons.
Acceptance criteria
- Test empty and unmatched groups.
- Use bound parameters for user input.
- Review query plans on realistic synthetic data.
This is a project specification, not a completed downloadable project. Build and test it independently or with a mentor.
Quick self-test
Choose one answer per question, then check your score. No sign-in required.
Complete learning roadmap
These are suggested course modules, not a claim that every module has a full tutorial on this site.
- 01Relational concepts
- 02SELECT & filtering
- 03Joins
- 04Aggregation
- 05Schema design
- 06Indexes, transactions & tuning
Learning outcomes
- Write SQL confidently
- Design relational schemas
- Understand performance basics
Continue with official documentation
Original PCDS learning material. Check the official documentation for your installed software version; these guides are not vendor-endorsed courses.
Need help learning SQL & Databases?
Choose a city and describe your learning goal in the enquiry form. Mention SQL & Databases, your current level and whether you prefer home or online learning. Tutor availability and pricing are subject to confirmation.
Browse SQL & Databases tutoring options in Mira Road or select a city above.
