Professional Documents
Culture Documents
Mba Lab File
Mba Lab File
i. Employee Table:
Create table Employee
(person_name varchar2 (30),
Street varchar2 (14),
City varchar2 (30));
Output Message: Table created.
Ii.Works Table:
Create table Works
(person_name varchar2 (30),
Company_name varchar2 (30),
Salary number (10));
Output Message: Table created.
Iv.Manages Table:
Create table manges
(Person_name varchar2 (30),
Manager_name varchar2 (30));
Output Message: Table created.
Experiment-3 Data constraint (Primary Key, Foreign Key, Not Null), Data Insertion into table.
E_name varchar2(15),
E_designation varchar2(15),
E_salary number(10),
E_city varchar2(10));
OUTPUT:
OUTPUT:
(:E_id ,:E_name,
:E_designation ,
3
: E_salary ,:E_city);
Output:
(Rollno number(10),
name varchar2(15),
class number(2),
subject varchar2(10),
percentage number(10));
OutputMessage:Table created.
Output:
4
(E_id number(10),
E_name varchar2(15),
E_designation varchar2(15),
E_salary number(10));
Output:
OutputMessage:Table altered.
Output:
5
(:e_id,
:e_name,
:e_designation,
:e_salary);
OutputMessage:
E_id-101
E_name-amit
E_designation-manger
E-salary- 10000
1 row inserted
ii.Update:
OUTPUT:
6
iii.DELETE
ii.Insert table:-
(:e_id:e_name,
: e _address,
: e_salary);
Output:
iii.Group by clauses:-
SUM (E_SALARY)
---------------------
7000
4000
10000
(i)ABS
Output
Absolute
----------
87
(ii)ACOS
Arc_Cosine
----------
1.26610367
Similar to ACOS, you have ASIN (Arc Sine), ATAN (Arc Tangent)
functions.
(iii)CIEL
Returns the lowest integer above the given number.
Example:
8
Ciel
---------
4
(iv)FLOOR
Example:
Output
Floor
------------
3
(i)LOWER
(ii)UPPER
(iii)INITCAP
(iv) LENGTH
Experiment-11. Subquieries
name varchar2(15),
age number(10));
OUTPUT:
10
OUTPUT:
Experiment-13 JOINS
i.QUERY:
ii.QUERY:
OUTPUT:
11
Experiment-14. PL/SQL
declare
n number(10);
m number(10);
i number:=1;
begin
n:=:n;
while i<=10 loop
m:=n*i;
dbms_output.put_line(m);
i:=i+1;
end loop;
end;
Output:
12
Declare
a number(10);
b number(10);
c number(10);
begin
a:=&a;
b:=&b;
c:=a*b;
dbms_output.put_line(c);
end;
OUTPUT:
13
Experiment-16Trigger
DECLARE
sal_diff number;
BEGIN
END;
Result
Experiment-17. Cursors
DECLARE
c_id customers.id%type;
c_name customerS.No.ame%type;
c_addr customers.address%type;
CURSOR c_customers is
BEGIN
OPEN c_customers;
LOOP
END LOOP;
CLOSE c_customers;
END;
OUTPUT
1 Ramesh Ahmedabad
2 Khilan Delhi
3 kaushik Kota
4 Chaitali Mumbai
5 Hardik Bhopal
6 Komal MP