Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For questions 4, 5 and 6, please use the W3Schools customer orders database. You

ID: 3804329 • Letter: F

Question

For questions 4, 5 and 6, please use the W3Schools customer orders database. You need to submit thoroughly tested SQL statements For your convenience and reference, relevant data model is attached as a PDF document with the assignment in the Blackboard. Name of this document is "Relationship diagram for W3schools order pdf. 1) You are implementing a Relational Database for a company t that sells its products on internet The Database maintains the Customer information in a table called "CUSTOMERS". The primary key of this table is a column called "CustomerID". There are also columns "LastName" First Name "City" and "ZipCode" representing last name, first name, city in which the Customer lives and the 5 digit zip code of the customer respectively When a customer calls the customerservice department with any inquiries, the customer service representative asks the customer for his or her Customer ID and pulls the information related to that customer from the Database. However, if a caller does not remember his/her Customer ID, the Customer service representative asks the customer for his/her last name and the 5 digit zip code, pulls the information related to all the customers from the database with matching last name & zip code combination and then further narrows down the search for the customer record based on some other identifiable information about the customer. The CUSTOMER table is expected to have millions of records and the system needs to quickly retrieve a set of matching customer records based on Customer's last name and 5 digit zip code combinations As the Database Designer, how could you speed up the retrieval of data from the CUSTOMER table for a given combination of customer's last name and zip code? 2) You are implementing a NoSQL database to record the grievances of customers of an automobile company. You have freedom of recommending a Key-Value type database or a Document Database. Each of the grievance record is keyed on Customer ID, and contains certain other information like the Automobile model examples: Camry, Civic, Corolla, Escort. grievance category (Example: Mileage/Fuel consumption, Maintenance costs, pickup time and some description of the grievance. The system needs an ability to index and query the grievance records based on values for Automobile model and grievance category As the Database Designer, would you recommend a Key-value type of database or Document database? Please provide explanation (s) for your recommendation 3) You are tasked with implementing a NoSQL database for a Social Network website. The website has a requirement to identify common friends/connections between given two members You have freedom to recommend akey-value type database, Document database or a Graph database Which type of Database would you recommend for this type of application?

Explanation / Answer

1. Need to create non clustered index on (LastName,ZipCode)

4.

SELECT Top 1 ShipperName
FROM [Shippers] Inner Join [Orders]
On [Shippers].[ShipperID]=[Orders].[ShipperID]
Group by ShipperName
Order by Count(ShipperName) Desc

5.

Select A.CategoryName,Sum(Quantity) as SumOfQuantity
From
(
SELECT ProductID,CategoryName
FROM [Products] Inner Join Categories
On Products.CategoryID=Categories.CategoryID
)As A
Inner Join OrderDetails As B
On A.ProductID=B.ProductID
Group by CategoryName
Order by SumOfQuantity desc

6.

SELECT Top 1 Max(A.ProductName) as ProductName,sum(B.Quantity) as SumofQuantity
FROM [Products] as A Inner Join OrderDetails As B
On A.ProductID=B.ProductID
Group by A.ProductID
Order by sum(B.Quantity) Desc

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote