Free Essay

Dbms

In:

Submitted By Supriya
Words 2607
Pages 11
LOVELY PROFESSIONAL UNIVERSITY
HOME WORK: 3

School: Department CSE/IT
Name of the faculty member: Course No: CSE301
Course Title: Database Management System
Class: B.Tech (CSE) Term: 6th Section: D1803 Batch:2008
Max. Marks: 18+7=25
Date of Allotment: Date of Submission:

Submitted By: Roll No: 25

PART-A

Q-1 What is overlapping of Candidate keys? What are the problems incurred due to this overlap and how these problems can be rectified. Explain with Example.
Overlap of candidate key is a type of candidate key which occur in BCNF(Boyce Codd Normal Form). In the difference between 3NF and BCNF example: a 3NF table which doesnot have multiple overlapping candidate keys is gurantted to be in BCNF. Depending on what its functional dependencies are . a 3NF table with two or more overlapping candidate keys may or maynot be in BCNF.

Example:
The original definition of 1NF was in adequate in some situations. It was not satisfactory for the table:

• They had multiple candidate keys • Where the multiple candidate keys were composite • Where the multiple candidate keys overlapped
Therefore, a normal form, the BCNF was introduced. We must understand it in tables where the above three candidates don’t apply, we can stop the 3NF. In such cases, the 3NF is same as the BCNF.

A relation is in BCNF iff every determinant is a candidate key.
Consider the following PROJECT table

|ECODE |NAME |PROJECT |HOURS |
|E1 |veronica |P2 |48 |
|E2 |Anthony |P5 |100 |
|E3 |Mac |P6 |15 |
|E4 |Susan |P2 |250 |
|E4 |Susan |P5 |75 |
|E1 |Verinoca |P5 |40 |

This table has redundancy. If the name of the employee has been modified, the change will have to be made consistence across the table. Otherwise there will be inconsistencies.

ECODE+PROJECT is the primary key. We will notice that NAME +PROJECT could be chosen as primary key and hence is a candidate key.

• HOURS is functionally dependent on ECODE=PROJECT • HOURS is also functionally de4pendent on NAME+PROJECT • NAME is functionally dependent on ECODE • ECODE is functionally dependent on NAME
This is a situation ythat requires conversion to BCNF. The table is essentially in the 3NF. The only non_key item is HOURS, which is dependent, on the whole key, that is, ECODE+PROJECT or NAME+PROJECT.

ECODE and NAME are determinants since they are functionally dependent on each other. However, they are not candidate keys by themselves. As per BCNF, the determinants have to be candidate keys.

Q-2 Suppose you are given a relation R = (A, B, C, D, E) with the following functional

dependencies: {CE → D, D → B, C → A}.

a. Find all candidate keys. b. Identify the best normal form that R satisfies (1NF, 2NF, 3NF, or BCNF). c. If the relation is not in BCNF, decompose it until it becomes BCNF. At each step, identify a new relation, decompose and re-compute the keys and the normal forms they satisfy.
a. The candidate key is {C,E}
b. The relation is in 1NF
c. Decompose into R1=(A,C) and R2=(B,C,D,E). R1 is in BCNF, R2 is in 2NF. Decompose R2 into, R21=(C,D,E) and R22=(B,D). Both relations are in BCNF.

Q-3 Can we achieve 2NF without 1NF and How. Also differentiate 1NF and 2NF with an example. No we cannot achieve 2NF without 1NF as Normal Forms form a hierarchy in such a way that a schema in a higher normal form automatically fulfills all the criteria for all of the lower Normal Forms. First normal form
A relation R is in first normal form (1NF) if and only if all underlying domains contain atomic values only

Example: 1NF but not 2NF

FIRST (supplier_no, status, city, part_no, quantity)

Functional Dependencies:

