I’m designing a website in which you can upload games with a description, etc, and store their rating. I am the only one who can provide a rating, so I won’t need a second DB for that.
However, there will be indefinite rounds of competitions, so I want to store the Round # in a column in the DataBase. The other requirement is that each round has it’s own information, so I’ll be making a second table with a Round_Number, then other fields like Description, Due Date, etc.
So this is my current DB schema idea:
Entries ( Comp #, Entry # AutoInc, Password,
Entry Date, Author Contact, Description, Screenshot, Website )
Competitions ( Comp #, Theme, Entries, Start Date, Finish Date, Prize )
So Entries can left join Competitions on Comp # to get extra information about its competition. Does these seem most efficient? There is no account system (or users table), each entry just gets its own password for editing.
I would think this through further. You could potentially have different screenshots for different Entries and competitions. You might as well define a relational schema and add user accounts for authentication purposes. Define three tables:
CREATE TABLE USERS_T(
account_id number,
username varchar,
password data_type,
author varchar,
....
)
CREATE TABLE COMPETITIONS_T(
comp_id number,
description varchar,
theme varchar,
#entries number- not needed, just count by id in ENTRIES_T table
start_date date,
finish_date date,
prize varchar,
...
)
CREATE TABLE ENTRIES_T(
account_id number,
comp_id number,
entry_date date,
descr varchar,
screenshot blob,
website varchar,
...
)
Add a primary key on the ENTRIES_T table:
PRIMARY KEY (account_id, comp_id)You could even take this further, define a themes table, comments table, etc. I think you’ll get the idea. Hope this helps. Goodluck!