Professional Documents
Culture Documents
Workshop Week 5 - Mysql Practical Exercise: Sid Sname Rating Age Sid Bid Day Bid Bname Colour
Workshop Week 5 - Mysql Practical Exercise: Sid Sname Rating Age Sid Bid Day Bid Bname Colour
Exercise 1
1. Create the database sbr and the following tables sailors, boats, and
reserves which are reproduced as follows:
sid sname rating age sid bid Day bid bname colour
Sailors Reserves
2. Using MySQL Workbench, construct the three tables for the sailors,
boats, and reserves accordingly. Enter the test data for the three tables
as shown above, and formulate MySQL queries to answer the following
questions.
Note: The above tables are related as 1:M relationship, “A sailor can
reserve many botas and a boat can be reserved by many sailors” can be
implemented via “Reserves” bridge entity.
3. Discuss- the need and requirements of a bridge entity and why it is not
advisable to implement many- to- many relationships in database directly.
A bridge entity has been used to indicate a many-to-many connection
that can't be described using basic specificity of a single piece of
evidence or scale object. To providing multi-valued measurement
attributes, a bridge entity combines the truth and measurement objects.
This particular utilization is permitted by the given DWM's bridge
structures. The primary key of a link is important in this scenario, and
a bridge object can handle even one-to-many relationships across
1
aspect objects. Relational objects were used to reference to bridge
entities in the past.
2
6. Find the sailor ID and boat ID of those boats reserved from 10/10/98 to
1/12/98 inclusive.