(supplier_no, part_no) ® quantity
(supplier_no) ® status
(supplier_no) ® city city ® status (Supplier's status is determined by location)

Comments:

Non-key attributes are not mutually independent (city ® status).
Non-key attributes are not fully functionally dependent on the primary key (i.e., status and city are dependent on just part of the key, namely supplier_no).

Anomalies:

INSERT: We cannot enter the fact that a given supplier is located in a given city until that supplier supplies at least one part (otherwise, we would have to enter a null value for a column participating in the primary key C a violation of the definition of a relation).
DELETE: If we delete the last (only) row for a given supplier, we lose the information that the supplier is located in a particular city.
UPDATE: The city value appears many times for the same supplier. This can lead to inconsistency or the need to change many values of city if a supplier moves.

Decomposition (into 2NF):

SECOND (supplier_no, status, city)
SUPPLIER_PART (supplier_no, part_no, quantity)

Second normal form
A relation R is in second normal form (2NF) if and only if it is in 1NF and every non-key attribute is fully dependent on the primary key

Example

SECOND (supplier_no, status, city)

Functional Dependencies:

supplier_no → status supplier_no → city city → status

Comments:

Lacks mutual independence among non-key attributes.Mutual dependence is reflected in the transitive dependencies: supplier_no → city, city → status.

Anomalies:

INSERT: We cannot record that a particular city has a particular status until we have a supplier in that city.
DELETE: If we delete a supplier which happens to be the last row for a given city value, we lose the fact that the city has the given status.
UPDATE: The status for a given city occurs many times, therefore leading to multiple updates and possible loss of consistency.

PART-B

Q-4 What problems occur in database system when a transaction does not satisfy ACID properties? Explain explicitly using Suitable Examples.

ACID properties are as follows:

Atomicity: either all operations of the transaction are reflected properly in the database, or none are.

Consistency: execution of a transaction in isolation preserves the consistency of the database.

Isolation: even though multiple transactions may execute concurrently, the system guarantees that, for every pair of transaction Ti and T j. it appears to Ti that Tj finished execution before Ti started or Tj starts execution after Ti finished. Thus each transaction is unaware of other transaction executing concurrently in the system.

Durability: after a transaction completes successfully, the changes it has made to database persists, even if there are system failures.

Now take an example showing problem occur in database system when a transaction does not satisfy ACID properties:

Lets take an example of the banking system, let ti be a transaction that transfers $50 from account A to account B. this transaction can be defined as:

Ti: read (A);

A: =A-50;

Write (A);

B: =B+50;

Write (B);

Now lets consider the ACID properties:

Consistency: the consistency requirement here that sum of A and B be unchanged by the execution of the transaction. Without the consistency requirement, money could be created or destroyed by the transaction. It can be verified easily that, if a database is consistence before an execution of the transaction, the database remain consistent after the execution of the transaction.

Atomicity: suppose that just before the execution of transaction Ti, the values of account A and B are $1000 and $2000, respectively. Now suppose that, during the execution of transaction Ti, a failure occurs that prevents Ti from completing its execution successfully. Example of such a failures includes power failures, hardware failures and software failures. Further, suppose that the failure happened after the write (A) operation but before write (B) operation. In this case, the value of account A and B reflected in the database are $950 and $2000. The system destroys $50 as a result of this failure. In particular, we note that the sum A+B is no longer preserved.

Thus, because of the failure, the state of the system no longer reflects a real state of the world that the database is supposed to capture. We term such a state as inconsistent state.

Durability: once the execution of the transaction completes successfully, and the user who initiated the transaction has been notified that the transfer of funds has taken place, it must be the case that no system failure will result in the loss of data corresponding to this transfer of fund.

The durability property guarantees that, once a transaction completes successfully, all the updates that it carried out on the database persists, even if there is a system failure after the transaction completes its execution. In case if durability property is not hold data will be left in the inconsistent state.

Isolation: even if consistency and atomicity property is ensured for each transaction, if several transactions are executed concurrently, there operations may interleave in some undesirable way, resulting in an inconsistent state.

For example, the database is temporarily inconsistent while the transaction to transfer funds from A to B is executing, with the deducted total written to and the increased total yet to be written to B at this intermediate point and computes A+B, it will observe an inconsistent value. Furthermore, if this second transaction then performs updates on A and B based on the inconsistent values that it read, the database may be left in an inconsistent state even after both transactions have completed.

Q-5 How can we test the serializability of the schedules?

Schedule compliance with conflict serializability can be tested with the precedence graph (serializability graph, serialization graph, conflict graph) for committed transactions of the schedule. It is the directed graph representing precedence of transactions in the schedule, as reflected by precedence of conflicting operations in the transactions.
In the precedence graph transactions are nodes and precedence relations are directed edges. There exists an edge from a first transaction to a second transaction, if the second transaction is in conflict with the first (see Conflict serializability above), and the conflict is materialized (i.e., if the requested conflicting operation is actually executed: in many cases a requested/issued conflicting operation by a transaction is delayed and even never executed, typically by a lock on the operation's object, held by another transaction; as long as a requested/issued conflicting operation is not executed, the conflict is non-materialized; non-materialized conflicts are not represented by an edge in the precedence graph).
Comment: In many text books only committed transactions are included in the precedence graph. Here all transactions are included for convenience in later discussions.
The following observation is a key characterization of conflict serializability: ← A schedule is conflict-serializable if and only if its precedence graph of committed transactions (when only committed transactions are considered) is acyclic. This means that a cycle consisting of committed transactions only is generated in the (general) precedence graph, if and only if conflict-serializability is violated. ← Cycles of committed transactions can be prevented by aborting an undecided (neither committed, nor aborted) transaction on each cycle in the precedence graph of all the transactions, which can otherwise turn into a cycle of committed transactions (and a committed transaction cannot be aborted). One transaction aborted per cycle is both required and sufficient number to break and eliminate the cycle (more aborts are possible, and can happen in some mechanisms, but unnecessary for serializability). The probability of cycle generation is typically low, but nevertheless, such a situation is carefully handled, typically with a considerable overhead, since correctness is involved. Transactions aborted due to serializability violation prevention are restarted and executed again immediately.
Serializability enforcing mechanisms typically do not maintain a precedence graph as a data structure, but rather prevent or break cycles implicitly.

A precedence graph, also named conflict graph and serializability graph, is used in the context of concurrency control in databases.
The precedence graph for a schedule S contains: • A node for each committed transaction in S • An arc from Ti to Tj if an action of Ti precedes and conflicts with one of Tj's actions.

Precedence graph example

[pic][pic]
Or
D = R1(A) W2 (A) Com.2 W1(A) Com.1 W3(A) Com.3
A precedence graph of the schedule D, with 3 transactions. As there is a cycle (of length 2; with two edges) through the committed transactions T1 and T2, this schedule (history) is not Conflict serializable.

Testing Serializability with Precedence Graph

The drawing sequence for the precedence graph:- 1. For each transaction Ti participating in schedule S, create a node labeled Ti in the precedence graph. So the precedence graph contains T1, T2, T3 2. For each case in S where Tj executes a read_item(X) after Ti executes a write_item(X), create an edge (Ti --> Tj) in the precedence graph. Here this process is not happening anywhere as there is no read after write. 3. For each case in S where Tj executes a write_item(X) after Ti executes a read_item(X), create an edge (Ti --> Tj) in the precedence graph. This will bring to front a directed graph from T1 to T2. 4. For each case in S where Tjexecutes a write_item(X) after Ti executes a write_item(X), create an edge (Ti --> Tj) in the precedence graph. It creates a directed graph from T2 to T1, T1 to T3, and T2 to T3. 5. The schedule S is serializable if and only if the precedence graph has no cycles. As T1 and T2 constitute a cycle, the above schedule is not supposed to be serializable.

Q-6 During Transaction execution, a transaction passes through several states, until it finally commits and abort. List all possible sequences of states and operations through which transaction may pass.

All possible sequence of states through which transaction may pass are as follows:

1. Active state: the initial state, the transaction stays in this state while it is executing.

2. Partially committed: a database transaction enters this phase when its final statement has been executed. At this phase, the database transaction has finished its execution, but it is still possible for the transaction to be aborted because the output from the execution may remain residing temporarily in main memory - an event like hardware failure may erase the output.

3. Failed state: A database transaction enters the failed state when its normal execution can no longer proceed due to hardware or program errors).

4. Aborted state: A database transaction, if determined by the DBMS to have failed, enters the aborted state. An aborted transaction must have no effect on the database, and thus any changes it made to the database have to be undone, or in technical terms, rolled back. The database will return to its consistent state when the aborted transaction has been rolled back. The DBMS's recovery scheme is responsible to manage transaction aborts.

5. Committed state: : A database transaction enters the committed state when enough information has been written to disk after completing its execution with success. In this state, so much information has been written to disk that the effects produced by the transaction cannot be undone via aborting; even when a system failure occurs, the changes made by the committed transaction can be re-created when the system restarts.

A transaction is said to be terminated if it has either committed or terminated.

Sate diagram is as follows:

Transaction operations are as follows:

Read(X): it transfers the data iten X from the database to local buffer belonging to the transaction that executed the read operation.

Write(X): it transfers the data item X from the local buffer of the transaction that executed the write back to the database.

There are many other operations too but read and write are the important once.

-----------------------
Partially committed

committed

failed

aborted

active

Similar Documents

Free Essay

Netw 360 Ilab 2

...power can be measured in two ways: on the linear scale, by the number of watts that are being transmitted; and on a relative scale, by the number of decibels (dBs) instead of watts. Decibel milliwatt (dBm) is the logarithmic power ratio (in dB) of the measured power in milliwatts referenced to one milliwatt (mW). Notice that the reference point is specified as 1 mW = 0 dBm. 3’s and 10’s rules are shortcuts for estimating the increase or decrease of these power levels. In this lab, students will practice basic RF calculations, including · converting from mW to dBm; · converting from dBm to mW; and · estimating power levels using the 3’s and 10’s rules. Task 1: Converting between dBm and mW Applying the 3’s and 10’s rules, the relationship between dBm and mW is estimated as shown in the following (partial) table. 3’s rule|10’s rule| ……|……| 0.125 mW = -9 dBm|0.001 mW = -30 dBm| 0.25 mW = -6 dBm|0.01 mW = -20 dBm| 0.5 mW = -3 dBm|0.1 mW = -10 dBm| 1 mW = 0 dBm|1 mW = 0 dBm| 2 mW = 3 dBm|10 mW = 10 dBm| 4 mW = 6 dBm|100 mW = 20 dBm| 8 mW = 9 dBm|1,000 mW = 30 dBm| ……|……| Notice that as the mW value increases or decreased by the factor of 10, the dBm value increases and decrease by adding or subtracting 10. As the mW value doubles or halves, the corresponding dBm value increases and decrease by adding or...

Words: 894 - Pages: 4

Premium Essay

Dbms

...DBMS vs. RDBMS • Relationship among tables is maintained in a RDBMS whereas this not the case DBMS as it is used to manage the database. • DBMS accepts the ‘flat file’ data that means there is no relation among different data whereas RDBMS does not accepts this type of design. • DBMS is used for simpler business applications whereas RDBMS is used for more complex applications. • Although the foreign key concept is supported by both DBMS and RDBMS but its only RDBMS that enforces the rules. • RDBMS solution is required by large sets of data whereas small sets of data can be managed by DBMS. 1. What is database? A database is a collection of information that is organized. So that it can easily be accessed, managed, and updated.   2. What is DBMS? DBMS stands for Database Management System. It is a collection of programs that enables user to create and maintain a database.   3. What is a Database system? The database and DBMS software together is called as Database system.   4.   What are the advantages of DBMS? I.  Redundancy is controlled. II.  Providing multiple user interfaces. III. Providing backup and recovery IV. Unauthorized access is restricted. V.  Enforcing integrity constraints.   5. What is normalization? It is a process of analysing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties (1).Minimizing redundancy, (2). Minimizing insertion, deletion and update anomalies.   6. What...

Words: 3541 - Pages: 15

Premium Essay

Dbms

...Lovely Professional University Case study on student record keeping system Name Abhishek Bhatt Regd. No. 11109390 Roll No. A21 Section K1104 Submittked By Submitted to Abhishek Bhatt Vipin Kumar Case Study case study on student record keeping system Table Of Content 1) Introduction 2) What is DBMS ? 3) Features/Advantages of DBMS. 4)Disadvantages of DBMS 5)Advantages of student record keeping system 6)Note * Introduction : * DBMS : DBMS Stands for Data Base Management System. It consists of interrelated data and set of programs to access those data. * Data : Raw information is called data. * Database : Database is a collection of interrelated data, contain information about one particular enterprise. * Interrelated Data : It is a type of data which is related to each other. e.g. Student and subject, parents and child. * About My Topic : My topic is about case study on student record keeping system * Introduction to case student record keeping system Student Record Keeping System is a comprehensive solution for all of a school’s student management needs, like enrollment...

