ou will need to create the database tables and choose sensible data types for each column. Make sure to maintain entity and referential integrity, and implement all the above constraints. Since other developers work in parallel on other parts of the system, you will need to strictly follow  the above specification to correctly implemented in your database. Otherwise, the other software  will not be able to use your database. This means, one needs to be able to rely on all constraints  being correct, the spelling of table and column names being as given, and that the data types that  you chose will allow for sensible data to be added to the database in the future. For testing purposes, you are asked to insert the data specified below into the tables, but no other  data except this. In short: 1. You will need to create the tables as specified 2. You will need to add the data specified Please use the 3.sql and implement your tables using the sketched  CREATE TABLE commands. Add the necessary queries in the file where indicated. 3.sql:  -- Task 1: Create Tables and Insert Data ------------------------------------------------------------------------------- CREATE TABLE Customer (   ); CREATE TABLE Park (   ); CREATE TABLE Booking (   ); CREATE TABLE ActivityLeader (   ); CREATE TABLE Activity (     ); CREATE TABLE Admin (   ); CREATE TABLE Lodge (   ); CREATE TABLE BookingLodge (   ); -- Add data to the tables: -- (add your queries here)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

You will need to create the database tables and choose sensible data types for each column.
Make sure to maintain entity and referential integrity, and implement all the above constraints.
Since other developers work in parallel on other parts of the system, you will need to strictly follow 
the above specification to correctly implemented in your database. Otherwise, the other software 
will not be able to use your database. This means, one needs to be able to rely on all constraints 
being correct, the spelling of table and column names being as given, and that the data types that 
you chose will allow for sensible data to be added to the database in the future.
For testing purposes, you are asked to insert the data specified below into the tables, but no other 
data except this.
In short:
1. You will need to create the tables as specified
2. You will need to add the data specified

Please use the 3.sql and implement your tables using the sketched 
CREATE TABLE commands. Add the necessary queries in the file where indicated.

3.sql: 

-- Task 1: Create Tables and Insert Data
-------------------------------------------------------------------------------

CREATE TABLE Customer (
 
);

CREATE TABLE Park (
 
);

CREATE TABLE Booking (
 
);

CREATE TABLE ActivityLeader (
 
);

CREATE TABLE Activity (
   
);

CREATE TABLE Admin (
 
);

CREATE TABLE Lodge (
 
);

CREATE TABLE BookingLodge (
 
);

