Search code examples
sqldatabasedatabase-designentity-relationshipentities

Entity Model Help


I have the following model in my database, but I'm a bit confused on what I should do.

If I have the Seat table how it is, it will end up creating so many rows, A - 1, A - 2 etc

How can I have this data split so it doesn't do this? I wanted the seatRow and seatNumber separate so I can easily match the values around the program.

Thanks

enter image description here


Solution

  • In the given scenario I don't see the problem with having a large number of rows in the seat table. Which is what I believe you are alluding to.

    Lets say you have a venue that has 1000 seats over 100 rows.

    • If you split the tables you have 1 table with 100 records and 1 table with 1000 records.
    • If you leave them together you have 1 table with 1000 records.

    If you followed all normalisation rules you would only end up merging the two tables back together. The design looks fine for what it is. Placing the SeatRow and Number together would have no bigger or smaller impact on the number of rows. It's a smart idea to leave them split. Microsoft SQL Server would have no problem with this architecture and indexing it for performance. For Access and other file based databases I'm not familiar with the indexing policies so I can't comment.