Question

1. Given the following database schema owner(owner_name, age) owns(owner_name, num_cats) Write relational algebra for the following:...

1. Given the following database schema

owner(owner_name, age)

owns(owner_name, num_cats)

Write relational algebra for the following:

  1. Find the name of all owners above the age of 50
  2. Find the name of all owners who own fewer than 5 cats
  3. Find the name of all owners who are below the age of 24 and own more than 4 cats

2. Given the following database schema

person(name, age, account_id)

account(account_id, balance)

Write a relational algebra for the following

  1. Find the name of all people who have existing account
  2. Find the name of all people who have an account balance of greater than 500
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Both the parts to the above question have been explained very clearly and in a detailed manner in the images below. Hope it helps....

Add a comment
Know the answer?
Add Answer to:
1. Given the following database schema owner(owner_name, age) owns(owner_name, num_cats) Write relational algebra for the following:...
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
  • Using the relational schema for the College Applications database, write relational algebra expressions that perform the...

    Using the relational schema for the College Applications database, write relational algebra expressions that perform the following problems. Complete 5 out of 6 for full credit. Apply(sID, cName, major, decision) Student(sID, sName, GPA, sizeHS) College(cName, state, enrollment) 1. List the ids and names of the students that applied to the CS Dept at MIT. 2. For students that have applied to a college, list the student’s id, name and number of different colleges the students has applied to. 3. List...

  • 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...

  • Consider following relational database schema and translate the queries ‘a’ and ‘b’ into relational algebra expressions...

    Consider following relational database schema and translate the queries ‘a’ and ‘b’ into relational algebra expressions Teacher(ID, Name, Designation, Phone, Address) Course(CourseCode, CourseName, CreditHour) Taught(TeacherID, CourseCode, Semester) a. SELECT Name, Address FROM Teacher, Taught WHERE Teacher.ID=Taught.TeacherID and CourseCode=’IT344’ b. SELECT CourseName FROM Course, Taught WHERE Course.CourseCode=Taught.CourseCode and TeacherID=200

  • 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...

  • Write the following queries in Relational Algebra, for the following bank schema: account (ano, bname, balance)...

    Write the following queries in Relational Algebra, for the following bank schema: account (ano, bname, balance) branch (bname, bcity, assest) customer (Cname, cstreet, ccity) loan (lno, bname, amount) deposit (cname, ano) borrower (cname, ino) -Select all loan tuples where branch name is Abha. -Select all loan tuples where branch name is Abha and loan amount less than 200000.   Please type the solution on the keyboard so that I can copy and paste

  • 3. (20 POINTS) Consider the LIBRARY relational database schema below to write down the relational algebra...

    3. (20 POINTS) Consider the LIBRARY relational database schema below to write down the relational algebra expressions for the following two queries. No SQL statements are required. BOOK Bookid Title Publisher name BOOK AUTHORS Book id Author name PUBLISHER Name Address Phone BOOK COPIES Book d Branch Id No o copies BOOK LOANS Book Branch Id Card no Date out Due date LIBRARY BRANCH Branch Branch name Address BORROWER Card Name Address Phone 3.A.) (10 POINTS) Let the number of...

  • Give the following queries in the relational algebra using the following relational schema: Student (sid, name,...

    Give the following queries in the relational algebra using the following relational schema: Student (sid, name, age, address, email, cgpa) enrolledIn (sid, modulecode, grade) module (modulecode, modulename, credits, lecturername) a) What are the names of students enrolled in module code “cs3020”? b) Give the module code of all the modules that are taught by the teacher named “Altaf”? c) Who teaches the module with code”cs1500”? d) Give the name of all the teachers teaching the student with id”12f6778”.

  • With the RelaX relational algebra calculator, and using the UIBK Pizza database, write a relational algebra...

    With the RelaX relational algebra calculator, and using the UIBK Pizza database, write a relational algebra expression that results in the names of all the people that eat pepperoni pizza at a pizzeria that does not serve cheese pizza.

  • Relational algebra pls. Appreciate it!(Queries are detailed) Consider the following relational database that stores information about...

    Relational algebra pls. Appreciate it!(Queries are detailed) Consider the following relational database that stores information about bars and customers: Drinker (name, address) Bar (name, address) Beer (name, brewer) Frequents (drinker, bar, times a week) Likes (drinker, beer) Serves (bar, beer, price) Write the following queries in relational algebra: (5 points) Find all drinkers who frequent only those bars that serve some beers they like. 5 points) Find all drinkers who frequent every bar that serves some beers they like (10...

  • 1. Given the following BANKING database, formulate a Relational Algebra expression for each of the following...

    1. Given the following BANKING database, formulate a Relational Algebra expression for each of the following questions. SELECT should be performed before any JOIN operation. Notation: use the symbol S for SELECT, P for PROJECT, J for INNER JOIN, * for NATURAL JOIN, LJ for LEFT JOIN, RJ for RIGHT JOIN, R for RENAME, and F for FUNCTION. Please type your answer; hand-writing is not accepted. branch(branch_name, branch_city, assets) customer (customer_name, customer_street, customer_city) loan (loan_number, branch_name, amount) borrower (customer_name, loan_number)...

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