Words: 1384 - Pages: 6

Premium Essay

Dbms

...Examination Paper of Database Management Systems IIBM Institute of Business Management Examination Paper Subject Code- E1010 Database Management Systems Section A: Objective Type (20 marks)    This section consists of Multiple Choice Questions / True & False. Answer all the questions. Each Question carries 1 mark. MM.100 Multiple Choices: 1. Structured Query Language (SQL) is the language for working with: a. DDBMS b. RDBMS c. Both (a) & (b) d. None of the above 2. Decomposition in database design means: a. Breaking one table into multiple tables b. Breaking two table into multiple tables c. Composing multiple tables into one table d. None of the above Locking helps: a. Hiding the database b. To solve concurrency problems c. Both (a) & (b) d. None of the above 3. 4. Database optimizer: a. Enhances the speed of query execution b. Minimizes the speed of query execution c. Is a program d. None of the above 5. Data is __________. a. Raw facts b. Processed information c. Both (a) & (b) d. None of the above 6. Mobile computing means: a. Ability to use computer while on still b. Ability to use computer while on move c. Calculation with the help of mobile d. None of the above 1 IIBM Institute of Business Management Examination Paper of Database Management Systems 7. Operation Data Store (ODS) provides: a. Situation sensitive decision support & operational reporting b. Time sensitive decision support & operational reporting c. Both (a) & (b) d. None of the above 8. Transaction...

