The procedure is a sample and needs to be modified.
The software used is oracle 11g.
Provide screen shot of the program running.
create table student(ST_ID int primary key,
NAME varchar(25),
COURSECODE CHAR(4),
COURSENAME varchar(20),
TOTAL_MARKS int,
PERCENTAGE int);
insert into student values(1,'peter','CS82','DBMS',350,75);
insert into student values(2,'john','CS82','DBMS',150,35);
insert into student values(3,'joe','CS82','DBMS',300,59);
insert into student values(4,'William','CS82','DBMS',360,55);
insert into student values(5,'Harry','CS81','python',550,95);
insert into student values(6,'pinky','CS81','python',100,30);
insert into student values(7,'john','CS81','python',320,61);
insert into student values(8,'jane','CS81','python',350,65);
select * from student;
set serveroutput on;
CREATE or replace PROCEDURE MYPROCEDURE4(COURSE_NAME VARCHAR)
aS
count1 NUMBER :=0;
count2 number :=0;
count3 number :=0;
count4 number :=0;
CURSOR C1 IS
SELECT PERCENTAGE
FROM STUDENT
WHERE COURSENAME=COURSE_NAME;
begin
for p in c1
loop
if p.percentage>=70 AND P.PERCENTAGE<=100
THEN
count1 := count1 + 1;
elsif p.percentage >= 60 and p.percentage <70
THEN
count2 :=count2 + 1;
elsif p.percentage >=50 and p.percentage <59
THEN
count3 :=count3 + 1;
else
count4 :=count4 + 1;
END IF;
END LOOP;
dbms_output.put_line('TOTAL NUMBER OF STUDENT FOR
COURSE '||COURSE_NAME||' RANGING FROM 70%-100% IS
'||COUNT1);
dbms_output.put_line('TOTAL NUMBER OF STUDENT FOR
COURSE '||COURSE_NAME||' RANGING FROM 60%-69% IS '||COUNT2);
dbms_output.put_line('TOTAL NUMBER OF STUDENT FOR
COURSE '||COURSE_NAME||' RANGING FROM 50%-59% IS '||COUNT3);
dbms_output.put_line('TOTAL NUMBER OF STUDENT FOR
COURSE '||COURSE_NAME||' BELOW 49% IS '||COUNT4);
end;
/
EXEC MYPROCEDURE4('DBMS');
EXEC MYPROCEDURE4('python');
set serveroutput on;
CREATE or replace function MYfunction5 return varchar2
as
output varchar2(50);
CURSOR C1 IS
SELECT ST_ID,COURSENAME,NAME,TOTAL_MARKS
FROM STUDENT;
begin
for p in c1
loop
IF p.TOTAL_MARKS=350 THEN
output := output || ' ( '
||p.COURSENAME|| ' ' ||p.NAME||')';
END IF;
END LOOP;
return output;
end;
/
select MYfunction5 from dual;
The procedure is a sample and needs to be modified. The software used is oracle 11g. Provide screen shot of the program running. EX:NO:7 PLISOL PROCEDURE & FUNCTION AIM To develop the package for...
The procedure is a sample and needs to be modified. The software used is oracle 11g. Provide screen shot of the program running. EX.NO. 6 SQL TRIGGER AIM To develop the package for employee management system using SQL triggers. DATABASE SCHEMA EMP (EMPID, NAME, SALARY, COMMISSION, DEPT NO) PROCEDURE STEP 1: Start STEP 2: Initialize the trigger with specific table id STEP 3: Develop and execute SQL trigger to carry out the following action. Create a trigger on EMP table...
Someone please answer all of these. I need these badly. The submission date is knocking at the door. Experiment 1: SQL data definition and data insertion 46 hours) 1. CREATE TABLE. The database schema consists of the three relations, whose schemas are: S (Spa, Sname. Sgender, Sage, Sdert? // students(SID, name, gender, age, department) SC (Spa, Cne. Grade) //Course(SID, CID, grade) C (One Cname Crno. Ceredit) l/courses (CID, course name, prerequisite courses, credit) 2. DROP TABLE, ALTER TABLE, CREATE INDEX,...
Problems and Exercises 1 through 5 are based on the class schedule 3NF relations along with some sample data in Figure 7-16. For Problems and Exercises 1 through 5, draw a Venn or ER diagram and mark it to show the data you expect your query to use to produce the results.Figure 7-16: Class scheduling relations (for Problems and Exercises 1-5Figure 7-17 Adult literacy program (for Problems and Exercises 6-14)1. Write SQL retrieval commands for each of the following queries:a....
PL/SQL Auction Program 1. Create a user xyz, who is the owner of the auction. Create the schema, and package. 2. Create users x1 and x2 who are the participants in the auction. They will need acces to the package. 3. Bid on the same item and record your observations. Verify all scenarios. Upload the files with the missing code and a detailed sample run. AUCTION OWNER.TXT SQL> conn / as sysdba Connected. SQL> drop user xyz cascade; User dropped....