Q3.1 Two types of databases with uses in a business context
Relational Database (e.g., MySQL, PostgreSQL):
Organizes data into structured tables with rows and columns related via keys. Uses SQL for queries. Ensures ACID properties (Atomicity, Consistency, Isolation, Durability).
Business uses: Ideal for Greenfleet Solutions to manage customer rentals, vehicle inventory, and payments with complex joins and transactions to prevent double-booking vehicles.
NoSQL Database (e.g., MongoDB, Cassandra):
Handles unstructured or semi-structured data in collections/documents. Flexible schema, horizontally scalable.
Business uses: Suitable for logging app usage analytics, real-time vehicle GPS data, or user reviews where data volume grows rapidly and structure varies.
Q3.2 Database design hypothesis for Greenfleet Solutions
A relational database is best as data is structured (customers, vehicles, rentals) with relationships and needs transaction integrity for rentals/payments. Conceptual design:
- Entities: Customers, Vehicles, Rentals, Payments, Locations.
- Relationships: One customer to many rentals (1:M), one vehicle to many rentals (1:M), one rental to one payment (1:1).
- Normalization: 3NF to avoid redundancy (e.g., separate locations). Supports app queries like available vehicles near user.
Q3.3 Four tables for Greenfleet Solutions database
- Customers
- Vehicles
- Rentals
- Payments
Q3.4 Schemas for the four tables
CustomersCustomerIDNameEmailPhoneAddressINT(PK,AUTO_INCREMENT)VARCHAR(100)NOTNULLVARCHAR(100)UNIQUENOTNULLVARCHAR(20)VARCHAR(200)
VehiclesVehicleIDTypeStatusBatteryLevelLocationIDINT(PK,AUTO_INCREMENT)ENUM(′Bike′,′Scooter′)NOTNULLENUM(′Available′,′Rented′,′Maintenance′)DEFAULT′Available′DECIMAL(3,1)INT(FK)
RentalsRentalIDCustomerIDVehicleIDStartDateEndDateRentalFeeINT(PK,AUTO_INCREMENT)INT(FK)NOTNULLINT(FK)NOTNULLDATETIMENOTNULLDATETIMEDECIMAL(8,2)
PaymentsPaymentIDRentalIDAmountPaymentDateMethodINT(PK,AUTO_INCREMENT)INT(FK)NOTNULLDECIMAL(8,2)NOTNULLDATETIMENOTNULLVARCHAR(50)
Q3.5 Primary keys for each table
Customers: CustomerID
Vehicles: VehicleID
Rentals: RentalID
Payments: PaymentID
Final design summary: Relational schema supports efficient queries for app (e.g., SELECT available vehicles by location). **Relational DB with Customers, Vehicles, Rentals, Payments tables}