← From E-R diagram to MySQL: all 6 parts
Databases ยท Free practice
From E-R Diagram to MySQL, Part 5: Drivers: a Subclass of Employees
Watch the lesson by Dr. J. Ubaldo Quevedo, then practice as many times as you want: every New button gives you a new example.
1. Watch
- Drivers is a subclass of Employees, so a driver is identified by
eid char(9) primary key. - Add
foreign key (eid) references employees(eid)so every driver is an employee. key (dl_number)builds an index;unique (dl_number)also stops two drivers from sharing a license.
2. Try it yourself
Practice as many times as you want. Every New button builds a new diagram, new constraints or new data. It's free, and you don't need an account or a MySQL installation.
Correct so far: 0