New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
computer sciences
databases
Database System Concepts 4th Edition Henry F. Korth, S. Sudarshan - Solutions
When designing an E-R diagram for a particular enterprise, you have several alternatives from which to choose.a. What criteria should you consider in making the appropriate choice?b. Design three alternative E-R diagrams to represent the university registrar’s office of Exercise 2.4. List the
An E-R diagram can be viewed as a graph. What do the following mean in terms of the structure of an enterprise schema?a. The graph is disconnected.b. The graph is acyclic.
In Section 2.4.3, we represented a ternary relationship (Figure a) using binary relationships, as shown in (Figure b). Consider the alternative shown in (Figure c). Discuss the relativemerits of these two alternative representations of a ternary relationship by binary relationships.
Consider the representation of a ternary relationship using binary relationships as described in Section 2.4.3 (shown in Figure b) a. Show a simple instance of E, A, B, C, RA, RB, and RC that cannot correspond to any instance of A, B, C, and R. b. Modify the E-R diagram of Figure b to introduce
A weak entity set can always be made into a strong entity set by adding to its attributes the primary key attributes of its identifying entity set. Outline what sort of redundancy will result if we do so.
Design a generalization–specialization hierarchy for a motor-vehicle sales company. The company sells motorcycles, passenger cars, vans, and buses. Justify your placement of attributes at each level of the hierarchy. Explain why they should not be placed at a higher or lower level.
Explain the distinction between condition-defined and user-defined constraints. Which of these constraints can the system check automatically? Explain your answer.
Explain the distinction between disjoint and overlapping constraints.
Explain the distinction between total and partial constraints.
Figure shows a lattice structure of generalization and specialization. For entity sets A, B, and C, explains how attributes are inherited from the higherlevel entity sets X and Y. Discuss how to handle a case where an attribute of X has the same name as some attribute of Y.
Draw the UML equivalents of the E-R diagrams.
Consider two separate banks that decide to merge. Assume that both banks use exactly the same E-R database schema?the one in Figure below (This assumption is of course highly unrealistic; we consider the more realistic case in Section 19.8.) If the merged bank is to have a single database, there
Reconsider the situation described for Exercise 2.26 under the assumption that one bank is in the United States and the other is in Canada. As before, the banks use the schema of Figure, except that the Canadian bank uses the social-insurance number assigned by the Canadian government, whereas the
Design a relational database for a university registrar’s office. The office maintains data about each class, including the instructor, the number of students enrolled, and the time and place of the class meetings. For each student–class pair, a grade is recorded.
Describe the differences inmeaning between the terms relation and relation schema. Illustrate your answer by referring to your solution to Exercise below.Student (student-id, name, program)Course (courseno, title, syllabus, credits)Course-offering (courseno, secno, year, semester, time,
Design a relational database corresponding to the E-R diagram of Figure.
In Chapter we saw how to represent many-to-many, many-to-one, one-tomany, and one-to-one relationship sets. Explain how primary keys help us to represent such relationship sets in the relational model.
Consider the relational database of Figure, where the primary keys are underlined. Give an expression in the relational algebra to express each of the following queries: a. Find the names of all employees who work for First Bank Corporation. b. Find the names and cities of residence of all
Consider the relation of as shown below, which shows the result of the query ?Find the names of all customers who have a loan at the bank.? Rewrite the query to include not only the name, but also the city of residence for each customer. Observe that now customer Jackson no longer appears in the
The outer-join operations extend the natural-join operation so that tuples from the participating relations are not lost in the result of the join. Describe how the theta join operation can be extended so that tuples from the left, right, or both relations are not lost from the result of a theta
Consider the relational database of Figure. Give an expression in the relational algebra for each request: a. Modify the database so that Jones now lives in Newtown. b. Give all employees of First Bank Corporation a 10 percent salary raise. c. Give all managers in this database a 10 percent salary
Using the bank example, write relational-algebra queries to find the accounts held by more than two customers in the following ways:a. Using an aggregate function.b. Without using any aggregate functions.
Consider the relational database of Figure. Give a relational-algebra expression for each of the following queries: a. Find the company with the most employees. b. Find the company with the smallest payroll. c. Find those companies whose employees earn a higher salary, on average, than the average
List two reasons why we may choose to define a view.
List two major problems with processing update operations expressed in terms of views.
Let the following relation schemas be given:R = (A, B, C)S = (D, E, F)Let relations r(R) and s(S) be given. Give an expression in the tuple relational calculus that is equivalent to each of the following:a. II A(τ)b. σB =17 (τ)c. τ × sd. IIA, F (σC =D(τ × s))
Let R = (A, B, C), and let r1 and r2 both be relations on schema R. Give an expression in the domain relational calculus that is equivalent to each of the following:a. IIA(r1)b. σB =17 (r1)c. r1 ∪ r2d. r1 ∩ r2e. r1 − r2f. IIA,B(r1) 1 ΠB,C(r2)
Repeat Exercise 3.5 using the tuple relational calculus and the domain relational calculus.
Let R = (A, B) and S = (A, C), and let r(R) and s(S) be relations. Write relational-algebra expressions equivalent to the following domain-relationalcalculus expressions:a. {< a > | ∃ b (< a, b >∈ r ∧ b = 17)}b. {< a, b, c > | < a, b >∈ r ∧ < a, c >∈ s}c.
Let R = (A, B) and S = (A, C), and let r(R) and s(S) be relations. Using the special constant null, write tuple-relational-calculus expressions equivalent to each of the following:a. r 1 sb. r 1 sc. r 1 s
List two reasons why null values might be introduced into the database.
Certain systems allow marked nulls. A marked null ⊥i is equal to itself, but if i ≠ j, then ⊥i ≠ ⊥j. One application of marked nulls is to allow certain updates through views. Consider the view loan-info (Section 3.5). Show how you can use marked nulls to allow the insertion of the tuple
Consider the insurance database of Figure, where the primary keys are underlined. Construct the following SQL queries for this relational database. a. Find the total number of people who owned cars that were involved in accidents in 1989. b. Find the number of accidents in which the cars belonging
Consider the employee database of Figure, where the primary keys are underlined. Give an expression in SQL for each of the following queries. a. Find the names of all employees who work for First Bank Corporation. b. Find the names and cities of residence of all employees who work for First Bank
Consider the relational database of Figure. Give an expression in SQL for each of the following queries. a. Modify the database so that Jones now lives in Newtown. b. Give all employees of First Bank Corporation a 10 percent raise. c. Give all managers of First Bank Corporation a 10 percent
Let the following relation schemas be given:R = (A, B, C)S = (D, E, F)Let relations r(R) and s(S) be given. Give an expression in SQL that is equivalent to each of the following queries.a. п A(r)b. σB = 17 (r)c. r × sd. IIA, F (σC =D(r × s))
Let R = (A, B, C), and let r1 and r2 both be relations on schema R. Give an expression in SQL that is equivalent to each of the following queries.a. r1 ∪ r2b. r1 ∩ r2c. r1 − r2d. II AB(r1) 1 ΠBC(r2)
Let R = (A, B) and S = (A, C), and let r(R) and s(S) be relations. Write an expression in SQL for each of the queries below:a. {< a > | ∃ b (< a, b >∈ r ∧ b = 17)}b. {< a, b, c > | < a, b >∈ r ∧ < a, c >∈ s}c. {< a > | ∃ c (< a, c >∈ s ∧
Show that, in SQL, < > all is identical to not in.
Consider the relational database of Figure. Using SQL, define a view consisting of manager-name and the average salary of all employees who work for that manager. Explain why the database system should not allow updates to be expressed in terms of this view.
Consider the SQL query select p.a1 from p, r1, r2 where p.a1 = r1.a1 or p.a1 = r2.a1. Under what conditions does the preceding query select values of p.a1 that are either in r1 or in r2? Examine carefully the cases where one of r1 or r2 may be empty.
Write an SQL query, without using a with clause, to find all branches where the total account deposit is less than the average total account deposit at all branches,a. Using a nested query in the from clauser.b. Using a nested query in a having clause.
a. Display the grade for each student, based on the marks relation.b. Find the number of students with each grade.
SQL-92 provides an n-ary operation called coalesce, which is defined as follows: coalesce (A1,A2, . . . , An) returns the first nonnull Ai in the list A1,A2, . . .,An, and returns null if all of A1,A2, . . .,An are null. Show how to express the coalesce operation using the case operation.
Let a and b be relations with the schemas A (name, address, title) and B(name, address, salary), respectively. Show how to express a natural full outer join b using the full outer join operation with an on condition and the coalesce operation. Make sure that the result relation does not contain two
Give an SQL schema definition for the employee database of Figure. Choose an appropriate domain for each attribute and an appropriate primary key for each relationschema.
Write check conditions for the schema you defined in Exercise 4.14 to ensure that:a. Every employee works for a company located in the same city as the city in which the employee lives.b. No employee earns a salary higher than that of his manager.
Describe the circumstances in which you would choose to use embedded SQL rather than SQL alone or only a general-purpose programming language.
Consider the insurance database of Figure, where the primary keys are underlined. Construct the following QBE queries for this relational-database. a. Find the total number of people who owned cars that were involved in accidents in 1989. b. Find the number of accidents in which the cars belonging
Consider the employee database of Figure. Give expressions in QBE, and Datalog for each of the following queries: a. Find the names of all employees who work for First Bank Corporation. b. Find the names and cities of residence of all employees who work for First Bank Corporation. c. Find the
Consider the relational database of Figure where the primary keys are underlined. Give expressions in QBE for each of the following queries: a. Find all employees who earn more than the average salary of all employees of their company. b. Find the company that has the most employees. c. Find the
Consider the relational database of Figure. Give expressions in QBE for each of the following queries: a. Modify the database so that Jones now lives in Newtown. b. Give all employees of First Bank Corporation a 10 percent raise. c. Give all managers in the database a 10 percent raise. d. Give
Let the following relation schemas be given:R = (A, B, C)S = (D, E, F) Let relations r(R) ands(S) be given. Give expressions in QBE, and Data log equivalent to each of the following queries:a. IIA(r)b. σB =17 (r)c. r × sd. d. IIA,F (σC =D(r × s))
Let R = (A, B, C), and let r1 and r2 both be relations on schema R. Give expressions in QBE, and Datalog equivalent to each of the following queries:a. r1 ∪ r2b. r1 ∩ r2c. r1 − r2d. IIAB (r1) 1 IIBC (r2)
Let R = (A, B) and S = (A, C), and let r(R) and s(S) be relations.Write expressions in QBE and Datalog for each of the following queries:a. {< a > | ∃ b (< a, b >∈ r ∧ b = 17)}b. {< a, b, c > | < a, b >∈ r ∧ < a,c >∈ s}c. {< a > | ∃ c (< a,c
Consider the relational database of Figure. Write a Datalog program for each of the following queries:a. Find all employees who work (directly or indirectly) under the manager “Jones”.b. Find all cities of residence of all employees who work (directly or indirectly) under the manager
Write an extended relational-algebra view equivalent to the Datalog rule p (A,C,D) :– q1 (A,B), q2 (B,C), q3 (4,B), D = B + 1 .
Describe how an arbitrary Data log rule can be expressed as an extended relational algebra view.
Complete the SQL DDL definition of the bank database of Figure to include the relations loan andborrower.
Consider the following relational database:employee (employee-name, street, and city)works (employee name, company-name, salary)company (company-name, city)manages (employee-name, manager name)Give an SQL DDL definition of this database. Identify referential-integrity constraints that should hold,
Referential-integrity constraints as defined in this chapter involve exactly two relations. Consider a database that includes the following relations:salaried-worker (name, office, phone, salary)hourly-worker (name, hourly-wage)address (name, street, city)Suppose that we wish to require that every
SQL allows a foreign-key dependency to refer to the same relation, as in the following example: create table manager (employee-name char (20), manager-name char(20), primary key employee-name, foreign key (manager-name) references manager on delete cascade ) Here, employee-name is a key to the
Suppose there are two relations r and s, such that the foreign key B of r references the primary key A of s. Describe how the trigger mechanism can be used to implement the on delete cascade option, when a tuple is deleted from s.
Write an assertion for the bank database to ensure that the assets value for the Perryridge branch is equal to the sum of all the amounts lent by the Perryridge branch.
Write an SQL trigger to carry out the following action: On delete of an account, for each owner of the account, check if the owner has any remaining accounts, and if she does not, delete her from the depositor relation.
Consider a view branch-cust defined as follows: create view branch-cust as select branch-name, customer-name from depositor, account where depositor.account-number = account.account-number Suppose that the view is materialized, that is, the view is computed and stored. Write active rules to
Make a list of security concerns for a bank. For each item on your list, state whether this concern relates to physical security, human security, operatingsystem security, or database security.
Using the relations of our sample bank database, write an SQL expression to define the following views:a. A view containing the account numbers and customer names (but not the balances) for all accounts at the Deer Park branch.b. A view containing the names and addresses of all customers who have
For each of the views that you defined in Exercise 6.10, explain how updates would be performed (if they should be allowed at all).
In Chapter 3, we described the use of views to simplify access to the database by users who need to see only part of the database. In this chapter, we described the use of views as a securitymechanism. Do these two purposes for views ever conflict? Explain your answer.
What is the purpose of having separate categories for index authorization and resource authorization?
Database systems that store each relation in a separate operating-system file may use the operating system’s security and authorization scheme, instead of defining a special scheme themselves. Discuss an advantage and a disadvantage of such an approach.
What are two advantages of encrypting data stored in the database?
Perhaps the most important data items in any database system are the passwords that control access to the database. Suggest a scheme for the secure storage of passwords.Be sure that your scheme allows the systemto test passwords supplied by users who are attempting to log into the system.
Explain what is meant by repetition of information and inability to represent information. Explain why each of these properties may indicate a bad relational database design.
Suppose that we decompose the schema R = (A, B, C, D, E) into (A, B, C)(A, D, E). Show that this decomposition is a loss less-join decomposition if the following set F of functional dependencies holds:A → BCCD → EB → DE → A
Why certain functional dependencies are called trivial functional dependencies?
List all functional dependencies satisfied by the relation of Figure.
Use the definition of functional dependency to argue that each of Armstrong’s axioms (reflexivity, augmentation, and transitivity) is sound.
Explain how functional dependencies can be used to indicate the following:• A one-to-one relationship set exists between entity sets account and customer.• A many-to-one relationship set exists between entity sets account and customer.
Consider the following proposed rule for functional dependencies: If α → β and γ → β, then α → γ. Prove that this rule is not sound by showing a relation r that satisfies α → β and γ → β, but does not satisfy α → γ.
Use Armstrong’s axioms to prove the soundness of the union rule. Use the augmentation rule to show that, if α → β, then α → αβ. Apply the augmentation rule again, using α→γ, and then apply the transitivity rule.
Use Armstrong’s axioms to prove the soundness of the decomposition rule.
Use Armstrong’s axioms to prove the soundness of the pseudotransitivity rule.
Explain how functional dependencies can be used to indicate the following:• A one-to-one relationship set exists between entity sets account and customer.• A many-to-one relationship set exists between entity sets account and customer.
Using the functional dependencies of Exercise 7.11, compute B+.
Using the functional dependencies of Exercise 7.11, compute the canonical cover Fc.
Consider the algorithm in figure to compute ?+. Show that this algorithm is more efficient than the one presented in Figure (Section 7.3.3) and that it computes ?+ correctly.
Given the database schema R (a, b, c), and a relation r on the schema R, write an SQL query to test whether the functional dependency b → c holds on relation r. Alsowrite an SQL assertion that enforces the functional dependency. Assume that no null values are present.
Show that the following decomposition of the schema R of Exercise 7.2 is not loss less-join decomposition:(A, B, C)(C, D, E).
Let R1, R2, Rn be a decomposition of schema U. Let u (U) be a relation, and let r i = IIRI (u). Show that u ⊆ r1 1 r2 1 · · · 1 rn
Show that the decomposition in exercise is not a dependency-preserving decomposition.
Show that it is possible to ensure that a dependency-preserving decomposition into 3NF is a loss less-join decomposition by guaranteeing that at least one schema contains a candidate key for the schema being decomposed.
List the three design goals for relational databases, and explain why each is desirable.
Give a loss less-join decomposition into BCNF of schema R of Exercise 7.2.
Give an example of a relation schema R` and set F` of functional dependencies such that there are at least three distinct lossless-join decompositions of R` into BCNF.
In designing a relational database, why might we choose a non-BCNF design?
Give a lossless-join, dependency-preserving decomposition into 3NF of schema R of Exercise 7.2.
Let a prime attribute be one that appears in at least one candidate key. Let α and β be sets of attributes such that α → β holds but β → α do not hold. Let A be an attribute that is not in α, is not in β, and for which β → A holds. We say that A is transitively dependent on α. We
A functional dependency α → β is called a partial dependency if there is a proper subset γ of α such that γ → β.We says that β is partially dependent on α. A relation schema R is in second normal form (2NF) if each attributes A in R meets one of the following criteria:• It appears in
Showing 100 - 200
of 3228
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Last
Step by Step Answers