Chapter 8. Joins and Multi-Table Operations: Canât we all just get along?
Welcome to a multi-table world. Itâs great to have more than one table in your database, but youâll need to learn some new tools and techniques to work with them. With multiple tables comes confusion, so youâll need aliases to keep your tables straight. And joins help you connect your tables, so that you can get at all the data youâve spread out. Get ready, itâs time to take control of your database again.
Still repeating ourselves, still repeating...
Greg noticed the same values for status, profession, interests, and seeking popping up again and again.
Prepopulate your tables
Wouldnât it make sense to have a set list of values in some of the tables?
Having many duplicate values will make it easy to prepopulate the status
, profession
, interests
, and seeking
tables. Greg wants to load up those four tables with the values already in his old my_contacts
table.
First he needs to query his table to find out whatâs already in there. But he doesnât want an enormous list of duplicate values.
Get Head First SQL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.