You are on page 1of 2

Create table student

(
Rollno Number,
Name Varchar2(10),
Age Number,
Marks Number,
Section Char,
);
// to check the table
Select *
From Student
// insert into table
insert into student
values(1,'Raju',23,80,'A');

insert into student


values(2,'Appu',20,90,'B');

output of this queary is


1 row is inserted
1 row is inserted
// to select all the tables
Select *
From students;
// display null
Select *
from student
Where marks is null;

SYNTAX:

Where <coloum name> is null


// order in ascending or descending
SYNTAX:

Order by <column name> asc/desc

ex:
Select *
from student
order by name desc

// aggregate functions
select *
from student
where max(age) or min(age) or sum(marks) or avg(salary)

//using having clause


select deptno,count(*)
from emp
group by deptno
having count(*)>=2

means it will provid only the count which is having equal or above 2
//subquery

Select *
from emp
where deptno = (select deptno
from dept
where loc= 'mumbai');

You might also like