You are on page 1of 7

RDBMS ASSIGNMENT

QUERY BY EXAMPLE

Submitted By,
Punitha Angel.P,
Roll.No:743.
QUERY BY EXAMPLE
A Query is a request for data or
information
From data base table or combination of
table
This data may be generated
as results
returned by structred Query Language
PROCEDURE
A Procedure is a
name PL/SQL block which performs one or
more specific task.
This is similar
to a procedure in other programming
language.
The header
consists of the name of the procedure
and the parameter or variable passed to
the procedure.
SYNTEX:
CREATE [OR REPLACE] PROCEDURE
procedure_name(<Argument>{IN, OUT,IN OT}
(<Datatype>,…)
IS
Declaration section<variable,
constant>;
BEGIN
Exectuion section
EXCEPTION
Exception section
End
HOW TO EXECUTE A PROCEDURE
From the SQL prompt:EXECUTE[orEXEC]
procedure_name;
Within another procedure-simply use the
procedure name: procedure_name;
Example:
CREATE OR REPLACE PROCEDURE p1(id IN
NUMBER,sal IN NUMBER)
AS
BEGIN
INSERT INTO emp VALUES(id, sal);
DBMD_OUT_PUT.PUT_LINE(‘VALUE INSERTED.
’);
END;
CREATE A TABLE
Create command can also be used to
create tables.
We can specify the names and Datatypes
of varios columns in the create command
itself.
Syntex
CREATE TABLE <TABLE_NAME>
(
column_name1 datatype1,
column_name2 datatype2,
column_name3 datatype3,
colmun_name4 datatype4
);
EXAMPLE FOR CREATING TABLE
CREATE TABLE Student(
Student_id INT,
Name VARCHAR(100),
Age INT);

You might also like