Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Database Management System) Implementing a sample database: Consider the following relations containing ridesharing information. Create Three tables described below. Name these tables as RIDERS, PASSENGERS,

Database Management System)

image text in transcribed

image text in transcribed

Implementing a sample database: Consider the following relations containing ridesharing information. Create Three tables described below. Name these tables as RIDERS, PASSENGERS, and RIDES TODAY. The underlined fields are the primary keys of their respective tables. RIDER(rdr_id: int, name: varchar, vehicle: varchar, vtype: varchar, join_date: date, total_rides.int, income: decimal, distance: decimal) PASSENGERS(pid: int, pname: varchar, join_date:date) RIDES TODAY(rd_id: int, rdr_id: int, pid: int, distance: decimal, bill: decimal) . TABEL: RIDER rdr_id rname vehicle vtype join_date total_rides income distance 1 Abrar Fahim Honda Civic 20-03-2020 75 87000 1200 2 Jafar Ahmed Yamaha R15 B 12-01-2020 55 60000 900 3 Jannatul Lamia Toyota Prius 04-04-2020 30 33000 350 4 Tanvir Ahmed Yamaha Pulsar B 01-12-2019 105 100000 1370 5 Shahriar Alam Bajaj Discover B 25-01-2020 5 1000 80 6 Ashfaq Nabid UM Sport B 28-09-2020 1 350 22 7 SM Sayem Toyota Corolla 08-08-2020 15 5200 190 8 Golam Haider Vespa 16-03-2020 45 52000 650 TABEL: PASSENGERS pid pname join_date 1 Shahriar Chowdhury 02-01-2020 2 Jamal E Mollah 21-10-2019 3 Alvi Hossain 12-11-2019 4 Tonmoy Jaman 27-01-2020 5 Toukir Munshi 02-12-2019 6 Yakub Noby 24-12-2019 7 Mithila Rahman 27-02-2020 8 Jobbar Sheikh 14-03-2020 9 Chunnu Wahidul 07-06-2020 10 Rakib Hasan 29-08-2020 TABEL: RIDES TODAY rd_id rdr_id pid distance bill 1 1 7 14.3 480 2 2 10 1.3 40 3 4 2 8.9 110 4 5 4 15.5 260 5 7 3 5.1 250 6 1 7 14.3 510 7 1 1 9.5 330 8 7 6 5.5 280 9 8 10 8.2 140 10 5.7 90 11 2 2 3.4 90 12 8 6 12.5 165 13 4 8 15.6 250 14 3 6 8.5 290 15 4 2 5.1 70 11. (8 Points) Create a trigger for inserting new rows in the PASSENGERS table. The trigger will insert levels based on the join_date. 12, (4 Points) Create a stored procedure that will return the total amount of bill each rider earned today. Execute the procedure. 13. [6 Points) Show the name of the car riders with his passenger name, traveled distance, and bill who completed a single ride today. 14. [6 Points) Show the name of all bike riders with their today's total income. 15. [6 Points) Show the details of today's rides with the riders' relevant information and passengers' relevant information about who went for the ride today. BEST OF LUCK

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. Discuss the process of behavior modeling training.

Answered: 1 week ago