Words: 643 - Pages: 3

Premium Essay

Dbms

...include code for the metadata of each file - Each application program must have its own processing routines for reading, inserting, updating, and deleting data - Lack of coordination and central control - Non-standard file formats Problems with Data Redundancy - Waste of space to have duplicate data - Causes more maintenance headaches The biggest problem: - Data changes in one file could cause inconsistencies - Compromises in data integrity SOLUTION: The DATABASE Approach - Central repository of shared data - Data is managed by a controlling agent - Stored in a standardized, convenient form Database Management System - A software system that is used to create, maintain, and provide controlled access to user databases - DBMS manages data resources like an operating system manages hardware resources Advantages of the Database Approach - Program-data independence - Planned data redundancy - Improved data consistency - Improved data...

Words: 391 - Pages: 2

Premium Essay

Dbms

... * Real-world entity − A modern DBMS is more realistic and uses real-world entities to design its architecture. It uses the behaviour and attributes too. For example, a school database may use students as an entity and their age as an attribute. * Less redundancy − DBMS follows the rules of normalization, which splits a relation when any of its attributes is having redundancy in values. * Consistency − There exist methods and techniques, which can detect attempt of leaving database in inconsistent state. A DBMS can provide greater consistency as compared to earlier forms of data storing applications like file-processing systems. * Query Language − DBMS is equipped with query language, which makes it more efficient to retrieve and manipulate data. * ACID Properties − DBMS follows the concepts of Atomicity, Consistency, Isolation, and Durability (normally shortened as ACID). These concepts are applied on transactions, which manipulate data in a database. ACID properties help the database stay healthy in multi-transactional environments and in case of failure. * Multiuser and Concurrent Access − DBMS supports multi-user environment and allows them to access and manipulate data in parallel. * Multiple views − DBMS offers multiple views for different users. A user who is in the Sales department will have a different view of database than a person working in the Production department. * Security − DBMS offers methods to impose constraints...

