1. All rows, all columns
2. All rows, selected columns
3. Selected rows, selected columns
4. Selected rows, all columns
ALL ROWS AND ALL COLUMNS:
In order to view all the rows and columns of your table. The syntax is:
Select to from ;
Here column 1 to column n is used to represent all the columns. Example: if you want to see all the rows and all the column of table student with column name "name", "fees", "marks", "percentage".
Select name, fees, marks, percentage from student;
Or; you can use "*" in spite of specifying all the column names like:
Select * from student;
To filter the data from the table i.e. to select some useful data from table you can use any of the below syntax:
ALL ROWS AND SELECTED COLUMNS:
To view specific column from the table this syntax is followed:
Select , from ;
Here column name 1 and column name 2 is used to represent the required column from your table. Example: if you want to see the name and percentage of student table than it will be done by:
Select name, percentage from student;
This will list all the rows but select columns like name and percentage.
SELECTED ROWS AND SELECTED COLUMNS:
To view or retrieve the selected rows and selected columns from your table the syntax followed is:
Select , from where ;
Till now you have list all the rows but if you want to filter rows based on some condition than it can be done in SQL by a clause "where". Where clause is used to specify some condition and the oracle engine compares each record in the table with the condition. This will select some specified columns and selected rows which will satisfy the condition followed by "where". Example: if you want to see name, marks and percentage of the student whose name starts with "a" than it will be done by:
Select name, marks, percentage from student where name like 'a%';
This command will list name, marks, percentage of those students whose name starts with 'a'.
SELECTED ROWS AND ALL COLUMNS:
You want to retrieve or list the entire column but on some specified condition than the syntax followed are:
Select * from where ;
This will list all the column with the rows which will satisfies the condition followed by where clause. Example: if you want to retrieve the entire column with the condition that lists only those students who scores percentage above 80%. The syntax is:
Select * from student where percentage>80;
This will lists the entire column with the percentage above 80%.
Published by Harsh Gupta - Tech Writer
I am a part time freelancer and writing is my hobby Some of my websites: http://www.GenericArticles.com http://www.JailBreakingiPhone.com View profile
- Inexpensive Designer Tricks for Christmas Table Top DecorOK, so you bit the bullet a decided to thorough a big shin dig this Christmas for friends and family. Well, personally I like to spend more money on the food and drinks then on the holiday table setting.
How to Decorate Your Easter Dinner Table for Less Than $20You don't have to spend a ton of money to really dress up the dinner table. Whether you are serving a buffet or a sit down Easter dinner these simple ideas are a great way to tr...- How to Make a Kitchen Table Base Out of Vintage Crochet MalletsThis Kitchen Table Base Out of Vintage Crochet Mallets is the perfect designer look for a retro or vintage kitchen.
How to Create a Service Invoice Using Microsoft WordIf you are a self-employed service provider, then your income depends on how professionally you present yourself. The more professional your image, the more business you'll attr...
Using Fireworks to Create Birthday InvitationsYou can create some pretty cool looking Birthday Invitaions in Fireworks. Creating the invitations does take a little time but if you can't find the invitations that you want, y...
- Using Varnish for Table Restoration
- How to Set the Table for a Dinner Party
- How to Make a Table of Contents in Microsoft Word
- Felt Table Runners
- Muddus Drop-Leaf Table by Ikea: Multipurpose Table and Desk for Small Spaces
- Thanksgiving Dinner Table Place Settings for Under $5
- How to Inexpensively Dress Up the Thanksgiving Table



