Question

You may use the CAP database handout. Write the relational algebra statement to answer the following...

You may use the CAP database handout. Write the relational algebra statement to answer the following question. Then write the SQL statement to answer the same question.

Create an unduplicated list of product id's for products that have been ordered.

Homework Answers

Answer #1

First of all i am going to make unduplicted list of product id's for different products and will discribe by the database digram.

Here I am going to describe with listing of product with sql query.

Example 1: Produce an unduplicated list of all product IDs for all Products that have been sold. Sort the List.

SELECT Product_ID FROM Product WHERE Status='sold' ORDER BY Product_ID

Example 2: Show the Ebay ID, Product ID, Product name, and description for all items.

SELECT pr.Product_ID,eay.ebay_ID,pr.Product_Name,pr.Description FROM Product AS pr JOIN Ebay AS eay ON pr.Product_ID!=null

Example 3 : Display all orders (Ebay ID, Consumer ID, and date ordered) placed in February 2017. The date should be displayed in this format: February 20, 2017.

SELECT eay.Date,eay.Ebey_ID,pr.Description,ch.Consumer_ID FROM Product AS pr,Ebay AS Eay, Consumer As ch WHERE eay.Date LIKE 'February___2017'

Example 4: Display the total quantity sold by the product ID.

SELECT Count(Product_ID) AS total_quantity FROM Product WHERE Status='sold' GROUP BY Product_ID

As per the question here, with some sql query describe details with product.

Know the answer?
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
Similar Questions
If you need to store the following data in a relational database and MongoDB, how would...
If you need to store the following data in a relational database and MongoDB, how would you implement in each of them. List the design and commands to store these records in relational database (SQL query) and MongoDB separately. {no:1,name:"ST",salary:2000,role:"OB"} {no:2,name:"MSD",salary:1500,role:"WK"} {no:3,name:"YS",salary:1000,role:"ALR"},
Assignment 2 Instructions You need to access to the database and write SQL queries on the...
Assignment 2 Instructions You need to access to the database and write SQL queries on the following site: https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_in 1. Use INNER JOIN to create a report. In this report, list each customer’s CustomerID, CustomerName, and their each OrderID and each order’s OrderDate, if the customer has ever placed an order. You should use the Customers table and the Orders table in the database to complete this query.   2. Use INNER JOIN to create a report. In this report, list...
Write a SQL statement for the following query: Relational Schema: Part( P #, PName, Producer, Year,...
Write a SQL statement for the following query: Relational Schema: Part( P #, PName, Producer, Year, Price) (P# is the primary key) Customer( C#, CName, City) (C# is the primary key) Supply(S#, P#, C#, Quantity, Amount, Date) (S# is the primary key) Query: For each Apple product supplied to more than 10 different customers in Chicago in 2020, list product number, product name, total supply quantity, and total supply amount. Sort the result by product name.
implement in Oracle Sql please 5) Write a SELECT statement that answers this question: Which products...
implement in Oracle Sql please 5) Write a SELECT statement that answers this question: Which products have a list price that’s greater than the average list price for all products? Return the product_name and list_price columns for each product. Sort the results by the list_price column in descending sequence.
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) AUTHOR(panum*, acnum*) FIELD(fieldnum, id, title) INTEREST(fieldnum*, acnum*, descrip) Some notes on the Academics database: An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR). A research field...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary to answer the queries that follow. Primary keys are underlined and foreign key fields have an asterisk at the end of the field. CUSTOMERS (CUST-NO, C-NAME, C-ADDRESS, BALANCE) SALESPERSONS (SP-NO, S-NAME, DATE-EMPLOYED, SALARY) SALES (INVOICE-NO, DATE, CUST-NO*, SP-NO*) a) List the salesperson name and salary for all sales to customers whose balance outstanding is greater than 20000. b) List the names and addresses of...
The following is about databases: queries on relational algebra Consider the following schemas for a LinkedIn-like...
The following is about databases: queries on relational algebra Consider the following schemas for a LinkedIn-like professional network. Note this is a slightly simplified version from your last assignment. Assume that the connections are mutual. Person (PID, first_name, last_name, age, gender) School (school_ID, school_name, type, city, state) Education (PID, school_ID, degree, major, year) Company (company_ID, company_name, total_asset, headquarter) Branch (company_ID, branch_num, city, state) WorksAt (PID, company_ID, branch_num, start, end) Connection (PID, friend_ID) For each relation, the attribute(s) of the primary...
The following is about databases: queries on relational algebra Consider the following schemas for a LinkedIn-like...
The following is about databases: queries on relational algebra Consider the following schemas for a LinkedIn-like professional network. Note this is a slightly simplified version from your last assignment. Assume that the connections are mutual. Person (PID, first_name, last_name, age, gender) School (school_ID, school_name, type, city, state) Education (PID, school_ID, degree, major, year) Company (company_ID, company_name, total_asset, headquarter) Branch (company_ID, branch_num, city, state) WorksAt (PID, company_ID, branch_num, start, end) Connection (PID, friend_ID) For each relation, the attribute(s) of the primary...
1) Write and answer a question that asks to find the derivative of an implicitly defined...
1) Write and answer a question that asks to find the derivative of an implicitly defined equation. Your question and solution must demonstrate include each of the following: a. Use implicit differentiation to find ??/?? , b. Make the implicit equation from part a. explicit (use algebra to define ? explicitly in terms of ?) and find ??/ ?? , and c. Show that the solutions from part a. and part b. are the same. 2) Write and solve a...
Use the Donor database attached to the assignment answer the following: Question 1: Create a block...
Use the Donor database attached to the assignment answer the following: Question 1: Create a block to retrieve and display pledge and payment information for a specific donor. For each pledge payment from the donor, display the pledge ID, pledge amount, number of monthly payments, payment date, and payment amount. The list should be sorted by pledge ID and then by payment date. For the first payment made for each pledge, display “first payment” on that output row. 2 marks...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT