All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
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
Ask a Question
Search
Search
Sign In
Register
study help
computer sciences
databases
Questions and Answers of
Databases
Why is an explicit transaction end statement needed in SQL but not an explicit begin statement?
Describe situations where each of the different isolation levels would be useful for transaction processing.
Prove that cautious waiting avoids deadlock.
Apply the timestamp ordering algorithm to the schedules of Figure 21.8 (b) and (c), and determine whether the algorithm will allow the execution of the schedules.
Repeat Exercise 22.25, but use the multiversion timestamp ordering method.
Modify the data structures for multiple-mode locks and the algorithms for read_lock(X), write_lock(X), and unlock(X) so that upgrading and downgrading of locks are possible.
Prove that the basic two-phase locking protocol guarantees conflict serializability of schedules.
Why would you choose a database system instead of simply storing data in operating system files? When would it make sense not to use a database system?
Explain the difference between logical and physical data independence.
What are the responsibilities of a DBA? If we assume that the DBA is never interested in running his or her own queries, does the DBA still need to understand query optimization? Why?
Which of the following plays an important role in representing information about the real world in a database? Explain briefly. 1. The data definition language. 2. The data manipulation language. 3.
Answer the following questions: 1. What is a transaction? 2. Why does a DBMS interleave the actions of different transactions instead of executing transactions one after the other? 3. What must a
Explain the following terms briefly: attribute, domain, entity, relationship, entity set, relationship set, one-to-many relationship, many-to-many relationship, participation constraint, overlap
Consider the following information about a university database: • Professors have an SSN, a name, an age, a rank, and a research specialty. • Projects have a project number, a sponsor name (e.g.,
Notown Records has decided to store information about musicians who perform on its albums (as well as other company data) in a database. The company has wisely chosen to hire you as a database
The Prescriptions-R-X chain of pharmacies has offered to give you a free lifetime supply of medicine if you design its database. Given the rising cost of health care, you agree. Here's the
Define the following terms: relation schema, relational database schema, domain, attribute, attribute domain, relation instance, relation cardinality, and relation degree.
Suppose that we have a ternary relationship R between entity sets A, B, and C such that A has a key constraint and total participation and B has a key constraint; these are the only constraints. A
Consider the university database from Exercise 2.3 and the ER diagram you designed. Write SQL statements to create the corresponding relations and capture as many of the constraints as possible. If
Consider the Notown database from Exercise 2.5. You have decided to recommend that Notown use a relational database system to store company data. Show the SQL statements for creating relations
Consider the ER diagram that you designed for the Prescriptions-R-X chain of pharmacies in Exercise 2.7. Define relations corresponding to the entity sets and relationship sets in your design using
Briefly answer the following questions based on this schema:1. Suppose you have a view SeniorEmp defined as follows: CREATE VIEW SeniorEmp (sname, sage, salary) AS SELECT E.ename, E.age,
Does the relational model, as seen by an SQL query writer, provide physical and logical data independence? Explain.
What is the difference between a candidate key and the primary key for a given relation? What is a superkey?
Consider the instance of the Students relation shown in Figure 3.1.FIELDS (ATTRIBUTES, COLUMNS)An Instance S1 of the Students Relation 1. Give an example of an attribute (or set of attributes) that
Consider the relations Students, Faculty, Courses, Rooms, Enrolled, Teaches, and Meets In defined in Section 1.5.2. 1. List all the foreign key constraints among these relations. 2. Give an example
Answer each of the following questions briefly. The questions are based on the following relational schema:Emp (eid: integer, ename: string, age: integer, salary: real)Works (eid: integer, did:
Consider the SQL query whose answer is shown in Figure 3.2. Sid Name Login Age Gpa 53831 Madayan madayan@ 11 1.8 53832 Gulda guldu@music 12 2.0 Students with age < 18 on Instance S 1.
Explain the statement that relational algebra operators can be composed. Why is the ability to compose operators important?
Consider the Supplier-Parts-Catalog schema from the previous question. State what the following queries compute: 1. πsname(πsid((σcolor = 'red' Parts) ⪻⪼ (σcost
What is an unsafe query? Give an example and explain why it is important to disallow such queries.
Consider the following relations: Student(snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets at: string, room: string, fid: integer) Enrolled(snum:
The following relations keep track of airline flight information: Flights (flno: integer, from: string, to: string, distance: integer, departs: time, arrives: time, price: real) Aircraft (aid:
Consider the instance of the Sailors relation shown in Figure 5.1.1. Write SQL queries to compute the average rating, using AVG; the sum of the ratings, using SUM; and the number of ratings, using
Consider the following relational schema and briefly answer the questions that follow:1. Define a table constraint on Emp that will ensure that every employee makes at least $10,000. 2. Define a
Discuss the strengths and weaknesses of the trigger mechanism. Contrast triggers with other integrity constraints supported by SQL.
Explain how the following steps are performed in JDBC: 1. Connect to a data source. 2. Start, commit, and abort transactions. 3. Call a stored procedure. How are these steps performed in SQLJ?
Compare exception handling and handling of warnings in embedded SQL, dynamic SQL, JDBC, and SQLJ.
Briefly answer the following questions: 1. Explain the following terms and describe what they are used for: HTML, URL, XML, Java, JSP, XSL, XSLT, servlet, cookie, HTTP, CSS, DTD. 2. What is CGI? Why
In this exercise, you are asked to write the functionality of a generic shopping basket; you will use this in several subsequent project exercises. Write a set of JSP pages that displays a shopping
TechnoBooks.com is in the process of reorganizing its website. A major issue is how to efficiently handle a large number of search results. In a human interaction study, it found that modem users
Answer the following questions about data on external storage in a DBMS: 1. Why does a DBMS store data on external storage? 2. Why are I/O costs important in a DBMS? 3. What is a record id? Given a
Consider the following relations: Emp(eid: integer, ename: varchar, sal: integer, age: integer, did: integer) Dept(did: integer, budget: integer, floor: integer, mgr eid: integer) Salaries range
Consider a relation stored as a randomly ordered file for which the only index is an unclustered index on a field called sal. If you want to retrieve all records with sal > 20, is using the index
Explain the difference between Hash indexes and B+-tree indexes. In particular, discuss how equality and range searches work, using an example.
If you were about to create an index on a relation, what considerations would guide your choice? Discuss: 1. The choice of primary index. 2. Clustered versus unclustered indexes. 3. Hash versus tree
What main conclusions can you draw from the discussion of the five basic file organizations discussed in Section 8.4? Which of the five organizations would you choose for a file where the most
What happens if a page is requested when all pages in the buffer pool are dirty?
Modern disks often have their own main memory caches, typically about 1 MB, and use this to prefetch pages. The rationale for this technique is the empirical observation that, if a disk page is
Describe two possible page formats. What are the trade-offs between them?
Consider the two internal organizations for heap files (using lists of pages and a directory of pages) discussed in the text. 1. Describe them briefly and explain the trade-offs. Which organization
Modern disk drives store more sectors on the outer tracks than the inner tracks. Since the rotation speed is constant, the sequential data transfer rate is also higher on the outer tracks. The seek
Both disks and main memory support direct access to any desired location (page). On average, main memory accesses are faster, of course. What is the other important difference between the two (from
Consider a disk with a sector size of 512 bytes, 2000 tracks per surface, 50 sectors per track, five double-sided platters, and average seek time of 10 msec. 1. What is the capacity of a track in
Explain what the buffer manager must do to process a read request for a page. What happens if the requested page is in the pool but not pinned?
What does it mean to say that a page is pinned in the buffer pool? Who is responsible for pinning pages? Who is responsible for unpinning pages?
Consider the B+ tree index of order d = 2 shown in Figure 10.1.1. Show the tree that would result from inserting a data entry with key 9 into this tree. 2. Show the B+ tree that would result from
Suppose that duplicates are handled using the approach without overflow pages discussed in Section 10.7. Describe an algorithm to search for the left-most occurrence of a data entry with search key
Answer the following questions: 1. What is the minimum space utilization for a B+ tree index? 2. What is the minimum space utilization for an ISAM index? 3. If your database system supported both a
Consider the B+ tree shown in Figure 10.11. 1. Identify a list of five data entries such that: (a) Inserting the entries in the order shown and then deleting them in the opposite order (e.g., insert
Suppose that you have a sorted file and want to construct a dense primary B+ tree index on this file. 1. One way to accomplish this task is to scan the file, record by record, inserting each one
The algorithms for insertion and deletion into a B+ tree are presented as recursive algorithms. In the code for insert, for instance, a call is made at the parent of a node N to insert into (the
Consider the Extendible Hashing index shown in Figure 11.1. Answer the following questions about this index:1. What can you say about the last entry that was inserted into the index?2. What can you
In answering the following questions, assume that the full deletion algorithm is used. Assume that merging is done when a bucket becomes empty. 1. Give an example of Extendible Hashing where deleting
Answer the following questions about Extendible Hashing: 1. Explain why local depth and global depth are needed. 2. After an insertion that causes the directory size to double, how many buckets have
Give an example of when you would use each element (A or B) for each of the following 'A versus B' pairs: 1. A hashed index using Alternative (1) versus heap file organization. 2. Extendible Hashing
Consider a relation R(a, b, c, d) containing 1 million records, where each page of the relation holds 10 records. R is organized as a heap file with unclustered indexes, and the records in R are
Consider the snapshot of the Linear Hashing index shown in Figure 11.7. Assume that a bucket split occurs whenever an overflow page is created.In figure 11.71. What is the maximum number of data
Briefly answer the following questions: 1. Describe three techniques commonly used when developing algorithms for relational operators. Explain how these techniques can be used to design algorithms
For each of the following SQL queries, for each relation involved, list the attributes that must be examined to compute the answer. All queries refer to the following relations: Emp(eid: integer,
Consider again the schema with the Sailors relation: Sailors(sid: integer, sname: string, rating: integer, age: real) Assume that each tuple of Sailors is 50 bytes long, that a page can hold 80
Suppose you have a file with 10,000 pages and you have three buffer pages. Answer the following questions for each of these scenarios, assuming that our most general external sorting algorithm is
Suppose that you just finished inserting several records into a heap file and now want to sort those records. Assume that the DBMS uses external sort and makes efficient use of the available buffer
Consider the refinement to the external sort algorithm that produces runs of length 2B on average, where B is the number of buffer pages. This refinement was described in Section 11.2.1 under the
Briefly answer the following questions: 1. Consider the three basic techniques, iteration, indexing, and partitioning, and the relational algebra operators selection, projection, and join. For each
Consider processing the following SQL projection query: SELECT DISTINCT E.title, E.ename FROM Executives E You are given the following information: Executives has attributes ename, title, dname, and
Consider the join of R and S described in Exercise 14.1. 1. With 52 buffer pages, if unclustered B+ indexes existed on R.a and S.b, would either provide a cheaper alternative for performing the join
We described variations of the join operation called outer joins in Section 5.6.4. One approach to implementing an outer join operation is to first evaluate the corresponding (inner) join and then
Briefly answer the following questions: 1. In the context of query optimization, what is an SQL query block? 2. Define the term reduction factor. 3. Describe a situation in which projection should
For each of the following SQL queries, for each relation involved, list the attributes that must be examined to compute the answer. All queries refer to the following relations: Emp(eid: integer,
Consider the query πA,B,C,D (R ⪻⪼A=CS). Suppose that the projection routine is based on sorting and is smart enough to eliminate all but the desired attributes during the initial pass of the
Consider the following relational schema and SQL query. The schema captures information about employees, departments, and company finances (organized on a per department basis). Emp(eid: integer,
Give brief answers to the following questions: 1. What is a transaction? In what ways is it different from an ordinary program (in a language such as C)? 2. Define these terms: atomicity,
Consider a database with objects X and Y and assume that there are two transactions T1 and T2. Transaction T1 reads objects X and Y and then writes object X. Transaction T 2 reads objects X and Y and
Suppose that a DBMS recognizes increment, which increments an integer- valued object by 1, and decrement as actions, in addition to reads and writes. A transaction that increments an object need not
Consider the university enrollment database schema: Student(snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets at: time, room: string, fid:
Consider a database with the following schema:Suppliers(sid: integer, sname: string, address: string)Parts(pid: integer, pname: string, color: string)Catalog(sid: integer, pid: integer, cost:
Answer the following questions: 1. Describe how a typical lock manager is implemented. Why must lock and unlock be atomic operations? What is the difference between a lock and a latch? What are
Consider a database organized in terms of the following hierarchy of objects: The database itself is an object (D), and it contains two files (F1 and F2), each of which contains 1000 pages (P1 . .
Consider the following concurrency control protocols: 2PL, Strict 2PL, Conservative 2PL, Optimistic, Timestamp without the Thomas Write Rule, Timestamp with the Thomas Write Rule, and Multiversion.
Briefly answer the following questions:1. Draw a Venn diagram that shows the inclusions between the classes of schedules permitted by the following concurrency control protocols: 2PL, Strict 2PL,
SQL supports four isolation-levels and two access-modes, for a total of eight combinations of isolation-level and access-mode. Each combination implicitly defines a class of transactions; the
Briefly answer the following questions: 1. How does the recovery manager ensure atomicity of transactions? How does it ensure durability? 2. What is the difference between stable storage and disk? 3.
Briefly answer the following questions:1. What are the roles of the Analysis, Redo, and Undo phases in ARIES?2. Consider the execution shown in Figure 18.1.(a) What is done during Analysis? (Be
Consider the execution shown in Figure 18.3. In addition, the system crashes during recovery after writing two log records to stable storage and again after writing another two log records.1. What is
Briefly answer the following questions: 1. If the system fails repeatedly during recovery, what is the maximum number of log records that can be written (as a function of the number of update and
The description in Section 18.6.1 of the Analysis phase made the simplifying assumption that no log records appeared between the begin checkpoint and end checkpoint records for the most recent
Briefly answer the following questions: 1. Define the term functional dependency. 2. Why are some functional dependencies called trivial? 3. Give a set of FDs for the relation schema R(A,B,C,D) with
Consider a relation R that has three attributes ABC. It is decomposed into relations R1 with attributes AB and R2 with attributes BC. 1. State the definition of a lossless-join decomposition with
Consider a relation R with five attributes ABCDE. 1. For each of the following instances of R, state whether it violates (a) the FD BC → D and (b) the MVD BC →→ D: (a) { } (i.e., empty
Showing 2400 - 2500
of 2962
First
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30