Database Reference
In-Depth Information
If you are a web designer this topic should also appeal if you want to see how the database
can influence your web design. You can see what is going on behind the scenes with a web
database.
If you are a hardened database programmer then this topic may have a place in your
library if you want to see what MySQL does specifically, or how it can interface with other
systems.
The topic also gives a brief introduction to database design, and shows how an efficiently
designed database can improve the performance of MySQL.
Lots of topics about SQL and databases start with a lot of theory. The theory normally
describes the “relational model” and instils terror into all but the most technical reader! I'm
not going to do this here. You do not have to learn about databases by looking at the theory.
I want you to learn how to use MySQL, and by association Structured Query Language
(SQL). You may pick up a bit of the theory on the way.
Databases and the Internet
As a web designer, databases can be of great use. In the early days of the internet, websites
were just static things that required each page to be created manually. This may have been
lucrative on an hourly rate but the more pages the site had the less sustainable they were.
Imagine trying to mount a sales catalogue on the web; you may have had to create a page
for every item in the catalogue. When databases began to get “glued” to websites, it sud-
denly meant that you could create a standard template page, which retrieved the product
detail from the database and created a webpage “on the fly” for each product.
That is not the only use for a web database. As soon as you start to put products on line
your users want to buy them! Another database can be used to log their orders, and even to
process and pick their orders by the warehouse staff and reorder from suppliers.
Even the web itself requires databases to run. Search engines like Google use incredibly
efficient databases that retrieve links to pages for us so simply that we take them for
granted.
DBMS
MySQL is what is known as a Database Management System (DBMS). The management
system decides how the data is stored, sorted and retrieved, as well as controlling user
access to it. Every time a user retrieves data, deletes data, or adds more data, the DBMS deals
with the request. The user cannot access the data files directly, he can only talk to the DBMS.
The management system is a barrier that controls access to the underlying data.
Figure 1.1 illustrates how a request to the database has to go through the DBMS first, and
cannot go directly to the database itself.
MySQL Databases
MySQL can control several databases at once. For instance, when you install MySQL, the
system creates the system database which is named mysql . This database contains all of the
Search WWH ::




Custom Search