Experiment-05
Object: To perform the group function in
simple database Table.
Requirement: Windows XP, Oracle 9i.
Program Code:
SQL>create
table abhisrm
2 (name char(20),
3
id_no number(20),
4 salery number(20),
5 count number(20),
6 acc_no number(20));
Table
Created.
SQL>insert
into abhisrm values(‘abhishek’,’1031030007’,’500000’,’1’,’5’);
1
row created.
SQL>insert
into abhisrm values(‘abhinav’,’1031030008’,’4500000’,’2’,’6’);
1
row created.
SQL>insert
into abhisrm values(‘abhi’,’1031030015’,’5500000’,’3’,’7’);
1
row created.
SQL>insert
into abhisrm values(‘ashish’,’1031030041’,’5200000’,’4’,’8’);
1
row created.
Output:
SQL>desc
abhisrm;
Name
Null? Type
---------
-------------------- --------------------
name
CHAR(20)
id_no
NUMBER(20)
salery
NUMBER(20)
count NUMBER(20)
acc_no
NUMBER(20)
SQL>select * from abhisrm;
Name Id_no Salery Count Acc_no
---------
-------------------- --------------------
abhishek 1031030007
500000 1 5
abhinav 1031030008
450000 2 6
abhi 1031030015 550000
3 7
ashish 1031030041 520000
4 8
SQL>select
(salary) from abhisrm;
SALARY
--------------------
500000
450000
550000
520000
SQL>select
max(salary) from abhisrm;
MAX(SALARY)
--------------------
550000
SQL>select
min(salary) from abhisrm;
MIN(SALARY)
--------------------
450000
SQL>select
avg(salary) from abhisrm;
--------------------
5050000
SQL>select
count(*) from abhisrm;
COUNT(*)
--------------------
4
Result:The group function in simple database
table has been executed successfully.
0 comments:
Post a Comment