Basic Queries Review (SQL Practice)
This is a follow-up to Introduction to Databases.
Download the sql-practice.sqlite
database. Open it in SQLite Manager and write a query for each of the following:
When writing the query to satisfy each research question, take a second to think carefully about which fields are actually relevant. Write your query so that only these relevant fields are selected for the final output. In other words, if you are going to continue with an analysis of the data you select, which fields do you actually need? (HINT: none of these problems should have SELECT * in the answer.)
- What is the distribution of males and females that weigh greater than 10?
- Where (in what sites) are the 10 heaviest males?
- How many females are at each site?