Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Northwind database. 1. Using a sub-query find all products that have never been ordered. Show the product Id and the product name in your

Use Northwind database.

image text in transcribedimage text in transcribedimage text in transcribed

1. Using a sub-query find all products that have never been ordered. Show the product Id and the product name in your results (13 Points) 2. List the customerld, Companyname and complete address for all customers that have a customer ID that starts with M. (13 Points) 3. List each HOURLY employee's first and last name and their estimated yearly salary. Use 2080 as the number of hours worked annually. Concatenate the employee first and last names. Name the columns appropriately. (13 Points) 4. List the ten highest product prices and the product name. (13 Points) 5. List all customers with no region. (13 Points) 6. List all products and the supplier. Order by supplier's company name then Product Name. (13 Points) 7. Run the Create table Script below and create the following tables. (16 Points) ***Remember If you create the FK references in the Create table command you have to create the tables in the correct order for the FK references to work. Alternatively you can create the tables and code Alter Table statements to create the FK references AFTER you create the tables ****Run this script prior to creating the tables for step 7**** --begin script--- IF DB_ID(College") IS NOT NULL --check to see if the database exists DROP DATABASE College; -- if it does drop the database GO Create Database College:--Creates the database Go Go Use College -- makes the database the active database --End Script-- Table:Student StuNum Varchar (5) Primary Key StuFirstName Varchar (25) StuLastName Varchar(25) StuMajor Varchar(40) Table:Enrollment Class_code Varchar(5) Primary Key, foreign Key References Class Class_Code StuNum Varchar (5) Primary Key, foreign key references Student StuNum EnrollDate Date/time Table:Class Primary Key ClassCode Varchar(5) SectionNum Varchar(5) InstructorID Varchar(5) Location Varchar(40) Foreign Key, references Instructor Table Table:Instructor InstructorID Varchar (5) Primary Key Ins_FName Varchar(30) Ins_LName Varchar(30) Phone Varchar(15) 8. In a commented block in your Script explain the purpose of the enrollment table. Why not create a PK/FK between student and Enrollment? (6 Points) ***EXTRA CREDIT. Up to 10 additional points Northwind would like to know the total compensation paid to each employee in 2014 List the employee last name, Commission paid, estimated salary and the total compensation. Commission is earned on the pre-discount total of all sales completed by that employee multiplied by the commission rate of 5%. Since salaried employees do not earn a commission you should only show hourly employees

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

What does need to change?

Answered: 1 week ago