Question

Please, No handwriting COURSE; introduction to database thank you for your efforts and time The f...

Please, No handwriting COURSE;
introduction to database
thank you for your efforts and time
The following set of schemas is given:

Customer (name, age, gender)
Visit (name, store)
Receipt (name, product)
Offer (store, product, price)

Write the following queries in relational algebra, using the above schema:
1. Find all stores visited by at least one customer under the age of 18.
2. Find the names of all females who bought either product # 1 or product #2.
3. Find all stores that offer at least one product that the customer Ahmed bought for less than 10 Riyal.
4. Find the names of customers who bought product # 1 or product # 2. [
5. Find the names of customers who bought product # 3 or are over the age of 18.

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

1.answer)

Πstorecustomer.name=Visit.name ^ age<18(Customer x Visit))

2.answer)

ΠCustomer.namecustomer.name=Receipt.name ^ gender="female" ^(product=1 v product=2)(Customer x Receipt))

3.answer)

ΠOffer.storecustomer.name=Receipt.name^customer.name="Ahmed"^Receipt.product=Offer.product ^ price<10)(Customer x Receipt xOffer))

4.answer)

ΠCustomer.namecustomer.name=Receipt.name ^(product=1 v product=2)(Customer x Receipt))

5.answer)

ΠCustomer.namecustomer.name=Receipt.name ^(product=3 v age>18)(Customer x Receipt))

Add a comment
Know the answer?
Add Answer to:
Please, No handwriting COURSE; introduction to database thank you for your efforts and time The f...
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
  • This is third time im posting this Question COURSE; introduction to database Please, No handwriting thanks...

    This is third time im posting this Question COURSE; introduction to database Please, No handwriting thanks for your efforts Design the database by following . Execute the sample requested queries. . ER Diagram. . All schemas before and after normalization. . All SQL statements of: -Creating tables. - Inserting data in tables. -Queries. 5. Screenshots from MySQL (or any other software you use) Question is - Database system for a Wholesale Management System Consider a database system for a Wholesale...

  • This is third time im posting this Question COURSE; introduction to database Please, No handwriti...

    This is third time im posting this Question COURSE; introduction to database Please, No handwriting thanks for your efforts Design the database by following . Execute the sample requested queries. . ER Diagram. . All schemas before and after normalization. . All SQL statements of: -Creating tables. - Inserting data in tables. -Queries. 5. Screenshots from MySQL (or any other software you use) Question is - Database system for a Wholesale Management System Consider a database system for a Wholesale...

  • Please help me to solve Please, No handwriting COURSE; introduction to database Q- write a query ...

    Please help me to solve Please, No handwriting COURSE; introduction to database Q- write a query SQL by Using the info below A. Normalize the Tables (in 3NF at least) B. Create the Normalized Tables and Populate them with at least 5 Rows C. Write the Wholesale Management System requested Queries & Execute them VERY IMPORTANT Screenshots from MySQL (or any other software you use) of all the tables after queries result. - Database system for a Wholesale Management System...

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

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

  • consider the following schema: Product(pid, name, type, manufacturer, price) key: pid Buys(cid, pid) key: cid and...

    consider the following schema: Product(pid, name, type, manufacturer, price) key: pid Buys(cid, pid) key: cid and pid together Customer(cid, cname, age, gender) key: cid 1) write the following query in relational algebra; find the names of all customers who have purchased all products manufactured by sears. 2)write the following in sql: find the names of all the customers who have not purchased the most expensive product. 3)write the following query in sql: find the best selling products (in terms of...

  • consider the following schema: Product(pid, name, type, manufacturer, price) key: pid Buys(cid, pid) key: cid and...

    consider the following schema: Product(pid, name, type, manufacturer, price) key: pid Buys(cid, pid) key: cid and pid together Customer(cid, cname, age, gender) key: cid 1) write the following query in relational algebra; find the names of all customers who have purchased all products manufactured by sears. 2)write the following in sql: find the names of all the customers who have not purchased the most expensive product. 3)write the following query in sql: find the best selling products (in terms of...

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

  • This is extra information about the shopping database given to answer this question: For many query...

    This is extra information about the shopping database given to answer this question: For many query questions we refer to the following database schema for a website that keeps track of what people like to buy or actually buy in different on-line supermarkets. (Think of something like a cross-store loyalty card system.) customer(cID, cName, street, city) Customers with unique cID and other attributes store(sID, sName, street, city) Stores with a unique ID and other attributes. Stores with the same name...

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

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