Docsity

Homework Assignment 1 on Database Systems | CS 461, Assignments of Deductive Database Systems

Toggle sidebar
bg1
Homework Assignment 1 – Database Systems CS 461
Total Points: 100
Due Thursday January 22nd
Post your solutions to WebCT no later than 11:55 PM
Use the following relations to answer the questions. All questions may not have a valid answer. If they do not, indicate why.
An ID field can be between 1 and 6 digits.
Products
ID_PRODUCT PRODUCT_NAME SKU Price
1 Zojjed! WALK-001 16.95
2 Race Walk Like a Champion WALK-002 23.95
3 The Evolution of Race Walking WALK-003 14.95
4 Race Walking Done Right WALK-006 14.95
5 Walk Like an Athlete WALK-010 24.95
6 Non Existent Fountains TFG-001 100.00
7 Race Walk Like a Champion WALK-011 49.95
8 Olympic 50K WALK-012 100.00
RefProductCategories
ID_CATEGORY CATEGORY_DESC
1 Walking
2 Photography
3 Fiction
RefProductTypes
pf3
pf4

Partial preview of the text

Download Homework Assignment 1 on Database Systems | CS 461 and more Assignments Deductive Database Systems in PDF only on Docsity!

Homework Assignment 1 – Database Systems CS 461Total Points: 100Due Thursday January 22ndPost your solutions to WebCT no later than 11:55 PMUse the following relations to answer the questions. All questions may not have a valid answer. If they do not, indicate why.An ID field can be between 1 and 6 digits.

Products

ID_PRODUCT

PRODUCT_NAME

SKU^

Price

1 Zojjed!

WALK-

2 Race Walk Like a Champion

WALK-

3 The Evolution of Race Walking WALK-

4 Race Walking Done Right

WALK-

5 Walk Like an Athlete

WALK-

6 Non Existent Fountains

TFG-

7 Race Walk Like a Champion

WALK-

8 Olympic 50K

WALK-

RefProductCategories ID_CATEGORY

CATEGORY_DESC 1 Walking 2 Photography 3 Fiction RefProductTypes

ID_PROD_TYPE

PROD_TYPE_DESC 1 Book 2 DVD 3 T-Shirt 4 Photograph

ProductCategories ID_PRODUCT

ID_CATEGORY 1 3 2 1 3 1 4 1 5 16 27 18 18 2 ProductTypes ID_PRODUCT

ID_TYPE 1

  1. Write the query, in relational algebra, to get the name of the product(s) that have the lowest price. (You may use the joins in class,but not the aggregate functions)(questions 6-8, you may

NOT

use the join conditions learned in class) (i.e. inner, natural, left, right, and full)

(10 points)6. Write a query in relational algebra to return id’s of all products with no product categories assigned to them.(10 points)7. Write the query, in relational algebra, to names of the products that have a category of “Walking” and also have a product type of“Book”.(10 points)8. Write the query, in relational algebra, to get a complete list of products (NAME, SKU, PRICE), and the descriptions of allcategories associated with them.(10 points)9. Write the query, in relational algebra, to get the names of the products that are assigned to the least product types.(6 points)10. Write a query, in relational algebra, to return the Product that have Product Types but not Product Categories.