CSE 581 - 2019F - Lab 3_Summary Queries, Subqueries.pdf - CSE 581 Introduction to Database Management Systems Fall 2019 Lab 3 Summary Queries Subqueries

CSE 581 - 2019F - Lab 3_Summary Queries, Subqueries.pdf -...

This preview shows page 1 - 2 out of 2 pages.

CSE 581 Introduction to Database Management Systems Fall 2019 1 Lab 3: Summary Queries, Subqueries 1. Write a SELECT statement that returns two columns: VendorName and their individual PaymentSum, where PaymetSum is the sum of the PaymentTotal column. Return 10 vendors who’ve been paid the least. 2. Write a SELECT statement that returns three columns: VendorName, InvoiceCount and InvoiceAverage. InvoiceCount is the count of the number of invoices, and InvoiceAverage is the average of the InvoiceTotal of each vendor. Group the result set by VendorName and sort the result by ascending order of number of invoices. 3. Write a SELECT statement that returns: AccountDescription, LineItemCount, and LineItemSum. LineItemCount is the number of entries in the InvoiceLineItems table that have that AccountNo. LineItemSum is the sum of the InvoiceLineItemAmount column for that AccountNo. Filter the result set to include only those rows with LineItemCount more than 1. Group the result set by account description, and sort it by ascending LineItemSum.
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Spring '08
  • Goel,A

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes