Skip to Content
Head First SQL
book

Head First SQL

by Lynn Beighley
August 2007
Beginner to intermediate
608 pages
13h 12m
English
O'Reilly Media, Inc.
Content preview from Head First SQL

Chapter 7. Multi-Table Database Design: Outgrowing your table

image with no caption

Sometimes your single table isn’t big enough anymore. Your data has become more complex, and that one table you’ve been using just isn’t cutting it. Your single table is full of redundant data, wasting space and slowing down your queries. You’ve gone as far as you can go with a single table. It’s a big world out there, and sometimes you need more than one table to contain your data, control it, and ultimately, be the master of your own database.

Finding Nigel a date

Greg’s lonely friend Nigel has asked Greg to help him find a woman to date with similar interests. Greg begins by pulling up Nigel’s record.

Here’s Nigel:

image with no caption
contact_id: 341
last_name: Moore
first_name: Nigel
phone: 5552311111
email: nigelmoore@ranchersrule.com
gender: M
birthday: 1975-08-28
profession: Rancher
city: Austin
state: TX
status: single
interests: animals, horseback riding,
movies
seeking: single F

The interests column isn’t atomic; it has more than one type of the same information in it. He’s worried it won’t be easy to query.

Greg adds Nigel’s request to his TO DO list:

image with no caption

Why change anything?

Greg’s decided not to change the interests column at all. He’s willing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Head First SQL, 2nd Edition

Head First SQL, 2nd Edition

Kimberly Fessel
Learning SQL

Learning SQL

Ben Forta
Practical SQL

Practical SQL

Anthony DeBarros

Publisher Resources

ISBN: 9780596526849Errata Page