In MySQL, it can often be easier to find data than to format it correctly. Subqueries can serve two purposes—they break up large queries in order to speed up search operations, and they can also change the way query results are formatted. Learn how to use them in this tutorial.
- [Instructor] For this challenge, we'll be using…the California population projection data…that we used in a previous challenge.…If you're not following along in order,…then you'll need to download the data yourself…from the California open data portal website.…Our first step is to set the ca_pop database…to be our default.…So I'll right-click on the database name…and select Set as Default Schema.…Then I need to add an index…to the population projection table…to make searching it faster,…so I'll click the wrench icon,…and then the Indexes tab.…And then we'll create an index named county,…and I'll leave that as the default index type.…
And I will add the county column to that index,…and click Apply, and then Apply again.…This may take a moment,…because of the number of rows in the table.…I chose the county column because we want to search…for male and female population by county.…Indexing the gender column doesn't help much,…because each gender accounts for half of the data.…We don't gain much of a performance improvement…
- Strengths and weaknesses of MySQL
- Creating a database
- Joining data sets
- Integrating Python with MySQL
- Searching a database
- CRUD operations
- Performing calculations
Skill Level Appropriate for all
1. Data and MySQL in under Five Minutes
2. Create a Database
3. Join Two Datasets
4. Search a Database
Searching a database1m 51s
5. Create, Read, Update, and Delete Operations
6. Averages and Calculations
Next steps1m 1s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.