
Already know some of this? A 2-minute test skips the lessons you know.
Take the placement testA free 24-lesson course built from CodeWithHarry's 3h 58m of YouTube video. 3 days at 90 minutes a day, with study notes and a quiz in every lesson. A 2-minute placement test skips what you already know.
Taught by CodeWithHarry on YouTube. Videos play in YouTube's own player, so the creator keeps every view.
Explain the purpose of a database, the role of a DBMS, and the difference between relational (MySQL, PostgreSQL) and non-relational (MongoDB) systems.
Write CREATE TABLE statements with columns, data types (INT, VARCHAR, ENUM, DATE, TIMESTAMP), and constraints (PRIMARY KEY, NOT NULL, UNIQUE, DEFAULT).
Define integer, string, enum, date, timestamp types; apply PRIMARY KEY, NOT NULL, UNIQUE, CHECK, and DEFAULT constraints; modify columns with ALTER TABLE.
Insert single and multiple rows with INSERT INTO ... VALUES, specify columns for partial inserts, and verify results with SELECT.
Filter rows with WHERE (comparison, BETWEEN, IN, IS NULL), combine conditions with AND/OR, sort with ORDER BY ASC/DESC, and paginate with LIMIT/OFFSET.
Change column values with UPDATE table SET column=value WHERE condition; avoid omitting WHERE to prevent mass updates.
Remove specific rows with DELETE FROM table WHERE condition; use TRUNCATE TABLE to delete all rows quickly (non-rollbackable).
Enforce uniqueness on email, prevent NULL on name, add CHECK constraint for date-of-birth > 1920, and test constraint violations on insert.
Use COUNT, MIN, MAX, SUM, AVG with GROUP BY; string functions LOWER, CONCAT; date functions YEAR, DATEDIFF; math ROUND, FLOOR, CEIL, MOD; conditional IF/CASE.
Disable auto-commit (SET autocommit=0), run multiple DML statements, then COMMIT to finalize or ROLLBACK to undo; understand transaction boundaries.
Define PRIMARY KEY with AUTO_INCREMENT; change the next auto-increment value with ALTER TABLE ... AUTO_INCREMENT=1000; contrast with multiple UNIQUE constraints.
Create a child table (addresses) with a FOREIGN KEY referencing users(id); define ON DELETE CASCADE, SET NULL, or RESTRICT behavior.
Combine users and addresses with INNER JOIN (matching only), LEFT JOIN (all users, NULL for missing addresses), and RIGHT JOIN (all addresses).
Merge result sets from similar tables (users, admin_users) with UNION (distinct) or UNION ALL (keep duplicates); apply ORDER BY and LIMIT to combined results.
Join a table to itself using aliases (A, B) to resolve referral IDs into referrer names; use LEFT JOIN to include users with no referrer.
Create virtual tables with CREATE VIEW view_name AS SELECT ...; query views like tables; they reflect live base-table data and simplify complex queries.
Create single-column (CREATE INDEX idx_email ON users(email)) and multi-column indexes; understand index order importance; drop indexes; trade-off: faster reads, slower writes.
Nest a query inside another (SELECT * FROM users WHERE salary > (SELECT AVG(salary) FROM users)); use subqueries in SELECT, WHERE, and FROM clauses.
Aggregate with GROUP BY; filter groups with HAVING (not WHERE); compute subtotals and grand totals with WITH ROLLUP (weighted average).
Create reusable logic blocks with CREATE PROCEDURE using custom DELIMITER; accept IN parameters; execute multiple statements (INSERT, SELECT); CALL procedure_name(args).
Automate actions on INSERT/UPDATE/DELETE with CREATE TRIGGER ... BEFORE/AFTER ... FOR EACH ROW; reference NEW.column and OLD.column; drop with DROP TRIGGER.
Use AND/OR/NOT logic, LIKE with % and _ wildcards, LIMIT/OFFSET for pagination (or LIMIT offset, count); leverage AI tools for syntax lookup and continued learning.