Use JOINS (inner, self, left and right, cross and full ) in these tables with sql:
Use JOINS (inner, self, left and right, cross and full ) in these tables with sql:
create
create table Books(
Book_id varchar (30)NOT NULL Primary key,
Book_name varchar (80),
Edition_no varchar (20),
category_835757 varchar(20),
price decimal(5,2)
);
INSERT into books
values (1,'Specs','12th','Philosophy',35.11);
INSERT into books
values (2,'Oxford','25th','Dictionary',20.12);
INSERT into books
values (3,'Revolution','9th','Novel',10.15);
INSERT into books
values (4,'Ghost in wires','8th','Crime',13.52);
INSERT into books
values (5,'Burned','4th','Encyclopedia',15.22);
create table Reader(
Userid_757 varchar(50) NOt NULL Primary key,
Last_name varchar(100),
First_name varchar (200),
Phone varchar(100),
Email varchar(200),
Book_id int
);
INsert into reader
values('U513','Mahara','Kapil',647-555-1151,'Phantomconflicted.com',003);
INSERT into reader
values ('U514','Bhatta','Bikas',434-568-1051,'bikas434@yahoo.com',001);
INSERT into Reader
Values ('U515','Ford','Richard',134-091-5122,'ford22.com',002);
Insert into Reader
values ('U516','Bhattarai','Bikram',647-887-2078,'everesl.com',005);
INSERT into reader
values ('U517','Bhoj','Biraj',603-788-1072,'regmi.com',004);
create table Booking (
Booking_id varchar(100) NOT NULL PRIMARY key ,
Booking_date date ,
Return_date date,
Userid_757 varchar(100)
);
Insert into Booking
values ('B011','22-JAN-2021','23-JAN-2021','U513');
Insert into Booking
values ('B012','22-JAN-2021','24-FEB-2021','U514');
Insert into Booking
Values ('B013','24-JAN-2021','28-JAN-2021','U515');
Insert into Booking
values ('B014','25-JAN-2021','27-JAN-2021','U516');
Insert into Booking
Values ('B015', '28-JAN-2021','02-FEB-2021','U517');
create table payment (
Payment_id varchar (100) Not null primary key,
Payment_date date ,
Amount decimal(5,2),
User_id varchar (100)
);
INSERT INTO payment
values ('P115','22-JAN-2021',10.15,'U513');
INSERT into payment
values ('P116','22-JAN-2021',35.11,'U514');
INSERT INTO payment
values ('P117','24-JAN-2021',20.12,'U515');
INSERT INTO payment
values ('P118','25-JAN-2021',15.22,'U516');
INSERT INTO payment
values ('P119','28-JAN-2021',13.52,'U517');

Step by step
Solved in 6 steps with 6 images









