Sale!

DBS 211 Lab 04 – Multi-Table Queries and Views Answered

Original price was: $35.00.Current price is: $28.00.

DBS 211 Lab 04 – Multi-Table Queries and Views Answered

Objective:

The purpose of this lab is to introduce students to querying data from multiple tables. Relationships are used

Download Details:

  • Name: Lab04-3mc90o.zip
  • Type: zip
  • Size: 1.44 MB

Category:

Description

5/5 - (1 vote)

Objective:

The purpose of this lab is to introduce students to querying data from multiple tables. Relationships are used in relational databases to reduce redundant and repetitive data, but it is necessary to reconnect these tables when extracting data and obtaining information. Student will be able to:

  • produce query results containing data from multiple tables using ANSI-92 joins and demonstrate their knowledge of inner, outer and full
  • To actively troubleshoot queries to handle potentially ambiguous fields across multiple tables through the use of aliases
  • Students learn to create and modify

Submission:

Your submission will be a single WORD file with the solutions provided.

Your submission needs to follow the same question order and clearly indicate the answers to each question. Make sure every SQL statement terminates with a semicolon.

ALL questions must be answered using ANSI-92 JOINs unless otherwise stated. ANSI-89 are obsolete and should not be used in new query derivations. We only teach them in case you see them in the workplace, that you know what they are and how they work.

Tasks:

Select data from multiple tables

 

  1. Create a query that shows retail customers first name and last name along with their sales rep employee number and their first name, last name, city, phone number and postal code for all retail customers who live in
    1. Answer this question using an ANSI-89 Join
    2. Answer this question using an ANSI-92 Join

 

  1. Create a query that displays all retail payments made by retail customers from
    1. Sort the output by Customer
    2. Only display the Customer Number, Customer Name,Country, Payment Date and
      1. Make sure the date is displayed clearly to know what date it is. (i.e. what date is 02-04-19??? – Feb 4, 2019, April 2, 2019, April 19, 2002, ….)

 

  1. Create a query that shows all Canada customers who have made a payment. Display only the customer number ,customer name, amount sorted by customer

 

Views and Joins

 

  1. Display all the retail orders with quantity ordered, price of each item, who have their order shipped and who live in Denmark
  2. Create a view (vwProductOrder) to list all the retail products with the following data:

Product code,  product name, msrp, buyprice, quantity ordered, and    price for each product in every order.

  1. b) Write a statement to view the results of the view just

 

  1. Using the vwProductOrder view, display the product order information with product name, buyprice ,order line number anwhose buy price is in the range from $30 to $40 and whose product code starts with ‘s32’. Sort the output based on product name and then buy price. (Hint: orderLineNumber is not in the view then how can you get in this query?)

 

  1. Create a query that displays the customer order information with customer number, first name, last name, phone, and credit limits for all customers who do not have any

 

  1. Create a view (vwEmployeeManager) to display the information of all retail employees first name and last name and  their managers first name and managers last name if there is any manager that the employee reports to. Include all employees, including those who do not report to

 

  1. Modify the vwEmployeeManager view so the view returns only employee information for employees who have a manager. Do not DROP and recreate the view – modify it. (Google is your friend).

 

  1. Drop both vwProductOrder and vwEmployeeManager