Saturday, 17 September 2016

View data from a Table

To view data of a table,
Here's the SYNTAXs for viewing the table data -

  1. Selected columns and All rows

    1: select column1,column2, column3, ..., columnN from <table_name>;
    

    Examples -

    1. select Roll_no,Name from student;
    


    1: select Name,Phone_Number from student;
    

  2. Selected rows and All columns

    1: select *from <table_name>
    2: where <condition>;
    

    Examples -

    1: select *from student 
    2: where Name='Trunks'; 
    

    1: select *from student 
    2: where Name='Naruto Uzumaki'; 
    

  3.  Selected rows and Selected columns

    1: select col1,col2,...,colN from <table_name>
    2: where <condition>;
    

    Examples -

    1: select Name,Phone_Number from student 
    2: where Name='Trunks'; 
    

    1: select Roll_no,Name from student 
    2: where Roll_no=15094; 
    

  4. All rows and All columns
    1: select *from <table_name>;
    

    Examples -

    1: select *from student;


No comments:

Post a Comment

If u need any help,