Dia 1 - VirtuaaliAMK

Download Report

Transcript Dia 1 - VirtuaaliAMK

Exercises 1
1.
List the car types with mark Peugeot
2.
Show the count of the rents by customers
3.
How many cars have the rate more than 45 €?
4.
Show the last names of the customers whose last name begins with C sorted in
descending order
5.
Add a customer John Wayne to the customer-table
6.
Add the address “2 Main St.” to John Wayne
7.
Add the postal code “23456” to John Wayne
8.
Show the customer ids, last names, first names and register numbers of the
rents where the customer id is less than 4
9.
List the cars whose rates are lower than the average rate.
10.
Add a new rent to the rent-table, where customer id is 4, car is ‘BSA-224’ and
the rent day is the 11 April, 2005
1/2
Exercises 2
11.
Show the lowest and highest rent dates of the rents by car
12.
Show the register numbers, marks, models and rent dates of the rents where the
register number begins with B and the return date is missing
13.
List all rents
14.
List the register numbers, marks and models of the cars where rates are at least 30 €
and no more than 50 €
15.
Add a new car with reg_no ‘EEE-666’ and model id 2 to the car-table
16.
Add the rate 60 to car ‘EEE-666’
17.
How many rents are there in 2005?
18.
Show the cust_ids and the corresponding counts of rents
19.
List those customers’ last names in which the last name begins with A and ends with s
20.
List the cust_ids of the rent table where the count of rents is more than 2
2/2