Manual Experiment 1.2
Manual Experiment 1.2
Aim: To explore the “SELECT” clause using where, order by, between, like,
group by, having etc.
S/W Requirement: Oracle Database Express Edition (XE) or Oracle Live Sql
Practical:
1. Where clause:
Where clause is used along with SELECT command to specify the condition based on
which rows will be extracted from table
Syntax:
Select * from tablename where condition;
2. Like Clause:
wildcards
%,
_, one character
syntax:
select * from student where name like ‘%n%’;
select * from student where name like ‘n%’;------print the name of students
whose name starts with n
‘n__%’
This operator is used for matching character patterns. The character pattern matching is
called a wild card search.
o
3. In Clause:
It is used to test for the values in the list.
Syntax: Select * from tablename where column name in(values);
4. Between Clause:
It is used to specify a range of values. The range you specify contain lower and upper
range.
Syntax:
Select * from tablename where column name between value1 and value 2
p
5. Order by clause:
It can be used to sort the rows. The clause sorts the query output according to the values in
one or more selected column.
Syntax:
Select * from tablename order by column name;
6. And Clause:
It is used to check multiple condition if all conditions are true than output will be shown.
Syntax:
Select * from tablename where col1 condition and col2 condition;
7. Or Clause:
It is used to check multiple condition if any one condition is true than output will be
shown.
8. Group by Clause:
It is used to collect data across multiple record and group the result by one or more
columns.
Syntax:
Select column name,Function from tablename group by column name;