DBMS Lab Manual 2020 - 21 Student Copy Updated
DBMS Lab Manual 2020 - 21 Student Copy Updated
To Excel in the emerging areas of Computer Science and Engineering by imparting knowledge,
relevant practices and inculcating human values to transform the students as potential resources to
contribute innovatively through advanced computing in real time situations.
DM1. To provide strong fundamentals and technical skills for Computer Science applications
through effective teaching learning methodologies.
DM2. To transform lives of the students by nurturing ethical values, creativity and novelty to
become Entrepreneurs and establish start-ups.
DM3. To habituate the students to focus on sustainable solutions to improve the quality of life
and the welfare of the society.
DM4. To enhance the fabric of research in computing through collaborative linkages with
industry and academia.
DM5. To inculcate learning of the emerging technologies to pursue higher studies leading to
lifelong learning.
COURSE OBJECTIVES AND OUTCOMES
AIM:
The aim of this laboratory is to inculcate the abilities of applying the principles of the database
management systems. This course aims to prepare the students for projects where a proper
implementation of databases will be required.
OBJECTIVES:
OUTCOMES:
DATE OF DATE OF
EX NO TITLE MARK SIGN
EXPERIMENT COMPLETION
VIEWS, SEQUENCES,
3 SYNONYMS
PROCEDURES AND
5 FUNCTIONS
TRIGGERS
6
EXCEPTION HANDLING
7
DATABASE CONNECTIVITY
9 WITH FRONT END TOOLS
DATE OF DATE OF
EX NO TITLE MARK SIGN
EXPERIMENT COMPLETION
POPULATING DATABASE
11 IN QUERY
CALCULATE AREA OF
13 CIRCLE USING PL/SQL
PROGRAM
EX NO: 1
DATE: DDL, DML & TCL COMMANDS
AIM:
SYNTAX:
INSERT:
SELECT:
UPDATE:
DELETE:
TCL Commands
COMMIT
Syntax:
Commit:
Syntax:
ROLLBACK TO [SAVEPOINT] savepointname; Where,
SAVEPOINT:is optional and is used to rollback a partial transaction, as far the specified
savepoint.
Savepointname: is a savepoint created in current transaction.
SAVEPOINT
Syntax:
SAVEPOINT savepointname;
PROBLEM STATEMENT:
Customer browse the catalogue of books
Customers place the orders
Customers call the book store and give the ISBN of a book and quantity.
Store prepares a shipment that contains the books customers have ordered
TABLE FROM THE PROBLEM STATEMENT
1) Books
2) Customers
3) Orders
4) Order_list
[root@localhost ~]# service mysqld
start [root@localhost ~]# mysql
mysql> create database sheryl;
Query OK, 1 row affected (0.00 sec)
mysql> use sheryl;
Database changed
mysql> show databases;
+ +
| Database |
+ +
| information_schema |
| mysql |
| sheryl |
| test |
+ +
4 rows in set (0.00 sec)
Table name: Books
mysql> Create table books(ISBN varchar(10) primary key, title varchar(30),
author char(10),Quan_instock int,price int ,pub_year date);
Query OK, 0 rows affected (0.01 sec)
Description of table
mysql> desc books;
+ + + + + + +
| Field | Type | Null | Key | Default | Extra |
+ + + + + + +
| ISBN | varchar(10) | NO | PRI | NULL | |
| title | varchar(30) | YES | | NULL | |
| author | char(10) | YES | | NULL | |
| Quan_instock | int(11) | YES | | NULL | |
| price | int(11) | YES | | NULL | |
| pub_year | date | YES | | NULL | |
+ + + + + + +
6 rows in set (0.00 sec)
Table name: Customers
mysql> create table customer(cust_id varchar(10) primary key, cust_name
varchar(20), cust_addr varchar(15), card_no varchar(15));
Query OK, 0 rows affected (0.01 sec)
Description of table
mysql> desc customer;
+ + + + + + +
| Field | Type | Null | Key | Default | Extra |
+ + + + + + +
| cust_id | varchar(10) | NO | PRI | NULL | |
| cust_name | varchar(20) | YES | | NULL | |
| cust_addr | varchar(15) | YES | | NULL | |
| card_no | varchar(15) | YES | | NULL | |
+ + + + + + +
4 rows in set (0.00 sec)
Description of table
mysql> desc orders;
+ + + + + + +
| Field | Type | Null | Key | Default | Extra |
+ + + + + + +
| order_no | varchar(10) | NO | PRI | NULL | |
| cust_id | varchar(10) | YES | | NULL | |
| order_date | date | YES | | NULL | |
+ + + + + + +
3 rows in set (0.00 sec)
Description of table
mysql> desc order_list;
+ + + + + + +
| Field | Type | Null | Key | Default | Extra |
+ + + + + + +
| order_no | varchar(20) | NO | PRI | NULL | |
| ISBN | varchar(10) | YES | | NULL | |
| quantity | int(11) | YES | | NULL | |
| ship_date | date | YES | | NULL | |
+ + + + + + +
4 rows in set (0.00 sec)
1. Write a query for creating new table from existing table with all fields.
Description of table
mysql> desc cust;
+ + + + + + +
| Field | Type | Null | Key | Default | Extra |
+ + + + + + +
| cust_id | varchar(10) | NO | | NULL | |
| cust_name | varchar(20) | YES | | NULL | |
| cust_addr | varchar(15) | YES | | NULL | |
| card_no | varchar(15) | YES | | NULL | |
+ + + + + + +
4 rows in set (0.00 sec)
2. Write a query for creating new table from existing table with selected fields.
Description of table
mysql> desc cust1;
+ + + + + + +
| Field | Type | Null | Key | Default | Extra |
+ + + + + + +
| cust_id | varchar(10) | NO | | NULL | |
| cust_name | varchar(20) | YES | | NULL | |
+ + + + + + +
2 rows in set (0.00 sec)
3. Write a query to create new table from existing table without any record.
Description of table
mysql> desc cust2;
+ + + + + + +
| Field | Type | Null | Key | Default | Extra |
+ + + + + + +
| cust_id | varchar(10) | NO | | NULL | |
| cust_name | varchar(20) | YES | | NULL | |
| cust_addr | varchar(15) | YES | | NULL | |
| card_no | varchar(15) | YES | | NULL | |
+ + + + + + +
4 rows in set (0.00 sec)
4. Alter the table books by increasing the field width of ISBN to 15.
mysql> desc books;
+ + + + + + +
| Field | Type | Null | Key | Default | Extra |
+ + + + + + +
| ISBN | varchar(10) | NO | PRI | NULL | |
| title | varchar(30) | YES | | NULL | |
| author | char(10) | YES | | NULL | |
| Quan_instock | int(11) | YES | | NULL | |
| price | int(11) | YES | | NULL | |
| pub_year | date | YES | | NULL | |
+ + + + + + +
6 rows in set (0.00 sec)
============================================================================
10. Drop customer_1 table.
13. Update the cust_addr as guindy for customer name raja in the Customer table.
mysql> select * from customer;
+ + + + +
| cust_id | cust_name | cust_addr | card_no |
+ + + + +
| 10 | Geetha | Medavakkam | C10 |
| 11 | Raja | Siruseri | C11 |
+ + + + +
2 rows in set (0.00 sec)
mysql> update customer set cust_addr='Guindy' where cust_name='Raja';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> rollback;
Query OK, 0 rows affected (0.01 sec)
SAVE POINT
mysql> rollback;
Query OK, 0 rows affected (0.00 sec)
INFERENCE:
DDL, DCL AND TCL commands were studied and its usage in implementation of
database in MySQL is understood from this experiment
RESULT:
Here the program has been verified and the output has been displayed
EX NO: 2
DATE: SIMPLE QUERIES, NESTED QUERIES, SUB QUERIES AND JOINS
AIM: To execute database querying with Simple queries, Nested queries, Sub queries and Joins
Syntax:
SELECT:
Syntax 1:Select column name1,columnname2 from <table name>;
Syntax 2: select * from <tablename>;
Syntax 3: select * from <tablename> where <condition>;
Select_clause from_clause [where_clause][groupby_clause][having_clause][orderby_clause]
The SELECT clause defines the types of the objects or values returned by the
query.The FROM clause defines the scope of the query by declaring one or more identification
variables, which can be referenced in the SELECTand WHERE clauses. An identification variable
represents one of the following elements:
The abstract schema name of an entity
An element of a collection relationship
An element of a single-valued relationship
A member of a collection that is the multiple side of a one-to-many relationship
The WHERE clause is a conditional expression that restricts the objects or values
retrieved by the query. Although the clause is optional, most queries have a WHERE
clause.
The GROUP BY clause groups query results according to a set of properties.
The HAVING clause is used with the GROUP BY clause to further restrict the query
results according to a conditional expression.
The ORDER BY clause sorts the objects or values returned by the query into a specified
order.
Subqueries with the SELECT Statement
SELECT column_name [, column_name ]FROM table1 [, table2 ]
WHERE column_name OPERATOR(SELECT column_name [, column_name ]
FROM table1 [, table2 ][WHERE])
Subqueries with the INSERT Statement
INSERT INTO table_name [ (column1 [, column2 ]) ]SELECT [ *|column1 [, column2 ]FROM table1 [,
tabl e2 ][ WHERE ]
Subqueries with the UPDATE Statement
UPDATE tableSET column_name = new_value[ WHERE OPERATOR [ VALUE ](SELECT COLUMN_NA
MEFROM TABLE_NAME)[ WHERE) ]
Subqueries with the DELETE Statement
DELETE FROM TABLE_NAME[ WHERE OPERATOR [ VALUE ](SELECT COLUMN_NAME
FROM TABLE_NAME)[ WHERE) ]
JOIN COMMANDS
INNER JOIN command returns the matching rows from the tables that are being joined.
LEFT OUTER JOIN command returns matching rows from the tables being joined and also non-
matching row from the left table in the result and places null values in the attributes that come
from the right side table.
RIGHT OUTER JOIN command returns matching rows from the tables being joined and also non-
matching row from the right table in the result and places null values in the attributes that come
from the left side table.
1. Find the names of all names in book relation eliminate duplicate.
mysql> select distinct author from books;
+ +
| author |
+ +
| David |
| James |
+ +
3 rows in set (0.00 sec)
=============================================================================
2. display in the books table with attribute price multiplied by 10.
mysql> select price*10 from books;
+ +
| price*10 |
+ +
| 1200 |
| 1200 |
| 2000 |
+ +
3 rows in set (0.00 sec)
============================================================================
3. Find all title for books whose author is james and price greater
Than 100.
mysql> select title from books where author='James'and price>100;
+ +
| title |
+ +
| Fairy Tales |
+ +
1 row in set (0.00 sec)
============================================================================
4. Find all isbn for books with book price between 150 and 200.
mysql> select isbn from books where price between 150 and 200;
+ +
| isbn |
+ +
| 1-103 |
| 2-203 |
+ +
3 rows in set (0.00 sec)
=============================================================================
5. Find the names of customer whose name includes the character ‘e’ in the third position.
mysql> select cust_name from customer where cust_name like ' %';
+ +
| cust_name |
+ +
| Geetha |
+ +
1 row in set (0.00 sec)
=============================================================================
6. Find the names of customer whose address starts with substring ‘e’.
SALESMAN TABLE
ORDERS TABLE
CUSTOMER TABLE
1.Write a query to display all the orders from the orders table issued by the salesman 'paul adam'.
2. Write a query to display all the orders which values are greater than the average order value for
10th October 2012.
mysql>SELECT * FROM orders WHERE purch_amt > (select AVG(purch_amt) FROM orders
whereord_date ='10/10/2012');
3. Write a query to find the sums of the amounts from the orders table, grouped by date, eliminating
all those dates where the sum was not at least 1000.00 above the maximum amount for that date.
mysql>SELECT ord_date, SUM (purch_amt) FROM orders a GROUP BY ord_date HAVING SUM
(purch_amt) > (SELECT 1000.00 + MAX(purch_amt) FROM orders b WHERE a.ord_date =
b.ord_date);
4. Write a query to extract the data from the customer table if and only if one or more of
the customers in the customer table are located in London.
5.Write a query to find all the salesmen who worked for only one customer.
6. Write a query to find all those customers who hold a different grade than any customer of the city
Dallas.
mysql>SELECT *FROM customer WHERE NOT grade = ANY (SELECT grade FROM customerWHERE
city='Dallas');
Table: Emp
Table:Depart
Table:Staff
Table:Book
Table:Issue
JOIN COMMANDS
EQUI-JOIN
Display the employee details, departments that the departments are same in both the emp and dept.
SELF JOIN
Write a Query to display employee names using Self Join
mysql> select distinct ename from emp x,depart y where x.deptno=y.deptno;
+ +
| ename |
+ +
| Arjun |
| Barath |
| Aparna |
+ +
4 rows in set (0.00 sec)
SUB-QUERY (query within another query)
Update deptno by adding empno and keep that as deptno for employee 4.
mysql> update emp set deptno=( select sum(empno)from depart) where empno=4;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
INFERENCE:
Here the execution of subqueries, nested and simple queries joint in database querying
is learnt and demonstrated with example
RESULT:
Here the program has been verified and the output has been displayed
EX NO: 3
DATE: VIEWS, SEQUENCES, SYNONYMS
AIM:
To implement and execute view, sequence and synonym in MySQL using Structured Query
Language commands
SYNTAX:
CREATE
[ALGORITHM = {MERGE | TEMPTABLE | UNDEFINED}]
VIEW [database_name].[view_name]
AS [SELECT statement]
index_col_name:
col_name [(length)] [ASC | DESC]
index_type:
USING {BTREE | HASH}
1) VIEWS:
Create a view using aggregate functions to calculate the No of years publish of the customer
3) INDEXES
To create an index on the Last Name column of the student table
CREATE INDEX:
mysql> create index lastname on student(name);
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
DROP INDEX:
mysql> drop index lastname on student;
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
INFERENCE:
In this experiment, the implementation and execution of view, sequence and command
is MySQL using structured Query Language is explained
RESULT:
Here the program has been verified and the output has been displayed
EX NO: 4
IMPLICIT AND EXPLICIT CURSORS
DATE:
AIM:
SYNTAX:
Explicit Cursors:
mysql> delimiter $$
mysql> call
curdemo(2)
-> $$
+ +
| name |
+ +
| shah |
+ +
1 row in set (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter $$
mysql> create procedure close_cursor(id int)
-> begin
-> declare name char(25);
-> declare cur1 cursor for select stu_name from student where stu_id =id;
-> open cur1;
-> fetch cur1 into name;
-> select name;
-> close cur1;
-> end $$
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter $$
mysql> call close_cursor(4);
-> $$
+ +
| name |
+ +
| maze |
+ +
1 row in set (0.00 sec)
AIM:
SYNTAX
CREATE
[DEFINER = { user | CURRENT_USER }]
PROCEDURE sp_name ([proc_parameter[,...]])
[characteristic ...] routine_body
CREATE
[DEFINER = { user | CURRENT_USER }]
FUNCTION sp_name ([func_parameter[,...]])
RETURNS type
[characteristic ...] routine_body
proc_parameter:
[ IN | OUT | INOUT ] param_name
type func_parameter:
param_name type
type:
Any valid MySQL data type
characteristic:
LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'
routine_body:
Valid SQL procedure statement
FUNTION SYNTAX:
CREATE
[DEFINER = { user | CURRENT_USER }]
FUNCTION sp_name ([func_parameter[,...]])
RETURNS type
[characteristic ...] routine_body
func_parameter:
param_name type
FACTORIAL OF GIVEN NUMBER
mysql> delimiter $$
mysql> CREATE PROCEDURE factorial(IN x INT)
-> BEGIN
-> DECLARE result INT;
-> DECLARE i INT;
-> SET result = 1;
-> SET i = 1;
-> WHILE i <= x DO
-> SET result = result * i;
-> SET i = i + 1;
-> END WHILE;
-> SELECT x AS Number, result as Factorial;
-> END;
-> $$
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter ;
mysql> CALL getin('Boston');
+ + + +
| deptno | dname | loc |
+ + + +
| 40 | Operation | Boston |
+ + + +
1 row in set (0.00 sec)
INFERENCE:
This experiment contains implementation of procedures and function in database
management system, procedure or function is a grouped SQL statement that performs
a specific task.
RESULT:
Here the program has been verified and the output has been displayed
EX NO: 6
TRIGGERS
DATE:
AIM:
TRIGGERS:
SYNTAX:
Syntax:
CREATE[DEFINER = { user | CURRENT_USER }]
TRIGGER trigger_name trigger_time trigger_event
ON tbl_name FOR EACH ROW trigger_stmt
Create a trigger to calculate the net salary and average salary of a employee in the employee table.
mysql> delimiter $$
mysql> CREATE TRIGGER before_emp_update
-> BEFORE UPDATE ON employees
-> FOR EACH ROW BEGIN
-> INSERT INTO emp_audit
-> SET action='update',
-> employeenumber=OLD.employeenumber,
-> lastname=OLD.lastname,
-> changedon = NOW();
-> END$$
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter ;
mysql> update employees set lastname='Ivan' where employeenumber=102;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
INFERENCE:
The implementation and execution of triggers in MySQL database using procedural
language is shown here. A trigger is a set of SQL statements that reside in a system
catalog.
RESULT:
Here the program has been verified and the output has been displayed
EX NO: 7
EXCEPTION HANDLING
DATE:
AIM:
The DECLARE….HANDLER statement specifies a handler that deals with one or more conditions. If one of
these conditions occurs, the specified statement executes. statement can be a simple statement such as SET
var_name = value, or a compound statement written using BEGIN and ENDThe handler_action value indicates
what action the handler takes after execution of the handler statement:
The condition_value for DECLARE ... HANDLER indicates the specific condition or class of conditions that
activates the handler:
+ +
| COUNT(*) |
+ +
| 4 |
+ +
1 row in set (0.00 sec)
INFERENCE:
The concept of exception handling using procedural that handles all types of exception
in database management system using procedural language concept is explained here
RESULT:
Here the program has been verified and the output has been displayed
EX NO: 8
DATABASE DESIGN USING ER MODELING, NORMALIZATION
DATE:
AIM:
ER- Diagram:
Mapping Cardinalities:
It expresses the number of entities to which another entity can be associated via a relationship set.
For a binary relationship set R between entity sets A and B. The Mapping Cardinalities must be one
of the following.
One to one
One to many
Many to one
Many to many
36
ER DIAGRAM
Produce the Third Normal Form of this document by normalization
0NF
ORDER(order#, customer#, name, address, orderdate(product#, description, quantity, unitprice))
1NF
ORDER(order#, customer#, name, address, orderdate)
ORDER_LINE(order#, product#, description, quantity, unitprice)
2NF
ORDER(order#, customer#, name, address, orderdate)
ORDER_LINE(order#, product#, quantity)
PRODUCT(product#, description, unitprice)
3NF
ORDER(order#, customer#, orderdate)
CUSTOMER(customer#, name, address)
ORDER_LINE(order#, product#, quantity)
PRODUCT(product#, description, unitprice)
INFERENCE:
Database design using E K Modeling and normalization is implemented here. E R
Model is componed of entity types and specifies relationship among entities.
RESULT:
Here the program has been verified and the output has been displayed
EX NO: 9 DATABASE CONNECTIVITY WITH FRONT END TOOLS
DATE:
AIM:
To design and implement a database connectivity with front end tools for Book database
using Netbeans and mysql.
Steps:
1.Create a database in
Mysql 2.Use the database.
3.Create three tables books,authors and book_by_author with SQL DDL Comands.
4.Insert few records in the tables mentioned above.
5. Open the NetBeans IDE and create a Java Project
6. Add the MySQL JDBC Driver
7. Create an application by connecting to the database and Execute the SQL
query processing statements and generate the query result
Database Creation:
mysql>CREATE
testdb; mysql>USE
testdb;
mysql>create table books(isbn varchar(20) primary key,title varchar(50),
edition varchar(20),price float(10,2));
mysql>create table authors(author_id int primary key,author_name
varchar(50));
mysql>create table book_by_author(isbn varchar(20),author_id int,foreign
key(isbn)references books(isbn),foreign key(author_id) references
authors(author_id));
Insertion:
msql>insert into books values('123456','Discrete Math','Second',56.78);
msql>insert into books values('102938','Numerical Methods','Third',98.46);
msql>insert into authors values(1,'CS Liu');
mysql>insert into authors values(2,'N Deo');
mysql>insert into book_by_author values('123456',1);
mysql>insert into book_by_author values('123456',2);
mysql>commit;
Open the NetBeans IDE and create a Java Project
package javaapplication1;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Connection connection = null;
Statement statement =
null; ResultSet resultSet
= null;
try{
connection=DriverManager.getConnection
(DB_URL,DB_USER,DB_PASSWD);
statement=connection.createStatement();
resultSet=statement.executeQuery
("SELECT * FROM books");
while(resultSet.next()){
System.out.printf("%s\t%s\t%s\t%f\n",
resultSet.getString(1),
resultSet.getString(2),
resultSet.getString(3),
resultSet.getFloat(4));
}
}catch(SQLException ex){
}finally{
try {
resultSet.close();
statement.close();
connection.close();
} catch (SQLException ex) {
}
}
}
}
OUTPUT:
INFERENCE:
The design and implementation of a database connectivity with frontend tools for
book database is executed using Netbeans and MySQL.
RESULT:
Here the program has been verified and the output has been displayed
EX NO: 10
CASE STUDY USING REAL LIFE DATABASE APPLICATIONS
DATE:
AIM:-
To create a Mini project to implement the Operations of a Student Database using JAVA
as front-end and MYSQL as back-end.
DESIGN PLAN
1) Biodata:-
2) Attendence:-
3) Marks:-
3) Import the packages: Requires that you include the packages containing the JDBC
classes needed for database programming. Most often using import java.sql.* will
suffice.
4) Register the JDBC driver:- Requires that you initialize a driver so you can open
a communication channel with the database.
Table Creation:-
Importjava.sql.*;
Importjavax.swing.JOptionPane;
Importjavax.swing.table.DefaultTableModel;
Button Coding:-
private void insertrecordActionPerformed(java.awt.event.ActionEventevt) {
try
{Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/sunil","root","rooty");
Statement stmt = conn.createStatement();
Class.forName("java.sql.Driver");
String nam = name.getText();
String roll = rollno.getText();
String regn = regno.getText();
String dbt = dob.getText();
stmt.executeUpdate("Insert into biodata values ('"+nam+"','"+roll+"',"+regn+" , '"+dbt+"')");
}
catch(Exception s){
JOptionPane.showMessageDialog(null, s.getMessage());
}
}
conn.createStatement();
Class.forName("java.sql.Driver");
String n = rollno2.getText();
int r = Integer.parseInt(phy.getText());
int p= Integer.parseInt(chem.getText());
int d = Integer.parseInt(dbms.getText());
catch(Exception s){
JOptionPane.showMessageDialog(null, s.getMessage());
rollno2.setText("");
phy.setText("");
chem.setText("");
dbms.setText("");
try {
rs.next();
rollno2.setText(rs.getString(1));
phy.setText(Integer.toString(rs.getInt(2)));
chem.setText(Integer.toString(rs.getInt(3)));
dbms.setText(Integer.toString(rs.getInt(4)));
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e.getMessage());
SCREEN SHOTS:
INFERENCE:
RESULT :
Here the program has been verified and the output has been displayed
CONTENT BEYOND SYLLABUS
INFERENCE
RESULT:
Here the program has been verified and the output has been displayed
EX NO:14
REPORTS USING SQL
DATE:
AIM:
EXAMPLE 1
SQL> SET LINESIZE 80
SQL> TTITLE 'PIT
STAFF'
SQL> select * from emp;
EXAMPLE 2
Employee Details
INFERENCE
RESULT:
Here the program has been verified and the output has been displayed
EX NO:15
CALCULATE AREA OF CIRCLE USING PL/SQL PROGRAM
DATE:
AIM:
To write a pl/sql code block to calculate the area of a circle for a value of radius varying from
3 to 7. Store the radius and the corresponding values of calculated area in an empty table named
areas, consisting of two columns radius & area .
Procedure:
INFERENCE
RESULT:
Here the program has been verified and the output has been displayed