STUDYSHIELDS ASSIGNMENT HELP

  • Home
  • Blog
  • Courses
    • Child Category 1
    • Child Category 2
    • Child Category 3
    • Child Category 4
  • Services
  • Country
    • Childcare
    • Doctors
  • Home
  • Blog
  • Sample Works
  • Order Now

Friday, February 12, 2021

How to code summary queries

 February 12, 2021     No comments   

 Chapter 5

How to code summary queries

Exercises

1. Write a SELECT statement that returns these columns:

The count of the number of instructors in the Instructors table

The average of the AnnualSalary column in the Instructors table

Include only those rows where the Status column is equal to “F” (Fulltime).

2. Write a SELECT statement that returns one row for each department that has instructors with these

columns:

The DepartmentName column from the Departments table

The count of the instructors in the Instructors table

The annual salary of the highest paid instructor in the Instructors table

Sort the result set so the department with the most instructors appears first.

3. Write a SELECT statement that returns one row for each instructor that has courses with these

columns:

The instructor first and last names from the Instructors table in this format: John Doe

(Note: If the instructor first name has a null value, the concatenation of the first and last

name will result in a null value.)

A count of the number of courses in the Courses table

The sum of the course units in the Courses table

(Hint: You will need to concatenate the instructor first and last names again in the

GROUP BY clause.)

Sort the result set in descending sequence by the total course units for each instructor.

4. Write a SELECT statement that returns one row for each course that has students enrolled with these

columns:

The DepartmentName column from the Departments table

The CourseDescription from the Courses table

A count of the number of students from the StudentCourses table

Sort the result set by DepartmentName, then by the enrollment for each course.

5. Write a SELECT statement that returns one row for each student that has courses with these columns:

The StudentID column from the Students table

The sum of the course units in the Courses table

Sort the result set in descending sequence by the total course units for each student.

6. Modify the solution to exercise 5 so it only includes students who haven’t graduated and who are

taking more than nine units.

7. Write a SELECT statement that answers this question: What is the total number of courses taught by

parttime instructors? Return these columns:

The instructor last name and first name from the Instructors table in this format: Doe,

John (Note: If the instructor first name has a null value, the concatenation of the first and

last name will result in a null value.)

The total number of courses taught for each instructor in the Courses table

Use the ROLLUP operator to include a row that gives the grand total

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Click Here to Place order

Popular Posts

  • A “criminal minds” Aileen Wournos individual will be your “patient”
     A “criminal minds” Aileen Wournos individual will be your “patient”  A brief history of the patient including diagnoses (documented or your...
  • CEO Jane Lionel has some hard decisions to make with regard to some of the company’
     CEO Jane Lionel has some hard decisions to make with regard to some of the company’solder hands, and even on the eve of that decision, I be...
  • Problem in Supply Chain
    Problem in Supply Chain Problem 2. (Chapter 11: The Storage and Handling System) Compare the constrast private ownership of storage space to...

Recent Posts

Unordered List

Pages

  • Home

Text Widget

Blog Archive

  • November 2022 (20)
  • October 2022 (50)
  • September 2022 (119)
  • August 2022 (107)
  • February 2022 (501)
  • January 2022 (443)
  • December 2021 (488)
  • November 2021 (1574)
  • October 2021 (28)
  • September 2021 (11)
  • July 2021 (8)
  • June 2021 (15)
  • May 2021 (39)
  • April 2021 (15)
  • March 2021 (303)
  • February 2021 (712)
  • January 2021 (903)
  • December 2020 (2)
  • September 2020 (33)
  • April 2016 (5183)
  • March 2016 (3763)
  • February 2016 (4356)
  • January 2016 (1749)
  • December 2015 (22)
  • November 2015 (147)
  • October 2015 (23)

Sample Text

Copyright © STUDYSHIELDS ASSIGNMENT HELP | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates