An introduction to querying data
In the previous chapter, we covered multiple ways of getting data into MySQL. We imported data in CSV, JSON, and SQL formats into tables and collections. Now, we want to use MySQL to get information out of the data. The main benefit of having data in a MySQL database is that you can query it, combine multiple tables, and aggregate and filter results. This makes it easy to create reports on the data. This is not limited to data stored in tables; it is still possible to do this if the data resides in a collection of JSON documents.
An example of this is having a database that stores an inventory of the laptops that the company has and then producing reports based on the different types of laptops and the different warranty periods.
In this chapter, you will learn how to filter the results – for example, filtering for only one brand of laptop. Then, you will learn how to use functions – for example, to calculate the days remaining in...