For test exercise we’ll use the PizzaDB. You can find link to the database script on GIT.
You don’t need to have a database installed to do these exercise, just use the prompts below.
In these exercise we’ll write some queries using either the Product or Employee tables.
Exercise #1
What is the average price of a product by product type?
You can use the product table. Display the ProductType and AveragePrice
Hint: Use the AVG function to calculate the average.
Show the answer to see the query I wrote: Notice that I group by ProductType and the Price is an argument to the avg function.
Exercise #2
How may employees are there in the Employee table?
Hint: You can don’t need to use GROUP BY to answer this question.