Consider a “Digital Games”
Gamer: (UserID, Name, Age, Address, City, Favorite-Game, Rank)
Game: (GameID, Name, Company, Release-Year, Version)
Store: (StoreID, Name, Address, City)
WhereToFind: (GameID, StoreID, Price)
Category: (GameID, Category-Name)
From the relational schemas illustrated above, use the different relational algebra operators and operations (ρ, σ, π, ⋂, ⋃, -, ⨝) discussed in class to build the following queries:
1. List -by name and ID- each gamer who lives in the city of Chicago, with a rank of 5, and is aged between 15 (included) and 30 (included).
2. List games -by name and release year- that are not in the “Action” category
3. Since each game can fall within several categories, list games -by name and release year- that are in the “Action” category and also in the “Role-Playing” category
4. Display stores -by name- located in the city of Chicago or Seattle and sell a certain game with a game ID of 67782.
5. Display games -by name- that are sold by stores with a price range between 20$ (included) to 100$ (included).
6. List gamers -by name- whose favorite games are either “Call of Duty” or “FIFA”. Call of Duty and FIFA are names for games, not IDs
7. For each possible game, list the name and category of the game as well as the name and address of the store selling it. Name the result as “Full_Info”.
8. List stores -by name and address- that sell games from the “action” category, not from the
“sports” category.
9. Display stores -by name- that sell a game named “NBA” with a price of less than 80$ (included). NBA is the name of the game, not the game’s ID. Name the result as “WhereToFind_NBA”.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- 10A-arrow_forwardThe database used for this question is a very simple one with the following schema: (Primary keys are bold, foreign keys are underlined) CUSTOMER (CustID, FirstName, LastName, City, Phone, Email) INVOICE (InvoiceNumber, CustID, Date) INVOICE_ITEM(InvoiceNumber, ItemNumber, Quantity) ITEM (ItemNumber, ItemName, UnitPrice) When a customer makes a purchase, an invoice is created. The invoice may be for many items. For example, in a single purchase, a customer might buy 10 Back Scratchers, 4 Hair Removers and a Dog Lead. Provide relational algebra (NOT SQL) queries to find the following information. Each question is worth 2 marks. NOTE: You can use the symbolss, P, etc., or the words’ PROJECT’, ‘RESTRICT’etc.as you prefer. You do not need to try to make efficient queries – just correct ones. Where you use a join, always show the join condition. List the first and last names of Customers who come from the City named Perth. List the first and last names of customers who had…arrow_forwardGiven the database schema below, write a relational algebra expression to get the count of records in the DEPENDENT relation group by Essn. Also, show the result of your query.arrow_forward
- A DreamHome database has following tables. Branch (branchNo, street, city, postcode) Staff (staffNo, fName, lName, position, sex, DOB, salary, branchNo) PropertyForRent (propertyNo, street, city, postcode, type, rooms, rent, ownerNo, staffNo, branchNo) PrivateOwner (ownerNo, fName, lName, address, telNo) Which is the correct relational algebra to express the following query? List the city and street of all branches which assistant staff’s salary is not greater than 9000 and age is at least 31. ( ) $$\Pi_{branchNo,street,city}(\sigma_{position='assistant' \wedge salary≤9000 \wedge DOB>'1-Jan-1990'} (Staff \bowtie Branch))$$ ( ) $$\sigma_{branchNo,street,city}(\Pi_{position=’assistant’ \wedge salary≤9000 \wedge DOB>’1-Jan-1990’}(Staff \cap Branch))$$ ( ) $$\sigma_{branchNo,street,city}(\sigma_{position=’assistant’ \wedge salary<9000 \wedge DOB>31}(Staff \bowtie Branch))$$ ( ) $$\Pi_{branchNo,street,city}(\sigma_{position=’assistant’ \wedge salary≤9000 \wedge…arrow_forwardStayWell also rents out properties on a weekly basis to students attending summer school in the Seattle area. Design a database to meet the following requirements, using the shorthand representation and a diagram of your choice. For each student renter, list his or her number, first name, middle initial, last name, address, city, state, postal code, telephone number, and e-mail address. For each property, list the office number, property address, city, state, postal code, square footage, number of bedrooms, number of floors, maximum number of persons that can sleep in the unit, and the base weekly rate. For each rental agreement, list the renter number, first name, middle initial, last name, address, city, state, postal code, telephone number, start date of the rental, end date of the rental, and the weekly rental amount. The rental period is one or more weeks.arrow_forwardThe database used for this question is a very simple one with the following schema: (Primary keys are bold, foreign keys are underlined) CUSTOMER (CustID, FirstName, LastName, City, Phone, Email) INVOICE (InvoiceNumber, CustID, Date) INVOICE_ITEM(InvoiceNumber, ItemNumber, Quantity) ITEM (ItemNumber, ItemName, UnitPrice) When a customer makes a purchase, an invoice is created. The invoice may be for many items. For example, in a single purchase, a customer might buy 10 Back Scratchers, 4 Hair Removers and a Dog Lead. Provide relational algebra (NOT SQL) queries to find the following information. NOTE: You can use the symbols s, P, etc., or the words’ PROJECT’, ‘RESTRICT’ etc. as you prefer. You do not need to try to make efficient queries – just correct ones. Where you use a join, always show the join condition. List the dates on which Homer Griffin made purchases. List the first and last names of customers who have bought “Back Scratcher” or “Hair Remover” List the first…arrow_forward
- EMPLOYEE Frame Minit Lname Sen Bdate Address Sex Salary Super sen Dno +444 DEPARTMENT Dname Dnumber Mor an Mgr start date DEPT LOCATIONS Dnumber Dlocation PROJECT Prame Prumber Plocation Dnum WORKS ON Ennn Pno Hoir Hours DEPENDENT Esen Dependent name Se Bdate Relationship Reforential integrity constraints displayed on the COMFWNY relational database schema. One possible database state for the COMPANY relational database schema. EMPLOYEE Fname Minit Lname John Frankin T Sex Salary 30000 333445555 5 M 40000 Jo00665555 F 25000 Joe7e54321 43000 J88Ge5556 San Bdate Address Super en Dno 123456789 1965-01-09 731 Fondren, Hounton, TX M 333445555 1955-12-08 638 Voas, Houston, TX Go0087777 1960-01-19 3321 Castle, Spring. TX 987654321 1941-06-20 291 Berry, Bellaire, TX Narayan 666884444 1962-09-15 975 Fire Oak, Humibile, TX M B Smith Wong Zelaya Wallace 5 Alicia 4 Jennifer F 38000 333445655 25000 333445555 M 25000 007654321 M 55000 NULL Ramesh English 453453453 1972-07-31 5631 Rice, Houston, TX F…arrow_forwardConsider the following schema of hotel reservations database: Hotel (Hotel No, Name, City) Room (Room No, Hotel No, Type, Price) Booking (Hotel No, Guest No, Date From, Date_To, Room No) Guest (Guest_No, Name, City) Write RA queries for the following: a) Get the details (names and price) of all hotels in California. b) Get the average price of a room grouped by city. c) Find the hotel name and city of the hotel with the highest priced room. d) Get the hotel names and room numbers of any hotel rooms that have not been booked.arrow_forwardQuestion A city college would like to maintain their academic information in a MySql database system. The following are the interested information: Courses: Catalog # (M170 for instance) Credit Hours; Name of the Course (Database Design Fundamentals for instance) Course Descriptions Prerequisite Components (Lecture, or Laboratory for instance) Classes: Class # Class Name (usually the course name, M 170 for instance) Start Date End Date Meeting time (9:30 am ~ 12:15 pm, for instance) Days in a week (Monday) Term (Spring 2018, for instance) Location (TIE Building for instance) Room (UB 301, for instance) Instructor Online status (online, or in-person) Faculty: Employee Id (001880301, for instance) First Name Last Name Title (professor, for instance) Email Phone Office Location (TIE building, for instance) Room (UB303, for instance) Student: Student ID First Name Last Name Plan Sub Plan Advisor Current GPA Grade of each course The Term you got the grade for a course. The class…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education