Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write an anonymous PL / SQL program to print out the names of students and their school names for the team that won the
Please write an anonymous PLSQL program to print out the names of students and their school names for the team that won the first place rank in Science Olympiad Maryland State name of a competition
create table school
sid int, school id
sname varchar school name
primary keysid;
insert into school values 'Catonsville High';
insert into school values 'MarriottsRidge High';
create table team
tid int, team id
tname varchar team name
primary keytid
;
insert into team values'Science Genius';
insert into team values'Super robot';
insert into team values'Mad Scientists';
insert into team values'Little Eisenstein';
create table student
stid int, student id
stname varchar student name
sid int, school id
tid int, team id
grade int, grade
primary keystid
foreign keysid references school,
foreign keytid references team;
insert into student values 'Anna', ;
insert into student values 'Erica', ;
insert into student values 'David', ;
insert into student values 'Ravi', ;
insert into student values 'Ali', ;
insert into student values 'Cathy', ;
insert into student values 'Grace', ;
insert into student values 'Megan', ;
insert into student values 'Jeff', ;
insert into student values 'Ryan', ;
insert into student values 'Ron', ;
insert into student values 'Ella', ;
create table competition
cid int, competition id
cname varchar competition name
cdate date, competition date
primary key cid;
insert into competition values 'Science Olympiad Regional Baltimore',
date ;
insert into competition values 'Science Olympiad Maryland State',
date ;
create table teamresult
tid int, team id
cid int, competition id
score number, score of the team in the competition
rank int, teams ranking in the competition, smaller the better
primary keytidcid
foreign keytid references team,
foreign keycid references competition;
insert into teamresult values;
insert into teamresult values;
insert into teamresult values;
insert into teamresult values;
insert into teamresult values;
insert into teamresult values;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started