Practical-1
Data types and Table creation
Page no - 1
RDBMS lab Roll no-17040
Command-describe department1704064
Output-
Command-describe student1704064
Output-
Page no - 2
RDBMS lab Roll no-17040
Practical-2
Alter, Drop & Rename commands
Page no - 3
RDBMS lab Roll no-17040
Output-
Page no - 4
RDBMS lab Roll no-17040
Page no - 5
RDBMS lab Roll no-17040
Practical-3
Insert commands
Query 1-Insert details into department table without using column names
Query 2-Insert details into department table with using column name
Page no - 6
RDBMS lab Roll no-17040
Page no - 7
RDBMS lab Roll no-17040
Practical-4
Delete, Update, Commit & Rollback commands
Page no - 8
RDBMS lab Roll no-17040
Command-commit;
Output-
Command-commit;
Output-
Page no - 9
RDBMS lab Roll no-17040
Practical-5
Select commands
Page no - 10
RDBMS lab Roll no-17040
Query 3-Select name, roll no, age of student from student table
Page no - 11
RDBMS lab Roll no-17040
Output-
Page no - 12
RDBMS lab Roll no-17040
Practical-6
Operators: conditional retrieval of rows matching a pattern from a table
Page no - 13
RDBMS lab Roll no-17040
Query 4-Select student details using AND logical operator with two different conditions
Page no - 14
RDBMS lab Roll no-17040
Command-select name, rollno, d_no from student_1704064 where name like ‘%a’
Output-
Command- select name, rollno, d_no from student_1704064 where name like ‘a%’
Output-
Page no - 15
RDBMS lab Roll no-17040
Command- select name, rollno, d_no from student_1704064 where name like ‘%a%’
Output-
Page no - 16
RDBMS lab Roll no-17040
Practical-7
Single row functions: aggregate functions and ordering the result of a
query
Query 3- Select student details from student table order by age in decreasing order
Page no - 17
RDBMS lab Roll no-17040
Output-
Query 6-Select student details with name in upper case, lower case and initcap
Page no - 18
RDBMS lab Roll no-17040
Output-
Page no - 19
RDBMS lab Roll no-17040
Page no - 20
RDBMS lab Roll no-17040
Page no - 21
RDBMS lab Roll no-17040
Query 16-Select name, roll no and round (age) from student table
Page no - 22
RDBMS lab Roll no-17040
Practical-8
Group functions: Grouping the result of a query
Query 1- select max, min, sum, avg marks and total no of enteries in student table
Query 2- select max, min, sum, avg marks and total no of enteries in student table grouped by
deparment no
Query 3- select max, min, sum, avg marks and total no of enteries in student table having
max(marks)<85
Query 4- select max, min, sum, avg marks and total no of enteries in student table grouped by
department no and having max(marks)<85
Page no - 23
RDBMS lab Roll no-17040
Practical-9
Set Operators, Nested Queries, Joins, Sequences
Command- select name from student_1704064 where d_no= (select d_no from
department_1704064 where d_name='cse');
Output-
Query 3- Find student name, dept name of students having marks >75 using join
Page no - 24
RDBMS lab Roll no-17040
Page no - 25
RDBMS lab Roll no-17040
Query 7- Find student details from table using left outer join
Query 8- Find student details from table using right outer join
Query 9- Find student details from table using (+) notation in the join
Page no - 26
RDBMS lab Roll no-17040
Query 10- Find the student names that in same department as that of student ‘abc’
Command- select rollno, name, DOB, gender, marks from student_17040 union select
rollno, name, DOB, gender, marks from student_1704064
Output-
Page no - 27
RDBMS lab Roll no-17040
Command- select rollno, name, DOB, gender, marks from student_17040 union all select
rollno, name, DOB, gender, marks from student_1704064
Output-
Command- select marks from student_17040 intersect select marks from student_1704064
Output-
Query 14-Find student details which is present in table1 but not in table2
Command- select name, marks from student_17040 minus select name, marks from
student_1704064
Output-
Page no - 28
RDBMS lab Roll no-17040
Practical-10
Views, Indexes, Database security and privileges: Grant and Revoke
commands
Page no - 29
RDBMS lab Roll no-17040
Page no - 30
RDBMS lab Roll no-17040
Page no - 31
RDBMS lab Roll no-17040
Practical-11
Pl/SQL architecture, assignments and expression, writing PL/SQL code,
referencing non-SQL parameters
Command- Declare
rno int;
deptno int;
Begin
rno:=&rollno;
select d_no into deptno from student064 where rollno=rno;
if (deptno=102) then
deptno: =101;
End if;
Update student064 set d_no=deptno where rollno=rno;
Commit;
End;
Output-
Page no - 32
RDBMS lab Roll no-17040
Command- Declare
rno int;
deptno int;
Begin
rno:=&rollno;
select d_no into deptno from student064 where rollno=rno;
if (deptno=104) then
deptno:=103;
elsif (deptno=103) then
deptno:=102;
end if;
update student064 set d_no=deptno where rollno=rno;
commit;
End;
Output-
Page no - 33
RDBMS lab Roll no-17040
Practical-12
Stored procedures and exception handling
Command-
Output-
Page no - 34