Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is only one question. **I need from query 8 forward.**Tables from last project start from the Vendor table until the Supply table. Only need

This is only one question. **I need from query 8 forward.**Tables from last project start from the Vendor table until the Supply table. image text in transcribed
image text in transcribed
image text in transcribed
Only need from query 8 forward**. Tables from last project start at Product table until the Supply table. thanks image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Project Description: Please write SQL queries to update tables extract the following information. Write your queries based on the database you developed in the previous project, Product: product name category brand production cm 1 (PK) (Nor Null) (Nor will) (FK) 1 Toothpaste Supermarket 1 1 2 Multivitamin Supermarket 2 1 3 Shampoo Supermarket 2 2 Jacket Department 4 5 T-shirt Department 5 3 Supplements Pharmacy 6 1 7 Aloe Pharmacy 6 10 Popcorn Pharmacy 7 2 4 $ 6 Queryl. Update the product table by adding another column as shown above. Query 2. Retrieve all the products (name) with production cost equal to one dollar. Query3. List the names of all products under the brand Equate. Query4. List the names) of all brands with products that have a production cost less than 4 dollars. Query5. Retrieve all the products (along with selling price) sold in Walgreens, ordered by selling price. Query 6. List the name(s) of the brands that make more than one product. Query 7. List the name(s) and selling price of the product(s) which brand is under the exclusive license. Query8 List the name(s) of the brand(s) which make at least one "Supermarket product and which contract year is after 2012 Query9. List the name(s) of the vendor which has selling price lower than 10 dollars for at least one product in supermarket category Query10. List the name(s) of the products and the highest selling price for each product. Queryli. Group and count the products by their category for which their brand is specifically under the non- exclusive license Query 12. List the names of the products and ordered them by their brand's contract year. Query13 Create the following table and name its Category category i (PK) 1 (Nor Null) Supermarket Department Pharmacy 3 Update the category" columns for both Vendor and Product table, alter them into a foreign key that references the Category table. vendor_id (PA) 1 2 category address(er will Nor Null (Net Null) Walmart Supermarket 9191 Flagler St service walmart.com Target Supermarket 1010 W Flagler St services target.com CVS Pharmacy 15:49 SW 107th Ave contact.com Macy's Department 1205 NW 107h Ave sales macys.com JCPenney Department 1603 NW 107th Ave service macys.com phone_num.hr mique (76) NO1-5700 (305) 994-2935 (305) 220-014 (305) 994-6300 (305) 477-1786 3 4 5 Walgreens Pharmacy 10700 W Flagler St contactat walgreeti.com (305)424-1140 Arand id (PA) 1 2 contact phone Nav Null) Unique) Great Value exclusive (786) 801-1234 Equate non-exclusive (360)516-9897 Radiance non-exclusive (776636-9641 Allani exclusive (953) 474-999 Worthington non-exclusive (955) 812-7462 Botanics non-exclusive (305)315-3700 Gold Emblem non exclusive (265) 213-7132 con mail ce (Nerul og retal.com 2008 jacquate.com 2010 eri radiance.com 2010 sandyfoni.com 2015 jakeworthington.com 2016 cindy botanics.com 2008 mindya poldembil.com 4 5 6 7 producten (Nor) category (Net all brand (FX (PN) 1 Toothpaste Supermarket 1 2 Multivitamin Supermarket 2 3 Shampoo Supermarket 2 4 Jacket Department 4 5 T-shirt Department 5 6 Supplements Pharmacy 6 7 Aloe Pharmacy 6 8 Popcom Pharmacy 7 SH product_idurid selling price (FK/PK) (FK/PK) 1 1 4 2 2 5 2 12 5 44 5 30 Supply: product_id vendor_id selling price (FK/PK) (FK/PK) 1 4 2 5 3 12 3 5 4 5 30 5 12 5 5 5 10 6 0 6 6 11 7 3 3 16 Project Description: Please write SQL queries to update tables extract the following information. Write your queries based on the database you developed in the previous project. Product: product i Home d (PK) category (Not Null) brand production co (FK) SE (Not Null) 1 Toothpaste 1 1 Supermarket Supermarket 2 Multivitamin 2 1 3 Shampoo Supermarket 2 2 4 Jacket Department 4 5 5 T-shirt 5 6 Supplements 6 1 Department Pharmacy Pharmacy Pharmacy 7 Aloe 6 10 8 Popcorn 7 2 Query1. Update the product table by adding another column as shown above. Query 2. Retrieve all the products (name) with production cost equal to one dollar Query3. List the name(s) of all products under the brand Equate. Query4. List the name of all brands with products that have a production cost less than 4 dollars. Query). Retrieve all the products (along with selling price) sold in Walgreens, ordered by selling price Query6. List the name(s) of the brands that make more than one product. Query 7. List the names and selling price of the product(s) which brand is under the "exclusive license. Query 8. List the name(s) of the brand($) which make at least one "Supermarket" product and which contract year is after 2012 Query9. List the name(s) of the vendor which has selling price lower than 10 dollars for at least one product in supermarket category. Query 10. List the name(s) of the products and the highest selling price for each product. Query11. Group and count the products by their category for which their brand is specifically under the "non- exclusive license Query12. List the names of the products and ordered them by their brand's contract year, Query13 Create the following table and name its Category: category_id (PK) name (Not Null) 1 Supermarket 2 Department Pharmacy 3 Update the category" columns for both Vendor and Product table, alter them into a foreign key that references the Category table Vendor vendor id (PR) phone her (Unique) 1 2 calgery address (Not Nu (Unique) (Not Nut (Niof Null Walmart Supermarked 9191 W Flaplar St service walmart.com Taeyet Supermarket 10101 W Flagler SE service.com CVS Pharmacy 1549 SW 107th Ave contacts.com Macy's Department 1205 NW 107th Ave sales@macys.com JCPenney Department 1603 NW 107th Ave service macys.com 3 (786) 801 5704 (305) 894-2938 (305) 220-0147 (305) 594-6300 (305) 477-1786 1 5 1 Waloreens Pharmacy 10700 W Flagler St contact walgreens.com (305)424-1140 Brand: brand id (PK) contact email contract war (Nor Not Name (Nor Nuit Great Value 1 2008 2 2010 Equate Radiance 3 license contact phone que) exclusive (786) 801.1234 non-exclusive (360) 516-9897 non-exclusive (776) 636.9611 exclusive (953) 474-8995 non exclusive (955) 812.7462 non-exclusive (305) 3153700 non-exclusive (65) 213-7132 2010 4 george greaval.com jacedequate.com eric (@radiance.com sandy alfani com jake wortunaton.com cindy botanics.com mind oldetit.com 2015 Alfani Worthington Botanics 5 2010 6 2008 2 Gold Emblem 2005 Product: product_id name (Not Nould category (Nor Null brand (FIO (PK) 1 Toothpaste Supermarket 1 2 Multivitamin Supermarket 2 3 Shampoo Supermarket 2 4 Jacket Department 4 5 T-shirt Department 5 6 Supplements Pharmacy 6 7 Aloe Pharmacy 6 8 Popcorn Pharmacy 7 Sanel: product id vendor selling price (FKP (FK/PR) 1 1 4 2 2 5 3 2 12 3 1 5 4 30 2 5 4 12 10 5 11 16

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Real Time Database And Information Systems Research Advances

Authors: Azer Bestavros ,Victor Fay-Wolfe

1st Edition

1461377803, 978-1461377801

More Books

Students also viewed these Databases questions