Creating Simple Tables

Once you've created a database or otherwise reserved space for your work, you can begin creating tables.

Tables are the basic building blocks of any database. They hold the rows and columns of your data. With SQL's data definition commands, you can create tables, drop tables, and alter them (add, remove, or rearrange columns or change their characteristics).

In most SQL implementations, the user who creates a table is its owner and is responsible for granting permission for its use to other users. When you create a table with SQL, you do at least the following:

  • Name the table

  • Name the columns it contains

  • Specify the datatype of each column

  • Specify the null status of each column—whether that column permits or forbids null values ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth 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.