ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Basic Structure of SELECT Statement

Updated on June 26, 2011

SELECT statement retrieves information from the database. If you want to retrieve any information, you must have to use SELECT statement. SELECT statement is one of the most useful statement of SQL. SELECT statement has several keywords and clause. This page describes about the basic structure of SELECT statement.

Syntax of SELECT statement

SELECT    * | {[DISTINCT] column | expression [alias], ... }
FROM      table;

Clauses of SELECT statement

SELECT statement has two clauses:

  1. SELECT clause: This clause specifies which column will be displayed
  2. Form clause: This clause identifies from which table the information will be retrieved.

Description of the SELECT statement syntax

The syntax of SELECT statement has several parts. Now, those will be explain:

  • SELECT: By this one or more column is listed.
  • * : It selects all the columns of the table.
  • DISTINCT: It only distinct the information and suppresses duplication.
  • column | expression : It selects the specific named column or the expression
  • alias : It gives a different headings to the selected column.
  • FROM table: It specifies the table containing the columns where table is the name of the table.

This is the basic structure of SELECT statement. If you have any difficulties or questions, you can ask it to the comment section. I will try to answer your questions.

© Written by rancidTaste

If you are enjoyed this post, please consider to give a thumbs up and leave a comment. You may Subscribe to rancidTaste's RSS feed to get new pages which will be delivered to your feed reader. You can also read more hubs by rancidTaste.

Want to express your knowledge and ideas, click here to join Hubpages.

It's simple, just like 1-2-3

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.

    Click to Rate This Article