Chapter 5. Alter: Rewriting the Past

image with no caption

Ever wished you could correct the mistakes of your past? Well, now is your chance. By using the ALTER command, you can apply all the lessons you’ve been learning to tables you designed days, months, even years ago. Even better, you can do it without affecting your data. By the time you’re through here, you’ll know what normal really means, and you’ll be able to apply it to all your tables, past and present.

We need to make some changes

Greg wants to make a few more changes to his table, but he doesn’t want to lose any data.

image with no caption
image with no caption

Yes, you can use ALTER TABLE to add it easily.

In fact, we think you should take a stab at it yourself since you’ve already met the ALTER command. Do the next exercise to get your code!

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.