1. Homepage
  2. Homework
  3. COMP2400/6240 - Relational Databases Assignment 2: Enhanced Entity Relationship, Relational Algebra and SQL
This question has been solved

COMP2400/6240 - Relational Databases Assignment 2: Enhanced Entity Relationship, Relational Algebra and SQL

Engage in a Conversation
AustraliaANUAustralian National UniversityEnhanced Entity RelationshipCOMP2400COMP6240Relational DatabasesRelational AlgebraSQL

COMP2400/6240 - Relational Databases CourseNana.COM

Question 1 3 Marks CourseNana.COM

Band-Aid is a booking agency that represents local Canberra bands by booking their shows nationally. The employees of Band-Aid are classified into two non-overlapping categories, agents and administrators. An agent represents one or more bands and can be contacted via their personal office phone or work email. Each administrator belongs to a department which offers administrative support to all agents of the agency. Note that the internal relationship between agents and administrators isn’t something CourseNana.COM


CourseNana.COM

Band-Aid cares to track. Administrative departments include accounts, contracts, and promotions. Each Band-Aid employee can be uniquely identified by their employee number. Band-Aid also stores the name, phone, and email of the best point of contact for the band. Each band is represented by a particular agent and Band-Aid likes to record the date that representation began. If a band has just joined the agency (or they aren’t very popular!) then the agency may never have booked a show for the band. CourseNana.COM


CourseNana.COM

Band-Aid maintains a list of venues. Each record includes the venue’s name, a distinct address, phone number, and the venue capacity. Band-Aid likes to keep a comprehensive list of venues, including new venues or venues where they’re yet to book a show. CourseNana.COM


CourseNana.COM

The primary purpose of Band-Aid is to book shows. Each show is hosted by a particular venue. One or more of the bands Band-Aid represents would perform at the show. When Band-Aid books a show, they record the date and ticket price, and once the show is finalised, the number of tickets sold. Each show is assigned a unique show ID. CourseNana.COM


CourseNana.COM

Your task is to design an Enhanced Entity Relationship (EER) diagram that captures the above require- ments. It should include entities, relationships, attributes, and constraints where appropriate. You may make more assumptions, if necessary, but any assumptions should be noted. If there are any requirements that cannot be captured in an EER-diagram, then they should also be identified. CourseNana.COM


CourseNana.COM

Question 2 CourseNana.COM

Consider the relation schema R = {A, B, C, D, E, F, G} and the following set Σ of FDs: CourseNana.COM

  • C BG
  • AE F
  • CF EA
  • A DF

5 Marks CourseNana.COM

  1. 2.1  What are the candidate keys of R? Justify your answer (i.e., include the main steps used for finding the candidate keys). (1 Mark)
  2. 2.2  Find a minimal cover of Σ and include the main steps used for finding a minimal cover. (2 Marks)
  3. 2.3  Demonstrate why R, given Σ, does not satisfy 3NF, and then identify a 3NF decomposition for R. You need to include the main steps used for identifying the 3NF decomposition. (2 Marks)

Question 3 3 Marks CourseNana.COM

Consider the relation schema Booking={Airline, Date, Destination, FlightNo, PassengerName, Origin, PassportNo, Seat, Terminal} and the following set Σ of FDs: CourseNana.COM

Airline Terminal
FlightNo Airline, Origin, Destination PassportNo PassengerName
FlightNo, PassportNo, Date Seat
FlightNo, Date, Seat PassportNo CourseNana.COM

Which, for brevity, we can alias the attributes and restate as Booking={A, D, E, F, N, O, P, S, T} and Σ: AT CourseNana.COM

F AOE PN CourseNana.COM

  • FPD S
  • FDS P

3.1 Is the above relation schema Booking in BCNF? If not, identify a BCNF decomposition for Booking and check if your BCNF decomposition is dependency-preserving. You need to include the main steps CourseNana.COM

used for identifying the BCNF decomposition. 3.2 Consider another set Σ1 of FDs on Bookings: CourseNana.COM

Airline Terminal
FlightNo Airline, Origin, Destination
PassportNo PassengerName
FlightNo, PassportNo, Date Terminal, Seat
FlightNo, Date, Seat PassportNo, PassengerName CourseNana.COM

Which can be similarly aliased as: AT CourseNana.COM

F AOE PN CourseNana.COM

FPDTS CourseNana.COM

FDSPN
Are Σ and Σ
1 equivalent? Justify your answer. (1 Mark) CourseNana.COM