-- Add data to the tables:
-- (add your queries here)
A booking is for a specific park.
A booking can choose one or more lodges as part of the booking.
Constraints
You also agreed on the following domain constraints:
• ArrivalDate in Booking should be no earlier than the current date
• DepartureDate in Booking should be no earlier than the ArrivalDate
• Special Requests in Booking should permit an arbitrarily long description of the request
DOB in ActivityLeader and Admin should be before the current date
• Salary in ActivityLeader and Admin cannot be negative
• WorkAdjustment in ActivityLeader and Admin should permit an arbitrarily long
description
• Role in Admin should only allow the values Manager, Receptionist, HR, Sales, Marketing
Target Audience in Activity should only allow the values Children, Adults, All
area in Lodge should only allow the values Central, Outer, Exclusive
•
LodgeNo and MaxOccupants in Lodge should only allow values larger than zero
a LodgeNo can only be used once in the same park
To ensure that all required data is available, you agreed on the following null-ability of attributes:
• All Attributes should be NOT NULL, except for:
o SpecialRequests in Booking
o WorkAdjustment in ActivityLeader and Admin
o DBSCheck in ActivityLeader
. No foreign key is allowed to be null, because none of the relationships are optional.
Transcribed Image Text:A booking is for a specific park. A booking can choose one or more lodges as part of the booking. Constraints You also agreed on the following domain constraints: • ArrivalDate in Booking should be no earlier than the current date • DepartureDate in Booking should be no earlier than the ArrivalDate • Special Requests in Booking should permit an arbitrarily long description of the request DOB in ActivityLeader and Admin should be before the current date • Salary in ActivityLeader and Admin cannot be negative • WorkAdjustment in ActivityLeader and Admin should permit an arbitrarily long description • Role in Admin should only allow the values Manager, Receptionist, HR, Sales, Marketing Target Audience in Activity should only allow the values Children, Adults, All area in Lodge should only allow the values Central, Outer, Exclusive • LodgeNo and MaxOccupants in Lodge should only allow values larger than zero a LodgeNo can only be used once in the same park To ensure that all required data is available, you agreed on the following null-ability of attributes: • All Attributes should be NOT NULL, except for: o SpecialRequests in Booking o WorkAdjustment in ActivityLeader and Admin o DBSCheck in ActivityLeader . No foreign key is allowed to be null, because none of the relationships are optional.
Scenario
You were contracted by as software development company as a database expert to help complete
the implementation of a database design. After long discussions with the customer, the lead
developer provided the following logical data model that needs to be implemented in a PostgreSQL
database. The data model also comes with assumptions and constraints that were agreed with the
customers and need to be implemented exactly.
Logical Data Model
Customer
CustomerNo (PK)
Firstname
Surname
EmailAddress
PhoneNo
Activity
ActivityID (PK)
Name
OnDateTime
Duration
TargetAudience
Parkid (FK)
StaffiD (FK)
•
•
.
◄
Assumptions
.
0.
Leads 11
Makes
* Schedules
StaffID (PK)
Firstname
Surname
0.
0...*
ActivityLeader
DOB
Address
PhoneNo
Salary
1.1
ο Employs
WorkAdjustments
DBSCheck
Speciality
ParkID (FK)
Booking
BookingNo (PK)
BookingDate
ArrivalDate
DepartDate
Special Requests
CustomerNo (FK)
ParkID (FK)
Has
1.1
1..1
Park
ParkID (PK)
Address
Postcode
1..1
An activity leader may not lead any classes yet.
A park may not have scheduled any activities.
11
Employs
Admin
StaffID (PK)
Firstname
Surname
DOB
Address
PhoneNo
Salary
Role
ParkID (FK)
Selects
WorkAdjustments
A park may schedule multiple activities at the same time.
A park may not yet have any bookings.
Provides
1.
BookingLodge
LodgelD (PK, FK)
BookingNo (PK, FK)
NumberGuests
Price
0.
Added To
Lodge
LodgelD (PK)
Area
LodgeNo
MaxOccupants
Wheelchair Accessible
DogsAllowed
ParkID (FK)
Transcribed Image Text:Scenario You were contracted by as software development company as a database expert to help complete the implementation of a database design. After long discussions with the customer, the lead developer provided the following logical data model that needs to be implemented in a PostgreSQL database. The data model also comes with assumptions and constraints that were agreed with the customers and need to be implemented exactly. Logical Data Model Customer CustomerNo (PK) Firstname Surname EmailAddress PhoneNo Activity ActivityID (PK) Name OnDateTime Duration TargetAudience Parkid (FK) StaffiD (FK) • • . ◄ Assumptions . 0. Leads 11 Makes * Schedules StaffID (PK) Firstname Surname 0. 0...* ActivityLeader DOB Address PhoneNo Salary 1.1 ο Employs WorkAdjustments DBSCheck Speciality ParkID (FK) Booking BookingNo (PK) BookingDate ArrivalDate DepartDate Special Requests CustomerNo (FK) ParkID (FK) Has 1.1 1..1 Park ParkID (PK) Address Postcode 1..1 An activity leader may not lead any classes yet. A park may not have scheduled any activities. 11 Employs Admin StaffID (PK) Firstname Surname DOB Address PhoneNo Salary Role ParkID (FK) Selects WorkAdjustments A park may schedule multiple activities at the same time. A park may not yet have any bookings. Provides 1. BookingLodge LodgelD (PK, FK) BookingNo (PK, FK) NumberGuests Price 0. Added To Lodge LodgelD (PK) Area LodgeNo MaxOccupants Wheelchair Accessible DogsAllowed ParkID (FK)
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY