Using sql, write the view definition for smallcust.

Assignment Help Database Management System
Reference no: EM13950147

Exercise 1

In the following exercises, you will use the data in the Premiere Products database (shown in the attachment). Explain how you would use SQL to obtain the desired results:

1.Craete the TopLevelCust view described in the following:

Using data from the Premiere Products database, define a view named TopLevelCust. It consists of the number, name, address, balance, and credit limit for all customers with credit limits that are greater than or equal to $100,000.

a.Using SQL, write the view definition for SmallCust.

b.Write an SQL query to retrieve the number and name of all customers in the SmallCust view with balances that exceed their credit limits.

c.Convert the query you wrote in Question 1b to the query that the DBMS will actually execute.

Display the data in the view.

2.Create thePartOrder view described in the following:

Define a view named PartOrder. It consists of the part number, description, price, order number, order date, number ordered, and quoted price for all order lines currently on file.

a.Using SQL, write the view definition for PartOrder.

b.Write an SQL query to retrieve the part number, description, order number, and quoted price for all orders in the PartOrder view for parts with quoted prices that exceed $100.

c.Convert the query you wrote in Question 2b to the query that the DBMS will actually execute.
Display the data in the view.

3.Create a view named OrdTot. It consists of the order number and order total for each order currently on file. (The order total is the sum of the number ordered multiplied by the quoted price on each order line for each order.) Display the data in the view.

4.Create the following indexes. If it necessary to name the index in your DBMS, use the indicated name.

a.Create an index named PartIndex1 on the PartNum field in the OrderLine table.

b.Create an index named PartIndex2 on the Warehouse field in the Part table.

c.Create an index named PartIndex3 on the Warehouse and Class fields in the Part table.

d.Create an index named PartIndex4 on the Warehouse and OnHand fields in the Part table and list units on hand in descending order.

5.Drop the PartIndex3 index.

Note: You will not be able to execute the code for view on the MySQL database, but you can test the SELECT statement that creates it. Questions 1, 2, and 3 require that you show the CREATE VIEW SQL as well as the SQL to select from the view itself.

---------------- End Exercise 1-----------------

Exercise 2

The following exercises are based on the Premiere Products database:

1.Using your knowledge of Premiere Products, determine the functional dependencies that exist in the following table. After determining the functional dependencies, convert this table to an equivalent collection of tables that are in third normal form.

Part (Part Num, Description, OnHand, Class, Warehouse, Price, (OrderNum, OrderDate, CustomerNum, CustomerName, RepNum, LastName, FirstName, NumOrdered, QuotedPrice) )

2.List the functional dependencies in the following table that concerns invoicing (an application Premiere Products in considering adding to its database), subject to the specified conditions. For a given invoice (identified by the InvoiceNum), there will be a single customer. The customer's number, name, and complete address appear on the invoice, as does the data. Also, there may be several different parts appearing on the invoice. For each part that appears, display the part number, description, price, and number shipped. Each customer that orders a particular part pays the same price. Convert this table to an equivalent collection of tables that are in third normal form.

Invoice (InvoiceNum, CustomerNum, LastName, FirstName, Street, City, State, Zip, Date, (PartNum, Description, Price, NumShipped) )

---------------- End Exercise 2-----------------

Attachment:- Premiere Products Database.doc

Reference no: EM13950147

Questions Cloud

How systems are used to manage financial resources : Explain to the committee the expenditure, budget, capital and potential income for your new dynamic care home -  explain what principles of costing will be used and what would be the most appropriate business control systems to monitor financial in..
Describe situation where this increase of the stock price : Cisco, an IT company, has announced a plan to invest in a new factory, and on the same day, the company's stock price jumped up by 1%. Describe a situation where this increase of the stock price may be interpreted as indicating that investors view th..
Consultant to firm evaluating expansion of current business : You are a consultant to a firm evaluating an expansion of its current business. The cash-flow forecasts (in millions of dollars) for the project are as follows: On the basis of the behavior of the firm’s stock, you believe that the beta of the firm i..
Estimate weighted-average cost of capital assuming tax rate : The total market value of Okefenokee Real Estate Company's equity is $6 million, and the total value of its debt is $4 million. The treasurer estimates that the beta of the stock currently is 1.2 and that the expected risk premium on the market is 5%..
Using sql, write the view definition for smallcust. : Using your knowledge of Premiere Products, determine the functional dependencies that exist in the following table. After determining the functional dependencies, convert this table to an equivalent collection of tables that are in third normal fo..
Which of the following is true of a dividend payout : A firm has issued preferred stock at its $125 per share par value. The stock will pay a $15 annual dividend. The cost of issuing and selling the stock was $4 per share. The cost of the preferred stock is ________. Which of the following is true of ..
Exchange currency risk with its forward market hedge : Suppose a U.S. firm buys $200,000 worth of stereo wire speaker from a Mexican manufacturer for delivery in 60 days with payment to be made in 90 days (30 days after the goods are received). The rising U.S. deficit has caused the dollar to depreciate ..
Regression statistics on several mutual fund and indexes : You are given the following regression statistics (sort of RBSA) on several mutual fund’s and indexes. These statistics are based on monthly data from the 1984–1993 period and the units are % per month. All regressions were performed using raw return..
Discuss the effectiveness of these us supply-side policies : Describe US international policies and initiatives to eliminate/reduce (1) cultivation and production of cocaine, and (2) organized crime and narco-trafficking in cocaine. Discuss the effectiveness of these US supply-side policies.

Reviews

Write a Review

Database Management System Questions & Answers

  Information about clients and projects

A software company has the following information about its clients and the projects given by them: Clients (client number, client name, address)

  What are the assumptions and limitations of the software

The current practice of a particular part of water resources engineering is supported by a variety of commercial software

  Design the network requirements for the xyz company

You must design the network requirements for the XYZ company. As the network consultant you will be required to develop a plan for the company network, including all costs.

  Elaborate further on the definition of information systems

Review some of the tools you use whether at home or school that helps turn the data we are exposed to into information for making decisions.

  Examine the common threats to data systems like web

suppose that you are currently employed as an information security manager for a medium-sized software development and

  Design and implement a small database application

Perform the conceptual database design using Entity-Relationship model. You must submit the Entity-Relationship diagram of your database and develop queries in the target DBMS

  Default rules for enforcing referential integrity constraint

Explain how referential integrity actions can be used to override the default referential integrity constraints.

  Create a student database in ruby

To create a student database in Ruby that allows for, updating a record within the database

  High-level conceptual view of a data warehouse

Design a high-level conceptual view of a data warehouse (DW) for Huffman Trucking using Microsoft Visio that shows the Integration layers.

  An entity-relationship diagram for a database

an Entity-Relationship diagram for a database

  Creating database

Question 1: Start Access. Open the downloaded Access file named exploring_acap_grader_h1_College. Question 2: Import the exploring_acap_grader_h1_Transfer.xlsx Excel workbook into a table named Transfer Schools. While importing the data, choose St..

  Describe five olap uses of the data warehouse

Happy Cruise Lines has several ships and a variety of cruise itineraries, each involving several ports-of-call. The company wants to maintain information on the sailors who currently work on each of its ships. It also wants to keep track of both..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd