18. Maintaining Tables

Keywords Introduced

CREATE TABLE  •  DROP TABLE  •  CREATE INDEX  •  DROP INDEX

With this chapter, we change our focus from data retrieval and modification to design. Up until now, we’ve assumed that tables simply exist and are available to any interested user. However, in the normal course of events, someone must create tables before the data in them can be accessed. We now turn to the question of how to create and maintain tables.

We previously touched on a few of the topics we’ll be addressing, such as primary and foreign keys, but we now want to delve into these areas in greater detail, and also bring in the related topic of table indexes.

Data Definition Language

Way back in Chapter 1, we mentioned the three main ...

Get The Language of SQL, Second Edition 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.