Database Articles

  Home arrow Database Articles arrow Page 2 - Query Primer
DATABASE ARTICLES

Query Primer
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2007-10-25

    Table of Contents:
  • Query Primer
  • Query Clauses
  • The select Clause
  • Column Aliases

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Query Primer - Query Clauses


    (Page 2 of 4 )

    There are several components or clauses that make up the select statement. While only one of them is mandatory when using MySQL (the selectclause), you will usually include at least two or three of the six available clauses. Table 3-1 shows the different clauses and their purposes.

    Table 3-1. Query clauses

    Clause name

    Purpose

    Select

    Determines which columns to include in the query’s result set

    From

    Identifies the tables from which to draw data and how the tables should be joined

    Where

    Restricts the number of rows in the final result set

    Group by

    Used to group rows together by common column values

    Having

    Restricts the number of rows in the final result set using grouped data

    Order by

    Sorts the rows of the final result set by one or more columns

    All of the clauses shown in Table 3-1 are included in the ANSI specification; additionally, there are several other clauses unique to MySQL that will be explored in Appendix B. The following sections delve into the uses of the six major query clauses.

    More Database Articles Articles
    More By O'Reilly Media

    blog comments powered by Disqus

    DATABASE ARTICLES ARTICLES

    - Completing a Book Inventory Management System
    - Uploading Images for a Book Inventory Manage...
    - Finishing the Add Book Story for a Book Inve...
    - Integration Testing for a Book Inventory Man...
    - User Stories for a Book Inventory Management...
    - Unit Testing a Book Inventory Management Sys...
    - Testing a Book Inventory Management System
    - Implementing Models for a Book Inventory Man...
    - Book Inventory Application: Publishers and B...
    - Handling Publishers in a Book Inventory Mana...
    - Publisher Administration for Book Inventory ...
    - Book Inventory Management
    - Using the SQL Reference Manual
    - Using Oracle SQL Developer with SQL Statemen...
    - Fixing Errors with Oracle SQL Developer


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap