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

    Chapter 3:  Tutorial Introduction 167 | Buffy   | f | Fang | m | dog | | Buffy   | f | Bowser | m | dog | +--------+------+--------+------+---------+ In this query,  we specify aliases for the table name in order to refer to the columns and keep straight which instance of the table each column reference is associated with. 3.4  Getting Information About Databases and Tables What if you forget the name of a database or table, or what the structure of a given table is (for example, what its columns are called)?  MySQL addresses this problem through several statements that provide information about the databases and tables it supports. You have already seen SHOW DATABASES, which lists the databases managed by the server. To nd out which database is currently selected, use the DATABASE() function: mysql> SELECT DATABASE(); +------------+ | DATABASE() | +------------+ | menagerie   | +------------+ If you haven't selected any database yet, the result is blank. To nd out what tables the current database contains (for example, when you're not sure about the name of a table), use this command: mysql> SHOW TABLES; +---------------------+ | Tables in menagerie | +---------------------+ | event | | pet | +---------------------+ If you want to nd out about the structure of a table, the DESCRIBE command is useful; it displays information about each of a table's columns: mysql> DESCRIBE pet; +---------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+-------+ | name | varchar(20) | YES   | | NULL | | | owner | varchar(20) | YES   | | NULL | | | species | varchar(20) | YES   | | NULL | | | sex | char(1) | YES   | | NULL | | | birth | date | YES   | | NULL | | | death | date | YES   | | NULL | | +---------+-------------+------+-----+---------+-------+ Field  indicates  the  column  name,  Type  is  the  data  type  for  the  column,  NULL  indicates whether the column can contain NULL values, Key indicates whether the column is indexed, and Default speci es the column's default value.
     

    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