Search code examples
sqlsql-serverdatabasediagram

SQL movie database diagram


Im working on a small school project where im creating a movie database in SQL. I've created the tables and was wondering if I will encounter any problems with the model i created.

Thanks in advance.

Current diagram enter image description here

Edit:

Here is the new diagram

enter image description here


Solution

  • MovieDetails is bad design. You need one row in MovieDetails per actor, while the director will be the same, which is data duplication. Instead, the Movie table should have a foreign key referencing director, then a MovieActor table should represent the many to many relationship between movies and actors.

    Technically, there's also no reason to have different tables for Directors and Actors since you have the same data in the tables. You could just as well have a Person table with both.