Hosting Web Sites Around the World
Home   About   Support   Search   Contact
  Ask Support
   
  Account Overview
  Control Panel Overview
    
  Anonymous FTP
  Archive Manager
  Active Server Pages
  CGI-BIN & File Paths
  Changing Passwords
  ContentXpress
  Counters
  Cron Job Manager
  Custom Error Manager
  Email Software Setup
  File Manager
  Formmail
  FTP Instructions
  .htaccess File
  IP address
  Mail Manager
  Mailing Lists
  Mime Types
  MS FrontPage
  MySQL
  Password Protection
  PGP & PGP Mail
  Real Audio/Real Video
  Redirect URL
  Revved Up Tools
  Search Engine
  Secure Mail
  Secure Server SSL
  Shopping Cart
  Site Statistics
  SiteXpress
  SSH / Telnet
  Spam Vault
  Sub-Domains
  Submission Tips
  Webmail
  Web Site Builder

 

 

Support Manual

Examples of SQL Statements

Below are a few examples 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 (00001, 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 = 00001;

searches the table Phonebook and finds the Name and Telephone number of the customer whose Id is equal to 00001.

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

 

Copyright © 2003-2007 Hosting Connecticut, LLC.
Resellers of Hosting Connecticut, LLC. may reproduce this manual on their sites.