Download presentation
Presentation is loading. Please wait.
Published byMorris Gibbs Modified over 5 years ago
1
Topic – select statement with ‘between’, ‘not between’ , ‘like’ operators
Objective: 1) Able to use between’, ‘not between’ , ‘like’ operators in ‘select’ statement
2
Select * from employee where salary between 4000 and 7000;
‘BETWEEN ‘ Operator Waq to display the details of employees whose salary is between 4000 and 7000 (including 4000 &7000) Select * from employee where salary between 4000 and 7000; TABLE - EMPLOYEE OUTPUT ID NAME SALARY 1 ARUN 6000 2 VARUN 8000 3 ALI 9000 ID NAME SALARY 1 ARUN 6000
3
‘NOT BETWEEN ‘ Operator
Waq to display the details of employees whose salary is not between 4000 and 7000 (including 4000 &7000) Select name,salary from employee where salary not between and 7000; TABLE - EMPLOYEE OUTPUT ID NAME SALARY 1 ARUN 6000 2 VARUN 8000 3 ALI 9000 NAME SALARY VARUN 8000 ALI 9000
4
‘Like’ Operator String matching operator ‘LIKE’ % (Percent) % matches any substring _ (underscore) _ matches one character
5
Waq to display id and name of employees with name starting with ‘A’.
TABLE - EMPLOYEE ID NAME SALARY 1 ARUN 6000 2 VARUN 8000 3 ALI 9000 Waq to display id and name of employees with name starting with ‘A’. Select id,name from employee where name like ‘A%’; Waq to displayid,name of employees with name ‘R’ as second character . Select id,name from employee where name like ‘_R%’; 3) Waq to display all the details of employees with name starting with ‘A’ and having 4 letters in the name. select * from employee where name like ‘A_ _ _’;
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.