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

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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