Chapter 9. Alter: Changing and Optimizing
Wish you could correct your mistakes or make upgrades?
Well, now’s your chance. If your table’s check engine light is on, consider making some improvements. You can use the ALTER command to apply all the lessons you’ve been learning about database design to tables you created days, months, or even years ago. Even better, you’re able to do it without affecting your underlying data. By the time you’re through with this overhaul chapter, you’ll also know about other ways you can optimize your data storage and turbocharge your query speed. And you’ll encounter string functions and table aliasing to refurbish your old clunker tables into dazzling beauties in mint condition. It’s time to put on your mechanic overalls and give your data a tune-up.
Summer camp chaos
The year is off to a rocky start for Camp Calloway, a summer camp for middle school students. The camp’s data administrator, Mrs. Murphy, came down with the flu, leaving Coach Collins to handle the SQL database. The coach did his best to build a table of information about the incoming camp participants, but his table admittedly has some problems.
You don’t have to dump your ...
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