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.
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.
Get Answers For Free
Most questions answered within 1 hours.