| | |
SQL command for calculating Ave from multiple tables
![]() |
I want to calculate average of grades of each student with SQL command but I encounter problem with this code. I have 3 tables related to each other and want to calculate average of student grades. This is my SQL string but it dose not work.
What is the problem with this code? Please take a look at it.
Here is my requirement of this code:
1) First of all joining these tables
2) Calculating average of grades for each student
What is the problem with this code? Please take a look at it.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Stri = "select student.StudentID,finalgrades.finalgrade, avg(FinalGrade)" _ & "FROM (student INNER JOIN CourseStudentJunc ON Student. StudentID = CourseStudentJunc.StudentID)" _ & " INNER JOIN FinalGrades on CourseStudentJunc.JuncID = FinalGrades.JuncID group by student. StudentID " blStudent=student info(StudentID,name,...) tblcourseStudentJunc=Junction table for creating many to many relationship between course and student(JuncID,StudentID,CourseID) tblFinalGrades=saving grades of each student for each course separately (Juncid,Finalgrade)
1) First of all joining these tables
2) Calculating average of grades for each student
•
•
Join Date: Nov 2009
Posts: 1
Reputation:
Solved Threads: 0
0
#3 19 Days Ago
Hi I have a similar problem around these lines...
I have following tables:
class( class_id, class_name)
student(student_id, student_name, class_id)
exam ( exam_id , class_id , exam_date )
grade( exam_id , student_id, grade )
create a list of students and ther avg grade in their last N ( n can be any number ) tests
Any help in getting this sql will be useful
I have following tables:
class( class_id, class_name)
student(student_id, student_name, class_id)
exam ( exam_id , class_id , exam_date )
grade( exam_id , student_id, grade )
create a list of students and ther avg grade in their last N ( n can be any number ) tests
Any help in getting this sql will be useful
![]() |
Similar Threads
- Calculating an average via multiple tables (MySQL)
- Submit data to multiple tables (PHP)
- Search from multiple tables ?? (PHP)
- Sql command to add new data using store values? (C#)
- data from multiple tables (VB.NET)
- SQL Command Misbehaving under VStudio 2005 (MS SQL)
- SQL Command Misbehaving under VStudio 2005 (C#)
- SQL Query Help... Searching one column in multiple tables? (MS Access and FileMaker Pro)
- Searching for a record in multiple tables (VB.NET)
- Query multiple tables? (MySQL)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB6 find and replace
- Next Thread: Open a form in a new window?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






