Account Overview - Getting Started - Control Panel Overview - Chapter 1 FTP Software Setup
Chapter 2 SSH / Telnet Setup - Chapter 3 Email Software Setup - Chapter 4 CGI-Bin - Chapter 5 Secure Server
Chapter 6 FormMail - Chapter 7 MS FrontPage - Chapter 8 CGI Scripts - Chapter 9 ASP - Active Server Pages
Chapter 10 JSP - Java Server Pages - Chapter 11 PHP - Chapter 12 Real Audio/Real Video
Chapter 13 File Manager - Chapter 14 Mail Manager - Chapter 15 Changing Passwords - Chapter 16 Site Statistics
Chapter 17 Network Tools - Chapter 18 FTP Manager - Chapter 19 Backup Manager - Chapter 20 Password Protect Directories
Chapter 21 Custom Error Pages - Chapter 22 MySQL & PhpMyAdmin - Chapter 23 Mime Types - Chapter 24 CronTab
Chapter 25 Entropy Chat - Chapter 26 Akopia Shopping Cart - Chapter 27 Search Engine Submission
Chapter 28 PGP & PGP Mail - Chapter 29 Subdomains

Chapter 22 - MySQL



Examples of SQL Statements

Below a few examples are provided to give you an idea of what an SQL statement looks like.

Though they have a specific structure and can perform complex operations,  SQL commands are fairly easy to understand.

For example,

CREATE TABLE Phonebook (
Id char(5),
Name char(50),
Telephone char(11)
);
creates a new table in your database named Phonebook that has three fields, Id, Name, and Telephone, which are characters strings of length 5, 50 , and 11, respectively.

The statement
INSERT INTO Phonebook (Id, Name, Telephone)
VALUES (‘AAAAA’, ‘Joe Smith’, ‘800-555-1212’);
adds the data into the named fields as a new record of the Phonebook table in your database.

The statement
SELECT Name, Telephone
FROM Phonebook 
WHERE Id = ‘AAAAA’;
searches the table Phonebook and finds the Name and Telephone number of the customer whose Id is equal to ‘AAAAA’.

These are, of course, simple statements. Much more complicated databases and queries can be written using SQL, all of which are supported by MySQL.

Much of your database management will be done through the MySQL Control Panel provided in your account administration pages and not by typing in commands such as above. Though not needed, a working understanding of how to read and write SQL statements is of great help. There are many books and web sites which teach SQL and have many more examples.  If you plan on doing much database development, it is recommended that you review them.

Back To Top






©Copyright 1998 Web Host It. All Rights Reserved.