0% found this document useful (0 votes)
17 views

Manual Experiment 1.2

MY SQL COMMAND, NOTES

Uploaded by

Sakshi Chib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Manual Experiment 1.2

MY SQL COMMAND, NOTES

Uploaded by

Sakshi Chib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Experiment: 1.

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.

Syntax: select * from tablename where columnname like ’condition’;

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;

You might also like