What Are Databases?


So what are databases? The fundamental concept is a simple onedatabases organize data for access and manipulation under programmatic or application control.

The most popular database construct is the table, which provides our conceptual starting point. To see how a database table works, say that you are in charge of teaching a class and must store a grade for each student. You might make up a table like Table 8-2 to record the grade for each student.

Table 8-2. Student grades

Name

Grade

Ann

C

Mark

B

Ed

A

Frank

A

Ted

A

Mabel

B

Ralph

B

Tom

B


This table exactly mimics a table in a database. The database, however, offers far more advantages than paper: with a computer, you can sort, index, update, and organize large tables of data easily (and without a great waste of paper). You can even connect tables together in various ways, creating what are called relational databases.

Each individual data entry in a table, such as a student's name, goes into a field in the table. A collection of fields, such as the Name and Grade fields in our table, make up a record.

Each record gets its own row in a table, and each column in that row represents a different field. A collection of recordsthat is, rows of records where each column is a fieldforms a table.

What, then, is a database? In its most conventional form, a database is just a collection of one or more tables. To access the data in those tables, you use SQL in PHP, which is coming up in the next chunk.



    Spring Into PHP 5
    Spring Into PHP 5
    ISBN: 0131498622
    EAN: 2147483647
    Year: 2006
    Pages: 254

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net