Purchase Solution

SQL Statement for Grades

Not what you're looking for?

Ask Custom Question

See the attached file.
8. Consider the following tables:

Customers
CustomerID LastName FirstName State
1 Cohen Mike CO
2 Highley Michelle MI
3 Cohen Margot MI

Orders
OrderID CustomerID Ordered_Item Date_Ordered
1 3 DVD Movie 1/1/2009
2 1 Computer Book 3/1/2009
3 2 Music CD 2/1/2009

Write an SQL statement that will return the following result:

Name Location Item Date
Margot Cohen OH DVD Movie 1/1/2009
Michelle Cohen GA Music CD 2/1/2009
Mike Cohen CO Computer Book 3/1/2009

9. Using the two tables from #8, write an SQL statement that uses a SUB QUERY and the IN keyword to return the First Name of the customers who live in the state of MI.

10. Tell why the following SQL statement is incorrect. Rewrite the SQL statement to make it correct. (Hint: The fields of the table are StudentName, Assignment, Grade. A student's name can be in the table more than once since they could have several assignments.)

SELECT StudentName, AVG(Grade)
FROM GradeBookTable.

Attachments
Purchase this Solution

Solution Summary

The solution examines SQL statements for students grades.

Solution Preview

See the attached file.

8. Consider the following tables:

Customers
CustomerID LastName FirstName State
1 Cohen Mike CO
2 Highley Michelle MI
3 Cohen Margot MI

Orders
OrderID CustomerID Ordered_Item Date_Ordered
1 3 DVD Movie 1/1/2009
2 1 Computer Book 3/1/2009
3 2 Music CD 2/1/2009

Write an SQL statement that will return the following result:

Name Location Item Date
Margot Cohen OH DVD Movie 1/1/2009
Michelle Cohen GA Music ...

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

C# variables and classes

This quiz contains questions about C# classes and variables.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.