I have 2 tables: Lecturer and Department.
The Lecturer table has these columns:
id, email, phone, expertise, dept_id.
The Department table has these:
dept_id, dept_name, dept_code, dept_program.
Sample data is as follows:
Lecturer table
(id=1, email= a@a.com, phone= 9999, expertise= multimedia and programming, dept_id=1)
Department table
(id=1, dept_name=Computer Science, dept_code=CS, dept_program=Bachelor of Comp Science)
The expertise column has several values, and some lecturers might have more than 5 expertise areas, so I think I should create another table for expertise alone. But how to insert multiple attributes of expertise into lecturer table?
You can’t really do this by changing only the
lecturertable. Normally, you handle multivalued attributes by creating seperate tables. In this case, you would create one table to hold expertise attributes and another one to associate expertises with lecturers. As a bonus, that’ll also help to prevent inconsistencies when it comes to descriptions of expertise.The resulting tables might look like this: