Table Of Contents:

Chapter 1
Account Overview

|
Chapter 2
Getting Started

|
Chapter 3
Control Panel Overview

|
Chapter 4
FTP Instructions

|
Chapter 5
SSH / Telnet

|
Chapter 6
Email Software Setup

|
Chapter 7
File Manager

|
Chapter 8
Change Password

|
Chapter 9
Mail Manager

|
Chapter 10
Site Statistics

|
Chapter 11
Mailing List

|
Chapter 12
Microsoft FrontPage

|
Chapter 13
Site Creation Tool

|
Chapter 14
Counters

|
Chapter 15
Protect Directories

|
Chapter 16
Redirect URL

|
Chapter 17
Search Engine

|
Chapter 18
Formmail

|
Chapter 19
PGP & PGP Mail

|
Chapter 20
Mime Types

|
Chapter 21
Anonymous FTP

|
Chapter 22
Archive Manager

|
Chapter 23
SSL (Secure Server)

|
Chapter 24
MySQL

|
Chapter 25
Shopping Cart

|
Chapter 26
CGI-bin

|
Chapter 27
Real Audio / Real Video

|

LinuxWebHost.com

Send a Support Request

Support Manual

Chapter 24: MySQL

Overview | MySQL Control Panel Feature | Examples of SQL Statements | Quick Actions
Advanced Queries | Table Properties | Table Select | Perl SQL Delete Example
Perl SQL Insert Example | Perl SQL Update Example | Perl While Loop Example
View Dump Database Schema | Using MySQL With CGI Scripts
References and Tutorials



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 undrstanding 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.