Question

Answer using SQL statements

1)All information about rental with longest rental period. Rental period in days must appear.

2)How much money earned from rental by car manufacturer’s country every year.

3)Show 20% of our best customers by total income.

4)Show customers who used our rental 2 or more times and customer’s average money spending less than average rental price;

5)Show customer count by each state (for state show 2 letters abbreviation). Results sort by customer count descending order then by state abbreviation ascending;

6)Select car manufacturers in which cars were not maintained in 2008.RENTAL X CARNUM - CUSTNUM - RENTALDAT - RETURNDAT 49291 592937 2010/10/20 2010/10/25 184737 429292 2010/5/23 2010/5/25 283249MANUFACTURER X MANUFNAME - COUNTRY - SALESREPN - SALESREPP - + Capital Motors Japan Smith 901 555 123 + Cooperative Motc USADate - PROCEDURE - MILEAGE - REPAIRTIME - MAINTENANCE X REPAIRNUM - 456 27381 27472 27556 27622 38201 38294 38299 38305 38312CUSTOMER X CUSTNUM - CUSTNAME - CUSTADDR - CUSTPHONE - 89287 Zhang Washington, 202 555 124 133819 Martin Memphis, TN 901 555- - CAR X CARNUM - MODEL 27391 Justice 48273 Beta 49291 Justice 123948 Beta 184737 Gold 283249 Prince 288299 Colorado 328151

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)

SELECT CARNUM, CUSTNUM, COST, DATEDIFF (RETURNDATE, RENTALDATE) AS NUMBER_OF_DAYS FROM RENTAL ORDER BY NUMBER_OF_DAYS DESC LIMIT 1;

2)

SELECT C.MANUFNAME, C.YEAR, SUM(R.COST) FROM CAR C JOIN RENTAL R ON C.CARNUM = R.CARNUM GROUP BY C.MANUFNAME, C.YEAR;

NOTE: As per HOMEWORKLIB POLICY I am allowed to answer specific number of questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.

