![]() ![]() The "professor doesn't look at the code" method The first is basically a joke the second isn't terribly useful, but at least is a serious answer (so, don't give up reading during the joke!). I hope that someone will have a really innovative take on this (maybe something that uses binary arithmetic somehow, I don't know). INSERT INTO tests (TestDate,ClassName,StudentID,Grade) VALUES INSERT INTO students (StudentFirstName,StudentLastName) VALUES SAMPLE DATA DROP DATABASE IF EXISTS error404 GROUP BY StudentFirstName, StudentLastName GROUP BY StudentFirstName, StudentLastName,ClassName) AS t INNER JOIN students ON tests.StudentID=students.StudentID SELECT StudentFirstName, StudentLastName, AVG(Grade) AS average My query: SELECT StudentFirstName, StudentLastName, AVG(average) ![]() | StudentFirstName | StudentLastName | AVG(average) | | TestDate | ClassName | StudentID | Grade | Tests table: PK-VARCHR PK-VARCHR PK&FK-INT INT | StudentID | StudentFirstName | StudentLastName | Data science: first exam: 91, second exam: 91.5, third exam: 93 -> Average: 91.8333.Machine-learning: first exam: 95, second exam: 94, third exam: 100 -> Average: 96.3333.Algebra: first exam: 99, second exam: 97, third exam: 96 -> Average: 97.3333.My query is working fine, I'm looking to learn from alternate approaches.įor example: the grades of me(aka Error404) are: Looking for other ways to write a query that finds for each student the average of averages in each subject.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |