List the name of the project with the lowest budget

Assignment Help Database Management System
Reference no: EM13336589

Design and tuning considerations

Question 1

Consider the following BCNF relational schema for a portion of a company database (type information is not relevant to this question and is omitted):

Project (pno, proj_name, proj_base_dept, proj_mgr, topic, budget)

Manager (mid, mgr_name, mgr_dept, salary, age, sex)

Note that each project is based in some department, each manager is employed in some department, and the manager of a project need not be employed in the same department (in which the project is based). Suppose you know that the following queries are the five most common queries in the workload for this company and all five are roughly equivalent in frequency and importance:

• List the names, ages, and salaries of managers of a user-specified sex (male or female) working in a given department. You can assume that, while there are many departments, each department contains very few project managers.2

• List the names of all projects with managers whose ages are in a user-specified range (e.g., younger than 30).

• If a department has a manager who manages a project based in this department, then list the department name as output (exclude those departments in the output whose managers always manage some other departments' project, or don't manage any projects at all).

• List the name of the project with the lowest budget.

• For a given project, list the names of all managers in the department in which the project is based. Note: a department may have more than one manager who can manage projects that may or may not belong to the same department, as described in the question above.

These queries occur much more frequently than updates, so you should build whatever indexes you need to speed up these queries. However, you should not build any unnecessary indexes, as updates will occur (and would be slowed down by unnecessary indexes). Given this information, design a physical schema for the company database that will give good performance for the expected workload. In particular, decide which attributes should be indexed and whether each index should be a clustered or an unclustered index. Assume that both B+ trees and hashed indexes are supported by the DBMS, and that both single-and multiple-attribute index keys are permitted.

1. Specify your physical design by identifying the attributes you recommend indexing on, indicating whether each index should be clustered or unclustered and whether it should be a B+ tree or a hashed index.

2. Assume that this workload is to be tuned with an automatic index-tuning wizard. Outline the main steps in the algorithm and the set of candidate configurations considered.

3. Redesign the physical schema assuming the set of important queries is changed to be the following:

• Find the total of the budgets for projects managed by each manager; that is, list proj_mgr and the total of the budgets of projects managed by that manager, for all values of proj_mgr.

• Find the total of the budgets for projects managed by each manager but only for managers who are in a user-specified age range.

• Find the number of male managers.

• Find the average age of managers.

Question 2

For each of the following queries, identify one possible reason why an optimizer might not find a good plan. Rewrite the query so that a good plan is likely to be found. Any available indexes or known constraints are listed before each query; assume that the relation schemas are consistent with the attributes referred to in the query.

Employee (eno, ename, dno, age, sex, sal )

Project (pno, pname, dno, proj_mgr, topic, budget)

Department (dno, dname, mgr_name, address) 3

1. An index is available on the age attribute:

SELECT E.dno

FROM Employee E

WHERE E.age = 20 OR E.age = 10

2. A B+ tree index is available on the age attribute:

SELECT E.dno

FROM Employee E

WHERE E.age<20 AND E.age>10

3. An index is available on the age attribute:

SELECT E.dno

FROM Employee E

WHERE 2*E.age< 20

4. No index is available:

SELECT DISTINCT *

FROM Employee E

5. No index is available:

SELECT AVG (E.sal)

FROM Employee E

GROUP BY E.dno

HAVING E.dno = 22

6. The dno in Employee is a foreign key that refers to Department:

SELECT D.dno

FROM Department D, Employee E

WHERE D.dno = E.dno

Reference no: EM13336589

Questions Cloud

Explain quantum numbers are valid for an electron : Identify which sets of quantum numbers are valid for an electron. Each set is ordered (n, l, ml, ms).
What tension does his rope need to support : Mountaineers often use a rope to lower themselves down the face of a cliff (this is called rappelling). They do this with their body nearly horizontal, What tension does his rope need to support
Explore and investigate technical problems of dbm systems : Your topic could come from a sub-problem of a cutting-edge research problem about these techniques (if you want to investigate and solve a technical problem), or a successful (or a planned) implementation in one of the above DBMSs (if you want to ..
What are her monthly payments for a fully amortizing : . Edie wants to borrow $475,000 to purchase a new condominium in New York. What are her monthly payments for a fully amortizing 30-year fixed rate mortgage with a 4.5% contract rate?
List the name of the project with the lowest budget : List the names, ages, and salaries of managers of a user-specified sex (male or female) working in a given department. You can assume that, while there are many departments, each department contains very few project managers.2
Reasoned argument do aesthetic value : Reasoned argument do aesthetic value helps us to see, hear, or otherwise perceive art in changed or expanded ways and to enhance our appreciation of art.
Foreign policy roles of the president and congress : Foreign Policy Roles of the President and Congress
Explain fragmentation and replication : Define association rules, and explain how to induct association rules by using frequent itemsets, a Priori Property, and support and confidence measures.
At what rate is the angular momentum increasing : You are designing a lathe motor, part of which consists of a uniform cylinder whose mass is 90 kg, At what rate is the angular momentum increasing

Reviews

Write a Review

Database Management System Questions & Answers

  Writing down sql query

Write down the SQL code in order to carrying out the following requests. Display all the data in each of the four tables. Do not display the foreign key columns.

  Find the entities from the functional requirements

Find the entities from the functional requirements. Entities can come from Nouns in the text, they may also come from forms, reports and legacy code.

  Find maximum salary of employees from database table

Find the maximum salary of all employees who are not managers. Give all the managers in the database a 10 percent salary raise. Give all the other employees a 5 percent salary raise.

  Identify three potential users and design subschema for each

Identify three potential users and design a subschema for each. Justify your design by explaining why each user needs access to that data element.

  Discuss the costs involved in implementing the database

Using the SafeAssign link in Blackboard to submit your report. Download and print out the FULL report and attach to the appendix at the back of your report. Assignments without the full SafeAssign report will NOT be marked.

  Write the sql ddl to create the database

The appropriate SQL commands, which should be copied from your source code in MySQL, and pasted into your submission file; and The resultant tables, which must be screenshots to show the change due to the execution of commands

  Write problems and issues associated with internet databases

Over 70% of web applications use database to store persistent data. Write some of the problems and issues associated with internet databases?

  Design a database for an insurance company

Don't forget to underline key attributes for entity sets and include arrowheads indicating the multiplicity of relationships

  Develop a system sequence diagram for each use case

Write out the steps of the dialog between the user and the system for the use case Place new order for nursing home employees.

  Your task is to develop a database to support this activity

Your task is to develop a database to support this activity.Here is what you need to be able to provide Custom Auto Body in order to land your first consulting contract:

  Analyse and comprehend a provided er diagram

Analyse and comprehend a provided ER diagram and Database Schema and to implement a database based on the provided ER diagram and Database Schema

  Design a case for other student to investigate

You need to design a CASE for other student to investigate. As an example; at the end of this week you should generate the following materials: A case description.

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