Words: 1010 - Pages: 5

Premium Essay

Dbms

...of the real world and is used for specific purposes by one or more groups of users. A DBMS is a generalized software package for implementing and maintaining a computerized database. The database and software together form a database system. We identified several characteristics that distinguish the database approach from traditional fileprocessing applications, and we discussed the main categories of database users, or the actors on the scene.We noted that in addition to database users, there are several categories of support personnel, or workers behind the scene, in a database environment. We presented a list of capabilities that should be provided by the DBMS software to the DBA, database designers, and end users to help them design, administer, and use a database. Then we gave a brief historical perspective on the evolution of database applications.We pointed out the marriage of database technology with information retrieval technology, which will play an important role due to the popularity of the Web. Finally, we discussed the overhead costs of using a DBMS and discussed some situations in which it may not be advantageous to use one. In this chapter we defined a database as a collection of related data, where data means recorded facts. A typical database represents some aspect of the real world and is used for specific purposes by one or more groups of users. A DBMS is a generalized software package for implementing and maintaining a computerized database...

Words: 419 - Pages: 2

Premium Essay

Dbms

...______________________________________ ------------------------------------------------- Roll No. : ______________________________________ ------------------------------------------------- ------------------------------------------------- An Introduction to Database Management Systems A database is a collection of related files that are usually integrated, linked or cross-referenced to one another. The advantage of a database is that data and records contained in different files can be easily organized and retrieved using specialized database management software called a database management system (DBMS) or database manager. DBMS Fundamentals A database management system is a set of software programs that allows users to create, edit and update data in database files, and store and retrieve data from those database files. Data in a database can be added, deleted, changed, sorted or searched all using a DBMS. If you were an employee in a large organization, the information about you would likely be stored in different files that are linked together. One file about you would pertain to your skills and abilities, another file to your income tax status, another to your home and office address and telephone number, and another to your annual performance ratings. By cross-referencing these files, someone could change a person's address in one file and it would automatically be reflected in all the other files....

