Question

In: Computer Science

Question 1                                         &nbs

Question 1                                                                                   

List the details of cars that are Toyota sedan. The details include registration number, make and model, the number of seats, manufactured year, category ID, and category name.

RegoNo

MakeAndModel

NumOfSeats

ManufacturedYear

CategoryID

CategoryName

ABC455

Toyota Camry

5

1

sedan

NAK455

Toyota Corolla

4

2017

1

sedan

Question 2                                                                                  

Which cars have never been rented out? List the details that include the car’s registration number, make and model, number of seats, manufactured year, category as well as the daily hire rate.

RegoNo

MakeAndModel

NumOfSeats

ManufacturedYear

Category

DailyHireRate

ABC455

Toyota Camry

5

sedan

$35.00

PAK561

Nissan Navara

8

2017

minivan

$60.00

QLD101

Volvo XC60

5

2018

suv

$55.00

SOU320

GM Cardillac

7

2011

limos

$450.00

Question 3                                                                                    

Which cars have been rented out more than once? Show the car’s

registration number, make and model, manufactured year, and the number of rentals.

RegoNo

MakeAndModel

ManufacturedYear

NumOfRental

NAK455

Toyota Corolla

2017

2

QWA321

VW Caravelle

2017

2

Question 4                                                                                  

Find out the rental activities that have the most expensive cost. This includes the customer names, car registration numbers, make and models, the start hire dates, end hire dates and the costs. Note: You will need to use an aggregate function.

FirstName

LastName

RegoNo

MakeAndModel

StartDate

EndDate

Cost

Tony

Morrison

LLP677

Toyota Hilux

15/06/2019

21/06/2019

$280.00

Question 5                                                                                   

How many times of rental activity were from each customer? Show the customer name, phone, and the number of rentals. Order the list so that the customers who rented the most appear first.

FirstName

LastName

Phone

NumbOfRental

James

Farrell

0733099000

2

Issac

Newton

0299001122

2

Tony

Morrison

0490787772

1

David

Hacker

0749008877

1

Solutions

Expert Solution

Question 1                                                                                    (2 marks)

List the details of cars that are Toyota sedan. The details include registration number, make and model, the number of seats, manufactured year, category ID, and category name.

RegoNo

MakeAndModel

NumOfSeats

ManufacturedYear

CategoryID

CategoryName

ABC455

Toyota Camry

5

1

sedan

NAK455

Toyota Corolla

4

2017

1

sedan

NOTE : Table name is not given for any table, hence 'TABLE_NAME' is used as name of the table for all questions.

ANSWER

SELECT * FROM TABLE_NAME WHERE CategoryName='sedan' AND MakeandModel LIKE %T;

Question 2                                                                                   (2 marks)

Which cars have never been rented out? List the details that include the car’s registration number, make and model, number of seats, manufactured year, category as well as the daily hire rate.

RegoNo

MakeAndModel

NumOfSeats

ManufacturedYear

Category

DailyHireRate

ABC455

Toyota Camry

5

sedan

$35.00

PAK561

Nissan Navara

8

2017

minivan

$60.00

QLD101

Volvo XC60

5

2018

suv

$55.00

SOU320

GM Cardillac

7

2011

limos

$450.00

In above table the field NumOf Rental is not present, Hence the above question cannot be answered.

Question 3                                                                                    (2 marks)

Which cars have been rented out more than once? Show the car’s

registration number, make and model, manufactured year, and the number of rentals.

RegoNo

MakeAndModel

ManufacturedYear

NumOfRental

NAK455

Toyota Corolla

2017

2

QWA321

VW Caravelle

2017

2

SELECT * FROM TABLE_NAME WHERE NumOfRental > 1;

Question 4                                                                                   (2 marks)

Find out the rental activities that have the most expensive cost. This includes the customer names, car registration numbers, make and models, the start hire dates, end hire dates and the costs. Note: You will need to use an aggregate function.

FirstName

LastName

RegoNo

MakeAndModel

StartDate

EndDate

Cost

Tony

Morrison

LLP677

Toyota Hilux

15/06/2019

21/06/2019

$280.00

In the above table there is only cost present and from this it is unable to find the most expensive cost.

QUESTION 5

How many times of rental activity were from each customer? Show the customer name, phone, and the number of rentals. Order the list so that the customers who rented the most appear first.

FirstName

LastName

Phone

NumbOfRental

James

Farrell

0733099000

2

Issac

Newton

0299001122

2

Tony

Morrison

0490787772

1

David

Hacker

0749008877

1

SELECT * FROM TABLE_NAME ORDER BY NumOfRental DESC;

NOTE :: In all the 5 questions all the field are asked to display, hence * is  used.


Related Solutions

