Provide a summary of customer balance characteristics for customers who made purchases. Include the minimum balance, maximum balance, and average balance, as shown in Figure P7.21. FIGURE P7.21 BALANCE SUMMARY FOR CUSTOMERS WHO MADE PURCHASES

Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900

Chapter
Section

Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900
Chapter 7, Problem 21P
Textbook Problem
1006 views

Provide a summary of customer balance characteristics for customers who made purchases. Include the minimum balance, maximum balance, and average balance, as shown in Figure P7.21.FIGURE P7.21 BALANCE SUMMARY FOR CUSTOMERS WHO MADE PURCHASES

Program Plan Intro

Aggregate Functions:

SQL has some built-in functions and they are called as aggregate functions. SQL contains five built-in functions. They are:

• SUM – This function is used to add values from the particular column.
• Syntax: SELECT SUM(column_Name) FROM table_Name;
• COUNT – This is used to count the number of rows for the particular column.
• Syntax: SELECT COUNT(column_Name) FROM table_Name;
• MAX – This function is used to get the maximum value from the column.
• Syntax: SELECT MAX(column_Name) FROM table_Name;
• MIN – This function is used to get the minimum value from the column.
• Syntax: SELECT MIN(column_Name) FROM table_Name;
• AVG – This function is used to get the average of all the values from the column.
• Syntax: SELECT AVG(column_Name) FROM table_Name;

Explanation of Solution

SQL code:

The SQL code is to provide minimum balance, maximum balance, and average balance from “CUSTOMER” table that inner join with “INVOICE” table.

SELECT Min(CUSTOMER.CUS_BALANCE) AS [Minimum Balance], Max(CUSTOMER.CUS_BALANCE) AS [Maximum Balance], Avg(CUSTOMER.CUS_BALANCE) AS [Average Balance]

FROM CUSTOMER WHERE cus_code in (select cus_code from invoic...

Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started

Find more solutions based on key concepts
What are the three basic methods used to mill angular surfaces?

Precision Machining Technology (MindTap Course List)

What is the relationship between mass flow rate and volume flow rate?

Engineering Fundamentals: An Introduction to Engineering (MindTap Course List)

List guidelines for evaluating earbuds and headphones.

Enhanced Discovering Computers 2017 (Shelly Cashman Series) (MindTap Course List)

If your motherboard supports ECC DDR3 memory, can you substitute non-ECC DDR3 memory?

A+ Guide to Hardware (Standalone Book) (MindTap Course List)

What are the advantages of alternators over generators?

Welding: Principles and Applications (MindTap Course List)