1 / 13

Good Afternoon

Good Afternoon. Select with relational operators. With the help of clauses we can filters our list. Syntax : Select <Col. Name……> from <table name> [where <condition>] Example : select * from student where mark=50 select * from student where mark>50

truman
Download Presentation

Good Afternoon

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Good Afternoon

  2. Select with relational operators With the help of clauses we can filters our list. Syntax : Select <Col. Name……> from <table name> [where <condition>] Example : select * from student where mark=50 select * from student where mark>50 select * from student where mark>=50 select * from student where mark<50 select * from student where mark<=50 select * from student where mark<>50

  3. Select with logical operators Syntax : Select <Col. Name……> from <table name> [where <condition>] Example: Select * from student where mark>60 and mark<80 Select * from student where name=‘smith’ or name=john’ Select * from student where not address =‘cuttack’

  4. Select with NULL Syntax : Select <Col. Name……> from <table name> [where <condition>] Example: Select * from student where name is null Select * from student where address is not null

  5. Select with Between Syntax : Select <Col. Name……> from <table name> [where <condition>] Example: Select * from student where roll between 5 and 10 Select * from student where roll not between 5 and10

  6. Select with in Syntax : Select <Col. Name……> from <table name> [where <condition>] Example: Select * from student where city in(‘ctc’,’bbsr’) Select * from student where city not in (‘ctc’, ‘bbsr’)

  7. Select with like Syntax : Select <Col. Name……> from <table name> [where <condition>] Example: Select * from student where name like ‘_a’ Select * from student where name like ‘a%’ Select * from student where address like ‘a[d-j]%’ Select * from student where dept not like ’s%’

  8. Select with distinct Syntax:Select [distinct | all] <col. name> from <table name> [where <condition>] Example: Select distinct address from student

  9. Select with order by Syntax:Select <col. name> from <table name> [where <condition>][order by <col.list>] Example: Select * from student order by name

  10. Select with aggregate functions Syntax:Select aggfun(<col. name>) from <table name> [where <condition>] Aggregate functions are: sum(), avg(), count(), max() & min() Example: Select sum(mark) from student Select avg(mark) from student Select max(mark) from student Select count(roll) from student where mark>40 Select min(mark)from student

  11. Select name,max(mark) from student Will display the name of the students who have secured maximum mark

  12. Select name from student Where mark = select max(mark) from student Sub Query

  13. Thank You

More Related