Answered step by step
Verified Expert Solution
Question
1 Approved Answer
BANG & OLUFSEN Back MySQL - Electricity QUESTION MySQL - Electricity Hard = 2 0 0 1 2 0 ( i ) The electric company
BANG & OLUFSEN
Back
MySQLElectricity
QUESTION
MySQL Electricity
Hard i
The electric company wants to analyze customer billing patterns to identify and reward consistent ontime payers.
Our database contains two tables:
Customers Table: This table will store information about the customers of the electric company.
Bills Table: This table keeps track of the billing information.
Tables Schema as Below:
tableCustomersdataTypecolumnNameINTCustomerIDVARCHARNameVARCHARAddressVARCHARPhoneNumberVARCHAREmaildataTypeBillsINTcolumnNameINTBillIDDATECustomerIDDATEBillingDateVARCHARDueDateUndefinedTotalAmountStatusFOREIGN KEY CustomerIDREFERENCES
Write a SQL query that:
For each paid bill of a customer, calculate the running average considering the last paid bills and the paid bill
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