Question

Database Intro

Salesmen Sheet

CommRate SalesRegion State SalesNum SalesName 100 James King 110 Arthur Dolan 200 Samantha Rose 300 John Miller 400 Susan Wal

Order_info Sheet

OrderNum 200 BusinessNum 135 104 122 203 128 129 Paid Yes Yes Yes Yes Yes 202 203 204 205 206 207 208 209 210 212 213 131 Yes

Business_Info sheet

BusinessNum 104 107 122 128 129 131 133 135 136 163 ME RI ons 1165 201 Bangor 202 203 322 Kittery 325 407 422 VT 423 Business

1.Create your own table design based on the Excel data, and include all relationships (joins). Apply referential integrity rules wherever appropriate.

Import the data from Excel to Access to populate tables:

1. Use the Chen technique and illustrate the E-R diagram for the tables you created

Note: It may be necessary to change the data composition due to normalization issues, if you change the composition detail how and why; (you may find it necessary to create additional tables or fields)

2. Create the appropriate SQL or use Access Queries to complete the following:

  • Find businesses and their orders sorted by Salesman Last Name. Include the following attributes: Business Number, Business Name, Order Number, Billing Date, Salesman Last Name, and Commission Amount (derived attribute based upon Invoice Amount and Commission Rate).
  • For all salesmen with current customers, create a list of each business (one record per business) with unpaid orders. Include the following attributes: Salesman Number, Salesman Full Name (derived from Salesman Last Name and Salesman First Name), Business Number, Business Name, and Owner Name.
  • Show Owners with unpaid bills (an order is classified as unpaid if the Paid indicator is = “No”), listing the Owner Name, Owner Phone, Business Number, Business Name, the amount Due, and a new amount Due (original amount Due with a 7% finance charge added), Sorted by New amount Due in descending order.

  1. Create a parameter based query to accept a region code and display the State, Salesman Number, Salesman Full Name, and all businesses in that region.
  2. Create a user interface to insert/maintain business information and an additional one to insert/maintain order information, or a single interface that combines both if you wish. This will involve the use of a form or forms.

Produce the following reports:

  1. List all businesses for a selected salesman (this is a good use of a parameter based query) include: Salesman Number, Salesman First Name, Salesman Last Name, Business Name, and Business Phone.
  2. Create a report listing the commission earned by each salesman for each order that has been paid. Group the report by salesman number and sort by commission amount in descending order within salesman. Include the following attributes: Region Code, State, Salesman Number, Salesman Full Name, Business Name, Invoice amount, Commission Rate, and Commission amount. In addition, include the total commission earned for each salesman and the total commission earned for the report.
  3. Generate labels for a promotion targeting all businesses that have spent more than $2,000. Address the label to the Business Name and Address and include a line “Attn: ”. Sort the labels by Business Name within Zip Code. Use Avery #C2163 label format, sheet fed.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

salesmen(s_num, s_fname, s_lname, c_rate, s_region, state)
order(o_num, b_num, paid, invoice_amt, date)
business(b_num, b_name, b_phn, add_region, owner_fnm, owner_lnm owner_phn)
address(add_region, street, city, state, zip)

1. Creating these tables:
CREATE TABLE salesmen(
   s_num INTEGER PRIMARY KEY,
   s_fname VARCHAR,
   s_lname VARCHAR,
   c_rate FLOAT,
   s_region INTEGER,
   state VARCHAR
);

CREATE TABLE address(
   add_region INTEGER PRIMARY KEY,
   street VARCHAR,
   city VARCHAR,
   state VARCHAR,
   zip VARCHAR
);

CREATE TABLE business(
   b_num INTEGER PRIMARY KEY,
   b_name VARCHAR,
   b_phn INTEGER(10),
   add_region INTEGER,
   owner_fnm VARCHAR,
   owner_lnm VARCHAR,
   owner_phn INTEGER(10),
   FOREIGN KEY add_region REFERENCES address(add_region)
);

CREATE TABLE order(
   o_num INTEGER PRIMARY KEY,
   b_num INTEGER NOT NULL,
   paid ENUM('Yes', 'No') NOT NULL,
   invoice_amt INTEGER NOT NULL,
   date DATE,
   FOREIGN KEY b_num REFERENCES business(b_num)
);

2. Queries:
-> SELECT o.b_num, b.bname, o.o_num, o.date, s.s_lname, o.invoice_amt, s.c_rate, s.c_rate*o.invoice_amt as amt
   FROM business b, order o, salesmen s, address a
   WHERE o.b_num = b.b_num AND b.add_region = a.add_region AND s.state = a.state ORDER BY s_lname

