<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    168 MySQL Technical Reference for Version 4.0.3 If  you  have  indexes  on  a  table,  SHOW INDEX FROM tbl_name  produces  information  about them. 3.5  Examples of Common Queries Here are examples of how to solve some common problems with MySQL. Some of the examples use the table shop to hold the price of each article (item number) for certain traders (dealers).  Supposing that each trader has a single xed price per article, then (article, dealer) is a primary key for the records. Start the command-line tool mysql and select a database: mysql your-database-name (In most MySQL installations, you can use the database-name 'test'). You can create the example table as: CREATE TABLE shop ( article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL, dealer   CHAR(20) DEFAULT '' NOT NULL, price DOUBLE(16,2) DEFAULT '0.00' NOT NULL, PRIMARY KEY(article, dealer)); INSERT INTO shop VALUES (1,'A',3.45),(1,'B',3.99),(2,'A',10.99),(3,'B',1.45),(3,'C',1.69), (3,'D',1.25),(4,'D',19.95); Okay, so the example data is: mysql> SELECT * FROM shop; +---------+--------+-------+ | article | dealer | price | +---------+--------+-------+ | 0001 | A |   3.45 | | 0001 | B |   3.99 | | 0002 | A | 10.99 | | 0003 | B |   1.45 | | 0003 | C |   1.69 | | 0003 | D |   1.25 | | 0004 | D | 19.95 | +---------+--------+-------+ 3.5.1  The Maximum Value for a Column \What's the highest item number?" SELECT MAX(article) AS article FROM shop +---------+ | article |
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide