help me to do the function of Calculate total sales for each employee,and mean sales for each employee,image 2 is data from csv file
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.
help me to do the function of Calculate total sales for each employee,and mean sales for each employee,image 2 is data from csv file

![print("Used Car Sales")
print("\n1. Import sales data from csv") # import sales data
print("2. Calculate total sales for each employee") # calculate total sales of employees
print("3. Calculate mean sales for each employee") # calculate the monthly mean sales for each employee
print("4. Graph of monthly sales data") # Create graph of monthly sales data
print("5. Exit") # Exit program
option = -1 # used to store the user's choice
# while x is less than 1 or greater than 5, loop
# used to validate user input
while option < 1 or option > 5:
# get user's choice
option = int(input("\nwhich operation do yoU want to perform?\n"))
return option
# function which will open the csv file and read in its values and return a list containing each record as a dictionary
adef open_csv_file(file_path):
database = [] # create empty list
with open(file_path,"r") as csv_file: # open file in read mode
# use DictReader to read in the data
# add each line, as a dictionary, to the list 'database'
# return the database
return database
# finds and returns a list of the total sales for each employee
def calc_total_sales(database):
# create empty list
total_sales = []
# iterate through each record
# initialise a variable to track the total
# loop through each key (need to ignore name key) and add to total
# append total value to total_sales list
# return list of total sales for each employee
return total_sales
def calc_mean_sales(sales_list):
pass # DELETE THIS AND ADD YOUR CODE HERE](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fcbfc90d0-be3c-48f7-ae75-acee31e3944b%2F66062513-3cf6-4c54-b106-b46f0876029d%2Fsra0c3g_processed.png&w=3840&q=75)

Step by step
Solved in 3 steps with 1 images









