user1902588
user1902588

Reputation: 53

Database tables and relationships

So the basic premises of my website is a professor rating site for my school . Each professor should be able to hold multiple entries in this rating system. I setup the category table with 3 fields, professorid which is a autoincrement (PK), the description is the name of the professor,I manully inserted each professor, the depart field is where I also manually inserted each department name. The second table professor which holds all the attributes of each professor and they should be able to have multiple entries with said attributes as the users enter. Now since I have the name and departments in one table how do I interact with the professor table so that each professor can have multiple entries?Any examples such as table markups or queries of interaction between both tables would help me alot. This is a project Im doing for practice over my winter break so thank you guys a lot! Im using PHP and myphpadmin

category table

professor table

Upvotes: 0

Views: 77

Answers (1)

David Aldridge
David Aldridge

Reputation: 52386

The entities you have here are Department, Professor, Course, Rating, and User, so I'd create a table to hold each of those. Each one gets a single column numeric primary key, the User and Professor get names and maybe some form of unique identifier in case of name clashes. The Courses and Departments have names. The Professor has a foreign key to a Department, and a Rating gets foreign keys to Professor, Course and User.

Upvotes: 3

Related Questions