I tried to search for answer for over a day, but with no staisfying results.
I would like to build site to track attendace of our players on trainings and matches. All attendance systems I found so far were pretty simple - usually two tables (students, attendance). But I think that I need more complex solution for my project.
Here are some hints:
We have trainings on many schools. At each school there is many training lessons during week.
Each training lesson is for one team, but the team has more than 1 training lesson during week and usualy has them on different schools.
Each team has players and players can be part of multiple teams.
Player can attend just some training lessons - for example for team1 - MondayTraining, TuesdayTraining but not FridayTraining and for team2 just ThursdayTraining.
Attendance will manage coaches. One coach can have more than 1 team.
The main goal is to have website where Coach can see in calendar his trainings for that day and when he click the link in calendar new page with list of players who should be attending on this lesson will be opened - ideally with checkboxes or radio buttons for tracking attendance.
EDIT: here is my basic model, but I know its horrible
my try on model
Hope someone can help me with database model.
Thanks for your answers.
Related
I have a database that schedules teachers to deliver lectures that range from 15 minutes to 4 hours long. Many of these lectures take place simultaneously. Some lectures require multiple teachers to deliver due to complexity of the subject. These lectures cover topics that are categorized in one of ten areas of specialization. We have ten teams whose members are experts in one of the ten areas of specialization. Each team is responsible for delivering the lectures that are associated with their area of specialization.
Teachers are assigned to a team based on their chosen area of specialization and expertise. Teachers must pass a certification course in order to be allowed to teach in an associated area of specialization.
Some teachers have multiple certifications and as a result can be scheduled to deliver lectures that are not the responsibility of the team to which they are assigned. However, they only fill in in this capacity if all teachers from the team with responsibility for the lecture in question are busy and no one else can be assigned the lecture.
Teachers earn sick and vacation time and they can use this time as needed. In addition, teachers are from time to time required to participate in professional development events or attend meetings. Therefore, they are not always available to deliver lectures.
My task has been to develop a process where teachers can be scheduled to deliver lectures based on their certifications, team membership, and availability.
I have the following tables:
Instructor lecture assignments (which instructors have been assigned to which lecture)
Lecture schedule (name, date, start time, end time, certifications required for each lecture)
Teacher not available (teacher name, date unavailable, start time unavailable, end time of unavailability)
Teacher teams (names of teacher teams)
Teachers (first, middle, last name of each teacher)
Teacher certifications (name of each certification that can be earned by each teacher)
Teacher certification conferrals (which teachers have earned which certifications and on what date)
Teacher team assignments (which teachers are on which team)
The issue that I am trying to resolve is how to structure a query that will display, for each lecture, the teachers that are CURRENTLY certified to deliver that lecture, a member of the team that is responsible for that lecture, NOT unavailable due to professional development nor being assigned to deliver another simultaneously occurring lecture.
Can someone help me to understand how to structure this needed query, please?
Thank you in advance.
What you have to do is take it one step at a time. Forget:
"for each lecture, the teachers that are CURRENTLY certified to deliver that lecture, a member of the team that is responsible for that lecture, NOT unavailable due to professional development nor being assigned to deliver another simultaneously occurring lecture."
Start with:
List all teachers
List all teacher certifications with their start and/or end dates. Your wording does not make it clear if by "currently" you mean "has not expired" which is what the assumption is reading the word currently, or "has already earned it" which is what your description of your data indicates, or both.
Filter the above with the certification required by each lecture
Filer by each reason for unavailability
One step at a time, you can't solve the problem in one go. It is ok if you take a wrong turn or end up with some extra queries that are unneeded, you can clean up when the goal has been reached.
I am working on another project that involves a car hire company which can be summarised as followed:
A depot supplies cars to multiple hire points and acts as a service garage for repairs
A hire point can use many depots for servicing and the supply of cars
A customer makes a rental for a car from a hire point and can return the car to the same hire point or a different one of their choice. The system must keep track of where the car currently is.
Vehicle availability and repair/maintenance status must be recorded.
A discount must be able to be added to cars for promotional events
The database must keep track of employees who are either depot employees or hire point employees. a hire point employee may work at a number of hire points during the week and is given a schedule a month in advance, whereas a Depot employee remains at the same location.
I have attached an ERD of what I have so far and would like some comments on its structure please.
I am having difficulty in understanding how I am going to keep track of the cars, and how I am going to implement a shift pattern for employees for both the depot and the hire point with the above requirements.
kind regards
I go to a lot of sports games, mostly hockey. I have been tracking the games via an excel sheet and even at one point a simple database table. I am trying to build this a little better and eventually create a web interface. But I also want to be able to run various queries.
I don't care about player goals, ice-time, sog or any of those stats - merely just teams playing, score and date with a section for notes. (eg, Hat trick, 500th game for player)
So what I had was:
(id, home_team, home_score, away_team, away_score, jersey = [home,away,alt], date, notes, timestamp)
I have thought of other ways to normalize it but I don't want to over complicate it and trying to query has been a nightmare.
I had a three table design in mind:
Team
(team_id, city, state, nickname)
League
(league_id, league_name, conference, division)
Venue
(venue_id, venue_name, venue_city, venue_state, venue_zip, venue_address, venue_capacity)
Venue table and even league table seem unnecessary for the most part but I was thinking of different types of queries.
Then I would create some views or a games table that would pull in the necessary fields.
Queries I had in mind to execute:
Games attended that the home team won
How many times my team has played whatever team and overall record
Games won/lost wearing alternate jersey, home jersey, away jersey
Venues visited and record when visiting
Games attended where there has been a significant event. (Hat trick, record)
Overall record of games attended in x year, all time.
Playoff game record, preseason game record, regular season record (I was thinking I could notate game type in notes or create a field for type and do (playoff, preseason, regular)
Any advice would be appreciated, its not that I do not know how to build the database, it is that I do not know how to build it right and without stressing over the entire website I want to build from it.
Eventually I would like to expand it to other sporting events (football, baseball, basketball, etc..) but before getting too far ahead of myself I would like to get the hockey one running.
Thanks in advance
I am developing a database for a Fantasy Cricket league for my Database module in college.
I had done the design and was fairly confident that I had a working version, but I suddenly realised that I hadn't handled the swapping of players.
This is a snippet of my diagram since the final version i have is still on paper.
I had this sudden realisation that the total points for an owners squad would be calculated based on the points of the players in the current squad, whether those players had been there all along or not.
How do I maintain the historic data of all the players in a specific squad and their points while they were in that squad?
I'm not sure I'm very clear here.. But would really appreciate the help.
One option is to insert a join table between player and squad, that maps a player to a squad for inerval of time. This way you can select all the players from a given squad for given time interval. Having the players, it should be easy to access the match information, since it is directly connected with a player.
I am creating system for a school management system and come up with the attached database schema.
Following is how the system works:
A school has many students and teachers. It has also many courses(subjects) taught. A grade level can have many courses assigned. These courses in turn will be assigned to the students in that particular grade.
The levels of students are categorized into grades and sections. A student can be in Grade 5, but if grade 5 students are huge in number, they are divided into sections. eg: Grade 5 section A, Grade 5 section B.
Students are placed in unique classrooms. A classroom will be unique throughout. Classroom of Grade 5 Section A of year 2010 will be different from Classroom of Grade 5 Section A of year 2011.
Students are assigned parents. A parent can have more than one student in the school.
One or more classrooms can be assigned to a teacher.
Attendance for students are taken by their teacher on a daily basis
There will be many types of exams. Exam results are stored for each subject (course).
I am a beginner in database normalization and would be glad if anyone could give me some hints if the database looks alright or not.
EDIT:
Also, there will only be one point of login. In the above case, during login, a user will have to select the type of user from a dropdown list. That dropdown selection will be used to query to respective table to login to the system. Another alternative is to use a common user table, which will store the user_id, email, password, last_login_date, last_login_ip but will store other details in respective tables such as student, parent, teacher. So, what is the preferred/correct way to implement it?
You don't model GRADE_SECTIONS at all.
Unless your school has a massive programmr of demolition and construction every summer holiday the classrooms will be the same. It is the assignments which change each year. So CLASSROOMS should be assigned to a separate GRADE_SECTION entity, instead of merging SECTIONS and CLASSROOMS as you do now.
Students should be assigned to GRADE_SECTIONS not CLASSROOMS.
COURSES should have many EXAMS rather than many EXAM_RESULTS. It simply doesn't make sense that a French Exam could be taken by students learning Maths and Russian.
The line from Attendance (many) should be drawn to the Classroom_Student (1) instead. Drawing the attendance to the students is not possible I think.