Add a comment
Know the answer?
Add Answer to:
Answer using SQL statements 1)All information about rental with longest rental period. Rental period in days...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The general fund budget for a state for 1988 (Period 1) to 2011 (Period 24) follows....

    The general fund budget for a state for 1988 (Period 1) to 2011 (Period 24) follows. vau AWN Year Period Budget ($billions) 1988 1 3.05 1989 3.29 1990 3 3.56 1991 4.31 1992 4.39 1993 4.54 1994 4.66 1995 5.19 1996 5.35 1997 5.69 1998 6.01 1999 12 2000 6.48 2001 6.65 2002 15 6.56 2003 6.78 2004 6.98 2005 18 2006 8.38 2007 8.57 2008 21 8.66 2009 8.43 2010 23 8.23 2011 24 8.76 6.2 7.65 a. Which...

  • Lake City: Park Gazebo Revenues and CPI (1984-2012) Rental Revenue Rental Revenue Rental Revenue Year CPI...

    Lake City: Park Gazebo Revenues and CPI (1984-2012) Rental Revenue Rental Revenue Rental Revenue Year CPI Year CPl Year CPI 1984 $13,36855 103.933 1994 $21,099.88 148.225 2004 $33,056.72 188.908 98 $14,564.45 10700 1995 $22,435.85 152 383 2005 $36,661.23 19267 1980 $15,487 57 109.692 1996 $23,575.86 156 858 2006 $39,770.85 201.558 987 $16,363.24 113617 1997 $24,924.04 160,525 2007 $41,430.22 207.344 1988 $17,16130 118.275 198 26,63609 163008 2008 4082303 215.254 1989 $18,000.50 123942 1999 $28.247.11 166583 2009 $37,668.88 214.567 990 18,379.25 130.658...

  • MAT 154 - GCU Answer the following: What do the mean, median, and standard deviation represent...

    MAT 154 - GCU Answer the following: What do the mean, median, and standard deviation represent for each of the two stock? Which stock has the most risk? Why? Which stock has the most reward? Why? What stock would you chose to invest in and why? The Statistics ^IXIC Mean Median Std Dev 10.48% 8.43% 30.72% PL 49.60% 46.52% 79.48% The Data Change in Value over past APPL Adj Yearly Change in Value 시xicAdj Yearly over past Date Close Change...

  • Using data from the Southwest case, create a chart that plots the relationship between each airline’s...

    Using data from the Southwest case, create a chart that plots the relationship between each airline’s market share, in terms of revenue or airline seat miles flown, and its profitability for two periods: 1995-2000 and 2001-2005. Does your analysis suggest that market share is correlated with profitability in this industry? If you exclude Southwest Airlines and Jet Blue airlines from the analysis (companies that use “point-to-point” route structure rather than a “hub and spoke” route structure), how well does market...

  • please solve this problem using excel and show steps please D. and the standard deviation of...

    please solve this problem using excel and show steps please D. and the standard deviation of this distribution. 71. FILE Refer to the Baseball 2016 data. Compute the mean number of home runs per game. To do this, first find the mean number of home runs per team for 2016. Next, divide this value by 162 (a season comprises 162 games). Then multiply by 2 because there are two teams in each game. Use the Poisson distribution to estimate the...

  • Problem 4 and 5-7 House Appreciation and Mortgage Payments Say that you purchase a house for...

    Problem 4 and 5-7 House Appreciation and Mortgage Payments Say that you purchase a house for $272,000 by getting a mortgage for $240,000 and paying a $32,000 down payment. If you get a 30-year mortgage with an interest rate of 7 percent, what are the monthly payments? (Do not round intermediate calculations and round your final answer to 2 decimal places.) Рayment What would the loan balance be in ten years? (Round the payment amount to the nearest cent but...

  • 1.b) Create a Java application Lab3Part1b. Make sure you create a NEW project with the specific...

    1.b) Create a Java application Lab3Part1b. Make sure you create a NEW project with the specific name just given. You need to make sure the projects you create and submit have the correct names and the name of the file and name of the class are the same. The names are case sensitive. In this new project, set up your program to read in the data from the file SciFiDataBMTClean.txt using a Scanner. {file/Scanner setup 2 points}   Declare the variables...

  • This course is actually Quantitative Methods and Analysis In Unit 2, you have learned about three...

    This course is actually Quantitative Methods and Analysis In Unit 2, you have learned about three different types of distributions: Normal, binomial, and Poisson. You can take data that you collect and plot it out onto graphs to see a visual representation of the data. By simply looking at data on a graph, you can tell a lot about how related your observed data are and if they fit into a normal distribution. For this submission, you will be given...

  • write a SQL statements to perform the following: Select all years a World Series game was...

    write a SQL statements to perform the following: Select all years a World Series game was played Select all losing teams that played in a World Series game Select all winning and losing teams that played in a World Series game Select all cities of a winning or losing team that played in a World Series game Select all winning and losing teams that played in a World Series game, and provide aliases of "Winning Team" and "Losing Team" Select...

  • program an 8-to-1 multiplexor using verilog output of time table from 1 - 2047 For example...

    program an 8-to-1 multiplexor using verilog output of time table from 1 - 2047 For example output should look like.... --------- [Start of table] ---------------------------- [End of table] ---------- Here is example of 4x1 Multiplexor ... Just need code for 8x1 Multiplexor module DecoderMod(s, o); input [1:0] s; output [0:3] o; wire [1:0] inv_s; not(inv_s[1], s[1]); not(inv_s[0], s[0]); and(o[0], inv_s[1], inv_s[0]); and(o[1], inv_s[1], s[0]); and(o[2], s[1], inv_s[0]); and(o[3], s[1], s[0]); endmodule module MuxMod(s, d, o); input [1:0] s; input [0:3]...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT