Question: A: NULL Values and Outer Joins (30 points) drop table if exists tSail ; drop table if exists tBoat ; drop table if exists tReserve

A: NULL Values and Outer Joins (30 points)

drop table if exists tSail ;

drop table if exists tBoat ;

drop table if exists tReserve ;

create table tSail (

sid int,

name varchar(20) NOT NULL,

age int, rating int,

Primary Key (sid) ) ;

create table tBoat (

bid int, name varchar(20),

ratingNeeded int,

bcolor varchar(20),

PRIMARY KEY (bid) ) ;

create table tReserve (

bid int, sid int, rdate date,

PRIMARY KEY (bid,sid,rdate) ) ;

insert into tSail values (2,"Lopez",21,7) ;

insert into tSail values (3,"Andrews",24,9) ;

insert into tSail values (4,"Leutenegger",30,6) ;

insert into tBoat values(101,"Guppy",2,"red") ;

insert into tReserve values( 102, 1, "2019-03-18") ;

insert into tReserve values( 104, 2, "2019-03-19") ;

insert into tReserve values( 102, 3, "2019-03-20") ;

select *

From tSail S

left outer join tReserve R on S.sid = R.sid

union

select *

From tSail S

right outer join tReserve R on S.sid = R.sid ;

What is the output when the code above is run (it is not super long). Show the select statement result here.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!