Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please do it by type not pics. 1.Consider the following three tables, primary an

ID: 426609 • Letter: P

Question

Please do it by type not pics.

1.Consider the following three tables, primary and foreign keys.

Table Name SalesPeople

Attribute Name Type Key Type

EmployeeNumber Number Primary Key

Name Character

JobTitle Character

Address Character

PhoneNumber Character

YearsInPosition Number

Table Name ProductDescription

Attribute Name Type Key Type

ProductNumber Number Primary Key

ProductName Character

ProductPrice Number

Table Name SalesOrder

Attribute Name Type Key Type

SalesOrderNumber Number Primary Key

ProductNumber Number Foreign Key

EmployeeNumber Number Foreign Key

SalesOrderDate Date

Assume that you draw up a new sales order for each product sold.

Develop the following queries and submit them as a picture or document:

a. All the Sales People with less than three years in position who have sold Product Number 1167.

b. All the Products with the word “bracket” in the Product Name.

c. All the Sales Orders for products with a price of more than $33.

Explanation / Answer

a. Select SalesPeople.EmployeeNumber from SalesPeople, SalesOrder where SalesPeople.EmployeeNumber = SalesOrder.EmployeeNumber and SalesPeople.YearsInPosition < 3 and SalesOrder.ProductNumber = 1167

In this case we have joined the SalesPeople and SalesOrder table and used the required conditions.

b. Select ProductDescription.ProductNumber from ProductDescription where ProductDescriptuon.ProductName like '%bracket%'.

Product number with product name containing bracket is displayed.

c. Select SalesOrder.SalesOrderNumber from SalesOrder, ProductDescription where SalesOrder.ProductNumber = ProductDescription.ProductNumber and ProductPrice > 33

Sales order and Product description table are joined and the required conditions are applied.