Words: 5712 - Pages: 23

Premium Essay

Dbms

...Section A: Multiple Choices: 1. Structured Query Language (SQL) is the language for working with b. RDBMS 2. Decomposition in database design means a. Breaking one table into multiple tables 3. Locking helps b. To solve concurrency problems 4. Database optimizer b. Minimizes the speed of query execution 5. Data is __________. a. Raw facts 6. Mobile computing means d. None of the above 7. Operation Data Store (ODS) provides c. Both (a) & (b) 8. Transaction is c. Logical unit of work 9. Transitive dependency is a. Indirect dependency relationship 10. Row in RDBMS is called b. Tuple True & False: 1. Database keys do not allow identification of records. False 2. A key is a minimal set of key minimal. True 3. Joins cannot be used to retrieve data from multiple tables. False 4. Data redundancy prefers to duplication of data. True 5. DML is used to retrieve or manipulate data stored in a database. True 6. Database keys do not allow identification of records. Flase 7. A super key is a set of column that identifies every row in a table. True 8. System recovery is sub-classified into transaction recovery and media recovery. False 9. Media recovery deals with disk error. True 10. The task of a DDBMS is quite complex. False Section B: Short Questions (20 marks) 1. What is SQL? Why is it a powerful language? ANS: SQL is an acronym that stands for "Structured Query Language" and it's used primarily...

