COMP3161 Lab 3
COMP3161 Lab 3
LAB 3
Problem
What to submit.
1. A sql script that creates the table and inserts the data into the table. It is your job
to figure out how to generate this script. (Your are free to the name the table
and the database whatever you wish)
2. Submit whatever script you used to generate the insert queries if one was used.
E.g a python script.
3. Flask api
4. A postman collection with the following endpoints.
Submit everything in a zip file named with your id number. E.g 6200000.zip
a. /customers [GET]
This should return all the customers in the following format.
{
"Profession": “HealthCare”
}
e. /highest_income_report [GET]
This should return a report with the highest income earners by profession.
[
{
"CustomerID": 3,
"AnnualIncome": 100000,
"Profession": "Healthcare"
},
{
"CustomerID": 10,
"AnnualIncome": 40000,
"Profession": "Executive"
},
{
"CustomerID": 5,
"AnnualIncome": 20000,
"Profession": "Lawyer"
}
]
This should show the average spending score by gender for the profession
specified. E.g. /average_spending_score/engineers would return the average
spending score by gender for engineers. Output should look as follows
[
{
"Gender": "Male",
"AverageSpendingScore": 20
},
{
"Gender": "Female",
"AverageSpendingScore": 30
}
]