RocAFella2007
Technical User
Hi, I need help with an SQL query. Basically I have a database created, and the layout of it is shown below:
Date/Room - Lesson1 - Lesson2 - Lesson3 - Lesson4 - Lesson5
Date1/Room1
Date1/Room2
Date1/Room3
Date1/Room4
Date1/Room5
Date2/Room1
Date2/Room2
Date2/Room3
Date2/Room4
Date2/Room5
Date3/Room1
Date3/Room2
Date3/Room3
Date3/Room4
Date3/Room5
And so on and so on.
It’s a timetable where people book rooms, the way it works is I have a date and then a room. The dates are the same for 5 records, as each record is for another room. Then when the user books a room, they choose a room and all the records are shown for that room e.g if they choose room1 the records are shown like
Date1/Room1
Date2/Room1
Date3/Room1
The user then enters their name and the details get saved into the database, all of this is working perfectly. However im working on the statistics part of the program, what I need help on is I need to list all names, and the amount of times they have booked a room. Could you give me any advice on how this would be achievable please? Thanks
Date/Room - Lesson1 - Lesson2 - Lesson3 - Lesson4 - Lesson5
Date1/Room1
Date1/Room2
Date1/Room3
Date1/Room4
Date1/Room5
Date2/Room1
Date2/Room2
Date2/Room3
Date2/Room4
Date2/Room5
Date3/Room1
Date3/Room2
Date3/Room3
Date3/Room4
Date3/Room5
And so on and so on.
It’s a timetable where people book rooms, the way it works is I have a date and then a room. The dates are the same for 5 records, as each record is for another room. Then when the user books a room, they choose a room and all the records are shown for that room e.g if they choose room1 the records are shown like
Date1/Room1
Date2/Room1
Date3/Room1
The user then enters their name and the details get saved into the database, all of this is working perfectly. However im working on the statistics part of the program, what I need help on is I need to list all names, and the amount of times they have booked a room. Could you give me any advice on how this would be achievable please? Thanks