Databases · Free practice
From E-R Diagram to MySQL
Six short lessons by Dr. J. Ubaldo Quevedo: map an E-R diagram to relations, then build it in MySQL Workbench with keys, NOT NULL, CHECK, SET and foreign keys, and see where a trigger is needed. Each part has unlimited practice.

Part 1: From E-R Diagram to Relations
entities, a 1-to-many relationship and a subclass · Where does the foreign key go? · Choose the keys

Part 2: Integrity Constraints and a New Database
constraints, CREATE DATABASE and USE · Match each constraint · Put the script in order

Part 3: Departments: Allowed Values with SET
primary key, varchar length and SET · Accepted or rejected? · Choose the column definition

Part 4: Employees: NOT NULL, CHECK and a Foreign Key
required columns, an age range and REFERENCES · Accepted or rejected? · Complete the CREATE TABLE

Part 5: Drivers: a Subclass of Employees
the subclass shares the employee's key · Map the subclass · PRIMARY KEY, FOREIGN KEY, UNIQUE or KEY?

Part 6: Inserting Rows, and Where Triggers Come In
INSERT, SELECT and BEFORE INSERT triggers · Which constraints need a trigger? · Will the trigger allow it?