Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to create a planner for teachers, as a personal project, where the Users (teachers) can click on a day (in a calendar, that's been already created) leading to a page where they can add a Subject, Hours, Class. All of this, along with the User_id and Day should be updated in the database.

Is what I'm doing the most efficient way?
Also, how can I add multiple Timetable entries for each user in a database?

What I have tried:

The most efficient way I can think of is to have the following tables:

Hours
----------
start_time (datetime)
end_time (datetime)

Subject
----------
name (str)

Class
----------
name (str)

Timetable
----------
user_id
hours_id
subject_id
class_id
day
Posted
Updated 24-Aug-16 21:18pm

1 solution

There could be two way to reach the solution here on the basis of front end developed to enter the details(by user).

1). If on front end dropdowns/Radiobuttons has been used to select Hours, Subject, class then your plan is perfect.

2). If user is entering details in textboxes manually then only one table can complete the task.
Timetable
----------
user_id
start_time (datetime)
end_time (datetime)
subject
class
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900