Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment 6: (amended – Nov. 22, 2022)

Structured Query Language (SQL) and Microsoft Access

Due Date: Thursday, December 01 by 6:00 pm.

Late Policy:

• It is expected that students budget enough time to properly submit their assignments via OWL     and allow for any unforeseen technological issues. Students are expected to regularly backup their assignments and submit well before any deadline.

• Each student will be given five late coupons” in total for the semester that may be used to submit an assignment one day late per coupon (up to a maximum of 3 days late per assignment).

• Late coupons will be applied automatically when an assignment is submitted late and tracked in the OWL gradebook. Each late coupon is valid for a 24 hour period (6:00pm to 6:00pm the following day).

• If a student has no late coupons remaining or submits an assignment more than 3 days late, a zero grade will be given for the assignment (no partial late marks will be given).

• Late coupons must be used before special circumstances are considered.

• After all late coupons are used, no extensions will be given for assignments except for in the event of serious medical or compassionate grounds. A student must follow the procedure for  Academic Accommodation for Medical Illness as given in the Course Outline.

All assignments must be completed individually and without the aid of any outside service or tutor. Do not share your work or use another students work in anyway.

Project 1: Written SQL

Specific employees are assigned to manage products that are manufactured by your company. You have a database that contains your employees’ demographics, the products they manage and the   locations where these products are manufactured.

Use the database shown below and create a Microsoft Word document containing the SQL statements (as shown in the lecture materials) to do the following:

A.  Find the Employee ID, first name, last name, phone number and email address for all employees who live in Toronto.

B.  Modify the employee information for employee ID equal to 3137 to your first name, last name, address and email address. (you may use a fake address and email, but must be your name).

C.  Find the Employee first and last name, Employee email, Assigned Date and Department Size for all employees with an assignment date in manage that occurred during the month of          January 2022

D.  Find the Product Name, Per Product Manufacturing Cost, Department Size, Assignment Date, Employee Last and First Name for the departments with 100 or more but less than 200            workers.

E.  Find the number of products that you manage. (Use your name in the query) and name the result as Product Totals.

F.  Find the Employee first and last name, Employee phone number, Assignment Date, Location Name, Product Name for all products that cost more than $75 to manufacture and Location   starts with the letter K’ .

 

HINT 1:

it is very easy to tell if a value is stored as a number or as text in an MS Access table.

-if the value is right justified (pushed to the right) then it is stored as a number. -if the value is left justified (pushed to the left) then it is stored as a text.

HINT 2:

remember how field names with spaces are treated differently from field names without spaces.

HINT 3:

remember, round brackets are required to be used with all INNER JOIN statements.

The format (the way the SQL statements are written out) MUST match the style shown in the notes.

Each SQL reserved word MUST appear on their own line and in capital letters in the document. example:

SELECT

something

FROM

( somewhere

INNER JOIN

somewhere else ON some condition )

WHERE

some condition is true;

This is non-optional. You MUST use this standard. You will be graded on adhering to this standard. You MUST write the SQL without the use or aid of any electronic method.

For example: You can NOT use MS Access Query Builder to create the SQL graphically and then  copy or type in the result to your Word document. You will be graded on adhering to this standard.

You must identify yourself on the document. You will lose marks if this is missing. Somewhere visible on the beginning (top) of the Word file you must include:

- your first and last name

- your Western ID (see below for a description of your Western ID)

- your student number

Save your SQL statements in the Word file named "youraccountname_sql.docx” and attach the file to your submission.

Project 2: Queries in Microsoft Access

Create a brand new, blank database and name it youraccountname_BookStore.accdb. (substitute youraccountname with your actual account name.)

Using the XML Import utility in MS Access import the data in the file Asn6_SQL2_F22.xml. This will import five (5) tables with data into your database.

Manually delineate (identify and create) the Primary Key for the necessary tables. hint: not all tables require Primary Keys.

Manually change the data type for the orderDate in the Orders table to Date/Time. Manually change the data type for quantity in the Orders table to Number (Integer).

Manually change the data type for retail_price in the Books table to Number (single).              Create the following relationships in your database AND enforce referential integrity for each:

1.  customer_number in the Customer table related to the custID in the Orders table.

