Assignment 4 Working on SQL Queries, Assignments of Information Technology

This assignment works on sql queries given a database that the professor gives.

Typology: Assignments

2021/2022

Uploaded on 05/02/2023

amina-31
amina-31 🇺🇸

1 document

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Page 1 of 2
IDS 410 Business Database Technology
Spring 2023
Individual Assignment 4
Structured Query Language SQL
Due Date: Submit your competed Access database file (with extension .accdb) to the
Blackboard by 11:59 pm on Tuesday, April 11, 2023
Instructions:
Download the attached Microsoft Access Database file (IDS 410 Assignment 4 Start
File.accdb).
Rename IDS 410 Assignment 4 Start File.accdb to Assignment4_yourNetid.accdb, where
yourNetid is your Netid.
Create (compose) 16 queries according to their requirements (see below). Be sure to save all
queries (you can name them as follows: Query_01, Query_02, …, Query_16) inside the
Assignment4_yourNetid.accdb.
A. Single Table Queries
1. List everything from the raw material table for raw materials made of birch, mahogany, or oak.
Order the list by firstly thickness, then by material, and lastly by standard price.
2. Display the product finish, and the maximum product standard price (name this column as
MaxPrice) for all products in each product finish.
3. List the IDs of the sales persons and the total number of customers that each sales person has
worked with in 2017.
4. For every product line that has more than two product finishes, display the product line ID, and
the number of product finishes associated with the product line ID.
5. For each group of product finishes, find the most expensive one (name this column as MaxPrice).
In the result table, show product finish and the maximum price. Show the results in descending
order.
6. List the average supply unit price of each vendor except for vendor with ID 1.
7. For each product ID (except for product IDs 1, 2, and 3), list all materials (use material ID), and the
required quantity of each material used to create the product, and whose required quantity is
greater than 2.
8. List order line ID, orde ID, product ID, and ordered quantity for order IDs 1 to 10 which have the
number of quantities ordered greater than 5, or for oder IDs 11 to 35 which have the number of
quantities ordered lower than 10.
pf2

Partial preview of the text

Download Assignment 4 Working on SQL Queries and more Assignments Information Technology in PDF only on Docsity!

Page 1 of 2

IDS 410 – Business Database Technology

Spring 2023

Individual Assignment 4

Structured Query Language – SQL

Due Date: Submit your competed Access database file (with extension .accdb ) to the

Blackboard by 11:59 pm on Tuesday, April 11 , 202 3

Instructions:

• Download the attached Microsoft Access Database file (IDS 410 Assignment 4 – Start

File.accdb).

• Rename IDS 410 Assignment 4 – Start File.accdb to Assignment4_ yourNetid .accdb, where

yourNetid is your Netid.

• Create (compose) 16 queries according to their requirements (see below). Be sure to save all

queries (you can name them as follows: Query_ 0 1, Query_02, …, Query_1 6 ) inside the

Assignment4_ yourNetid .accdb.

A. Single Table Queries

  1. List everything from the raw material table for raw materials made of birch, mahogany, or oak. Order the list by firstly thickness, then by material, and lastly by standard price.
  2. Display the product finish, and the maximum product standard price ( name this column as MaxPrice ) for all products in each product finish.
  3. List the IDs of the sales persons and the total number of customers that each sales person has worked with in 201 7.
  4. For every product line that has more than two product finishes, display the product line ID, and the number of product finishes associated with the product line ID.
  5. For each group of product finishes, find the most expensive one ( name this column as MaxPrice ). In the result table, show product finish and the maximum price. Show the results in descending order.
  6. List the average supply unit price of each vendor except for vendor with ID 1.
  7. For each product ID (except for product IDs 1, 2 , and 3), list all materials (use material ID), and the required quantity of each material used to create the product, and whose required quantity is greater than 2.
  8. List order line ID, orde ID, product ID, and ordered quantity for order IDs 1 to 10 which have the number of quantities ordered greater than 5, or for oder IDs 11 to 35 which have the number of quantities ordered lower than 10.

Page 2 of 2 B. Multiple Table Queries

  1. List product line names, number of products in each of the product line ( name this column NbrOfProducts ), and the average of product standard prices ( name this column AvgPrice ) which is higher than $200.

10. List the names of employees, employee birthdate, manager name ( note: name this column

as Manager ), manager’s birthdate ( note: name this column as ManagerBirth ) for those

employees who were born before their manager was born. ( Note: use operator < to

compare a date which is earlier than another date. )

  1. Display order ID, customer ID, order date, product ID, product description, and ordered quantity for customer with ID = 4.
  2. Display each item ordered for order ID = 1, its standard price, and total price for each item ordered ( note: name it as LineTotal and it’s calculated by multiplying ordered quantity and product standard price ).
  3. List each customer (ID and name) who bought at least one product that belongs to a product line named “Basic”. Each customer should be listed only once; i.e. no duplicate customer.
  4. Show all customers (their names and IDs) who have ordered product with ID 3. You may include the product ID in the result table to check the correctness of your query.
  5. Show all customers (their names and IDs) who have ordered products with IDs 3 and 4 on the same order. (Hint: use sub-query.)
  6. List all the customers who live in the same postal code. In the result table show the pair of the customer names, and the postal code.