Question 4 4 Marks CourseNana.COM

The following table contains the relational algebra operators covered in our course. You should only use these operators to answer the following questions. CourseNana.COM

σφR
π
A1 ,...,An R CourseNana.COM

ρR(A1,...,An)R ρRR CourseNana.COM

ρ(A1 ,...,An ) R R1R2 R1R2 R1R2 R1×R2 CourseNana.COM

R1 ▷◁φ R2 R1 ▷◁ R2 φ1 ? φ2 φ1 ? φ2 CourseNana.COM

Selection by condition φ CourseNana.COM

Projection onto the set of attributes {A1 . . . , An} CourseNana.COM

RenamingtherelationnametoR andattributenamestoA1,...,An CourseNana.COM

Renaming the relation name to R
Renaming the attribute names to A1 , . . . , An
Union of two relations R1 and R2
Intersection of two relations R1 and R2
Difference of two relations R1 and R2
Cartesian product of two relations R1 and R2
Join of two relations R1 and R2 with the join condition φ Natural join of two relations R1 and R2
condition φ1 AND condition φ2
condition φ1 OR condition φ2 CourseNana.COM


CourseNana.COM

Consider a relational database schema S with the following relation schemas: CourseNana.COM

  • Movie(title, production year, genre) with the primary key {title, production year}
  • Person(id, first name, last name, year born) with the primary key {id}
  • Director(id, title, production year) with the primary key {title, production year} and with the foreign keys [title, production year] Movie[title, production year] and [id] Person[id]
  • Writer(id, title, production year, credits) with primary key {id, title, production year} and with the foreign keys [title, production year] Movie[title, production year] and [id] Person[id]
  1. 4.1  Answer the following questions using relational algebra queries only using the operators in the above table. (2 Marks)

[a] List the ids, first and last names of directors who have never written any movie(s). (1 Mark) CourseNana.COM

[b] A person has worked on a movie if this person is a director, a writer, or both a director and writer, of this movie. List the ids of persons who have worked on at least two distinct movies. (1 Mark) CourseNana.COM

  1. 4.2  Optimise the following relational algebra query. Your marks will depend on how well you optimise the query in your solution. Additionally, draw the query trees of the query before and after your optimisation. (2 Marks)

πDirector.idσ(Director.id=Person.id) ?(year born>production year40)(Director × Person) πidσ(year born<1970) ?(production year>2010)(Writer ▷◁ Person) CourseNana.COM

  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Australia代写,ANU代写,Australian National University代写,Enhanced Entity Relationship代写,COMP2400代写,COMP6240代写,Relational Databases代写,Relational Algebra代写,SQL代写,Australia代编,ANU代编,Australian National University代编,Enhanced Entity Relationship代编,COMP2400代编,COMP6240代编,Relational Databases代编,Relational Algebra代编,SQL代编,Australia代考,ANU代考,Australian National University代考,Enhanced Entity Relationship代考,COMP2400代考,COMP6240代考,Relational Databases代考,Relational Algebra代考,SQL代考,Australiahelp,ANUhelp,Australian National Universityhelp,Enhanced Entity Relationshiphelp,COMP2400help,COMP6240help,Relational Databaseshelp,Relational Algebrahelp,SQLhelp,Australia作业代写,ANU作业代写,Australian National University作业代写,Enhanced Entity Relationship作业代写,COMP2400作业代写,COMP6240作业代写,Relational Databases作业代写,Relational Algebra作业代写,SQL作业代写,Australia编程代写,ANU编程代写,Australian National University编程代写,Enhanced Entity Relationship编程代写,COMP2400编程代写,COMP6240编程代写,Relational Databases编程代写,Relational Algebra编程代写,SQL编程代写,Australiaprogramming help,ANUprogramming help,Australian National Universityprogramming help,Enhanced Entity Relationshipprogramming help,COMP2400programming help,COMP6240programming help,Relational Databasesprogramming help,Relational Algebraprogramming help,SQLprogramming help,Australiaassignment help,ANUassignment help,Australian National Universityassignment help,Enhanced Entity Relationshipassignment help,COMP2400assignment help,COMP6240assignment help,Relational Databasesassignment help,Relational Algebraassignment help,SQLassignment help,Australiasolution,ANUsolution,Australian National Universitysolution,Enhanced Entity Relationshipsolution,COMP2400solution,COMP6240solution,Relational Databasessolution,Relational Algebrasolution,SQLsolution,