Database Model and SQL Queries Assignment Answers
Your question:



Assignment Help Answers with Step-by-Step Explanation:
a. Entities, Relationships, and Attributes: Identify all entities (tables), relationships between entities, and attributes for each entity.
b. Primary Key: Underline the primary key for each entity.
Entities:
- Movie (MovieID [PK], Title, Genre, Duration, Language, Release Date, Rating)
- Ticket (TicketID [PK], CustomerID [FK], MovieSessionID [FK], DateOfPurchase, TicketType, Format, Comment)
- Review (ReviewID [PK], CustomerID [FK], MovieID [FK], ReviewDate, Rating, Comments)
- WeeklySchedule - MovieSession: Many-to-Many (with ScheduleDate as an associative entity)
- Customer - Ticket: One-to-Many
b. Attribute Names: Define attributes for each relation.
c. Primary Keys and Foreign Keys: Identify primary keys and foreign keys.
3. MovieSession (MovieSessionID [PK], MovieID [FK], SessionID [FK])
4. WeeklySchedule (ScheduleID [PK], WeekStarting, Day, MovieSessionID [FK])
a. Basic Concepts of Relational Algebra:
- Relational algebra is a theoretical framework for manipulating and querying relational databases. It includes operations like projection (π), selection (σ), join (⨝), etc.
FROM Customer
WHERE PostalAddress IS NULL;
Here, π represents projection, σ represents selection, and C represents the Customer relation.
You can similarly express other SQL queries in relational algebra using these basic operations.


