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

  Design a high-level conceptual view of a data warehouse by

an organization has several operational systems customer relationship management crm for marketing and sales enterprise

  Calculate the total expenditure for each of the categories

The data in the table on the data sheet contains the operational expenditure and the budget for a small department.

  Evaluate the selection of a database management

Identify and describe three criteria that should be used to evaluate the selection of a database management system. Describe how an organization should use each criterion to evaluate database management system selection.

  How to use traditional database design method

Explain how you would follow three phases of traditional database design method (Hierarchical, Network, and Relational), considering the following scenario.

  Database and programming design

Database and Programming Design

  Program to build a database concerning employee information

Company XYZ needs a program to build a database concerning employee information.

  Case study - cqr accounting

Find domains for which there is none or only one current employee with that expertise - Find the minimum billing rate for each employee type for the most recent billing rate effective date;

  Write an sql statement that displays customer details

Write an SQL statement that displays customer details

  Design a clean and normalized database

Design a clean and normalized database that handles books for a library application. You need to consider the following rules before you design the database: All books are mapped to categories. For example, the book Distributed Operating System bel..

  Database application improvements question

Submit an Executive Memo addressed to the CIO and the board of directors. Last week, the CIO reviewed your presentation and has decided to move forward with your recommendations for improvements.

  Triggers important in database systems

What are triggers used for, and why are they important in database systems? Provide an example of a situation where a trigger would be appropriate.

  Convert an erd to a relational schemacovert the extended

convert an erd to a relational schemacovert the extended entity relationship diagram eerd for orthopedic alliance of

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