Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
SAM exm paper
1. Practice exam paper Employee number Employee name Rate category Project number Employee number Project number Project name Rate category Hourly rate employee project employee_project e.g. Street, Town, City are dependent on Postcode (and not on the table’s PRIMARY KEY) CustomerID HouseNum Street Town City Postcode dependent not dependent 3NF
2.
3. Scenario S-Cars is a company which hires out stretch limousines, complete with uniformed chauffeurs, for special occasions. S-Cars currently has a fleet of 12 limos the smallest of which can take seven passengers the largest 20. The limos are hired out in sessions. In general there are three sessions in a day. The morning session starts at 7 am and finishes at 12 midday, the afternoon session lasts from 1 pm to 6 pm and the evening session from 7 pm to midnight. Earlier starts can be negotiated depending on the availability of limos and drivers. If customers book consecutive sessions they can negotiate with the driver as to when the hour break is taken. The firm employs 15 freelance drivers who are paid on a ‘number of sessions’ basis. Their rates vary from £40 to £80 a session and their wages are paid by the firm at the end of each month. Customers may hire more than one car or driver for special occasions (eg weddings or West End trips) and many customers book limos regularly. The first time customers make a booking they are given a client number which consists of the first three letters of their surname plus a four figure number. Customers quote their number when they make further bookings. Regular customers can negotiate discounts. Limos can only be booked up to 90 days in advance but drivers are assigned on the morning of the hire. A customer rings up or comes to reception. If they are an existing customer you look up their details in the card index file. If they are new, you ask them for their details and create a card. You are the new owner of S-Cars and are shocked to find the company uses this archaic paper-based system. bookings drivers customers limos bookings bookings ONE customer(s) can make ONE booking(s) MANY MANY ( ) ( ) ONE booking(s) can be for ONE limo(s) MANY MANY ( ) ( ) ONE booking(s) can be for ONE driver(s) MANY MANY ( ) ( ) drivers limos bookings bookings bookings_limos bookings_drivers
4. bookings customers drivers limos bookings_limos bookings_drivers bookings drivers customers limos bookings bookings ONE customer(s) can make ONE booking(s) MANY MANY ( ) ( ) ONE booking(s) can be for ONE limo(s) MANY MANY ( ) ( ) ONE booking(s) can be for ONE driver(s) MANY MANY ( ) ( ) drivers limos bookings bookings bookings_limos bookings_drivers
5. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile bookings customers drivers limos bookings_limos bookings_drivers
6. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Customer ID (PK) Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone bookings customers drivers limos bookings_limos bookings_drivers
7. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Customer ID (PK) Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Driver NHI Number (PK) Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile bookings customers drivers limos bookings_limos bookings_drivers
8. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Customer ID (PK) Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Driver NHI Number (PK) Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Car Reg (PK) Make Max Passengers Price per Session bookings customers drivers limos bookings_limos bookings_drivers
9. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Customer ID (PK) Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Driver NHI Number (PK) Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Car Reg (PK) Make Max Passengers Price per Session Booking ID Date Session No. of Passg Customer ID Date Booking Made Pickup Point Payment Made ? bookings customers drivers limos bookings_limos bookings_drivers
10. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Customer ID (PK) Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Driver NHI Number (PK) Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Car Reg (PK) Make Max Passengers Price per Session Booking ID (PK) Customer ID (FK) Date Booking Made Pickup Point Payment Made bookings customers drivers limos bookings_limos bookings_drivers
11. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Customer ID (PK) Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Driver NHI Number (PK) Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Car Reg (PK) Make Max Passengers Price per Session Booking ID (PK) Customer ID (FK) Date Booking Made Pickup Point Payment Made Booking ID (FK) Driver NHI Number (FK) Booking ID (FK) Car Reg (FK) bookings customers drivers limos bookings_limos bookings_drivers
12. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Customer ID (PK) Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Driver NHI Number (PK) Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Car Reg (PK) Make Max Passengers Price per Session Booking ID (PK) Customer ID (FK) Date Booking Made Pickup Point Payment Made Booking ID (FK) Driver NHI Number (FK) Date Session Booking ID (FK) Car Reg (FK) Date Session No. of Passg bookings customers drivers limos bookings_limos bookings_drivers
13. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile bookings customers drivers limos bookings_cars Customer ID (PK) Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Driver NHI Number (PK) Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Car Reg (PK) Make Max Passengers Price per Session Booking ID (PK) Customer ID (FK) Date Booking Made Pickup Point Payment Made Booking ID (FK) Car Reg (FK) Driver NHI Number (FK) Date Session No. of Passg Primary key? What uniquely identifies a particular session booking session?
14. Bookings CSV file Car Reg Date Session Booking ID Driver ID No. of Passg Make Max Passengers Price per Session Customer ID Date Booking Made Pickup Point Payment Made Customer Last Name Customer Initial Customer Title Customer House No. Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Customers CSV file Customer ID Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Drivers CSV file Driver NHI Number Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile bookings customers drivers limos bookings_cars Customer ID (PK) Customer Last Name Customer Initial Customer Title Customer House No Customer Street Name Customer Town Customer County Customer Post Code Customer Telephone Customer Day Telephone Driver NHI Number (PK) Driver Last Name Driver First Name Driver Title Driver HouseNo. Driver Street Name Driver Town Driver County Driver Post Code Driver Rate Per Session Driver Telephone Driver Mobile Car Reg (PK) Make Max Passengers Price per Session Booking ID (PK) Customer ID (FK) Date Booking Made Pickup Point Payment Made Booking ID (FK) Car Reg (PK) (FK) Driver NHI Number (FK) Date (PK) Session (PK) No. of Passg