Question
The Class table contains information about students, classes and grades. In this example, we are not concerned with normalizations. The goal is the use the
The Class table contains information about students, classes and grades. In this example, we are not concerned with normalizations. The goal is the use the data provided and write SQL statements to view the desired output. The score attribute is a number data type, the DOB attribute is a date data type and all other attributes are string data types.
You will be provided the results of a query from the class table. Your task is to write the query that would produce those results.
1. Display the number of students from each class who got an A or B in the course.
className grade count(grade)
Database A 3
Database B 2
Computer Based IS A 3
Computer Based IS B 3
2. Display the className, grade and how many students got an A, B or C in the class. Filter the data to only display the class and grades where there is a count less than 3.
className grade count(grade)
Database B 2
Database C 2
Computer Based IS C 1
3. Display the last name of all students who have more than 8 characters in their name. The query results should only display unique values (no duplicate results). The results should appear in descending alphabetical order.
lName Lenth
Stephenson 10
OConnell 9
McRoberts 9
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started