2.  isbn in the Books table related to the BookISBN in the Writes table

3.  isbn in the Books table related to the BookISBN in the Orders table.

4.  authID in the Authors table related to the AuthorID in the Writes table.

Create a query for each of the following. (Name each query as follows: QueryA, QueryB, etc)

A.  Find the isbn, title, publisher’s name, publication year for all of the books from 159 series of the ISBN in descending order by publication date.  Books from the 159 series all have an    isbn number that begins with a “0-159” .

B.  Change the name of the Customer with the customer number of 2 to your last and first name and your Western email.

C.  Find the ISBN, title and retail price for all of the books order by the customer whose ID is 10.

D.  Find the customer number, first name and last name for all customers who ordered a book in February of 2022.  In addition to showing the customer number, customer first name and       customer last name, show the book title as part of the resulting dataset.  Order this by           customer name. If a customer has ordered more than one book in February of 2022 that        customer will appear more than once in the resulting dataset.

E.  Find the total number of orders of books which were ordered in February of 2022.

Customers who have ordered more than one book in February of 2022 will be included in the answer for each book that they have ordered. Label this as: Feb 2022 Sales.

HINT: Use the saved QueryD in your answer.

F.  Find the title, author’s name, Order Date and quantity for all of the books that you have   ordered  (use your last name and first name in the query not your Customer ID).  List the books in ascending order by order date.

Save your database in the file named "youraccountname_BookStore.accdb and submit the file through OWL.

Project 3:  Information Systems Questions about Your Company

Create a one page MS Word document and complete the following questions pertaining to the business you described in Assignment One (1).

Each answer must be comprehensive (more than one sentence). Each answer requires at least four  sentences. The entire Project 3 should be at least approximately 400 words.  It is expected that some thought and explanation is included in this section.

1.) In Assignment Two (2) Project Three part 2.) you were asked:

What type of data do you think you will to track in the beginning?

Review your answer that you submitted in Assignment Two.

Name one item you overlooked and did not include that you now realize you should track.

- briefly explain your answer

Name one item you think might not be as important or that you would not track.

- briefly explain your answer

2.) Name one way you might use SQL in your company?

- briefly describe how it could be used and what need it would fulfill.

3.) After what you have learned in CS1032, has your interest in computers in business increased or  will you be glad if you never to have to use a computer again except for social media and videos?

- briefly explain your answer

The format of this document should be identical to format you used in Assignment One (1). Place your name, followed by the company name at the top.

Fill in the required information after.

At the end of the document, include your name, Student number and Western ID (the first part of your Western email (i.e. if your email was - derntwis@uwo.ca your ID would be - derntwis)

Formatting is not important as long as the document is easy to follow:

This document must be a Word file saved and submitted as a .doc (or .docx) file

The name must be a combination of your Western Account Name and the name of your company. The file name must be youraccountname_companyname_A6.doc (or .docx)

Submission Instructions:

For Project One (1) you must submit the SQL statements inside a MS Word document. You are expected to write out the actual SQL statements and they MUST be in the format shown in the  notes/videos.

For example:

1.) SELECT

field1

FROM

table1;

For Project Two (2) you must submit the MS Access file and the answers are provided as actual       Queries through the Design View.  Do NOT write the answers as SQL but use the actual design tool in MS Access to complete each question.

You must upload, attach and submit, via the CS1032 course website in OWL, the following files:

•   youraccountname_BookStore.accdb

•   youraccountname_sql.docx

•   youraccountname_companyname_A6.docx

NOTE: This description of the assignment contains instructions that tell you to create files with names that have a specific format.  In these file names; the youraccountname” is your UWO username.

It is your responsibility to regularly backup your files. No extensions will be given for lost or corrupt files.

REMEMBER: It must be your own work. You can NOT work in groups or share work.                    You cannot use a template or starting point” from another person (even if they are your tutor).

Do not use your friend’s” work, change some of the data and submit it as original work.

Do not let your friend(s)” see or have access to your work. You are not helping’ them as they will need to be able to do this on their own in the exam. Remember, you will     lose full marks if a friend’ in any way uses your work. It will be reflected on your record as an academic dishonesty exactly as if you copied from another person.

We will be checking for any academic dishonesty and the penalties as outlined in the course outline will be applied.