-> SELECT UNIQUE s.s_num, CONCAT(s.s_fname, s.s_lname) as s_name, b.b_num, b.b_name, b.owner_nm
   FROM business b, order o, salesmen s, address a
   WHERE o.b_num = b.b_num AND b.add_region = a.add_region AND s.state = a.state AND o.paid = 'No'

Add a comment
Know the answer?
Add Answer to:
Database Intro Salesmen Sheet Order_info Sheet Business_Info sheet 1.Create your own table design based on the...
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
  • Database Design Problem You have been hired to review the accuracy of the books of Northeast...

    Database Design Problem You have been hired to review the accuracy of the books of Northeast Seasonal Jobs International (NSJI), a job broker. NSJI matches employers whose business is seasonal (like ski resorts) with people looking for part time positions at such places. Employers are located in the Northeast (New England), but recently expanded to include parts of Canada. NSJI maintains all of this information in a flat file spreadsheet (see attached layout of the spreadsheet structure). Required: 1) From...

  • I am working on multi-table queries for my SQL class using a premade database, which I...

    I am working on multi-table queries for my SQL class using a premade database, which I have included screenshots of. I received assistance and was able to complete a good number of the queries but the bolded ones seem absolutely impossible to do?? How do I write a query for the bolded questions?? I've scoured my textbook and notes and cannot get anything I try to successfully produce results. 1. List all current reservations with the trip ID, customer’s first...

  • Oracle only database: DROP TABLE ORDERITEMS; DROP TABLE Orders; DROP TABLE BOOKAUTHOR; DRO...

    oracle only database: DROP TABLE ORDERITEMS; DROP TABLE Orders; DROP TABLE BOOKAUTHOR; DROP TABLE BOOKS; DROP TABLE PROMOTION; DROP TABLE AUTHOR; DROP TABLE CUSTOMERS; DROP TABLE PUBLISHER; CREATE TABLE Customers ( Customer# NUMBER(4), LastName VARCHAR2(10) NOT NULL, FirstName VARCHAR2(10) NOT NULL, Email VARCHAR(40), Address VARCHAR2(20), City VARCHAR2(12), State VARCHAR2(2), Zip VARCHAR2(5), Referred NUMBER(4), Region CHAR(2), CONSTRAINT customers_customer#_pk PRIMARY KEY(customer#) ); INSERT INTO CUSTOMERS VALUES (1001, 'MORALES', 'BONITA', '[email protected]', 'P.O. BOX 651', 'EASTPOINT', 'FL', '32328', NULL, 'SE'); INSERT INTO CUSTOMERS VALUES...

  • USE colonial; CREATE TABLE CUSTOMER (CUSTOMER_NUM CHAR(4) PRIMARY KEY, LAST_NAME CHAR(30) NOT NULL, FIRST_NAME CHAR (30),...

    USE colonial; CREATE TABLE CUSTOMER (CUSTOMER_NUM CHAR(4) PRIMARY KEY, LAST_NAME CHAR(30) NOT NULL, FIRST_NAME CHAR (30), ADDRESS CHAR(35), CITY CHAR(35), STATE CHAR(2), POSTAL_CODE CHAR(5), PHONE CHAR(12) ); CREATE TABLE RESERVATION (RESERVATION_ID CHAR(7) PRIMARY KEY, TRIP_ID DECIMAL(3,0), TRIP_DATE DATE, NUM_PERSONS DECIMAL(3,0), TRIP_PRICE DECIMAL(6,2), OTHER_FEES DECIMAL(6,2), CUSTOMER_NUM CHAR(4) ); CREATE TABLE TRIP (TRIP_ID DECIMAL(3,0) PRIMARY KEY, TRIP_NAME CHAR(75), START_LOCATION CHAR(50), STATE CHAR(2), DISTANCE DECIMAL(4,0), MAX_GRP_SIZE DECIMAL(4,0), TYPE CHAR(20), SEASON CHAR(20) ); CREATE TABLE TRIP_GUIDES (TRIP_ID DECIMAL(3,0), GUIDE_NUM CHAR(4), PRIMARY KEY (TRIP_ID, GUIDE_NUM)...

  • Partial Question 10 1/2 pts Give the SQL statement to list the trip name and state...

    Partial Question 10 1/2 pts Give the SQL statement to list the trip name and state for each trip that occurs during one of the Fall seasons that is Early Fall, Spring and Late Fall. Sort by State. Use the wildcard for the season. SELECT TripName, State FROM Trip WHERE Season LIKE '%Fall' OR SEA ORDER BY State: Answer 1: LIKE '%Fall' OR SEASON LIKE 'Spring' Answer 2: ORDER BY Partial Question 11 1/2 pts Give the SQL statement to...

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
ADVERTISEMENT