Good evenings. I trying to make simple Attendance Managment Sytem using MySQL. My goal is teacher can mark student attendance in given day and student can see his/her attendance. But i am having problem about design. First, let me explian my system.
Here is my plannig....
System has Student,Teacher and Courses.
A Teacher can teach multiple Course.
A Course can have multiple Teacher.
A Course dividen in Groups, for example 1 Course have group 1 and group 2 in different times.
A Teacher can teach Course in Multiple Groups but a Group can have only one teacher.
Student can have only one group in just one Course.
A Group can have multiple students.
A Group can occur in different time for example Group 1 has lecture in monday and tuesday.
Teacher can mark student attendance in his Course and Group
I have confusion in this system.First,i could not figure out where i should connect attendance table, because i wanted to student can see his attendance day by day so i connected to group_dates and as you can see attendance table have many attributes so it will be affect performance. Second one is should i connect student to course_groups alone or should i connect it both course_groups and courses like in the example?
I am very new to MySQL and design, if you can give advice i will be very appriciated
Related
Introduction
Currently I'm designing a database structure for my university. I want to store student personal data and staff (non student) data. FYI, the total number of student's records is about 136K, incrementing about 10K each year. On the other hand, staff's records is only about 3K (slow incrementing).
Problem
I argued with my friend about three options below:
Create Person table, staff table and student table. The last two is inherited from Person table.
Create Person_staff table, staff table (inherit from person_staff). Then, same goes to student, create Person_student, and student table (inherited from Person_student).
Create Staff and Student table.
My opinion, option #1 is the best choice. But my friend argued that if we do that (option #1), we will have slow query when we need to retrieve only staff data, because had to join with Person table which is filled with student records (significantly larger than staff records).
Any advice for me? Thanks in advance.
EDIT: FYI, we need to be able to track each person (whether staff or student) who was once a student or staff.
I'm a beginner in SQL and Database management, I have an idea that I don't know how to model into database tables.
I have these tables : users, orders, bills, lessons, tickets, coaches.
Lessons are posted by coaches.
The users are able to order lessons.
A bill is registered after the order.
The users are also able to order tickets.
A ticket gives access to a lesson.
When users buy a ticket, the coache benefit or half or the ticket price.
So when a user buy a ticket that costs 6$ for a specific lesson, the coache who owns the lesson will get 3$.
Do I need another bills table for the coaches? or I can use the same bills table to register their gains from the purchased lessons?
I really have no idea how to achive my List of ideas above, sorry.
For now I've just managed to do this, I don't know how to complete the rest of the DB.
|bills|<--|orders| *<------ |users|
|
v
*
|order_lesson|
*
/\
|
|lessons| *<----- |coaches|
I can't ask you for a complete answer, but I really need some explication or guidance.
From what I can tell the ticket is no different then a regular order and can be placed with the orders as the only difference is the money the coach gets. So maybe just a column in the orders table would signify the type of order.
|bills|<--|orders|<----|users|
/ \
|
|lessons|<---|coaches|
I am currently having an issue with my database that requires supervisors to monitor a group with students in the group.
Entites: Student, Supervisor and Group
A Student can only be in one group but the group can have many students
A Group can have only one Supervisor but Supervisors can have Many Groups
I hope this Image will explain more:
Here how it is supposed to be according to your data model explained.
As explained, removed StudentID from Groups and added GroupID into Students since Groups can have MANY students but Student can be assigned to only ONE group.
SupervisorID should stay in Groups since Groups can have only ONE Supervisor.
my apologies for asking it very uncommon question.
I am using mysql and i have database which has the following tables
course
course_subject
subject
student
student_course
department
employee
employee_role
personal_information
attendance
attendance_symbol
the above database is linked to each other(relational database)... it is fine until when it comes to attendance... when a student enroll to a course it automatically enroll to the subjects that are related to that particular course..
but when it comes to attendance as whole i have some issues which.. but first lets let me tell you folks what i have assumed about attendance which may not be right but that includes:
1. when student enroll to a course it automatically enroll to its subjects
2. each course has their register students
3. student enroll on daily basis
I cant seems to work it out how cope with the situation... i just need help to create a table that will mark student attendance everyday... once marked dont know may be stored another table or how... need help
and student get it attendance everyday...
but when it comes to attendance i cant work it out where should i have attendance table... should i link attendance table to student_course or where?
To save the information of whether a Student attended to a Subject on a certain date, you should have a table like the following:
Attendance (student_id, subject_id, date)
And then store when the student attended. That way, it will be related to your Student, Subject, but also to student_course as the subject is part of the course. Or you can just store course_id instead of subject_id.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I'm trying to make a application for keeping attendance for a relative's martial arts studio. I've tried looking around for some similar examples, but I couldn't find any specific or clear enough ones for this kind of application.
At the moment, I am using two tables, one for keeping student information, students(id, first_name, last_name, email, ...), and another table for attendance by the weeks in a year, attendance(id, week_1, week_2, week_3, ...). I am trying to change it to keep attendance by days instead, but can't seem to think of a good approach since I'm still kind of new to MySQL.
I am trying to make it so it is possible to see the attendance in a calendar-like format. It probably would be bad to just make columns for 365 days... and same with having a table for each month. I've noticed some similar applications just keep track of the dates, and store that in the database. Would this approach be better? Or, is there some other better approach to designing this kind of database? Thanks in advance.
In martial arts, instructors are students too -- so the Instructor table is sub-typed to the Student table. All common fields are in the Student table and only columns specific to instructors are in the Instructor table.
The Art table has list of arts that the school offers (judo, karate ...).
The school may have several rooms, these are listed in the Room table.
ClassSchedule describes the published schedule of classes that the school offers.
Attendance is captured in the Attendance table.
One row in the Calendar table is one calendar day (date). The table has date-properties like DayOfWeek, MonthName, MonthNumberInYear etc.
One row in the TimeTable is one minute of a day, like 7:05.
Calendar and TimeTable allow for easy attendance reporting by date/time, for example
-- Attendance of judo morning classes
-- for the first three months of the year 2010
-- by day of a week (Sun, Mon, Tue, ..)
select
DayOfWeek
, count(1) as Students
from ClassSchedule as a
join Calendar as b on b.CalendarId = a.CalendarId
join TimeTable as c on c.TimeID = a.StartTimeId
join Attendance as d on d.ClassId = a.ClassID
join Art as e on e.ArtId = a.ArtID
where ArtName = 'judo'
and Year = 2010
and MonthNumberInYear between 1 and 3
and PartOfDay = 'morning'
group by DayOfWeek ;
Hope this gets you started.
Attendance should have id, student_id and date. This is all you need to record when students attended. if you want to know how many students attended on a specific date (and who) you run a query for that specific date or date range.
You could also create a lesson table, in which case the attendance table would be
id, student_id and lesson_id
the lesson table could be
id, held_on_date
unless you need to add more columns to the lesson table, I think it is overkill.
Step back a little, you have two types of entities:
a person [like a student]
events [like a class]
Think of any entity as something that exists in the real world.
And one relationship
attendance
A relationship is just that, an association between entities, and often has time data associated with it or other types of measures.
So without thinking too hard, you should have 3 database tables:
attendee [E]
class [E]
attendance [R]
E = entity, R = relationship
If you find yourself duplicating data in one of the entity tables, this is a good sign that this entity requires a "sub-model". In some places this is called "don't repeat yourself" or DRY and for entity relational modeling, this is called "data normalization".
Remember, there's overhead in both time and code to build a more elaborate schema. So consider starting simple [3 tables] and refactoring away redundancy.