Learn how to join datasets in MySQL where columns do not match exactly. Joins are typically done where values are identical, but MySQL supports joins on static, explicit values, or on conditional values. Learn how to use the CASE conditional structure to join unlike population data.
- [Instructor] To find the educational demand…using the full California population projection,…we need to create another nested select statement.…As usual, I'll start by working on a subquery first…and then build around it.…I have the mySQL workbench open, so I'll open a new SQL tab…and I'll make sure that my ca_pop database…is selected as default, which it is.…The thing that we'll need to do in this subquery…is find the total population for each age…so that we can multiply it by the educational coefficient…we found earlier and we put it in the data graphics table.…We'll also need to select the year…because our output needs to show the demand for every age…and every year.…
So I will select the year, the age,…and the sum of the population for that year and age…from the population projection table.…I'm actually going to name that sum of the population…total_pop so we can refer to it later.…And then I will need to group by the nonaggregate columns,…the year and age, and I'll end that query with a semicolon…and run it just to make sure that we've got the right data.…
- 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.