Find the total PurchaseAmt for all the orders Find the average PurchaseAmt for all the orders Find the total count of orders done.
Concepts in Designing Database
A database design is the process of data organization based on a database model. The process deals with identifying what data should be stored in a database and how data elements relate to each other.
Entity Relationship Diagram
Complex real-world applications call for large volumes of data. Therefore, it is necessary to build a great database to store data safely and coherently. The ER data model aids in the process of database design. It helps outline the structure of an organization’s database by understanding the real-world interactions of objects related to the data. For example, if a school is tasked to store student information, then analyzing the correlation between the students, subjects, and teachers would help identify how the data needs to be stored.
Had dout in data structures:
Create the given table and implement the queries:
OrderNo |
PurchaseAmt |
OrderDate |
Customer_ID |
Salesman_Id |
1001 |
150.5 |
1-01-2021 |
111 |
211 |
1002 |
250.75 |
2-01-2021 |
112 |
212 |
1003 |
500.00 |
2-01-2021 |
113 |
213 |
1004 |
100.00 |
3-01-2021 |
113 |
214 |
1005 |
57.34 |
4-01-2021 |
114 |
214 |
- Find the total PurchaseAmt for all the orders
- Find the average PurchaseAmt for all the orders
- Find the total count of orders done.
- Find the minimum PurchaseAmt for Customer_ID 113
- Find the maximum PurchaseAmt for Salesman_ID 214
- Display all the details in descending order of PurchaseAmt.
- Update the Customer_ID as 115 whose PurchaseAmt is 150.5
Step by step
Solved in 3 steps with 1 images