Question

In: Computer Science

Given the following 7 relations: MIScompany (name, address, phone, email, FedTaxId, StaTaxId) branch (branchId, name, address,...

Given the following 7 relations:

MIScompany (name, address, phone, email, FedTaxId, StaTaxId)

branch (branchId, name, address, phone, email, FedTaxId, StaTaxId)

employee (empId, driverId, ssno, name, branchId)

customer (custId, name, address, driverId, ssno, FedTaxId, StaTaxId)

equipment (equipId, name, type, upc, purchaseDate, year, manufacturId, cost, rentFee, branchId )

manufacturer (manufacturId, name, FedTaxId, StaTaxId, phone, email)

rental (rentalId, equipId, custId, rentDate&time, returnDate&time, empId)

  1. Use relational algebra to retrieve every customer that has not rented any equipment in September 2020. The report should contain custId and customer name.
  2. Use relational algebra to list every manufacturer that only makes an electric cleaning tool (a type of equipment). The report should contain manufacturId and manufacturer name
  3. Use relational algebra to list the number of rentals that is handled by each employee yesterday. The report should contain empId, employee name, and the number of rentals handled by the employee (rented yesterday).
  4. Use relational algebra to list all equipment in detail, including the name of the customer if the equipment is rented out yesterday.
  5. Use relational algebra to list every to list each equipment name with more than three quantities and the name of customers who has rented them. The report should contain the equipment name and customer name.

Solutions

Expert Solution

1. Use relational algebra to retrieve every customer that has not rented any equipment in September 2020. The report should contain custId and customer name.

R1 ← π custId, name (σ rentDate&Time≥date('2020-09-01') and rentDate&Time≤date('2020-09-30') (RENTAL ⨝ CUSTOMER))
R2 ← π custId, name (CUSTOMER)
RESULT ← R2 - R1

2. Use relational algebra to list every manufacturer that only makes an electric cleaning tool (a type of equipment). The report should contain manufacturId and manufacturer name

π manufacturId, MANUFACTURER.name (σ EQUIPMENT.name='Electric Cleaning Tool' (MANUFACTURER ⨝ EQUIPMENT))

3. Use relational algebra to list the number of rentals that is handled by each employee yesterday. The report should contain empId, employee name, and the number of rentals handled by the employee (rented yesterday).

R1 ←  emp_id γ count(*) as no_of_rentals (σ rentDate&time=date(2020-10-04) (RENTAL))
RESULT ← π emp_id, name, no_of_rentals (R1 ⨝ EMPLOYEE)

4. Use relational algebra to list all equipment in detail, including the name of the customer if the equipment is rented out yesterday.

R1 ← π equip_id, cust_id (σ rentDate&Time=date('2020-10-04') (RENTAL))
R2 ← π cust_id, name (CUSTOMER ⨝ R1)
R3 ← π equip_id, EQUIPMENT.name, type, upc,purchaseDate, year, manufacturId, cost, rentFee, branchId, cust_id, R2.name (EQUIPMENT ⨝ R2)

Related Solutions

Using the given file, ask the user for a name, phone number, and email. Display the...
Using the given file, ask the user for a name, phone number, and email. Display the required information. These are the Files that I made: import java.util.Scanner; public class Demo5 { public static void main(String args[]) { Scanner keyboard = new Scanner(System.in); System.out.println("New number creation tool"); System.out.println("Enter name"); String name = keyboard.nextLine(); System.out.println("Enter phone number"); String phoneNumber = keyboard.nextLine(); System.out.println("Enter email"); String email = keyboard.nextLine(); Phone test1 = new SmartPhone(name, phoneNumber, email); System.out.print(test1); System.out.println("Telephone neighbor: " + ((SmartPhone) test1).getTeleponeNeighbor()); }...
create a project charter GENERAL PROJECT INFORMATION Project Name: Project Sponsor: Project Manager: Email Address: Phone...
create a project charter GENERAL PROJECT INFORMATION Project Name: Project Sponsor: Project Manager: Email Address: Phone Number: Organizational Unit: Process Impacted: Expected Start Date: Expected Completion Date: Expected Savings: Estimated Costs: PROBLEM, ISSUE, GOALS, OBJECTIVES, DELIVERABLES Problem or Issue: Purpose of Project: Business Case: Goals/Metrics: Expected Deliverables: PROJECT SCOPE & SCHEDULE Within Scope Outside of Scope PROJECT RESOURCES & COSTS Project Team Support Resources Special Needs PROJECT BENEFITS & CUSTOMERS Process Owner Key Stakeholders Final Customers Expected Benefits PROJECT RISKS,...
I need to add variables such as name, address and phone into a Jpanel in the...
I need to add variables such as name, address and phone into a Jpanel in the constructor called AddressBook. I then need to add that panel into a Jframe and call it in the main method how would i do that in java.
Write a class named ContactEntry that has fields for a person’s name, phone number and email...
Write a class named ContactEntry that has fields for a person’s name, phone number and email address. The class should have a no-arg constructor and a constructor that takes in all fields, appropriate setter and getter methods. Then write a program that creates at least five ContactEntry objects and stores them in an ArrayList. In the program create a method, that will display each object in the ArrayList. Call the method to demonstrate that it works. I repeat, NO-ARG constructors....
Problem: Read the following tables and answer the following questions: Customers Customer ID Name Address Phone...
Problem: Read the following tables and answer the following questions: Customers Customer ID Name Address Phone Email 9087 John Doe 204 University Ave. 987-098-9087 [email protected] 2098 Bill Lawrence 123 Jones St 717-387-3387 Business 2398 Laura Smith 0900 West Blvd. 901-234-4567 Information Transactions Customer ID Account Number Date of Last Transaction 9087 375 01/31/98 2098 123 03/09/97 2398 375 09/21/97 2098 375 12/31/97 2398 123 02/01/98 Accounts Account Number Balance Account Type 375 234.45 Checking 123 056.90 Savings 1. Who owns...
Programming C: Write a program for a Rolodex of contact information (e.g., name, phone number, email)...
Programming C: Write a program for a Rolodex of contact information (e.g., name, phone number, email) implemented as a linked list. The program will ask the user to enter a new contact information, retrieve/print a person’s contact information, and to delete a person. It will maintain the linked list in alphabetical order by last name. It will also allow the user to search for a person’s contact information by last name. Assume that all last names are unique.
Employee ID First Name Last Name email Title Address Extension Department Department ID Hiring Date Department...
Employee ID First Name Last Name email Title Address Extension Department Department ID Hiring Date Department Phone # 0001 John Smith jsmith Accountant 1300 West st 5775 Accounting 2100 8/1998 407-366-5700 0002 Brian Miller badams Admin Assistant 1552 Palm dr 5367 Human resource 2300 4/1995 407-366-5300 0003 James Miller miller Inventory Manager 2713 Buck rd 5432 Production 2520 8/1998 407-366-5400 0004 John Jackson jackson_sam Sales Person 433 tree dr 5568 Sales 2102 6/1997 407-366-5500 0005 Robert Davis Davis Manager 713...
Create a class called Student. Include the following instance variables: name, address, phone, gpa Create all...
Create a class called Student. Include the following instance variables: name, address, phone, gpa Create all of the methods required for a standard user defined class: constructors, accessors, mutators, toString, equals Create the client for testing the Student class Create another class called CourseSection Include instance variables for: course name, days and times course meets (String), description of course, student a, student b, student c (all of type Student) Create all of the methods required for a standard user defined...
Q3. Create a Company trading computer accessories with your Student ID & Name, address, College Email...
Q3. Create a Company trading computer accessories with your Student ID & Name, address, College Email ID and phone number for the year ended 31st Mar, 2020, and enter the following transactions using appropriate vouchers in Tally ERP 9 software: (3 Marks + 7 Marks) 1st Jan 2020, Started his business with an investment of RO 45,000 in cash. 2nd Jan 2020, Purchases computer accessories of RO 20,000 on credit from Mr. Salim. 31st Jan 2020, Sold computer accessories worth...
Q3. Create a Company trading computer accessories with your Student ID & Name, address, College Email...
Q3. Create a Company trading computer accessories with your Student ID & Name, address, College Email ID and phone number for the year ended 31st Mar, 2020, and enter the following transactions using appropriate vouchers in Tally ERP 9 software: (3 Marks + 7 Marks) 1st Jan 2020, Started his business with an investment of RO 45,000 in cash. 2nd Jan 2020, Purchases computer accessories of RO 20,000 on credit from Mr. Salim. 31st Jan 2020, Sold computer accessories worth...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT