Question

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 in relational algebra as well as in relational calculus.

Question 2: Find the names and addresses of customers that order products for which there is no stock. Provide solutions expressed both in relational algebra as well as in relational calculus.

Question 3: Find the cities where customers who do not order any product supplied by AB live. Provide solutions expressed both in relational algebra as well as in relational calculus.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Consider the following relational schema of the company’s database. Use Tuple Relational Calculus (TRC) & Domain...
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 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...

  • Given the following relational schema, write queries in SQL to answer the English questions. There is...

    Given the following relational schema, write queries in SQL to answer the English questions. There is a shipment database on the MySQL server. You can also use the DDL for MySQL. You must only submit the SQL for your answers but you can include the query output as well to help the TA with marking. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid: integer, shipdate: Date/Time) ShippedProduct(sid:...

  • Given the following relational schema, write queries in SQL to answer the English questions. There is...

    Given the following relational schema, write queries in SQL to answer the English questions. There is a shipment database on the MySQL server. You can also use the DDL for MySQL. You must only submit the SQL for your answers but you can include the query output as well to help the TA with marking. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid: integer, shipdate: Date/Time) ShippedProduct(sid:...

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

  • Express the query with Tuple Relational Calculus Consider the Movies, Stars, Studios Database with the following...

    Express the query with Tuple Relational Calculus Consider the Movies, Stars, Studios Database with the following 5 relations: Movies (title, year, length, genre, studioName, producerC#) Stars (movie Title, movie Year, starName ) MovieStar (name, address, gender, birthdate) MovieExec (name, cert#, address, networth) Stud (name, address, presC#) Find names of movie stars who starred in every movie produced by “MGM” studios in 2019.

  • Given the following relational schema, write queries in SQL to answer the English questions. The Access...

    Given the following relational schema, write queries in SQL to answer the English questions. The Access Database for the schema is available, as is a DDL file. It is also available on the MySQL server. You must only submit the SQL for your answers. You can get your answers without using a DBMS or by using Access or MySQL. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid:...

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

  • The following relational schema is given for a Pokemon Database: Pokemon (PID, PName) Type (TID, TName)...

    The following relational schema is given for a Pokemon Database: Pokemon (PID, PName) Type (TID, TName) Trainer (SSN, Name, Surname) InType (PID, TID) StrongAgainst (TID_Strong, TID_Weak) Owns (SSN, PID, Nickname, Level, Height, Weight, Catch_Date) SpecializedIn (SSN, TID) In this database, Pokemon (Imaginary creatures, short for “Pocket Monsters”) are stored in the entity set Pokemon, with a unique PID and PName. Pokemon types are stored in the entity set Type, with a unique TID and TName. Pokemon trainers are stored in...

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