Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
this is database about Exam
i want SQL statement that retrieve data about

- Successful students in the subject of teacher
- Students with the highest score
- Name of the teacher and the material taught
- Material name and the name of the teacher who is explain it
- The more difficult questions in each exam
- The names of students in the first grade

the database contains the following tables :
I don't know How to send database source to you ?
1- Admin (Admin_ID, Admin_Name, User_ID)
2- Answers(AnswerID,Question_ID,Is_Correct_Answer,The_Answer,Answer_Keyboard_Key )
3- Attendance (Attendance_ID, Stud_ID, Date, Arrival_Time, Leaving_Time )
4- Chapter (Chapter_ID, Chapter_Name_english, Chapter_Name_arabic, Subject_ID )
5- Class (Class_ID, Class_Name_Arabic, Class_Name_english, Class_Location, Teacher_ID, Year_ID )
6-Exam (Exam_ID, Exam_name_english, Exam_name_arabic, Subject_ID, Semester_ID, Exam_Duration, Full_Mark, Pass_Mark, Num_Of_Question, IS_Randamized )
7-Exam_LevelOfDiffculty_Group (Exam_ID, Group_code, Level_Of_diffculty_code, no_Of_question_for_each_section, Score_for_each_type )
8- Exam_Registration(Exam_Registration_ID, Student_ID, Exam_ID, Estimated_Start_Time, Estimated_End_Time, Date )
9- Lesson (Lesson_ID, Lesson_Name_arabic, Lesson_Name_english, Chapter_ID )
10- Level_Of_Diffeculty (Level_Of_diffeculty_Code, Level_Of_Difficulty_Description_arabic, Level_ Of_Diffculty_Description_english )
11- Question (Question_ID, Question_Header, Question_Group_code, Quiz_ID, Exam_ID, Created_By, Level_Of_Diffculty_code, Subject_ID, In_practice, Is_Active, Is_There_Diagram, Diagram, GUID )
12- Question_Group (Group_Code, Group_Description_arabic, Group_Description_english )
13- Quiz (Quiz_ID, Quiz_Name_Arabic, Quiz_Name_english, Lesson_ID )
14 - Result (Result_ID, Student_ID, Exam_ID, Score )
15-Semester(Semester_ID, Semester_Name_english, Semester_startdate, Semester_enddate, semester_Name_arabic )
16- Student (Student_ID, Student_Firstname_Arabic, Student_Lastname_Arabic, Student_Firstname_English, Student_Lastname_English, E-mail, Phone, Address, Year_id, User_id, Gender, Date_Of_Birth, Photo, Class_ID, File_Stream )
17- Student_Exam_Question (Exam_id, Student_id, Start_Time, End_Time, Date_Published, Question_ID, Time_Answered, Is_Marked, Is_Answered, Student_Answer )
18- Student_Exam_TimeNow (student_ID, Exam_ID, In_question_no, Time_Remaining )
19- Subject (Subject_ID, Subject_Name, Year_ID, Semester_ID )
20- Teacher (Teacher_ID, Teacher_name_english, Teacher_name_arabic, Subject_ID, user_id, Phone, Email )
21- Teacher_Class (Teacher_ID, Class_ID )
22- Teacher_Subject (Teacher_ID, Subject_ID )
23- Users (User_ID, Username, Password, Type, Active )
24- Year (Year_ID, Year_name_english, Year_name_arabic )
25- Year_semester (Year_ID, Semester_ID )


i need statement that retreive data about studentes that passed in each exam ?
thanks



thank you
execuse me

i have this code to retrieve data about student that passed in exam
but didn't retreive any data
what's the wrong in this code ?

SQL
SELECT "Exam"."Exam_name_english", "Result"."Score",
       "Semester"."Semester_Name_english", "Student"."Student_Firstname_English",
       "Student"."Student_Lastname_English", "Year"."Year_name_english"
FROM (("Examination_System"."dbo"."Result" "Result"
       INNER JOIN "Examination_System"."dbo"."Student" "Student"
       ON "Result"."Student_ID"="Student"."Student_ID"
      )
      INNER JOIN "Examination_System"."dbo"."Exam" "Exam"
      ON "Result"."Exam_ID"="Exam"."Exam_ID"
     )
     INNER JOIN (("Examination_System"."dbo"."Year_semester" "Year_semester"
                  INNER JOIN "Examination_System"."dbo"."Semester" "Semester"
                  ON "Year_semester"."Semester_ID"="Semester"."Semester_ID"
                 )
                 INNER JOIN "Examination_System"."dbo"."Year" "Year"
                 ON "Year_semester"."Year_ID"="Year"."Year_ID"
                )
     ON "Student"."Year_id"="Year"."Year_ID"
ORDER BY "Year"."Year_name_english"
Posted
Updated 18-Oct-11 12:18pm
v2
Comments
Orcun Iyigun 18-Oct-11 13:52pm    
You have asked this question yesterday and for some good reason which i dont know it is deleted. and today again you are asking it. you should work on your SQL skills more. We are not here to do your homework or whatsoever. Come and ask a specific question you will get an answer, you wnt get an answer if you dont show any hardwork...
[no name] 18-Oct-11 14:33pm    
Agreed. We are not here to do your work for you. If you attempt something and have a problem, then ask.

1 solution

It is very disrespectful to expect others to give you their time when you are unwilling to spend your own time.

Please respect this forum and the people who are trying to help with genuine problems and not what seems to be someones homework.
 
Share this answer
 
Comments
Simon Bang Terkildsen 18-Oct-11 15:22pm    
Agreed.
Mehdi Gholam 18-Oct-11 15:33pm    
Thanks Simon. You seemed MIA for a while, glad your back.
Simon Bang Terkildsen 18-Oct-11 15:37pm    
Yeah, I have a lot of work right now, so just popping my head in now and then the next couple of weeks. I'm happy someone have noticed, thank you :)
Haanaza 18-Oct-11 18:09pm    
thank you
execuse me

i have this code to retrieve data about student that passed in exam
but didn't retreive any data
what's the wrong in this code ?

SELECT "Exam"."Exam_name_english", "Result"."Score", "Semester"."Semester_Name_english", "Student"."Student_Firstname_English", "Student"."Student_Lastname_English", "Year"."Year_name_english"
FROM (("Examination_System"."dbo"."Result" "Result" INNER JOIN "Examination_System"."dbo"."Student" "Student" ON "Result"."Student_ID"="Student"."Student_ID") INNER JOIN "Examination_System"."dbo"."Exam" "Exam" ON "Result"."Exam_ID"="Exam"."Exam_ID") INNER JOIN (("Examination_System"."dbo"."Year_semester" "Year_semester" INNER JOIN "Examination_System"."dbo"."Semester" "Semester" ON "Year_semester"."Semester_ID"="Semester"."Semester_ID") INNER JOIN "Examination_System"."dbo"."Year" "Year" ON "Year_semester"."Year_ID"="Year"."Year_ID") ON "Student"."Year_id"="Year"."Year_ID"
ORDER BY "Year"."Year_name_english"


Simon Bang Terkildsen 18-Oct-11 18:19pm    
I've added you sql to your question and indented it, so it's at least readable, this should raise your chance of getting an answer.
But before anyone you have to say what is wrong, do you get an error, do you not get the expected result (if so what do you get and what did you expect)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900