Database Design

RMAG news

Today we focused on database design, specifically exploring the concepts that drive relational databases.

What’s a relational database?

A relational database is a collection of tables that refer to one another. By including references to other tables, we can stick to one value per field while adding organized complexity to our entries.

What?

Today, we used a film database as an example. This database clearly had tables for films, actors, and directors.

You can’t just include a list of every actor that was in a movie in the films table, so you need a way to keep track of each film’s cast. This is where a one-to-many join table comes into play. You can create a table where each record is a film ID, an actor’s ID, and the name of the role they played. That way, you can keep track of the dozens of actors that make up a film’s cast without bogging down every table.

Conclusion

This form of database design applies to SQL, it’s been a while since I’ve studied SQL, so it was nice to get a refresher.