homeworkstudyhelp

Our Services

Get 15% Discount on your First Order

Database Model: KimTay The management of KimTay Pet Supplies (a…

Database Model: KimTay

The management of KimTay Pet Supplies (a supplier of pet supplies, food, and accessories located in Cody, Wyoming) has determined that the company’s recent growth no longer makes it feasible to maintain customer, invoice, and inventory data using its manual systems. In addition, KimTay Pet Supplies wants to build an Internet presence. With the data stored in a database, management will be able to ensure that the data is up-to-date and more accurate than in the current manual systems. In addition, managers will be able to obtain answers to their questions concerning the data in the database easily and quickly, with the option of producing a variety of useful reports.

The CUSTOMER table maintains information about each customer, such as their ID, first and last name, address, balance, and credit limit.

 

CUSTOMER table

In the INVOICES table contains information about each invoice, such as the invoice number, date, and the customer being invoiced.

INVOICES table

 

The INVOICE_LINE table has the itemized information for each invoice. This includes the item ids, quantity, and price for each invoice.

INVOICE_LINE table

 

The ITEM table has a information pertaining to each item for sale by KimTay’s Pet Supplies. This includes a description, the number in stock, location, and price.

ITEM table

 

The SALES_REP table includes the information for each sales representative for KimTay’s Pet Supplies. This includes first and last name, address, cell-phone, commission, and commission rate.

SALES_REP table

 

Task 1: Create  VIEW named MAJOR_CUSTOMER. It consists of the customer ID, first name, last name, balance, credit limit, and rep ID for every customer whose credit limit is $500 or less.
Task 2: Write and execute the command to retrieve the customer ID, first name, and last name of each customer in the MAJOR_CUSTOMER VIEW with a balance that exceeds the credit limit.
Task 3: Without using the MAJOR_CUSTOMER VIEW, retrieve the customer ID, first name, and last name for every customer whose credit limit is $500 or less.

Task 4: Create a VIEW named ITEM_INVOICE. It consists of the item ID, description, price, invoice number, invoice date, quantity, and quoted price for all invoice lines currently on file.

Task 5: Write and execute the command to retrieve the item ID, description, invoice number, and quoted price for all invoices in the ITEM_INVOICE VIEW for items with a quoted prices that exceed $100.

Task 6: Repeat Task 5 without using the ITEM_INVOICE VIEW to retrieve the item ID, description, price, invoice number, invoice date, quantity, and quoted price for all items with a quoted price that exceed $100.

Task 7: Create a view named INVOICE_TOTAL. It consists of the invoice number and invoice total for each invoice currently on file. (The invoice total is the sum of the number of units ordered multiplied by the quoted price on each invoice line for each invoice.) Sort the rows by invoice number. Use TOTAL_AMOUNT as the name for the invoice total.

Task 8: Using the INVOICE_TOTAL VIEW write and execute the command to retrieve the invoice number and invoice total for only those orders totaling more than $250.

Task 9: Repeat Task 8 without using the INVOICE_TOTAL VIEW. Use the LIMIT clause to select a limited number of records to display.

Task 10: List all the tables contained within the system catalog, but only display the first 10 records with a TABLE_TYPE of SYSTEM VIEW.

Task 11: List all the columns contained within the system catalog, but only display the first 11 records that are in the KimTay TABLE_SCHEMA.

Task 12: List all the views contained within the system catalog, but only display the first 12 records.

 

 

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Use the SaleCo ERD listed below and the provided SQL scripts to…

Use the SaleCo ERD listed below and the provided SQL scripts to construct its relational database and answer the following queries. Note: Purchases = LINE_PRICE * LINE_UNITS Note: Inventory value = P_QOH * P_PRICE   (2 pts) How many invoices are there?  (3 pts) List the invoice numbers and the

-draw an ER model clearly denoting maximum and minimum cardinality…

-draw an ER model clearly denoting maximum and minimum cardinality constraints.  -Write one-liner and four sentences for each diagram (statements that specify the minimum and maximum cardinality), and the number of tables needed. Post the Primary and foreign keys and any available attributes. -diagram must be complete in all respects

1. Compare and contrast the tuple relational calculus with domain…

1. Compare and contrast the tuple relational calculus with domain relational calculus. Specifically, discuss the distinction between tuple and domain variables.    2. Answer the following questions considering the Hotel schema I have attached below.a) πhotelName (Hotel ⋈ Hotel.hotelNo = Room.hotelNo (σprice > 50(Room)) ).b) Guest ⊐⊲ (σdateTo≥ ‘1-Jan-2007’ (Booking)). 

 most important steps in solving a math problem is to understand…

 most important steps in solving a math problem is to understand what the problem is asking you to do. Read the problem carefully and make sure you understand what is being asked. Look for keywords and phrases that indicate what operation(s) you need to perform to solve the problem. Identify

MCQ: Which of the following is true of NoSQL databases? Group of…

MCQ: Which of the following is true of NoSQL databases? Group of answer choices   They are geared toward transaction consistency rather than performance.   They do not support distributed database architectures.   They do not support very large amounts of sparse data.   They are not based on the

7-1 Project Two: Analyzing Databases.  (Please provide Codio…

7-1 Project Two: Analyzing Databases.  (Please provide Codio Screenshots thanks)     Competency In this project, you will demonstrate your mastery of the following competency: Analyze the results of queries constructed to address data requirements Scenario The product manager of Quantigration has asked your data analytics team for a report