Words: 2698 - Pages: 11

Premium Essay

Dbms

...(Tribhuvan University) A STUDY IN THE ATTENDANCE MANAGEMENT SYSTEM OF HIMALAYAN WHITEHOUSE INTERNATIONAL COLLEGE Project Report on Database Management System In partial fulfillment of the requirements For the Bachelor’s Degree in Business Administration By: September 2014 Table of Contents Chapter I 1 INTRODUCTION 1 1.1 Introduction of the Organization 1 1.2 Attendance Management System 1 1.3 Overview 2 1.4 Economically Feasibility 2 1.5 Technical Feasibility 2 1.6 Behavioural Feasibility 2 Chapter II 3 LITERATURE SURVEY 3 2.1 Drawbacks Of Present System 3 2.2 Proposed System 3 2.2.1 Objectives of the Proposed System 3 2.2.2 Advantages of Proposed System 4 2.3 Scope 4 Chapter III 5 SYSTEM DESIGN 5 3.1 E-R-D Representations 5 3.2 E-R Diagram 6 3.3 Schema 7 3.4 Tabular Representation Of Schema 7 Chapter IV 10 IMPLEMENTATION 10 4.1 Syntaxes 10 4.2 Snapshots 11 Chapter V 14 CONCLUSION 14 BIBLIOGRAPHY 15 REFERENCES 16 LIST OF TABLES |Table no. |Title |Page no. | |3.4.1 |Tabular representation of Schema: Teacher |9 | |3.4.2 |Tabular representation of Schema: Teaches |9 | |3.4.3 |Tabular representation of Schema: Subject |9 ...

Words: 2569 - Pages: 11

Premium Essay

Dbms

...Notes on DBMS Internals Neil Conway neilc@samurai.com November 10, 2003 Preamble These notes were originally written for my own use while taking CISC-432, a course in DBMS design and implementation at Queen’s University. The textbook used by that class is Database Management Systems, 3rd Edition by Raghu Ramakrishnan and Johannes Gehkre; some of the material below may be specific to that text. This document is provided in the hope that it is useful, but I can’t provide any assurance that any information it contains is in any way accurate or complete. Corrections or additions are welcome. Distribution Terms: This document is released into the public domain. Query Evaluation External Sorting • A DBMS frequently needs to sort data (e.g. for a merge-join, ORDER BY, GROUP BY, etc.) that exceeds the amount of main memory available. In order to do this, an external sort algorithm is used. • 2-Way External Merge Sort: – In the first pass, each page of the input relation is read into memory, sorted, and written out to disk. This creates N runs of 1 page each. – In each successive pass, each run is read into memory and merged with another run, then written out to disk. Since the number of runs is halved with every pass, this requires log2 N passes. Since an additional initial pass is required and each pass requires 2N I/Os, the total cost is: 2N( log2 N + 1) – Thus, we can see that the number of passes we need to make is critical to the overall performance of the sort (since in...

Words: 12979 - Pages: 52

Premium Essay

Dbms

...4. In the section "Disadvantages of File Processing Systems," the statement is made that the disadvantages of file process- ing systems can also be limitations of databases, depending on how an organization manages its databases. First, why do organizations create multiple databases, not just one all- inclusive database supporting all data processing needs? Second, what organizational and personal factors are at work that might lead an organization to have multiple, independently managed databases(and,hence,not completely follow the database approach)? 6. A driver's license bureau maintains a database of licensed drivers. State whether each of the following represents data or metadata. if it represents data, state whether it is structured or unstructured data. If it represents metadata, state whether it is a fact describing a property of data or a fact describing the context of data. Driver's name, address, and birth date The fact that the driver's name is a 30-character field A photo image of the driver An image of the driver's fingerprint The make and serial number of the scanning device that was used to scan the fingerprint The resolution (in megapixels) of the camera that was used to photograph the driver The fact that the driver's birth date must precede today's date by at least 16 years 17. Draw an ERD for each of the following situations. (If you believe that you need to make additional assumptions, clearly state them for each situation.) Draw the same...

Words: 1310 - Pages: 6

Premium Essay

Dbms

...Chapter 1 HW Name___________________________________ MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) ________ analyzes the business situation and identify the need for information and information services to meet the problems or opportunities of the business. 1) Database Anaysts A) Database analysts B) Users C) Systems analysts D) Programmers TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 2) Database development projects are never done in a bottom-up fashion. 2) _______ 3) A well-structured database establishes the entities between relationships in order to derive the desired information. 3) _______ ESSAY. Write your answer in the space provided or on a separate sheet of paper. 4) Provide a brief overview of the various components of the database environment. TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 5) Database processing programs are coded and tested during the design stage of the systems development life cycle. 5) _______ MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 6) Organizing the database in computer disk storage is done in the ________ phase. 6) _______ A) analysis B) design C) implementation D) maintenance 7) A workgroup database is stored on a central device called a(n): 7) _______ A) client. B) network. C) server. D) remote...

