Book HomeMySQL and mSQLSearch this book

1.2. What Is a Relational Database?

According to our definition, a database is an organized collection of data. A relational database organizes data into tables. It is probably easier to illustrate the concept of a table than try to explain it. Table 1-1 is an example of a table that might appear in a book database.

Table 1-1. A Table of Books

ISBN

Title

Author

0-446-67424-9

L.A. Confidential

James Ellroy

0-201-54239-X

An Introduction to Database Systems

C.J. Date

0-87685-086-7

Post Office

Charles Bukowski

0-941423-38-7

The Man with the Golden Arm

Nelson Algren

Table 1-2 and Table 1-3 demonstrate two tables that might appear in an NBA database.

Table 1-2. A Table of NBA Teams

Team #

Name

Coach

1

Golden State Warriors

P.J. Carlesimo

2

Minnesota Timberwolves

Flip Saunders

3

L.A. Lakers

Kurt Rambis

4

Indiana Pacers

Larry Bird

Table 1-3. A Table of NBA Players

Name

Position

Team #

Rik Smits

Center

4

Kevin Garnett

Forward

2

Kobe Bryant

Guard

3

Reggie Miller

Guard

4

Stephon Marbury

Guard

2

Shaquille O'Neal

Center

3

We'll get into the specifics about tables later on, but you should note a few things about these examples. Each table has a name, several columns, and rows containing data for each of the columns. A relational database represents all of your data in tables just like this and provides you with retrieval operations that generate new tables from existing ones. As a result, the user sees the entire database in the form of tables.

A DBMS for a relational system is often called a Relational Database Management System (RDBMS). MySQL and mSQL are both examples of an RDBMS.

Where does SQL fit into all of this? We need some way to interact with the database. We need to define tables and retrieve, add, update, or delete data. SQL (Structured Query Language) is a computer language used to express database operations for data organized in a relational form (e.g., in tables). SQL is the industry standard language that most database programmers speak, and it is used by most RDBMS packages. As their names indicate, MySQL and mSQL are both SQL database engines. Due to their simplicity, however, they only support a subset of the current SQL standard, SQL2. We will discuss exactly how MySQL and mSQL support for SQL differs from the standard in later chapters.



Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.

This HTML Help has been published using the chm2web software.