Relational Database *help needed*

Watch this thread
Semper Fortis
Badges: 10
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#1
Report Thread starter 4 months ago
#1
Hi, so I'm building a revision program with the basic premise being that each user can select up to 4 courses. Each course will have a range of topics, and each topic will have a range of questions. Each question will have one answer.

Struggling to represent this as a relational database - how many tables will I need and what would the entity relationship diagram look like?

Any help would be greatly appreciated - thanks!
0
reply
Strange5050
Badges: 17
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#2
Report 4 months ago
#2
I would have the following:

A 'Courses' table - Example fields: ID, Name, Tutor etc...

A 'Topics' table - Example fields: ID, Name, CourseID etc.. The CourseID would act as a Foreign Key linking to the 'Courses' table, meaning that Courses and Topics have a 1 to many relationship.

A 'Questions' table. - Example fields: ID, Question, Answer, TopicID etc... The TopicID would act as a Foreign Key linking to the 'Topics' table, meaning that Topics and Questions have a 1 to many relationship.

This is of course assuming that Courses do not share topics, and topics do not share questions.
1
reply
Semper Fortis
Badges: 10
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#3
Report Thread starter 4 months ago
#3
(Original post by Strange5050)
I would have the following:

A 'Courses' table - Example fields: ID, Name, Tutor etc...

A 'Topics' table - Example fields: ID, Name, CourseID etc.. The CourseID would act as a Foreign Key linking to the 'Courses' table, meaning that Courses and Topics have a 1 to many relationship.

A 'Questions' table. - Example fields: ID, Question, Answer, TopicID etc... The TopicID would act as a Foreign Key linking to the 'Topics' table, meaning that Topics and Questions have a 1 to many relationship.

This is of course assuming that Courses do not share topics, and topics do not share questions.
Awesome - thanks! And how about if I want the system to store user progress for each topic?
0
reply
Strange5050
Badges: 17
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#4
Report 4 months ago
#4
(Original post by Semper Fortis)
Awesome - thanks! And how about if I want the system to store user progress for each topic?
That depends on how you want to measure progress. You could have a separate table that tracks UserID against each QuestionID that the user has completed.
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Year 12s - where are you at with making decisions about university?

I’ve chosen my course and my university (19)
32.2%
I’ve chosen my course and shortlisted some universities (22)
37.29%
I’ve chosen my course, but not any universities (2)
3.39%
I’ve chosen my university, but not my course (3)
5.08%
I’ve shortlisted some universities, but not my course (4)
6.78%
I’m starting to consider my university options (7)
11.86%
I haven’t started thinking about university yet (1)
1.69%
I’m not planning on going to university (1)
1.69%

Watched Threads

View All