final dbms
final dbms
Source code:
Output:
2. ALTER TABLE
Source code:
Output:
Table altered.
TABLE Emp1
Colum
n Null? Type
ROLL_NO - VARCHAR2(10)
ENAME - VARCHAR2(20)
EDOB - DATE
SALARY - NUMBER
ADDRESS - VARCHAR2(10)
Download CSV
5 rows selected.
3. DROP TABLE
Source code:
DROP TABLE Emp1;
desc Emp1
Output:
Table dropped. ORA-20001: object EMP1 does not exist
4. RENAME TABLE
Source code:
RENAME Emp1 TO Employee;
desc Employee
Output:
TABLE EMPLOYEE
Colum
n Null? Type
ROLL_NO - VARCHAR2(10)
ENAME - VARCHAR2(20)
EDOB - DATE
SALARY - NUMBER
ADDRES
- VARCHAR2(10)
S
5. TRUNCATE TABLE
Source code:
Output:
The data will be deleted but the structure will remain in the memory for further
operations. Table truncated. TABLE EMP1
EXPERIMENT 2
AIM: Implement Data Manipulation language statements (DML).
1. INSERT
2. SELECT
3. UPDATE
Output:
4. DELETE
EXPERIMENT 3
AIM : Implement select command with different classes.
1. WHERE
2. GROUP BY
3. HAVING
Output:
4. ORDER BY
5. SELECT
EXPERIMENT 4
2. UNIQUE
Source code: Output:
3. CHECK
4. DEFAULT
EXPERIMENT 5
AIM: Implement single row functions and group functions.
1. SUM
2. AVERAGE
3. COUNT
UNION
EXPERIMENT 7
AIM-Study and implement the concept of sub queries
UNION CLAUSE
INTERSECTION CLAUSE
MINUS CLAUSE
EXPERIMENT 8
AIM-Study and implement the concept of data control
language(DCL),Transaction control language (TCL).
COMMIT
EXPERIMENT 9
AIM-Study of Simple and Complex View
CREATE VIEW
OUTPUT
DROP VIEW
The above sql command drops the “age above 25” view.
EXPERIMENT 10:-
<VARIABLE DECLARATION>;
BEGIN
END;
SQL>Set serveroutput on
SQL> declare
a
number;
b
number; c
number;
begin
a:=&a;
b:=&b;
c:=a+b;
dbms_output.put_line(‘sum of’||a||’and’||
b||’is’||c); end;
/
new 7: b:=12;
OUTPUT:
sum of 23 and 12 is 35
dbms_output.put_line('B is maximum');
else
dbms_output.put_line('C is maximum');
end if;
end;
INPUT:
Output:-
C is maximum
EXPERIMENT 12
Aim:- Write a PL/SQL block for summation of odd numbers using for
LOOP
Source Code:-
DECLARE
-- declare variable num
num NUMBER(3) := 1;
sum1 NUMBER(4) := 0;
BEGIN
WHILE num <= 5 LOOP
-- end loop
END LOOP;