Question

employee(employee-id, employee-name, street, city) works(employee-id, company-id, salary) company(company-id, company-name, city) manages(employee-id, manager-id) Consider the data base...

employee(employee-id, employee-name, street, city)

works(employee-id, company-id, salary)

company(company-id, company-name, city)

manages(employee-id, manager-id)

Consider the data base above where the primary keys are in bold

For each of the questions give the following. (NOTICE the Relations on the given database it isn't like the ones that are commonly posted they are slightly different)

(1) a relational algebra expression,

(2) a tuple relational calculus expression, and

(3) a domain relational calculus expression.

f. Find all employees in the database who do not work for the First Bank Corporation.

g. Find all employees in the database who earn more than each employee of Small Bank Corporation.

h. Assume that the companies may be located in several cities. Find all companies located in every city in which Small Bank Corporation is located.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

f.

1) Πe-name (σc-name ≠ 'First Bank Corporation' (works))

2) {t | ∃ w ∈ works (w[c-name] ≠ 'First Bank Corporation' ∧ t[e-name] = w[e-name])}

3 {<p>| ∃ c, s (<p,c,s> ∈ works ∧ c ≠ 'First Bank Corporation')}

g.

1) Πe-name (works) – (Πworks.e-name (works ⋈(works.salary ≤ works2.salary ∧ works2.c-name = 'Small Bank Corporation') ρworks2(works)))

2) {t | ∃ w ∈ works (t[e-name] = w[e-name] ∧ ∀ s ∈ works (s[c-name] = 'Small Bank Corporation' ⇒ w[salary] > s[salary]))}

3) { <p>| ∃ c, s ( <p,c,s> ∈ works ∧ ∀ p2, c2, s2 ( <p2,c2,s2>∈ works ∧ c2 = 'Small Bank Corporation' ⇒ s > s2))}

h.

1) Πc-name (company ÷ (Πcity(σc-name = 'Small Bank Corporation' (company))))

2) {t | ∀s ∈ company(s[c-name] = 'Small Bank Corporation' ⇒ ∃ r ∈ company (t[c-name] = r[c-name] ∧ r[city] = s[city]))}

3) { <co>| ∀ co2, ci2 ( <co2.ci2>∈ company ∧ co2 = 'Small Bank Corporation' ⇒ <co2,ci2>∈ company)}​

Add a comment
Know the answer?
Add Answer to:
employee(employee-id, employee-name, street, city) works(employee-id, company-id, salary) company(company-id, company-name, city) manages(employee-id, manager-id) Consider the data base...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the following relational schema of the company’s database. Use Tuple Relational Calculus (TRC) & Domain...

    Consider the following relational schema of the company’s database. Use Tuple Relational Calculus (TRC) & Domain Relational Calculus (DRC) expression to answer each of the following three questions (Step by step brief description is appreciated if possible) PRODUCT (pid, stock, supplier) CLIENT (cid, name, address, city) ORDER (orderno, date, quantity, pid, cid) Question 1: Find the number of orders for products that are being ordered in quantities smaller than 100 items by customers living in Madrid. Provide solutions expressed both...

  • Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN,...

    Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN, DNA) TA DEPARTMENT(DNAME, DNUMBER. MESSINS, MGRSTARTDATE) DEPT_LOCATIONS(DNUMBER. DLOCATION PROJECT(PNAME, PNUMBER. PLOCATION, DNLIM) WORKS_ONCESSN.PNG, HOURS) DEPENDENTESSN, DEPENDENT-NAME, SEX, BDATE, RELATIONSHIP) Write SQL statements for the following queries: a) List the names of those employees who work in the "Production" department (6 marks). b) Find the maximum salary, minimum salary, and the average salary among employees who work for the "Production department (6 marks). Count the...

  • Please refer to the following business scenarios: (i) Using SELECT statements of SQL, find the employee...

    Please refer to the following business scenarios: (i) Using SELECT statements of SQL, find the employee id, first name, last name, job title and email of all employees working in Asia (i.e. all countries coming from the region     ‘Asia’). This query must be implemented as a nested query! (ii) Using SELECT statements of SQL, find the employee id, first name, last name, job title and supervisor id of employees who had worked for more than 3 years and completed...

  • Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orde...

    Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orders(orderld, customerld, dateOrdered, dateRequired, status) Customer(customerld, customerLastName, customerStreet, customerCity, customerState, customer Lip OrderDetails(orderld.productld, quantity, lineNumber, amount) Products(productld, name, description, quantity, unitPrice) Account(accountNumber, customerld, dateOpened, creditCard, mailingStreet, mailingCity, mailingState, mailingZip) 2.1 (2 Points) List all possible foreign keys. For each foreign key list both the referencing and referenced relations. 2.2 (2 Points) Devise a reasonable database instance by filling the tables with data of...

  • Problem 1 (25 points) Consider the following database schema: Employee (fname, Iname, ssn, address, salary, mgrssn,...

    Problem 1 (25 points) Consider the following database schema: Employee (fname, Iname, ssn, address, salary, mgrssn, dnumber) Department (dname, dnumber, mgrssn, mngrstartdate) Project (pname, pnumber, plocation, dnumber) Works_On (ssn, pnumber, hours_per_week) Dependent (ssn, dependent name, bdate, relationship) The above relations store information about a company. The meaning of most of the relations and attributes is straightforward. For example, the first relation stores information about employees. The mgrssn is the SSN of the manager (supervisor) of the given employee. A manager...

  • Gives the departments, their ID, name and budget. d stands for department. Employees(eID, dID, eN...

    Please explain the questions with detailed explanations. For SQL, do not use inner join. Gives the departments, their ID, name and budget. d stands for department. Employees(eID, dID, eName, eSala e stands for employee ry) Gives the employees, their IDs, where they work, their names and salaries stands for supplier. and where they are located (city and state). Also tells which employees are contact persons for the suppliers Items( ID, siCode dlD, ¡Name, MSRP) | Gives the items and the...

  • You work for a local company that sells and manages data security for small businesses in...

    You work for a local company that sells and manages data security for small businesses in Minnesota and Wisconsin. This company sells security software, hardware encryption, and hosts secure servers for Internet transactions. Your company also stores customer data including TAX-ID numbers and bank accounts. As your company grows and tries to compete with the larger companies like IBM or Microsoft, your boss asks you to discover new ways of generating business. One idea you have is that you could...

  • Please help me answer the following questions regarding data relationship tables. Employee ID First Name Last...

    Please help me answer the following questions regarding data relationship tables. 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...

  • New to DB's Please help! You are designing and creating a database named COMPANY for an HR (Human Resource) Dept of...

    New to DB's Please help! You are designing and creating a database named COMPANY for an HR (Human Resource) Dept of a Software Consulting Company to manage their employees and their assigned work (projects) in the company First Step to Design and Create a Database is Creating an E-R Diagram by Identifying Entities, Attributes and Relationships between any two Entities to Create a Company Database Scheme. 1. Create an E-R Diagram for the Company database from the raw data files...

  • 1,List the first and last name of the donators that donated in December 2009. 2. List...

    1,List the first and last name of the donators that donated in December 2009. 2. List the ID's of the volunteers that have not worked. 3. List the ID, first name, and last name of any employees who works in the Finance department. 4. List all the different prices suppliers have for 'Tasty Meat' product. 5. Select the store ID and store phone number for all stores in 'St.Paul'. 6. List the member first and last name, address, city, zip...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT