C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
Today
    Last 7 Days more...








    Examples of SQL Statements



    This chapter talks about some of the most commonly used SQL statements.





    As you already know by now, SQL is the language used to communicate with database systems. To execute commands on a database, you will compose SQL statements and send to a database or database server. The database system will parse the SQL statement and execute.

    What is SQL Statement ?


    An SQL statement represents a set of commands that can be executed by a database system. Here is a sample SQL statement:

    select name from employee where age > 20


    The above SQL statement will find the name of all employees from the EMPLOYEE table whoes Age is above 20. The words marked in blue color are keywords.

    Let us break the statement into 3 sections:

    select name - SELECT is a keyword and NAME represents the database field to select.

    from employee - FROM is a keyword and EMPLOYEE represents the database table to select data from.

    where age > 20 - WHERE is a keyword and AGE > 20 is the condition based on which the records are selected from the table.

    Basically, the select statement has the following syntax:

    SELECT [FIELD 1, FIELD 2, ...] FROM [TABLE NAME] WHERE [CONDITION]

    The WHERE condition is optional. If there is no WHERE condition, then the sql statement will return all the records from the table.

    In the next chapter, you will learn about the other types of SQL statements.





    Next Chapter: Sample SQL statements


    Previous Chapter: CRUD Operation


    Tutorial Index




    Read TATA Nano reviews.
    dotNet Slackers   BizTalk Adaptors    Web Design   Scripts
    Are you waiting for engineering entrance result? Watch here for engineering entrance results.
    web conferencing services

    Contact Us    Privacy Policy    Terms Of Use