Database Systems
Database Systems
Systems
Practical File
Index
Practical 1: Introductory Lab and Implementation of DDL, DML
Commands 3
Practical 2: To Implement the Usage of Constraints in SQL 13
Practical 3: To Implement the Usage of Clauses, Aggregate
Functions, Set Operations and Pattern Matching in SQL. 16
Practical 4: Implement the Usage of Joins, Nested Queries and
Sequences in SQL 20
Practical 5: Using Views in SQL 23
Practical 6: Introduction to PL/SQL 25
Practical 7: Using Procedures and Functions in PL/SQL 28
Practical 8: Reversing a Number in PL/SQL 30
Practical 9: Using Cursors in PL/SQL 31
3|Page
SQL
SQL stands for Structured Query Language. SQL is a programming language used by
nearly all relational databases to query, manipulate, and define data, and to provide
access control.
3. Scroll down until you see details for apex.oracle.com. Click Request a Free
Workspace.
4|Page
5|Page
4. On the Request a Workspace dialog, enter your Identification details – First Name,
Last Name, Email, Workspace. Note: For workspace, enter a unique name, such as
first initial and last name or roll number.
o Result:
o Result:
o Result:
10 | P a g e
o Result:
o Result:
o Result:
11 | P a g e
o Result:
o Result:
o Result:
Table Altered.
15 | P a g e
o Result:
Table Altered.
o Result:
Table Altered.
o Result:
o Result:
16 | P a g e
o Result:
Table Altered.
o Result:
Table Altered.
17 | P a g e
o Result:
o Result:
o Result:
18 | P a g e
o Result:
o Result:
o Result:
o Result:
o Result:
o Result:
20 | P a g e
o Result:
o Result:
o Result:
o Result:
22 | P a g e
o Result:
o Result:
o Result:
23 | P a g e
o Result:
o Result:
o Result:
24 | P a g e
7. Creating Sequence:
o Query:
o Result:
Sequence created.
o Result:
Sequence created.
9. Altering a Sequence:
o Query:
o Result:
Sequence altered.
o Result:
o Result:
Sequence dropped.
25 | P a g e
o Result:
o Result:
o Result:
26 | P a g e
o Result:
1 row(s) inserted.
o Result:
1 row(s) updated.
o Result:
1 row(s) deleted.
7. Renaming a View:
o Query:
o Result:
Statement processed.
8. Dropping a View:
o Query:
o Result:
View dropped.
27 | P a g e
Practical 6: Introduction to
PL/SQL
1. Creating a PL/SQL Block:
o Code:
o Result:
Hello!
o Result:
Hello, Kritika!
o Result:
Hello, Madhur!
28 | P a g e
o Result:
o Result:
Larger number is 34
29 | P a g e
o Result:
Factorial = 120
30 | P a g e
o Result:
Procedure created.
o Result:
Factorial = 120
31 | P a g e
o Result:
Function created.
o Result:
Factorial is 120
32 | P a g e
o Result:
2. Using a Function:
o Code:
o Result:
33 | P a g e
o Result:
No of rows deleted = 1
o Result:
Salary of JONES = 2975
Salary of SCOTT = 3000
Salary of FORD = 3000
Salary of SMITH = 800
Salary of ADAMS = 1100
34 | P a g e