Question

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

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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.

Add a comment
Know the answer?
Add Answer to:
Please do it by type not pics. 1.Consider the following three tables, primary and foreign keys....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the following three tables, primary and foreign keys. Table Name        SalesPeople Attribute Name                  &nbsp

    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...

  • SQL queries and procedures TABLE: Employees Business Rules: EmployeeID is defined as the primary key. Address...

    SQL queries and procedures TABLE: Employees Business Rules: EmployeeID is defined as the primary key. Address has been denormalized to include City and State for performance reasons. DeptNbr is a foreign key that references DeptNbr in the Department table Manager is a foreign key that references EmployeeID in the Employees table Data Structure: (EmployeeId, LastName, FirstName, Street, City, State, Zip, DateOfHire, DateOfBirth, JobTitle, Salary, DeptNbr(fk), Manager(fk)) TABLE: Department Business Rules: DeptNbr is defined as the primary key. Data Structure: (DeptNbr,...

  • these are all tables please see the tables and questions are mentioned below please see that...

    these are all tables please see the tables and questions are mentioned below please see that all and I need answers asap please write proper answer it's an easy task and don't take much time please do it fast thanks in advance EMPLOYEE Remark Column Name EmployeeNumberINT Primary Key Yes No CHAR (25 CHAR (35 CHAR 25 NUMERIC INT CHAR (12 CHAR Name in the DEPARTMENT table Position No Number in the EMPLOYEE table Su OfficePhone EmailAddress No No No...

  • NEED THE SQL QUERIES ASAP PLEASE(LIKE 1 HOUR) THE ONES WITH ID ARE PRIMARY KEYS OR...

    NEED THE SQL QUERIES ASAP PLEASE(LIKE 1 HOUR) THE ONES WITH ID ARE PRIMARY KEYS OR FOREIGN etc Customer [ CustID, LastName, FirstName, Address, City, State, Zip, Phone, Fax, Email] Product [ ProdID, Description, Color, Size, Pack] Sales [ TransID, CustID, ProdID, Price, Quantity, Amount] Write SQL statement to produce a list of unique products and their prices from the Sales table. Please ensure that the products do not repeat. Write an SQL statement to list ProdID and Description for...

  • Please help I promise positive feedback Part IV. Formulate SQL queries that follow for the database...

    Please help I promise positive feedback Part IV. Formulate SQL queries that follow for the database with the following tables: CUSTOMER, PRODUCT, SALES, and ITEM-SOLD. Table: CUSTOMER Primary Key: Account-No Account-No Customer-Name Customer-City 1 A NYC 2 B NYC 3 C MIA Table: PRODUCT Primary Key: Item-No Item-No Price 1 $1.00 2 $2.00 3 $3.00 4 $4.00 Table: SALES Primary Key: Receipt-No Foreign Key: Account-No References CUSTOMER Receipt-No Account-No Sales-Person 1 1 S1 2 1 S1 3 2 S2 4...

  • SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do...

    SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do steps after. First 3 tables are after the first 2 images for reference if needed. //1// CREATE TABLE kr_customer ( Name VARCHAR(40) NOT NULL PRIMARY KEY, City VARCHAR(20), Status CHAR(1) ); //2// CREATE TABLE kr_salesperson ( Name VARCHAR(40) NOT NULL PRIMARY KEY, Age INT, Salary DECIMAL(8, 2) ); //3// CREATE TABLE kr_order ( Order_Number number(3) NOT NULL PRIMARY KEY, Customer_Name VARCHAR(40), Salesperson_Name VARCHAR(40), Amount...

  • Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys...

    Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys Exercise                                                                                In Lab 09, we will continue the practice of creating tables. You will need to write SQL statements for the tasks specified below. After you complete them, submit your SQL script (in one *.sql file) to Blackboard by 11:59pm Nov. 16 (Friday). Include your name as a comment in the SQL script submitted. The creation statement for each table is worth one point,...

  • Fundamentals of Database Systems Consider the following data. Arrows show the functional dependency Product Item ld...

    Fundamentals of Database Systems Consider the following data. Arrows show the functional dependency Product Item ld QuantityItem Used uct Receipt Quantity Sales ription Number Num Description Date The arrows in this question indicated the determination of two attributes. For example, the arrow that goes ProductID to ProductDescription indicates that ProductID determines the ProductDescription, This in turn means that Productld can be considered as primary key for ProductDescription a) Write the tables b) Place the tables in 3rd normal form (if...

  • using SQL Assume the relations shown below (underlined attributes are primary and foreign keys): merchants(mid, name,...

    using SQL Assume the relations shown below (underlined attributes are primary and foreign keys): merchants(mid, name, city, state) products(pid, name, category, description) sell(mid, pid, price, quantity_available) orders(oid, shipping_method, shipping_cost) contain(oid,pid) customers(cid, fullname, city, state) place(cid, oid, order_date)   For each of the following questions write a SQL query: List names and sellers of products that are no longer available (quantity=0) List names and descriptions of products that are not sold. How many customers bought SATA drives but not any routers between 2009...

  • Consider the following relational database to manage concert and ticket sales. The relations are artist, concert,...

    Consider the following relational database to manage concert and ticket sales. The relations are artist, concert, venue, seat, ticket, and fan. The schemas for these relations (with primary key attributes underlined) are: Artist-schema = (artistname, type, salary) Concert-schema = (artistname, date, venuename, artistfees) Venue-schema = (venuename, address, seating_capacity) Seat-schema=(venuename, row, seatnumber) Ticket-schema = (fanID, date, venuename, row, seatnumber) Fan-schema = (fanID, name, address, creditcardno) Where: • artistname is a unique name for the artist (because of trademark/copyright rules no two...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT