Use the database schema of Question 1 to write OPTIMIZED relational algebra for the following queries:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Use the database schema of Question 1 to write OPTIMIZED relational algebra for the following queries: 1) List the name of all managers who do not have The Little Prince in their libraries. ("The Little Prince" is a book name) 2) Borrowers should like their favorite book. List the name of all borrowers who DO NOT like their favorite book. 3) List the name of the libraries whose managers live in lake Charles. 4) List the name of managers whose libraries loan book genre "science fiction". 5) List phone numbers that are recorded both for the library and the manager phone. 6) List name of managers who live in the same city that Mr. "Mark" (name of one of the managers) lives. Question 3 (10 marks): Consider the following schema, query, and relational algebra expression: student (id, name) enrolledIn (id, code) subject (code, lecturer) Query: What are the names of students who are either in CMPS 460 or in CMPS 340? Relational algebra expression: Iname ((6 code='CMPS460' (student enrolled In)) U (6 code='CMPS340' (student enrolledIn))) Optimize the above relational algebra expression. Use the database schema of Question 1 to write OPTIMIZED relational algebra for the following queries: 1) List the name of all managers who do not have The Little Prince in their libraries. ("The Little Prince" is a book name) 2) Borrowers should like their favorite book. List the name of all borrowers who DO NOT like their favorite book. 3) List the name of the libraries whose managers live in lake Charles. 4) List the name of managers whose libraries loan book genre "science fiction". 5) List phone numbers that are recorded both for the library and the manager phone. 6) List name of managers who live in the same city that Mr. "Mark" (name of one of the managers) lives. Question 3 (10 marks): Consider the following schema, query, and relational algebra expression: student (id, name) enrolledIn (id, code) subject (code, lecturer) Query: What are the names of students who are either in CMPS 460 or in CMPS 340? Relational algebra expression: Iname ((6 code='CMPS460' (student enrolled In)) U (6 code='CMPS340' (student enrolledIn))) Optimize the above relational algebra expression.
Expert Answer:
Related Book For
Fundamentals Of Database Systems
ISBN: 9780133970777
7th Edition
Authors: Ramez Elmasri, Shamkant Navathe
Posted Date:
Students also viewed these databases questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Consider the LIBRARY relational schema shown in Figure 6.14, which is used to keep track of books, borrowers, and book loans. Referential integrity constraints are shown as directed arcs in Figure...
-
A trader depreciates his vehicles at 40% per annum using the reducing balance method, with proportionate depreciation in the year of acquisition. In addition to vehicles acquired on 1 July 2010 for...
-
Fusible interlinings are being used with increasing frequency to support outer fabrics and improve the shape and drape of various pieces of clothing. The article "Compatibility of Outer and Fusible...
-
Determine which one of these three portfolios dominates another. Name the dominated portfolio and the portfolio that dominates it. Portfolio Blue has an expected return of 12 percent and risk of 18...
-
Art pervades almost every aspect of human social life. Give examples of art in the ways people make a living, in religion, in social structure, and in family life.
-
Presented below are selected transactions of Molina Company. Molina sells in large quantities to other companies and also sells its product in a small retail outlet. March 1 Sold merchandise on...
-
Critically evaluate different ethical frameworks and their applicability to H&M group working methods (operationally and culturally). You are required to apply recognised theory within your...
-
Find a current computer ad in a magazine or newspaper or online. Identify each of the featured items in the ad, show its position in the system block diagram of Figure 11.1, explain how it operates,...
-
2. (5 points) Analyze the following program and write down the output of the program. Please print every character (including whitespace character) clearly! #include using namespace std; { int main()...
-
8. Adelaide Limited is dedicated to the production and sale of highly fashionable sunglasses. (15 marks) a. The company's budgeted monthly production is 6,000 units. b. Variable manufacturing costs...
-
1)What is the difference between Thread and Process? 2)What is Multi-tasking? 3)Multi-Threading? 4)Thread priority? 5)Setting and Getting Name of a thread Q) In how many ways we can prevent a thread...
-
1)What is the Functional Interface?(JAVA 1.8 FEATURES) 2)What is the Lamda Expression? 3)What do you know about Stream API?
-
1)What is JDBC ? 2)How many steps are there to develop jdbc application? 3)How many drivers are there in jdbc? 4)How many statements are there in JDBC? 5)What is DatabaseMetaData? 6)What is...
-
1. A hockey puck has a gravitational potential energy of 2.3 J when it is held by a referee at a height of 1.4 m above the rink surface. What is the mass of the puck? A: 2 2. A 200-g piece of iron at...
-
Consider an online shopping process. Please provide 1 Financial, 2 External, and 2 Internal metric examples for this process.
-
The May 2014 revenue and cost information for Houston Outfitters, Inc. follow: Sales Revenue (at standard).............. $ 540,000 Cost of Goods Sold (at standard) ..........341,000 Direct Materials...
-
What is the public key infrastructure scheme? How does it provide security?
-
What are solid-state drives (SSDs) and what advantage do they offer over HDDs?
-
Consider the LIBRARY relational database schema in Figure 6.6. Create an XML schema document that corresponds to this database schema. Figure 6.6 BOOK Book id Title Publisher_name BOOK AUTHORS...
-
The results in Exercises 17.117.4 are certainly extreme, and the statistics look unusual. What might trouble you about these data? Exercise 17.4 The interaction in the analysis for Exercise 17.3...
-
Referring to Exercise 17.8, it seems obvious that the sample sizes do not reflect the relative frequency of these characteristics in the population. Would you expect the mean for all these...
-
In Exercise 17.10 you used traditional simple and effect procedures. a) What would happen if you simply ran a t test between LBW and FT means for multiparous mothers using MS error as the pooled...
Study smarter with the SolutionInn App