Question 1                                         &nbs
Question 1                                                                                                                    2 Marks Briefly explain the referential integrity rule. Provide a suitable situation when the referential integrity constraint is violated. Question 2                                                                                                                    2 Marks This question refers to the Part table as used in this unit lecture slides about the customers to order homeware parts. Using SQL DCL command to write a statement to permit a user with the log in ID of JOHNSON to access the Part table and update its UnitPrice value. Question 3                                                                                                                    2...
Question 1                                         &nbs
Question 1                                                                                      On October 1, 2010, Madison Ltd. acquired all the shares of Dobson Ltd. for $849,600. On that date, Dobson’s statement of financial position showed share capital of $540,000 and retained earnings of $273,600. In addition, at the acquisition date, all of Dobson’s identifiable assets and liabilities had carrying values that equaled their fair values. Madison and Dobson’s financial statements for September 30, 2014 are presented below: Statement of Financial Position As of September 30, 2014                                                                                                 Madison...
QUESTION 1                                         &nbs
QUESTION 1                                                                                                                                From the following information of two sole trader enterprises conducting similar businesses, prepare: Ratio calculations in the table below for comparison of profitability, asset efficiency, liquidity and capital structure. Vertical analysis of the Balance Sheets for both enterprises. Round all calculations to 2 decimal places. Balance Sheet data (end-of-year) Hi Enterprises $ Lo Enterprises $ Current assets 24 000 32 000 Motor vehicles (net) 19 000 27 000 Total assets 43 000 59 000 Current liabilities 14...
Question 1                                         &nbs
Question 1                                                                                                         25 Marks Study the following comparative profit and loss and financial position statements for Phoenix Energy for the years 2013 and 2014. The current market price for Phoenix Energy is OMR 0.420 Instructions: Based on the information provided, Examine the following ratios for the years 2015 and 2016.                      20 marks Earnings per share.           Inventory turnover. Total assets turnover.        Times interest earned.          Operating profit margin. Critically evaluate the profitability and the efficiency of the company over the two-year period....
Question 1                                         &nbs
Question 1                                                                                                                    2 Marks Briefly explain the referential integrity rule. Provide a suitable situation when the referential integrity constraint is violated. Question 2                                                                                                                    2 Marks This question refers to the Part table as used in this unit lecture slides about the customers to order homeware parts. Using SQL DCL command to write a statement to permit a user with the log in ID of JOHNSON to access the Part table and update its UnitPrice value. Question 3                                                                                                                    2...
Question 1                                         &nbs
Question 1                                                                                   (Total: 25 marks)                                                 Sijanggut runs a news agency and general store, selling goods mainly for cash, although she has a few account customers for newspapers and magazines who pay monthly. His income statement for the year ending 31 August 2019 is as follows: SIJANGGUT INCOME STATEMENT FOR THE YEAR ENDED 31 AUGUST 2019 RM RM Revenue 87,355 Cost of sales Opening inventory 3,567 Purchases 71,714 75,281 (-) Closing inventory (3,886) (71,395) Gross profit 15,960 Expenses (20,466)...
Question No. 1:                                    (LO1)     &nbs
Question No. 1:                                    (LO1)                                                            Explain the “due process” procedures followed by the FASB in developing a financial reporting standard.                                                                                                                      What is meant by “economic Consequences” in accounting standard-setting?                                                                                                                         Explain in your own words the importance of Financial Accounting and Financial Reporting.                                                                  
Question 5                                         &nbs
Question 5                                                                                                                                          Julian and Jenna carry on a partnership business and for the income year ended 30 June, the partnership net income was $38,000, as returned by their accountant. However, included in the deductions was a salary of $12,000 paid to Julian’s wife (who is not a business partner). The Commissioner disallows all but $2,000 of this amount. Required: What authority, if any, does the Commissioner have in disallowing the claim for salary? (2.5 marks) ANSWER: What course of...
Question 3                                         &nbs
Question 3                                                                                     Prints Galore Ltd., a Canadian company, acquired 100% of Sculptures Ltd. for FC 300,000 on January 1, 2014. Prints Galore’s functional currency is the Canadian dollar and Sculpture’s functional currency is the FC. Selected exchange rates are presented below:                              January 1, 2014                       FC1 = $1.6993 CAD                              December 31, 2015                  FC1 = $1.7182 CAD                              December 31, 2016                  FC1 = $1.7233 CAD Assume that the average rate for 2014, 2015, and 2016 is FC 1...
Question 2                                         &nbs
Question 2                                                                                                                  15 Marks The Anderson Group provides counselling services at different suburbs in NSW. It charges clients for (a) direct professional time (at an hourly rate) and (b) support services (at 30% of the direct professional costs billed). The three counsellors in The Anderson Group and their rates per counselling hour are as follows: Counsellor Billing Rate per Hour Rob Mason $320 Meghana Shreshtha 110 Daniel Jacob 50 The Anderson Group has just prepared the May 2019 bills...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT