DEV Community 👩‍💻👨‍💻

Dwayne Lacey
Dwayne Lacey

Posted on • Updated on

Video Game DB PostgreSQL

Image description

Recently I've been spending some time working with PostgreSQL. While I have had experience building databases within Microsoft Excel, it's been an eye opener to see how everyday sites I use at work and home communicate with an underlying database. As a start to understanding how to build a proper database schema and automate data input into my database, I built a sample database for GameCube/PS2/Xbox games as well as a python script to automate the entry of my dataset rather than writing several insert clauses. I'd love to hear any feedback about how I could improve my schema. The SQL file and python script can be found below for those interested;

Top comments (2)

bias profile image
Tobias Nickel
  • if you use the genrename as foreignkey in game-genre, you can store the genrename in game table and drop the game-genre table. but if a game can have multiple genre(fantasy-strategy) you should use the ids in this table.
    • same with the game developers publishers table, or will one game have multiple dev-publusher combinations?
  • the game-to-console table you can keep, but please use id instead and name and title.
dlacey profile image
Dwayne Lacey Author

I know it's a late response but thank you so much for the feedback! I went back through and did what you said and switched to using ids for all of my foreign keys. For my game-genre and game-dev-publisher tables, there's games with multiple genres like you mentioned and games with different dev/publisher combinations so I updated the keys but ended up leaving the tables.

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.