= Logical and Physical Design, DB Creation (DDL) == Notation * Primary Key - '''bold''' and __underline__ * Required/`NOT NULL` - '''bold''' * Foreign Key - Asterisk ( * ) * Optional (nullable) attributes - regular characters == Tables USERS (__'''user_id'''__, '''username''', '''first_name''', '''last_name''', '''password''', '''email''') ADMINS (__'''user_id'''__*) PET_OWNERS (__'''user_id'''__*) PET_SITTERS (__'''user_id'''__*) PET_TYPES (__'''pettype_id'''__, '''species''', average_lifespan, '''needs_outdoor_walk''') PETS (__'''pet_id'''__, '''name''', photo, '''age''', special_needs, description, '''owner_id'''*, '''pettype_id'''*) SERVICES (__'''service_id'''__, '''type''', description) BOOKINGS (__'''booking_id'''__, '''status''', '''date_from''', '''date_to''', '''address''', '''owner_id'''*, '''sitter_id'''*) REVIEWS (__'''review_id'''__, '''rating''', comment, '''booking_id'''*) PAYMENTS (__'''payment_id'''__, '''amount''', '''payment_type''', '''booking_id'''*) ADMIN_MANAGEMENT (__'''admin_id'''__*, __'''user_id'''__*) BOOKING_PETS (__'''booking_id'''__*, __'''pet_id'''__*) SITTER_SERVICES (__'''sitter_id'''__*, __'''service_id'''__*) BOOKING_SERVICES (__'''booking_id'''__*, __'''service_id'''__*) == DDL script for creating the database schema and objects: [attachment:schema_creation.sql] == DML script for filling tables with data: [attachment:data_load.sql] == Relational diagram [[Image(relational_schema.png)]]