In chapters 16 and 17, we started creating and manipulating data, and in this chapter, we’ll examine ways to create and manipulate the tables themselves. In many ways, we’ll be getting to the core of SQL language and its use because how the data is stored in tables is at the very heart of any relational database management system (RDBMS). Choosing how data is stored is one of the most important—perhaps the most important decision—that is made in any database.
Don’t worry; this chapter won’t be overly technical. It will still be easy enough for anyone to understand, and because you’ve been querying data with SQL statements that often mirror the English language for a while now, I’m confident that you’ll find the concepts and commands easy to comprehend. This chapter should also reinforce your understanding of things like primary keys and data types.
18.1 Creating a table
As you’ll soon see, creating a table in SQL can be very simple. First, though, you must consider a few things about the table before you write the SQL that creates the table.
18.1.1 Considerations before creating a table
- What is the name of the table?
- What are the names of the columns that will be included in the table?
- What are the data types of those columns?