Words: 333 - Pages: 2

Premium Essay

Dbms

...ROBOTC Reference Pseudocode & Flow Charts Pseudocode is a shorthand notation for programming which uses a combination of informal programming structures and verbal descriptions of code. Emphasis is placed on expressing the behavior or outcome of each portion of code rather than on strictly correct syntax (it does still need to be reasonable, though). In general, pseudocode is used to outline a program before translating it into proper syntax. This helps in the initial planning of a program, by creating the logical framework and sequence of the code. An additional benefit is that because pseudocode does not need to use a specific syntax, it can be translated into different programming languages and is therefore somewhat universal. It captures the logic and flow of a solution without the bulk of strict syntax rules. Below is some pseudocode written for a program which moves as long as a touch sensor is not pressed, but stops and turns to the right if its sonar detects an object less than 20in away. task main() { while ( touch sensor is not pressed ) { Robot runs forward if (sonar detects object < 20in away) { Robot stops } } } Robot turns right Some intact syntax The use of a while loop in the pseudocode is fitting because the way we read a while loop is very similar to the manner in which it is used in the program. Descriptions There are no actual motor commands in this section of the code, but the pseudocode suggests where...

Words: 679 - Pages: 3

Free Essay

Dbms

...Faculty of Science and Technology ITECH1006/5006 Database Management Systems Database Management Systems Tutorial Week 3 Tasks 1. Given the following table, convert the table into normalised data structure showing all attributes and identifying primary keys. Show your normalisation process from the un-normalised form to the third normal form. 2. Given the following table, convert the above table into normalized data structures showing all attributes and identifying primary keys. Show your normalisation process from the un-normalised form to the third normal form. Customer Number 148 148 282 356 356 408 608 608 608 Customer Name AI’s Appliance and Sport AI’s Appliance and Sport Brookings Direct Ferguson’s Ferguson’s The Everything Shop Johnson’s Department Store Johnson’s Department Store Johnson’s Department Store CRICOS Provider No. 00103D Order Number 21608 Order Date Part Description Iron Number Ordered 11 Quoted Price $21.95 Warehouse 10/20/2007 Part Number AT94 3 Rep Number 20 21619 10/23/2007 DR93 Gas Range 1 $495.00 2 20 21614 10/21/2007 KT03 Dishwasher 2 $595.00 3 35 21610 21610 21613 10/20/2007 10/20/2007 10/21/2007 DR93 DW11 KL62 Gas Range Washer Dryer 1 1 4 $495.00 $399.99 $329.95 2 3 1 65 65 35 21617 10/21/2007 BV06 Howe Gym 2 $794.95 2 65 21617 ...

Words: 648 - Pages: 3