Question

Task 4: The InstantRide Driver Relationship team wants to create groups for drivers according to their...

Task 4: The InstantRide Driver Relationship team wants to create groups for drivers according to their ratings such as 3+ or 4+. For instance, a driver with the rating 3.8 will be 3+; whereas a driver with the rating 4.2 will be 4+. You need to return a two column output with DRIVER_ID and DRIVER_RATING which has first FLOOR applied and then CONCAT with + sign for all drivers with a rating greater than 0.

Create groups of drivers according to their ratings.

MySQL programming language

Homework Answers

Answer #1

Follow the below mysql code which return driver_id and driver_rating as mention in problem statement. I have inserted some dummy data.

/*create table driver_info */ 
create table Driver_Info(Driver_Id integer, rating double);
/* insert some data in table*/
insert into Driver_Info(Driver_Id, rating) values(1, 23.45);
insert into Driver_Info(Driver_Id, rating) values(2, 3.4);
insert into Driver_Info(Driver_Id, rating) values(3, 4);
insert into Driver_Info(Driver_Id, rating) values(5, 0);
insert into Driver_Info(Driver_Id, rating) values(7, -5);
/* select query to print id and rating */
select Driver_Id,concat(cast(substring_index(rating, '.', 1) as unsigned),'+') as Driver_Rating from Driver_Info where rating > 0;

Output:-

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
InstantRide is the new ride sharing application in the city and it has just started its...
InstantRide is the new ride sharing application in the city and it has just started its operations. With the help of the InstantRide mobile application, the users request a ride with their location. Drivers and cars are assigned to the request; and then the driver picks up the user to ride their requested location. Information for the users, drivers and cars are stored in the database as well as the travel transactions. In the USERS table, information for the users...
Problem Set 2: Pearson’s correlation (7 pts) Research Scenario: Is there a positive relationship between grit...
Problem Set 2: Pearson’s correlation (7 pts) Research Scenario: Is there a positive relationship between grit and GPA in high school seniors? A researcher examined this issue by having students beginning their senior year of high school complete a grit inventory using a Likert-based scale (range 1 – 7), where higher numbers indicate more “grit”. GPA was self-reported (scale 0 – 4.0). Enter the data shown here into SPSS to assess whether there is a positive relationship between grit and...
provide 3-4 paragraphs post (team 2) 1-What are 4 key things you learned about the topic...
provide 3-4 paragraphs post (team 2) 1-What are 4 key things you learned about the topic from reading their paper? 2-How does the topic relate to you and your current or past job? 3-Critique the paper in terms of the organization and quality.1- Employee Stress and how it has an Adverse Effect on a Company This paper explores employee stress and how it has an adverse effect on a company, its employees and the organization. Job stress can have a...
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation....
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation. case:    W17400 APIGEE: PEOPLE MANAGEMENT PRACTICES AND THE CHALLENGE OF GROWTH Ranjeet Nambudiri, S. Ramnarayan, and Catherine Xavier wrote this case solely to provide material for class discussion. The authors do not intend to illustrate either effective or ineffective handling of a managerial situation. The authors may have disguised certain names and other identifying information to protect confidentiality. This publication may not be...
3 SECURING THE WORKFORCE Diversity management in X-tech, a Japanese organisation This case is intended to...
3 SECURING THE WORKFORCE Diversity management in X-tech, a Japanese organisation This case is intended to be used as a basis for class discussion rather than as an illustration of the effective or ineffective handling of an administrative situation. The name of the company is disguised. INTRODUCTION In light of demographic concerns, in 2012, the Japanese government initiated an effort to change the work environment in order to secure the workforce of the future. Japan is world renowned for its...
2. SECURING THE WORKFORCE Diversity management in X-tech, a Japanese organisation This case is intended to...
2. SECURING THE WORKFORCE Diversity management in X-tech, a Japanese organisation This case is intended to be used as a basis for class discussion rather than as an illustration of the effective or ineffective handling of an administrative situation. The name of the company is disguised. INTRODUCTION In light of demographic concerns, in 2012, the Japanese government initiated an effort to change the work environment in order to secure the workforce of the future. Japan is world renowned for its...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT