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

  Provide explanation about each of the applied techniques

In the assignment report provide explanation about each of the applied techniques. In your Excel workbook file place the results in separate columns in the corresponding spreadsheet.

  By using the instructions given by your instructor install

using the instructions provided by your instructor install mysql and connect from netbeans. create a user account that

  Draw the corresponding entity-relationship diagram

Design an entity-relationship schema that most correctly and most completely captures the constraints expressed in the above description of the VINO application. Draw the corresponding entity-relationship diagram.

  The traditional retail model has focused on finding

assignment 3 how is technology changing the face of business today?the traditional retail model has focused on finding

  Finding out the benefits of data mining to the business

the development of complex algorithms that can mine mounds of data that have been collected from people and digital

  Database design for the solution of new database

You have completed the database design for the solution of new database you selected in week 1 in Microsoft Access; the final step is to submit the database for implementation. After you have created the remaining pieces needed for the application..

  Calculate confidence and support of rule

Assume that 30% of science students are majoring in biology. Would you consider to be novel with respect to rule? Describe. Calculate confidence and support of rule.

  Identify potential sales and department store transactions

Identify the potential sales and department store transactions that can be stored within the database. Design a database solution and the potential business rules that could be used to house the sales transactions of the department store

  Display all the lastnames from the customers table

Display all the LastNames from the Customers table and any associated OrdersIDs from the Orders Table. Show the LastName even if they do not have any associated orders. Order the results by LastName in ascending order.

  What are the candidate keys of r

Suppose you have a relation schema about teaching classes that has the following attributes: Class, Instructor, Time and Room.

  Data-flow diagrams can be used to the physical system

Data-flow diagrams can be used to model both the physical and logical systems. Data models can be analyzed to identify possible inconsistencies that exist between two sets of diagrams or within a single DFD.

  Complete service request scheduling system database

Complete Service Request Scheduling System Database

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