O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Creating, Altering, and Dropping Tables

Many DBMSes have interactive, graphical tools that let you create and manage tables and table properties such as column definitions and constraints. In this chapter, I’ll explain how to perform those tasks programmatically by using SQL:

  • The CREATE TABLE statement creates a new table.

  • The ALTER TABLE statement modifies the structure of an existing table.

  • The DROP TABLE statement destroys a table and all its data.

  • The CREATE TEMPORARY TABLE statement creates a table that the DBMS destroys automatically when it’s no longer in use.

  • The SELECT INTO statement creates a new table from an existing one.

These statements don’t return a result, but your DBMS normally will print a message indicating whether ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required