Question N . 1 2. Using the following relations to write SQL statement that foll
ID: 3824706 • Letter: Q
Question
Question N . 1
2. Using the following relations to write SQL statement that follows:
Product (product_name, price, category, company_name)
Company (company_name, stockPrice, country)
a- Find all products produced by USA and have a price greater than 500.
b- Find the Categories that a product might belong to. Make sure that the category is not repeated and it is listed in ascending order.
c- delete all products with that belong to SONY company.
Question N . 2
3.a List the three design goals for relational databases, and explain why each is desirable.
3.b What is the result of an arithmetic expression involving nulls, for instance, what 7 + null would return?
Explanation / Answer
1.SELECT * FROM PRODUCT,COMPANY
WHERE PRICE>500 AND COUNTRY=USA
JOIN ON PRODUCT.COMPANYNAME=COMPANY.COMPANYNAME
2.SELECT PRODUCTNAME FROM PRODUCT.PRODUCT_NAME AS P WHERE IN(SELECT DISTINCT CATEGORY FROM PRODUCT.PRODUCT_NAME AS Q WHERE PRODUCT.P=PRODUCT.Q
ORDER BY CATEGORY ASC.
3. DELETE *FROM PRODUCTS
WHERE COMPANY_NAME=SONY
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.