1- Consider the following SQL query and related relations
SELECT P.Name
FROM Players P, Games G
WHERE P.Id = G.PlayerId
AND P.Game = 'Football' AND G.Season ='2019'
where:
Players (Id, Name, Game)
Games (PlayerId, GameCode, Season)
A- Translate the above SQL query to a relational algebra expression.
B- Draw the Query tree for above relational algebra expression in part (a).
Note: Please no screenshot
SELECT P.Name
FROM Players P, Games G
WHERE P.Id = G.PlayerId
AND P.Game = 'Football' AND G.Season ='2019'
Let us see first symbol which will be used in translating the query in relational algebra:
πP.name
σ Id(Player)= PlayerId(Games)
So the relational algebra expression for the following part of Sql Query :
SELECT P.Name
FROM Players P, Games G
WHERE P.Id = G.PlayerId
is
πP.name (σ Id(Player)= PlayerId(Games))
π Player.name (σ Id(Player)= PlayerId(Games) and σGame=’FootBall’(Player) and σseason=2019(Games))( Player X Games)
Where Player X Games shows Cartesian product to merge two relations Player and Games.
Query Tree

1- Consider the following SQL query and related relations SELECT P.Name FROM Players P, Games G...
Please clear and direct answer Consider the following SQL query and related relations SELECT P.Name FROM Players P, Games G WHERE P.Id = G.PlayerId AND P.Game = 'Football' AND G.Season ='2019' where: Players (Id, Name, Game) Games (PlayerId, GameCode, Season) Translate the above SQL query to a relational algebra expression. Draw the Query tree for above relational algebra expression in part (a).
**************PLEASE COMPLETE PART F) ONLY************** Consider the following relational database schema (primary keys are underlined) and SQL query: Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) SELECT g.guestNo, g.guestName FROM Room r, Booking b, Hotel h, Guest g WHERE h.hotelNo = b.hotelNo AND g.guestNo = b.guestNo AND h.hotelNo = r.hotelNo AND h.hotelName = "Ritz" AND dateFrom >= "Jan 01, 2001" AND dateTo <= "Dec 31, 2001"; (A) state what...
**************PLEASE COMPLETE PART E) ONLY************** Consider the following relational database schema (primary keys are underlined) and SQL query: Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) SELECT g.guestNo, g.guestName FROM Room r, Booking b, Hotel h, Guest g WHERE h.hotelNo = b.hotelNo AND g.guestNo = b.guestNo AND h.hotelNo = r.hotelNo AND h.hotelName = "Ritz" AND dateFrom >= "Jan 01, 2001" AND dateTo <= "Dec 31, 2001"; (A) state what...
Question 1.Write a SQL statement for each of the following
questions based on the above tables (50 Points).
1) Create “Enrollment” table.
2) Change the credits of “Database” course from 2 to 3.
3) List the course titles (not Course_No) and grades John Doe
had taken.
4) Calculate average of Café Balance, and name new field as
Average Balance.
5) Create a roster for “Database” course (list student ID, last
name, first name, major, and status for each student enrolled...
ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) NeedByEvent(Event) CRPrevState(CRID, CRState, StartDate, EndDate) CRAssigned(CRID, EmpID, StartDate, EndDate) Employees(EmpID, FirstName, LastName, JobTitle) ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) The CRID is the primary key, it is unique, and it is an positive integer The CRType may be one of two values: "Deficiency" or "Enhancement" CRTitle is a variable length string that may be up to 2048 characters CROriginDate is a date CRPriority is an integer that may assume a value of...