From b89d3a7c9af9ea41b1fb256a6330c275ebdc5839 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Thu, 4 Jan 2024 18:02:02 +0530 Subject: show more fields --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 8c30613..e403cdc 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - Home + CU Boulder Grades Database @@ -24,7 +24,7 @@

Queries

By Instructor

Find classes, and average grade for a given instructor

-

Note: Since the instructor names are provided in the format Last Name, First Name, it is best if you start typing the last name first.

+

Since the instructor names are provided in the format

Last Name, First Name
It is best if you start typing the last name first.

@@ -130,7 +130,7 @@ function getClassesByInstructor() { let instructor = document.getElementById("instructor").value; - let query = `SELECT Subject || ' ' || Course as "Class", CourseTitle as "Title", GROUP_CONCAT(DISTINCT YearTerm) AS YearTerms, ROUND(AVG(AVG_GRD), 2) AS AverageGrade, ROUND(AVG(PCT_A), 2) as "% A", ROUND(AVG(PCT_B), 2) as "% B", ROUND(AVG(PCT_C_MINUS_OR_BELOW), 2) as "% <= C-" FROM raw_data AS main WHERE insname1 = "${instructor.toUpperCase()}" OR insname2 = "${instructor.toUpperCase()}" OR insname3 = "${instructor.toUpperCase()}" GROUP BY CourseTitle` + let query = `SELECT Subject || ' ' || Course as "Class", CourseTitle as "Title", GROUP_CONCAT(DISTINCT YearTerm) AS YearTerms, ROUND(AVG(AVG_GRD), 2) AS "Average Grade", ROUND(AVG(PCT_A), 2) as "% A", ROUND(AVG(PCT_B), 2) as "% B", ROUND(AVG(PCT_C_MINUS_OR_BELOW), 2) as "% C- and below", ROUND(AVG(N_GRADE)) as "Average No. of Students" FROM raw_data AS main WHERE insname1 = "${instructor.toUpperCase()}" OR insname2 = "${instructor.toUpperCase()}" OR insname3 = "${instructor.toUpperCase()}" GROUP BY CourseTitle` console.log(query); const results = db.exec(query); @@ -175,7 +175,7 @@ function getClassesByClassCode() { let classCode = document.getElementById("classCode").value; - let query = `SELECT YearTerm as "Year-Term", insname1 as Instructor, AVG_GRD as "Average Grade", PCT_A as "% A", PCT_B as "% B", PCT_C_MINUS_OR_BELOW as "% <= C-" FROM raw_data WHERE Subject || ' ' || Course = '${classCode.toUpperCase()}';` + let query = `SELECT YearTerm as "Year-Term", insname1 as Instructor, AVG_GRD as "Average Grade", PCT_A as "% A", PCT_B as "% B", PCT_C_MINUS_OR_BELOW as "% C- and below", N_GRADE as "No. Graded" FROM raw_data WHERE Subject || ' ' || Course = '${classCode.toUpperCase()}';` const results = db.exec(query); const result = results[0]; -- cgit v1.2.3