Hello,
I have large database with students' names, courses they took, and grades. If all will be working okay, this database should be updated every quarter.
I need to select students for specific certificate. For example, for one certificate, I need to select every student who took course 125, course 126, and course 134, and have grades >=2.0 or "P".
I would like to create SQL query to pull needed information from the table. I already have started and can do SQL query to select students with grades >=2.0 or "P". However, I do not know how to combine all needed criteria into one query.
So, I need:
1. Select students who took specific classes for the particular certificate (for example, for one certificate, in could be: course 125, course 126, and course 134). Please note that I have many different certificates with different requrements
2. Grades should be equal or greater than 2.0 or "P"
3. Somehow mark eligible students
4. And next time (when new classes are added to the database) do not select students who already got certificate.
If it is possible please help me to create such query or suggest me how to do this assignment in better way (maybe using macro or Visual Basic?)
Thank you very much.
Here is example of the database
YRQ DEPT DIV CRS NUM DEC GR GR NAME SID STREET CITY ST ZIP DAY PHONE STU-EMAIL-ADDR A893 Course 125 2.8 Name 111 111111111 Street 1 City 1
A894 Course 126 0.7 Name 111 111111111 Street 1 City 1
A902 Course 134 2.4 Name 111 111111111 Street 1 City 1
A903 Course 135 4.0 Name 111 111111111 Street 1 City 1
A904 Course 136 0.0 Z Name 111 111111111 Street 1 City 1
A892 Course 124 3.0 Name 111 111111111 Street 1 City 1
A904 Course 146 0.0 Name 22222 222222222 Street 2 City 2
A892 Course 144 4.0 Name 22222 222222222 Street 2 City 2
A902 Course 144 3.6 Name 22222 222222222 Street 2 City 2
A893 Course 145 3.7 Name 22222 222222222 Street 2 City 2
A903 Course 145 4.0 Name 22222 222222222 Street 2 City 2
A894 Course 146 3.7 Name 22222 222222222 Street 2 City 2
B234 Course 125 3.0 Name 3333333 333333333 Street 3 City 3
A904 Course 126 3.6 Name 3333333 333333333 Street 3 City 3
B234 Course 126 1.1 Name 3333333 333333333 Street 3 City 3
B012 Course 134 2.0 Name 3333333 333333333 Street 3 City 3
B013 Course 135 2.7 Name 3333333 333333333 Street 3 City 3
B014 Course 136 4.0 Name 3333333 333333333 Street 3 City 3
B122 Course 144 3.1 Name 3333333 333333333 Street 3 City 3
B123 Course 145 2.8 Name 3333333 333333333 Street 3 City 3
B124 Course 146 3.7 Name 3333333 333333333 Street 3 City 3
B232 Course 154 0.0 P Name 3333333 333333333 Street 3 City 3
B233 Course 155 4.0 Name 3333333 333333333 Street 3 City 3
A903 Course 157 2.6 Name 3333333 333333333 Street 3 City 3