Table of Contents
Previous Section Next Section

Chapter 12: Working with Database Objects

Overview

In this chapter, you'll learn how to create, alter, and drop databases and other kinds of objects that live inside databases, such as tables, sequences, and so on.

Each of these objects has well-delimited purposes, and you'll examine them one at a time. The topics covered in this chapter include the following:

  • How to create and drop entire databases

  • How to create and drop data tables

  • How to modify existing data tables

  • Temporary tables

  • Sequences

  • Indexes

  • Declarative Referential Integrity (DRI) and the FOREIGN KEY constraint

Most databases ship with visual tools that help design tables and relationships between them. MySQL is an exception, but you can download third-party tools at http://www.mysql.com/downloads/contrib.html. One of the utilities you can try is MySQL Control Center, available from http://www.mysql.com/products/mysqlcc. These programs work by generating SQL for you and executing the SQL against the database without you even seeing it. You might find these tools do the job, but they won't always. It's certainly worthwhile knowing the SQL required to create these yourself.


Table of Contents
Previous Section Next Section