Final Assignment of CSE311L: Database Management System
Final Assignment of CSE311L: Database Management System
Final Assignment of CSE311L: Database Management System
(5 ,7 ,3 ,5.1 ,250),
(6 ,1 ,7 ,14.3, 510),
(7 ,1 ,1 ,9.5 ,330),
(8 ,7 ,6 ,5.5 ,280),
Explanation :- Here first table show all passengers name and id then second table show who
ride today and we use “EXCEPT” returns only rows, which are not available in the second Select
statementAnd then print that passenger's id and name which are absent in the second table
and print those name and id.
ON a.rdr_id = r.rdr_id
UNION
SELECT r.rname,r.vehicle,r.vtype,r.income ,p.pname, p.join_date
Answer :-
SELECT r.rname ,r.vehicle, MAX(rt.distance)
FROM rider AS r JOIN rides_today AS rt
ON r.rdr_id = rt.rdr_id
WHERE r.vtype = 'C'
Explanation: Here we join rider and rider_today table find out car from different type vehicle
which is used for ride today. And we also find out who rides maximum distance through using
“MAX” and show the result.
Query :-
GROUP BY r.rdr_id
HAVING (COUNT(r.rdr_id)) =1
Explanation: - we use have join to join 2 table and where for search vehicle type and having for count
particular person who complete full single ride and we show the result.
Query :-
SELECT r.rname,r.vehicle,r.vtype,rt.distance,rt.bill
ON r.rdr_id = rt.rdr_id
group by r.rname
Explanation :- Here we 1st table print all rider and rider today who travel with bike . We use
join , where and group by operation to connect 2 table information and show the result .
Query :-
ON p.pid = rt.pid
JOIN rider AS r
ON rt.rdr_id = r.rdr_id
Explanation :- Here we 1st table print all rider and passengers details with that passenger who
do take a ride today. Then 2nd table also print rider and passenger details but this table also
print that rider today and all other information by using JOIN operation and show the result .