Task-6: Company also likes to find out the total purchase amount and the number transactions made by each customer in their lifetime Create new data frame called "new-dataset", containing the columi ['CustomerlID', 'TotalPurchaseAmount', 'NumberofTransactions']. Display the la 10 rows. Expected output is as follows: CustomerID TotalPurchaseAmount NumberOrTransactions 15100 350 40 7 15291 328.80 2 15311 454.63 36 16029 3702.12 8 10 16098 430.60 12 11 16250 226.14 14 12 17420 130.85 13 17809 34.80 1 14 17850 725.44 45 15 18074 489.60 13
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
What is the python code for this
Step by step
Solved in 3 steps with 2 images