SYSTEMS
(For II CSE by B.S.N.V.RAMANAMURTHY, Asst. Professor, CSE)
Objectives ................................................................................................................................. 4
Outcomes .................................................................................................................................. 5
Experiment 1 ................................................................................................................. 6
Experiment 2 ............................................................................................................... 9
Experiment 3 ............................................................................................................. 12
Experiment 4 .............................................................................................................. 15
Experiment 5 ............................................................................................................. 19
Experiment 6 ............................................................................................................... 22
Experiment 7 ................................................................................................................ 25
Experiment 8 ............................................................................................................... 28
Experiment 9 ............................................................................................................. 31
Experiment 10 .............................................................................................................. 34
Experiment 11 .............................................................................................................. 37
Experiment 12 ............................................................................................................. 40
Experiment 13 ............................................................................................................. 43
Experiment 14 ............................................................................................................. 45
Sample data:
Aim:
Creation, altering and dropping of tables and inserting rows into a table (use constraints while
creating tables) examples using SELECT command.
Outcomes:
Student should be able to know Creating and deleting of Tables.
Student should be able to Inserting, altering data by using SQL commands.
Requirements:
Essential Concepts:
SQL DDL, Create Table, INSERT, DELETE commands.
Integrity constraints, Domain constraints, Key constraints, PRAIMARY KEY, FOREIGN KEY.
Program:
Create a database called COMPANY consisting of two tables – EMP & DEPT
Insert Rows Into EMP, DEPT tables
Alter EMP table.
Drop the tables.
Faculty signature :
Aim:
Queries (along with sub Queries) using ANY, ALL, IN, EXISTS, NOTEXISTS, UNION, INTERSET,
Constraints.
Example: - Select the roll number and name of the student who secured fourth rank in
the class.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should be able to understand various queries and their execution.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Basic Structure of SQL Queries.
Select, Where and From Clauses.
Basics of Set Operations- UNION, INTERSECT, EXCEPT.
Faculty Signature:
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should be able to understand various queries and their execution.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Basics of Aggregate functions, GROUP BY and HAVING Clause.
Basics of Nested Queries.
Basic structure of views.
Syntax :
SELECT columnname, columnname
FROM tablename
GROUP BY columnname;
Faculty Signature:
Aim:
Queries using Conversion functions (to_char, to_number and to_date), string functions
(Concatenation, lpad, rpad, ltrim, rtrim, lower, upper, initcap, length, substr and instr), date
functions (Sysdate, next_day, add_months, last_day, months_between, least, greatest,
trunc, round, to_char, to_date)
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should learn various queries and their execution.
Student should learn several conversions using the functions.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Elements of data format model.
Basics of Implicit and explicit data conversions.
Performing Arithmetic with date.
Syntax:
Faculty Signature:
Aim:
i) Creation of simple PL/SQL program which includes declaration section, executable section
and exception –Handling section (Ex. Student marks can be selected from the table and
printed for those who secured first class and an exception can be raised if no records were
found)
ii) Insert data into student table and use COMMIT, ROLLBACK and SAVEPOINT in PL/SQL block.
Outcomes:
.
Student should able to know manage the changes made by the DML statements.
Student should able to learn how to control transactions with the COMMIT,ROLLBACK,
SAVEPOINT.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Basic structure of PL/SQL Block.
Cocepts of Transaction control – COMMIT, ROLLBACK, SAVEPOINT.
DECLARE
Declarations of memory variables used later
BEGIN
SQL executable statements for manipulating table data
EXCEPTIONS
SQL and/or PL.SQL code to handle errors
END;
COMMIT
Save changes (transactional).
Syntax:
COMMIT [WORK] [COMMENT 'comment_text']
COMMIT [WORK] [FORCE 'force_text' [,int] ]
ROLLBACK
Undo work done (transactional).
Syntax:
ROLLBACK [WORK] [TO [SAVEPOINT]'savepoint_text_identifier'];
ROLLBACK [WORK] [FORCE 'force_text'];
SAVEPOINT
Save changes to a point (transactional).
Syntax:
SAVEPOINT text_identifier
Insert data into student table and use COMMIT, ROLLBACK and SAVEPOINT in PL/SQL block.
Faculty Signature:
Aim:
Develop a program that includes the features NESTED IF, CASE and CASE expression. The
program can be extended using the NULLIF and COALESCE functions.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should be able to learn scope of a block.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Basic structure of PL/SQL Block.
Basics of PL/SQL conditional control statements.
1. write a PL/SQL block for inserting rows into EMPDET table with the following
Calculations:
HRA=50% OF BASIC
DA=20% OF BASIC
PF=7% OF BASIC
NETPAY=BASIC+DA+HRA-PF
2. write a PL/SQL block to check whether given number is Armstrong or not.
3. write a PL/SQL block to check whether a given number is Even or Odd.
Faculty Signature:
Aim:
Program development using WHILE LOOPS, numeric FOR LOOPS, nested loops using ERROR
Handling, BUILT –IN Exceptions, USE defined Exceptions, RAISE- APPLICATION ERROR.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should learn about PL/SQL block.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Basic structure of PL/SQL Block.
Basics of PL/SQL Loops- simple loop, while loop, For loop.
Faculty Signature:
Aim:
Programs development using creation of procedures, passing parameters IN and OUT of
PROCEDURES.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should able to know about PL/SQL programs.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Basic data types of PL/SQL.
Basics of SQL Queries.
Basics of PL/SQL Loops- simple loop, while loop, For loop.
Program:
1. Programs development using creation of procedures, passing parameters IN and OUT of
PROCEDURES.
Faculty Signature:
Aim:
Program development using creation of stored functions, invoke functions in SQL
Statements and write complex functions.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should able to know about stored and complex functions.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Basic data types of PL/SQL.
Basics of SQL Queries.
Basics of Creating local and stored functions and RETURN clause.
Basics of Parameter modes, constraints on formal parameters.
BEGIN
----PL/SQL code to call function
[EXCEPTION
----calling program exception handler ]
END;
Faculty Signature:
Aim:
Program development using creation of package specification, package bodies, private
objects, package variables and cursors and calling stored packages.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should be able to know about packages and cursors.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Create a Package by Groups of procedures, functions, variables, constants, cursors,
exceptons and SQL statements.
Basics of SQL Queries.
Faculty Signature:
Aim:
Develop programs using features parameters in a CURSOR, FOR UPDATE CURSOR, WHERE
CURRENT of clause and CURSOR variables.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should be able to know about cursors.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Basic Cursor definition and Usage.
Properties and working of Cursors.
Opening and closing the Cursors.
Cursor attributes.
OPEN <cursor-name>;
Faculty Signature:
Aim:
Develop Programs using BEFORE and AFTER Triggers, Row and Statement Triggers and
INSTEAD OF Triggers.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should be able to know about triggers.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Trigger Definition
Types of Triggers.
Program:
1. Create a TRIGGER to ensure that DEPT TABLE does not contain duplicate of null
values in DEPTNO column.
2. Develop Programs using BEFORE and AFTER Triggers, Row and Statement Triggers and
INSTEAD OF Triggers.
Faculty Signature:
Aim:
TO design REPORTS using oracle developer.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should be able to know about reports.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Properties of reports
Procedure to create report.
Types of reports.
Program:
Design reports using oracle developer.
Faculty Signature:
Aim:
Provide security using GRANT and REVOKE commands.
Outcomes:
Student should have a good understanding of the fundamental DBMS used in computer.
Student should be able to know about reports.
Requirements:
Processor 166 MHz, 256 MB RAM, 3 GB of available disk space.
Mysql /Oracle latest version Recommended
Essential Concepts:
Procedure to give privileges.
Creating users.
Program:
Assign several objects privileges in a single GRANT statement.
Revoke privileges from users or roles
Faculty Signature:
4. Create a trigger to delete all the employee records of a department when it is deleted.