2

1. Student Table

Student Table

2. Subject Table

Subject Table

3. Exam Table

Exam Table

4. Mark Table

Mark Table

5. Project Table

Project Table

6. Daily Mark Table

daily Mark Table

Result Table

Suppose i have subjectID and classID for search. Then below example result will be show using above database table :

result table

Exam could be 7th exam or 8th exam not fixed but daily and project is fixed. daily mark 6 column can be possible for each student and project mark 2 column can be possible for each student.

Anyone can help to write the sql select query ? is it possible in sql joining ?

Shìpu Ahamed
  • 430
  • 4
  • 16
  • Yes, it's possible. See http://stackoverflow.com/questions/7674786/mysql-pivot-table for how to pivot your results in MySQL, to get the exams in different columns. – Barmar Sep 16 '15 at 21:52
  • The rest of it looks like you need to join with a subquery that calculates the averages. – Barmar Sep 16 '15 at 21:53
  • it's very complicated query for me.... can any one to write this query. i am really confuse about exam and i can't use CASE in sql because of exam table may change the examid or add new exam – Shìpu Ahamed Sep 16 '15 at 21:58

0 Answers0