added py file to do queries

This commit is contained in:
Armen Vartan 2014-10-12 22:47:02 -04:00
parent 489d60da73
commit f97db775da
3 changed files with 17 additions and 0 deletions

17
exercises/2-sql/README.md Normal file
View File

@ -0,0 +1,17 @@
Loan or No Loan?
================
Here is some people's last month bank statements. Query the database to answer the questions. Write methods to return all of the information to you. Don't do this manually.
* How many people are there in the database?
* What is each persons salary (return their name and salary)?
* What is each persons net income?
* How about their highest expense?
* What percent of their salary did they spend?
* What was the average price of their expenses (don't include salary)?
* How many expenses did each person have?
* How many things did each person buy in the first week of the month? How much money did they spend?
* How about in the last week?
* Print everything bought between $40 and $60.
* Using the mortgage calculator you built before (some adjustments will need to be made), how large of a house could each person afford on a 15 year mortgage at 4%, if they plan on saving $200 a month (assuming they keep their jobs and spend the same amount).
* Write the database to a csv.

Binary file not shown.

0
exercises/2-sql/loan.py Normal file
View File