Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Course Queries Syllabus Queries 2 years ago
Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I'm storing data which logs whether or not a user has logged their attendance for a given day. Some days are unimportant (holiday, weekend), so those are also stored.
The two requirements are that:
Right now it seems like I'm faced with two options for how the data should be stored, each with their own advantages/disadvantages:
Option 1: Two Tables
Table calendar - Tracks days to be not counted
calendar
date | log | -----------+-----| 2019-01-10 | DNL | // "Do Not Log" - holiday etc. 2019-01-12 | NB | // "Non-business day" 2019-01-13 | NB |
Table logs - Tracks successful attendance logs
logs
user_id | date | --------+------------| 1 | 2019-01-08 | 1 | 2019-01-09 | 2 | 2019-01-09 | // It's implied that user #2 missed their log on Jan. 8
Advantages:
Challenges:
Option 2: One Table (What I've tried)
Table calendar - Tracks logs and days to be counted and not counted
date | user_id | log | 2018-01-09 | 1 | 1 | // Counted, logged 2019-01-10 | 1 | DNL | // Not counted 2019-01-11 | 1 | NB | // Not counted 2019-01-09 | 2 | NULL | // Counted, missed log
log
NULL
My question is this: Is there a way to either use Option 1 and somehow encode the number of missed logs, or is there some other way of storing the data that meets both requirements? I've tried using Option 2, although scaling has become quite a challenge. Thanks in advance for any advice.
Here's a few cases to spoil both designs: Teachers get sick. Unions go on strike. Servers go down. Snow days happen.
Class happens when it happens regardless of what the syllabus says. So rather than pretend we know what the future holds, simply record events as they happen.
Events:
absences = class days - attendances
Advantage: design does not require use of confusing misleading non-descriptive nulls.
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Course Queries 4 Answers
Course Queries 5 Answers
Course Queries 1 Answers
Course Queries 3 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.