When it takes input , email is given and all other parameters are null it should show all records of that email. Similarly with other three input paramters.
If all inputs are null then it should show all records of the student table.
create or replace procedure get_student_records(
pis_email in varchar2,
pis_rollno in number,
pis_dept in varchar,
pi_class_id in number
)
IS
begin
end get_student_records;
Tables to be accessed :
CREATE TABLE student (
s_id NUMBER(10) NOT NULL,
s_rollno NUMBER(10) NOT NULL,
s_name VARCHAR2(20) NOT NULL,
s_dept VARCHAR2(10),
s_email VARCHAR2(25),
class_id NUMBER(10),
CONSTRAINT student_pk PRIMARY KEY ( s_rollno ),
CONSTRAINT fk_class FOREIGN KEY ( class_id )
REFERENCES class ( class_id )
);
CREATE TABLE class (
class_id NUMBER(10) NOT NULL,
class_name VARCHAR2(10) NOT NULL,
dept_id NUMBER(10),
CONSTRAINT class_pk PRIMARY KEY ( class_id ),
CONSTRAINT fk_depts FOREIGN KEY ( dept_id )
REFERENCES dept ( dept_id )
);
CREATE TABLE dept (
dept_id NUMBER(10) NOT NULL,
dept_name VARCHAR2(50) NOT NULL,
CONSTRAINT depts_pk PRIMARY KEY ( dept_id )
);