Q.1 Short Questions Marks 1. New fields can be added to the created table by using command. a) ALTER b) SELECT c) CREATE. D. UPDATE.

Size: px
Start display at page:

Download "Q.1 Short Questions Marks 1. New fields can be added to the created table by using command. a) ALTER b) SELECT c) CREATE. D. UPDATE."

Transcription

1 ID No. Knowledge Institute of Technology & Engineering BE III SEMESTER MID EXAMINATION ( SEPT-27) PAPER SOLUTION Subject Code: Date: 14/09/27 Subject Name: Database Management Systems Branches: Computer & IT Q.1 Short Questions Marks 1. New fields can be added to the created table by using command. a) ALTER b) SELECT c) CREATE. D. UPDATE. 2. Define Transaction. Logical unit of database processing that includes one or more access operations (read - retrieval, write - insert or update, delete). 3. Write functionality of DESC command in SQL. DESC has two purposes. It is used to describe a schema as well as to retrieve rows from table in descending order. 4. DDL stands for Data Definition Language 5. Define the command COMMIT. Commit signals a successful end of the transaction so that any changes (updates) executed by the transaction can be safely committed to the database and will not be undone. 6. State true or false: Any relation schema that satisfies BCNF also satisfies 3NF True. Q.2 (a) Define: Primary key, Foreign Key and NOT NULL constraint. 03 (b) Primary Key: A primary key is one or more columns in a table used to uniquely identify each row in the table. Its values must not be null and must be unique across the column. Foreign Key: A foreign key is a column or a group of columns whose values are derived from the primary (or unique) key of the same or some other table. It represents relationship between tables. Not null: The not null constraint ensures that a table column cannot be left empty. Explain the States of the transaction with a neat sketch. 04 Active: This is state. The transaction stays in this state while it is executing. Partially Committed: This is the state after the final statement of the transaction is executed. At this point failure is still possible since changes may have been only done in main memory, a hardware failure could still occur. Failed: After the discovery that normal execution can no longer proceed. Once a 1

2 (c) (c) transaction cannot be completed, any changes that it made must be undone rolling it back. Aborted: The state after the transaction has been rolled back and the database has been restored to its state prior to the start of the transaction. Committed: The transaction enters in this state after successful completion of the transaction. We cannot abort or rollback a committed transaction We have following relations: EMP(empno, ename, jobtitle, managerno, hiredate, sal, comm, deptno) DEPT(deptno, dname, loc) Answer the following queries in SQL. i) Find the Employees working in the department 10, 20, 30 only. Ans : Select * from emp where deptno in(10,20,30) OR Select * from emp where deptno=10 or deptno=20 or deptno=30; ii) Find Employees whose names start with letter A or letter a. Ans : Select * from emp where ename like A% or ename like a% ; iii) Find Employees along with their department name. Ans :Select e.empno,e.ename,e.jobtitle,e.managerno,e.hiredate, e.comm,e.deptno,d.dname,d.loc from emp e,dept d where e.deptno=d.deptno iv) Insert data in EMP table. INSERT INTO EMPLOYEE VALUES(1,'SMIT', CLERK,79,17- DEC-80,5000,,20); INSERT INTO EMPLOYEE VALUES(102,'ANIL', SALSMAN,89,21-AUG-80,8000,300,30); INSERT INTO EMPLOYEE VALUES(103,'SUNIL', CLERK,7902,25- DEC-85,5500,500,20); INSERT INTO EMPLOYEE VALUES(104,'AJAY', MANAGER,5902,29-DEC-70,10000,,20); INSERT INTO EMPLOYEE VALUES(105,'ROHIT', CLERK,7903,25-JAN-79,7000,300,20); v) Find the Employees who are working in Smith's department Ans :Select e.empno,e.ename,e.jobtitle,e.managerno,e.hiredate, e.comm,e.deptno,d.dname,d.loc from emp e,dept d where d.deptno=e.deptno and d.dname= Smith ; OR Explain materialized evaluation and pipelining. There are two methods for the evaluation of expression 1. Materialization 2. Pipelining Materialization In this method we start from bottom of the tree and each expression is evaluated one by one in bottom to top order. The result of each expression is materialized (stored) in temporary relation (table) for later use. 05 2

3 In our example, there is only one such operation, selection operation on account. The inputs to the lowest level operation are relations in the database. We execute these operations and we store the results in temporary relations. We can use these temporary relations to execute the operation at the next level up in the tree, where the inputs now are either temporary relations or relations stored in the database. In our example the inputs to join are the customer relation and the temporary relation created by the selection on account. The join can now be evaluated, creating another temporary relation. By repeating the process, we will finally evaluate the operation at the root of the tree, giving the final result of the expression. In our example, we get the final result by executing the projection operation at the root of the tree, using as input the temporary relation created by the join. Evaluation just described is called materialized evaluation, since the results of each intermediate operation are created and then are used for evaluation of the next level operations. The cost of a materialized evaluation is not simply the sum of the costs of the operations involved. To compute the cost of evaluating an expression is to add the cost of all the operation as well as the cost of writing intermediate results to disk. The disadvantage of this method is that it will create temporary relation (table) and that relation is stored on disk which consumes space on disk. It evaluates one operation at a time, starting at the lowest level. Pipelining We can reduce the number of temporary files that are produced by combining several relations operations into pipeline operations, in which the results of one operation are passed along to the next operation in the pipeline. Combining operations into a pipeline eliminates the cost reading and writing temporary relations. In this method several expression are evaluated simultaneously in pipeline by using the result of one operation passed to next without storing it in a temporary relation. First it will compute records having balance less than 2500 and then pass this result directly to project without storing that result in any temporary relation (table). And then by using this result it will compute the projections on customer-name. It is much cheaper than materialization because in this method no need to store a temporary relation to disk. Pipelining is not used in sort, hash joins. 3

4 Q.3 (a) Explain join dependency and 5 NF 03 Definition. A join dependency (JD), denoted by JD(R1, R2,..., Rn), specified on relation schema R, specifies a constraint on the states r of R. The constraint states that every legal state r of R should have a nonadditive join decomposition into R1, R2,..., Rn. Hence, for every such r we have (πr1(r), πr2(r),..., πrn(r)) = r\ The relation r(abc)decomposes losslessly onto the relation schemes A B, A C, and B C. The projections are shown in Figure 7.2. However, r satisfies no nontrivial MVDs, so it has no Iossless decomposition onto any pair of relation schema R1 and R2 such that R1 ABC and R2 ABC. 5NF(FIFTH NORMAL FORM) Definition. A relation schema R is in fifth normal form (5NF) (or projectjoin normal form (PJNF)) with respect to a set F of functional, multivalued, and join dependencies if, for every nontrivial join ependency JD(R1, R2,..., Rn) in F+ (that is, implied by F), every Ri is a superkey of R. A relation is said to be in 5NF if and only if it is in 4NF and every join dependency in it is implied by the candidate keys. Fifth normal form deals with cases where information can be reconstructed from smaller pieces of information that can be maintained with less redundancy. Fifth normal for mainly emphasizes on lossless decomposition. Consider the following example To add the seminar DAT-2 to New York, we would have to add a line to the table for each instructor located in New York. The Table would look like as shown below adding the above information 4

5 There is a redundancy of data F for Brown's information. So to eliminate this redundancy, we have to do a 'Non-Loss decomposition of the table. Consider the decomposition of above table into 5NF In the normalized form, the fact that Brown travelling to New York is recorded only once, whereas, in the unnormalized form it may be repeated many times. (b) List and discuss ACID properties of transaction. Ans : Property of transaction are classified in to four different categories and list are below. 1) Atomicity 2) Consistency 3) Isolation 4) Durability Atomicity Either all operations of the transaction are properly reflected in the database or none are. Means either all the operations of a transaction are executed or not a single operation is executed. For example consider below transaction to transfer Rs. 50 from account A to account B: 1. read(a) 2. A := A write(a) 4. read(b) 5. B := B write(b) In above transaction if Rs. 50 is deducted from account A then it must be added to account B. 04 Consistency Execution of a transaction in isolation preserves the consistency of the database. Means our database must remain in consistent state after execution of any transaction. In above example total of A and B must remain same before and after the execution of transaction. Isolation 5

6 Although multiple transactions may execute concurrently, each transaction must be unaware of other concurrently executing transactions. Intermediate transaction results must be hidden from other concurrently executed transactions. In above example once your transaction start from step one its result should not be access by any other transaction until last step (step 6) is completed. Durability After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures. Once your transaction completed up to step 6 its result must be stored permanently. It should not be removed if system fails. (c) Discuss various steps of query processing with proper diagram It is a process of transforming a high level query (such as SQL) in to low level language. Query processing refers to the range of activities involved in extracting data from a database. 05 A query expressed in a high level query language such as SQL must be Scanned Parsed Validated The scanner identifies the language tokens such as SQL keywords, attribute names and relation names in the text of the query. Parser checks the query syntax to determine whether it is formulated according to the syntax rules of the query language. The query must also be validated by checking that all attributes and relation names are valid and semantically meaningful names in the schema of the particular database being queried. A query typically has many possible execution strategies and the process of choosing a suitable one for processing a query is known as query optimization. The query optimizer module has the task of producing an execution plan and code generator generates the code to execute that plan. The runtime database processor has the task of running the query code whether in compiled or interpreted mode, to produce the query result. If a runtime error results, an error message is generated by the runtime database processor. Query code generator will generate code for query. Runtime database processor will select optimal plan and execute query and gives result. OR 6

7 Q.3 (a) Write a note on conflict serializability. Instructions li and lj of transactions Ti and Tj respectively, conflict if and only if there exists some item Q accessed by both li and lj, and at least one of these instructions wrote Q. 1. If li and lj access different data item then li and lj don t conflict. 2. li = read(q), lj = read(q). li and lj don t conflict. 3. li = read(q), lj = write(q). li and lj conflict. 4. li = write(q), lj = read(q). li and lj conflict. 5. li = write(q), lj = write(q). li and lj conflict. Intuitively, a conflict between li and lj forces a (logical) temporal order between them. If a schedule S can be transformed into a schedule S by a series of swaps of nonconflicting instructions, we say that S and S are conflict equivalent. We say that a schedule S is conflict serializable if it is conflict equivalent to a serial Schedule. Example Schedule S can be transformed into Schedule S by swapping of non-conflicting series of instructions. Therefore Schedule S is conflict serializable. 03 Instruction Ii of transaction T1 and Ij of transaction T2 conflict if both of these instruction access same data A and one of these two instructions performs write operation on that data (A). In above example the write(a) instruction of transaction T1 conflict with read(a) instruction of transaction T2 because both the instructions access same data A. But write(a) instruction of transaction T2 is not conflict with read(b) instruction of transaction T1 because both the instructions access different data. Transaction T2 performs write operation in A and transaction T1 is reading B. So in above example in schedule S two instructions read(a) and write(a) of transaction T2 and two instructions read(b) and write(b) of transaction T1 are interchanged and we get schedule S. Therefore Schedule S is conflict serializable. We are unable to swap instructions in the above schedule S to obtain either the serial schedule < T3, T4 >, or the serial schedule < T4, T3 >. So above schedule S is not conflict serializable. 7

8 (b) Write a note on two phase commit protocol. Two phase commit protocol The two phase commit protocol provides an automatic recovery mechanism in case a system or media failure occurs during execution of the transaction. The two phase commit protocol ensures that all participants perform the same action (either to commit or to roll back a transaction). The two phase commit strategy is designed to ensure that either all the databases are updated or none of them, so that the databases remain synchronized. In two phase commit protocol there is one node which is act as a coordinator and all other participating node are known as cohorts or participant. Coordinator the component that coordinates with all the participants. Cohorts (Participants) each individual node except coordinator are participant. As the name suggests, the two phase commit protocol involves two phases. 1. The first phase is Commit Request phase OR phase 1 2. The second phase is Commit phase OR phase 2 Commit Request Phase (Obtaining Decision) To commit the transaction, the coordinator sends a request asking for ready for commit to each cohort. The coordinator waits until it has received a reply from all cohorts to vote on the request. Each participant votes by sending a message back to the coordinator as follows: It votes YES if it is prepared to commit It may vote NO for any reason if it cannot prepare the transaction due to a local failure. It may delay in voting because cohort was busy with other work. Commit Phase (Performing Decision) If the coordinator receives YES response from all cohorts, it decides to commit. The transaction is now officially committed. Otherwise, it either receives a NO response or gives up waiting for some cohort, so it decides to abort. The coordinator sends its decision to all participants (i.e. COMMIT or ABORT). Participants acknowledge receipt of commit or about by replying DONE. 04 (c) Write queries for the following tables: T1 ( Empno, Ename, Salary, Designation) T2 (Empno, Deptno.) (1) Display all the details of the employee whose salary is lesser than 10K. Ans: select e.empno,e.ename,e.salary,e.designation,d.deptno from T1 e, T2 d where e.empno=d.empno and e.salary>10000 (2) Display the Deptno in which Employee Seeta is working. Ans :select d.deptno from T1 e, T2 d where e.empno=d.empno and e.ename= Seeta (3) Add a new column Deptname in table T2. Ans : ALTER TABLE T2 ADD ( Deptname varchar2(20) ) ; (4) Change the designation of Geeta from Manager to Senior Manager. Ans : UPDATE T1 SET Designation = Senior Manager WHERE Ename = Geeta ; (5) Find the total salary of all the employees. Ans : Select SUM(salary) Total_Salary from T

CHAPTER: TRANSACTIONS

CHAPTER: TRANSACTIONS CHAPTER: TRANSACTIONS CHAPTER 14: TRANSACTIONS Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition in SQL Testing

More information

Transaction Management. Chapter 14

Transaction Management. Chapter 14 Transaction Management Chapter 14 What we want to cover Transaction model Transaction schedules Serializability Atomicity 432/832 2 Chapter 14 TRANSACTION MODEL 432/832 3 Transaction Requirements Eg. Transaction

More information

Chapter 9: Transactions

Chapter 9: Transactions Chapter 9: Transactions modified from: Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 9: Transactions Transaction Concept Transaction State Concurrent Executions

More information

Chapter 14: Transactions

Chapter 14: Transactions Chapter 14: Transactions Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 14: Transactions Transaction Concept Transaction State Concurrent Executions Serializability

More information

Roadmap of This Lecture

Roadmap of This Lecture Transactions 1 Roadmap of This Lecture Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Testing for Serializability Transaction Definition

More information

Chapter 15: Transactions

Chapter 15: Transactions Chapter 15: Transactions! Transaction Concept! Transaction State! Implementation of Atomicity and Durability! Concurrent Executions! Serializability! Recoverability! Implementation of Isolation! Transaction

More information

CSIT5300: Advanced Database Systems

CSIT5300: Advanced Database Systems CSIT5300: Advanced Database Systems L12: Transactions Dr. Kenneth LEUNG Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong SAR, China kwtleung@cse.ust.hk

More information

Chapter 13: Transactions

Chapter 13: Transactions Chapter 13: Transactions Transaction Concept Transaction State Implementation of Atomicity and Durability Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition

More information

References. Transaction Management. Database Administration and Tuning 2012/2013. Chpt 14 Silberchatz Chpt 16 Raghu

References. Transaction Management. Database Administration and Tuning 2012/2013. Chpt 14 Silberchatz Chpt 16 Raghu Database Administration and Tuning 2012/2013 Transaction Management Helena Galhardas DEI@Técnico DMIR@INESC-ID Chpt 14 Silberchatz Chpt 16 Raghu References 1 Overall DBMS Structure Transactions Transaction

More information

Chapter 15: Transactions

Chapter 15: Transactions Chapter 15: Transactions Chapter 15: Transactions Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition in SQL Testing

More information

Transactions. Prepared By: Neeraj Mangla

Transactions. Prepared By: Neeraj Mangla Transactions Prepared By: Neeraj Mangla Chapter 15: Transactions Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition

More information

BİL 354 Veritabanı Sistemleri. Transaction (Hareket)

BİL 354 Veritabanı Sistemleri. Transaction (Hareket) BİL 354 Veritabanı Sistemleri Transaction (Hareket) Example BUSEY SAVINGS Winslett $1000 Transfer $500 BUSEY CHECKING Winslett $0 A single operation from the customer point of view It comprises several

More information

Lecture 20 Transactions

Lecture 20 Transactions CMSC 461, Database Management Systems Spring 2018 Lecture 20 Transactions These slides are based on Database System Concepts 6 th edition book (whereas some quotes and figures are used from the book) and

More information

Transaction Concept. Two main issues to deal with:

Transaction Concept. Two main issues to deal with: Transactions Transactions Transactions Transaction States Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition in SQL Testing for Serializability. Transaction

More information

Chapter 14: Transactions

Chapter 14: Transactions Chapter 14: Transactions Transaction Concept Transaction Concept A transaction is a unit of program execution that accesses and possibly updates various data items. E.g. transaction to transfer $50 from

More information

Transactions These slides are a modified version of the slides of the book Database System Concepts (Chapter 15), 5th Ed

Transactions These slides are a modified version of the slides of the book Database System Concepts (Chapter 15), 5th Ed Transactions These slides are a modified version of the slides of the book Database System Concepts (Chapter 15), 5th Ed., McGraw-Hill, by Silberschatz, Korth and Sudarshan. Original slides are available

More information

ICOM 5016 Database Systems. Chapter 15: Transactions. Transaction Concept. Chapter 15: Transactions. Transactions

ICOM 5016 Database Systems. Chapter 15: Transactions. Transaction Concept. Chapter 15: Transactions. Transactions ICOM 5016 Database Systems Transactions Chapter 15: Transactions Amir H. Chinaei Department of Electrical and Computer Engineering University of Puerto Rico, Mayagüez Slides are adapted from: Database

More information

Advanced Databases. Transactions. Nikolaus Augsten. FB Computerwissenschaften Universität Salzburg

Advanced Databases. Transactions. Nikolaus Augsten. FB Computerwissenschaften Universität Salzburg Advanced Databases Transactions Nikolaus Augsten nikolaus.augsten@sbg.ac.at FB Computerwissenschaften Universität Salzburg Version October 18, 2017 Wintersemester 2017/18 Adapted from slides for textbook

More information

CS322: Database Systems Transactions

CS322: Database Systems Transactions CS322: Database Systems Transactions Dr. Manas Khatua Assistant Professor Dept. of CSE IIT Jodhpur E-mail: manaskhatua@iitj.ac.in Outline Transaction Concept Transaction State Concurrent Executions Serializability

More information

Transactions. Silberschatz, Korth and Sudarshan

Transactions. Silberschatz, Korth and Sudarshan Transactions Transaction Concept ACID Properties Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition in SQL Testing for Serializability.

More information

Database System Concepts

Database System Concepts Chapter 15: Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2007/2008 Slides (fortemente) baseados nos slides oficiais do livro c Silberschatz, Korth and Sudarshan. Outline

More information

Transactions. Lecture 8. Transactions. ACID Properties. Transaction Concept. Example of Fund Transfer. Example of Fund Transfer (Cont.

Transactions. Lecture 8. Transactions. ACID Properties. Transaction Concept. Example of Fund Transfer. Example of Fund Transfer (Cont. Transactions Transaction Concept Lecture 8 Transactions Transaction State Implementation of Atomicity and Durability Concurrent Executions Serializability Recoverability Implementation of Isolation Chapter

More information

Advanced Databases (SE487) Prince Sultan University College of Computer and Information Sciences. Dr. Anis Koubaa. Spring 2014

Advanced Databases (SE487) Prince Sultan University College of Computer and Information Sciences. Dr. Anis Koubaa. Spring 2014 Advanced Databases (SE487) Prince Sultan University College of Computer and Information Sciences Transactions Dr. Anis Koubaa Spring 2014 Outlines Transaction Concept Transaction State Implementation of

More information

Transaction Concept. Chapter 15: Transactions. Example of Fund Transfer. ACID Properties. Example of Fund Transfer (Cont.)

Transaction Concept. Chapter 15: Transactions. Example of Fund Transfer. ACID Properties. Example of Fund Transfer (Cont.) Chapter 15: Transactions Transaction Concept - ACID Transaction States Concurrent Executions Serializability Testing for Serializability Recoverability Transaction Definition in SQL Transaction Concept

More information

Database Management Systems 2010/11

Database Management Systems 2010/11 DMS 2010/11 J. Gamper 1/30 Database Management Systems 2010/11 Chapter 6: Transactions J. Gamper Transaction Concept ACID Properties Atomicity and Durability Concurrent Execution Serializability Recoverability

More information

Database System Concepts

Database System Concepts Chapter 15: Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2008/2009 Slides (fortemente) baseados nos slides oficiais do livro c Silberschatz, Korth and Sudarshan. Outline

More information

Transactions and Concurrency Control. Dr. Philip Cannata

Transactions and Concurrency Control. Dr. Philip Cannata Transactions and Concurrency Control Dr. Philip Cannata 1 To open two SQLDevelopers: On the Mac do the following: click on the SQLDeveloper icon to start one instance from the command line run the following

More information

Database Management Systems

Database Management Systems Database Management Systems Associate Professor Dr. Raed Ibraheem Hamed University of Human Development, College of Science and Technology Computer Science Department 2015 2016 1 Points to Cover Transaction

More information

ss A good decomposition must be lossless and dependency preserving 1. Lossless-Join Decomposition Exactly the original information can be recovered by joining 2. Non-Lossless-Join or Lossy Decomposition

More information

Database System Concepts

Database System Concepts Chapter 15+16+17: Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2010/2011 Slides (fortemente) baseados nos slides oficiais do livro c Silberschatz, Korth and Sudarshan.

More information

Transactions. Chapter 15. New Chapter. CS 2550 / Spring 2006 Principles of Database Systems. Roadmap. Concept of Transaction.

Transactions. Chapter 15. New Chapter. CS 2550 / Spring 2006 Principles of Database Systems. Roadmap. Concept of Transaction. New Chapter CS 2550 / Spring 2006 Principles of Database Systems 09 Transactions Chapter 15 Transactions Alexandros Labrinidis University of Pittsburgh Alexandros Labrinidis, Univ. of Pittsburgh 2 CS 2550

More information

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu. 7CA0 DATABASE MANAGEMENT SYSTEMS Academic Year : 08-09 Programme : MCA Question Bank Year / Semester : I / I Course Coordinator: Ms.S.Visalatchy Course Objectives. To learn the fundamentals of data models

More information

DATABASE MANAGEMENT SYSTEMS

DATABASE MANAGEMENT SYSTEMS www..com Code No: N0321/R07 Set No. 1 1. a) What is a Superkey? With an example, describe the difference between a candidate key and the primary key for a given relation? b) With an example, briefly describe

More information

Database Management Systems Paper Solution

Database Management Systems Paper Solution Database Management Systems Paper Solution Following questions have been asked in GATE CS exam. 1. Given the relations employee (name, salary, deptno) and department (deptno, deptname, address) Which of

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 14 Basics of Functional Dependencies and Normalization for Relational Databases Slide 14-2 Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1 Semantics of the Relation Attributes

More information

Introduction to Transaction Management

Introduction to Transaction Management Introduction to Transaction Management CMPSCI 645 Apr 1, 2008 Slide content adapted from Ramakrishnan & Gehrke, Zack Ives 1 Concurrency Control Concurrent execution of user programs is essential for good

More information

UNIT 3 UNIT 3. Transaction Management and Concurrency Control, Performance tuning and query optimization of SQL and NoSQL Databases.

UNIT 3 UNIT 3. Transaction Management and Concurrency Control, Performance tuning and query optimization of SQL and NoSQL Databases. UNIT 3 Transaction Management and Concurrency Control, Performance tuning and query optimization of SQL and NoSQL Databases. 1. Transaction: A transaction is a unit of program execution that accesses and

More information

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601 Techno India Batanagar Computer Science and Engineering Model Questions Subject Name: Database Management System Subject Code: CS 601 Multiple Choice Type Questions 1. Data structure or the data stored

More information

MODULE: 3 FUNCTIONAL DEPENDENCIES

MODULE: 3 FUNCTIONAL DEPENDENCIES MODULE: 3 (13 hours) Database design: functional dependencies - Inference Rules for Functional Dependencies - Closure -- Minimal Cover -Normal forms First-second and third normal forms Boyce- Codd normal

More information

UNIT-IV TRANSACTION PROCESSING CONCEPTS

UNIT-IV TRANSACTION PROCESSING CONCEPTS 1 Transaction UNIT-IV TRANSACTION PROCESSING CONCEPTS A Transaction refers to a logical unit of work in DBMS, which comprises a set of DML statements that are to be executed atomically (indivisibly). Commit

More information

Introduction to Transaction Management

Introduction to Transaction Management Introduction to Transaction Management CMPSCI 445 Fall 2008 Slide content adapted from Ramakrishnan & Gehrke, Zack Ives 1 Concurrency Control Concurrent execution of user programs is essential for good

More information

ajpatelit.wordpress.com

ajpatelit.wordpress.com ALPHA COLLEGE OF ENGINEERING & TECHNOLOGY COMPUTER ENGG. / INFORMATION TECHNOLOGY Database Management System (2130703) All Queries 1. Write queries for the following tables. T1 ( Empno, Ename, Salary,

More information

Babu Banarasi Das National Institute of Technology and Management

Babu Banarasi Das National Institute of Technology and Management Babu Banarasi Das National Institute of Technology and Management Department of Computer Applications Question Bank (Short-to-Medium-Answer Type Questions) Masters of Computer Applications (MCA) NEW Syllabus

More information

UNIT 8. Database Design Explain multivalued dependency and fourth normal form 4NF with examples.

UNIT 8. Database Design Explain multivalued dependency and fourth normal form 4NF with examples. UNIT 8 Database Design -2 1. Explain multivalued dependency and fourth normal form 4NF with examples. (JUN/JULY 2013 / JAN 2014) A multivalued dependency (MVD) X Y specified on R, where X, and Y are both

More information

UNIT 4 TRANSACTIONS. Objective

UNIT 4 TRANSACTIONS. Objective UNIT 4 TRANSACTIONS Objective To study about the transaction concepts. To know the recovery management. To have a clear understanding of concurrent executions. To know how these are facilitated in SQL.

More information

TRANSACTION PROCESSING CONCEPTS

TRANSACTION PROCESSING CONCEPTS 1 Transaction CHAPTER 9 TRANSACTION PROCESSING CONCEPTS A Transaction refers to a logical unit of work in DBMS, which comprises a set of DML statements that are to be executed atomically (indivisibly).

More information

King Fahd University of Petroleum and Minerals

King Fahd University of Petroleum and Minerals 1 King Fahd University of Petroleum and Minerals Information and Computer Science Department ICS 334: Database Systems Semester 041 Major Exam 1 18% ID: Name: Section: Grades Section Max Scored A 5 B 25

More information

COSC344 Database Theory and Applications. Lecture 21 Transactions

COSC344 Database Theory and Applications. Lecture 21 Transactions COSC344 Database Theory and Applications Lecture 21 Transactions - Overview This Lecture Transactions Source: Chapter 20 Next Lecture Concurrency control Source: Chapter 21 Lecture After Recovery Source:

More information

Relational Database design. Slides By: Shree Jaswal

Relational Database design. Slides By: Shree Jaswal Relational Database design Slides By: Shree Jaswal Topics: Design guidelines for relational schema, Functional Dependencies, Definition of Normal Forms- 1NF, 2NF, 3NF, BCNF, Converting Relational Schema

More information

Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2

Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2 Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2 Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant

More information

Creating and Managing Tables Schedule: Timing Topic

Creating and Managing Tables Schedule: Timing Topic 9 Creating and Managing Tables Schedule: Timing Topic 30 minutes Lecture 20 minutes Practice 50 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe the

More information

Real-World Performance Training SQL Introduction

Real-World Performance Training SQL Introduction Real-World Performance Training SQL Introduction Real-World Performance Team Basics SQL Structured Query Language Declarative You express what you want to do, not how to do it Despite the name, provides

More information

SQL Interview Questions

SQL Interview Questions SQL Interview Questions SQL stands for Structured Query Language. It is used as a programming language for querying Relational Database Management Systems. In this tutorial, we shall go through the basic

More information

Q.2 e) Time stamping protocol for concurrrency control Time stamping ids a concurrency protocol in which the fundamental goal is to order transactions globally in such a way that older transactions get

More information

AC61/AT61 DATABASE MANAGEMENT SYSTEMS JUNE 2013

AC61/AT61 DATABASE MANAGEMENT SYSTEMS JUNE 2013 Q2 (a) With the help of examples, explain the following terms briefly: entity set, one-to-many relationship, participation constraint, weak entity set. Entity set: A collection of similar entities such

More information

Objectives. After completing this lesson, you should be able to do the following:

Objectives. After completing this lesson, you should be able to do the following: Objectives After completing this lesson, you should be able to do the following: Write SELECT statements to access data from more than one table using equality and nonequality joins View data that generally

More information

UNIT 3 DATABASE DESIGN

UNIT 3 DATABASE DESIGN UNIT 3 DATABASE DESIGN Objective To study design guidelines for relational databases. To know about Functional dependencies. To have an understanding on First, Second, Third Normal forms To study about

More information

Data about data is database Select correct option: True False Partially True None of the Above

Data about data is database Select correct option: True False Partially True None of the Above Within a table, each primary key value. is a minimal super key is always the first field in each table must be numeric must be unique Foreign Key is A field in a table that matches a key field in another

More information

INDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables

INDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables INDEX Exercise No Title 1 Basic SQL Statements 2 Restricting and Sorting Data 3 Single Row Functions 4 Displaying data from multiple tables 5 Creating and Managing Tables 6 Including Constraints 7 Manipulating

More information

Transactions. Juliana Freire. Some slides adapted from L. Delcambre, R. Ramakrishnan, G. Lindstrom, J. Ullman and Silberschatz, Korth and Sudarshan

Transactions. Juliana Freire. Some slides adapted from L. Delcambre, R. Ramakrishnan, G. Lindstrom, J. Ullman and Silberschatz, Korth and Sudarshan Transactions Juliana Freire Some slides adapted from L. Delcambre, R. Ramakrishnan, G. Lindstrom, J. Ullman and Silberschatz, Korth and Sudarshan Motivation Database systems are normally being accessed

More information

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database?

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database? DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS Complete book short Answer Question.. QUESTION 1: What is database? A database is a logically coherent collection of data with some inherent meaning, representing

More information

Chapter 10. Chapter Outline. Chapter Outline. Functional Dependencies and Normalization for Relational Databases

Chapter 10. Chapter Outline. Chapter Outline. Functional Dependencies and Normalization for Relational Databases Chapter 10 Functional Dependencies and Normalization for Relational Databases Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant

More information

Example: Transfer Euro 50 from A to B

Example: Transfer Euro 50 from A to B TRANSACTIONS Example: Transfer Euro 50 from A to B 1. Read balance of A from DB into Variable a: read(a,a); 2. Subtract 50.- Euro from the balance: a:= a 50; 3. Write new balance back into DB: write(a,a);

More information

14.1 Answer: 14.2 Answer: 14.3 Answer: 14.4 Answer:

14.1 Answer: 14.2 Answer: 14.3 Answer: 14.4 Answer: 14.1 Suppose that there is a database system that never fails. Is a recovery manager required for this system? Even in this case the recovery manager is needed to perform roll-back of aborted transactions.

More information

1 SQL Structured Query Language

1 SQL Structured Query Language 1 SQL Structured Query Language 1.1 Tables In relational database systems (DBS) data are represented using tables (relations). A query issued against the DBS also results in a table. A table has the following

More information

SQL. Char (30) can store ram, ramji007 or 80- b

SQL. Char (30) can store ram, ramji007 or 80- b SQL In Relational database Model all the information is stored on Tables, these tables are divided into rows and columns. A collection on related tables are called DATABASE. A named table in a database

More information

CPSC 421 Database Management Systems. Lecture 19: Physical Database Design Concurrency Control and Recovery

CPSC 421 Database Management Systems. Lecture 19: Physical Database Design Concurrency Control and Recovery CPSC 421 Database Management Systems Lecture 19: Physical Database Design Concurrency Control and Recovery * Some material adapted from R. Ramakrishnan, L. Delcambre, and B. Ludaescher Agenda Physical

More information

Chapter 14. Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies

Chapter 14. Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies Chapter 14 Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies Copyright 2012 Ramez Elmasri and Shamkant B. Navathe Chapter Outline 1 Informal Design Guidelines

More information

Chapter 10. Normalization. Chapter Outline. Chapter Outline(contd.)

Chapter 10. Normalization. Chapter Outline. Chapter Outline(contd.) Chapter 10 Normalization Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant Information in Tuples and Update Anomalies 1.3 Null

More information

Page 1. Goals of Today s Lecture. The ACID properties of Transactions. Transactions

Page 1. Goals of Today s Lecture. The ACID properties of Transactions. Transactions Goals of Today s Lecture CS162 Operating Systems and Systems Programming Lecture 19 Transactions, Two Phase Locking (2PL), Two Phase Commit (2PC) Finish Transaction scheduling Two phase locking (2PL) and

More information

Sample Question Paper

Sample Question Paper Sample Question Paper Marks : 70 Time:3 Hour Q.1) Attempt any FIVE of the following. a) List any four applications of DBMS. b) State the four database users. c) Define normalization. Enlist its type. d)

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Computer Science and Engineering CS6302- DATABASE MANAGEMENT SYSTEMS Anna University 2 & 16 Mark Questions & Answers Year / Semester: II / III

More information

Functional Dependencies and. Databases. 1 Informal Design Guidelines for Relational Databases. 4 General Normal Form Definitions (For Multiple Keys)

Functional Dependencies and. Databases. 1 Informal Design Guidelines for Relational Databases. 4 General Normal Form Definitions (For Multiple Keys) 1 / 13 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant d Information in Tuples and Update Anomalies 1.3 Null Values in Tuples 1.4 Spurious Tuples

More information

1 SQL Structured Query Language

1 SQL Structured Query Language 1 SQL Structured Query Language 1.1 Tables In relational database systems (DBS) data are represented using tables (relations). A query issued against the DBS also results in a table. A table has the following

More information

Transaction Management & Concurrency Control. CS 377: Database Systems

Transaction Management & Concurrency Control. CS 377: Database Systems Transaction Management & Concurrency Control CS 377: Database Systems Review: Database Properties Scalability Concurrency Data storage, indexing & query optimization Today & next class Persistency Security

More information

UNIT IV TRANSACTION MANAGEMENT

UNIT IV TRANSACTION MANAGEMENT UNIT IV TRANSACTION MANAGEMENT The term transaction refers to a collection of operations that form a single logical unit of work. For instance, transfer of money from one account to another is a transaction

More information

Transactions and Concurrency Control

Transactions and Concurrency Control Transactions and Concurrency Control Transaction: a unit of program execution that accesses and possibly updates some data items. A transaction is a collection of operations that logically form a single

More information

Informal Design Guidelines for Relational Databases

Informal Design Guidelines for Relational Databases Outline Informal Design Guidelines for Relational Databases Semantics of the Relation Attributes Redundant Information in Tuples and Update Anomalies Null Values in Tuples Spurious Tuples Functional Dependencies

More information

Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment

Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment Introductory concepts of DBMS 1. Explain detailed 3-level architecture

More information

Transactions. Kathleen Durant PhD Northeastern University CS3200 Lesson 9

Transactions. Kathleen Durant PhD Northeastern University CS3200 Lesson 9 Transactions Kathleen Durant PhD Northeastern University CS3200 Lesson 9 1 Outline for the day The definition of a transaction Benefits provided What they look like in SQL Scheduling Transactions Serializability

More information

CSE 344 MARCH 21 ST TRANSACTIONS

CSE 344 MARCH 21 ST TRANSACTIONS CSE 344 MARCH 21 ST TRANSACTIONS ADMINISTRIVIA HW7 Due Wednesday OQ6 Due Wednesday, May 23 rd 11:00 HW8 Out Wednesday Will be up today or tomorrow Transactions Due next Friday CLASS OVERVIEW Unit 1: Intro

More information

Database Recovery. Dr. Bassam Hammo

Database Recovery. Dr. Bassam Hammo Database Recovery Dr. Bassam Hammo 1 Transaction Concept A transaction is a unit of execution Either committed or aborted. After a transaction, the db must be consistent. Consistent No violation of any

More information

CS122 Lecture 15 Winter Term,

CS122 Lecture 15 Winter Term, CS122 Lecture 15 Winter Term, 2017-2018 2 Transaction Processing Last time, introduced transaction processing ACID properties: Atomicity, consistency, isolation, durability Began talking about implementing

More information

CS2 Current Technologies Lecture 3: SQL - Joins and Subqueries

CS2 Current Technologies Lecture 3: SQL - Joins and Subqueries T E H U N I V E R S I T Y O H F R G E D I N B U CS2 Current Technologies Lecture 3: SQL - Joins and Subqueries Chris Walton (cdw@dcs.ed.ac.uk) 11 February 2002 Multiple Tables 1 Redundancy requires excess

More information

Attach extra pages as needed. Write your name and ID on any extra page that you attach. Please, write neatly.

Attach extra pages as needed. Write your name and ID on any extra page that you attach. Please, write neatly. UCLA Computer Science Department Fall 2003 Instructor: C. Zaniolo TA: Fusheng Wang Student Name and ID: CS143 Final EXAM: Closed Book, 3 Hours Attach extra pages as needed. Write your name and ID on any

More information

Part III. Data Modelling. Marc H. Scholl (DBIS, Uni KN) Information Management Winter 2007/08 1

Part III. Data Modelling. Marc H. Scholl (DBIS, Uni KN) Information Management Winter 2007/08 1 Part III Data Modelling Marc H. Scholl (DBIS, Uni KN) Information Management Winter 2007/08 1 Outline of this part (I) 1 Introduction to the Relational Model and SQL Relational Tables Simple Constraints

More information

Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Slide 17-1

Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Slide 17-1 Slide 17-1 Chapter 17 Introduction to Transaction Processing Concepts and Theory Multi-user processing and concurrency Simultaneous processing on a single processor is an illusion. When several users are

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - 1DL300 Spring 2011 An introductory course on database systems http://www.it.uu.se/edu/course/homepage/dbastekn/vt11/ Manivasakan Sabesan Uppsala Database Laboratory Department of Information

More information

Database implementation Further SQL

Database implementation Further SQL IRU SEMESTER 2 January 2010 Semester 1 Session 2 Database implementation Further SQL Objectives To be able to use more advanced SQL statements, including Renaming columns Order by clause Aggregate functions

More information

GIFT Department of Computing Science Data Selection and Filtering using the SELECT Statement

GIFT Department of Computing Science Data Selection and Filtering using the SELECT Statement GIFT Department of Computing Science [Spring 2013] CS-217: Database Systems Lab-2 Manual Data Selection and Filtering using the SELECT Statement V1.0 4/12/2016 Introduction to Lab-2 This lab reinforces

More information

2011 DATABASE MANAGEMENT SYSTEM

2011 DATABASE MANAGEMENT SYSTEM Name :. Roll No. :..... Invigilator s Signature :.. CS/B.TECH(IT)/SEM-6/IT-604/2011 2011 DATABASE MANAGEMENT SYSTEM Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks.

More information

In This Lecture. Transactions and Recovery. Transactions. Transactions. Isolation and Durability. Atomicity and Consistency. Transactions Recovery

In This Lecture. Transactions and Recovery. Transactions. Transactions. Isolation and Durability. Atomicity and Consistency. Transactions Recovery In This Lecture Database Systems Lecture 15 Natasha Alechina Transactions Recovery System and Media s Concurrency Concurrency problems For more information Connolly and Begg chapter 20 Ullmanand Widom8.6

More information

CT13 DATABASE MANAGEMENT SYSTEMS DEC 2015

CT13 DATABASE MANAGEMENT SYSTEMS DEC 2015 Q.1 a. Explain the role of concurrency control software in DBMS with an example. Answer: Concurrency control software in DBMS ensures that several users trying to update the same data do so in a controlled

More information

SQL Structured Query Language Introduction

SQL Structured Query Language Introduction SQL Structured Query Language Introduction Rifat Shahriyar Dept of CSE, BUET Tables In relational database systems data are represented using tables (relations). A query issued against the database also

More information

Name :. Roll No. :... Invigilator s Signature : DATABASE MANAGEMENT SYSTEM

Name :. Roll No. :... Invigilator s Signature : DATABASE MANAGEMENT SYSTEM Name :. Roll No. :..... Invigilator s Signature :.. CS/B.TECH(IT)/SEM-6/IT-604/2011 2011 DATABASE MANAGEMENT SYSTEM Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks.

More information

CS2255 DATABASE MANAGEMENT SYSTEMS QUESTION BANK UNIT I

CS2255 DATABASE MANAGEMENT SYSTEMS QUESTION BANK UNIT I CS2255 DATABASE MANAGEMENT SYSTEMS CLASS: II YEAR CSE SEM:04 STAFF INCHARGE: Mr S.GANESH,AP/CSE QUESTION BANK UNIT I 2 MARKS List the purpose of Database System (or) List the drawback of normal File Processing

More information

VU Mobile Powered by S NO Group All Rights Reserved S NO Group 2013

VU Mobile Powered by S NO Group All Rights Reserved S NO Group 2013 1 CS403 Final Term Solved MCQs & Papers Mega File (Latest All in One) Question # 1 of 10 ( Start time: 09:32:20 PM ) Total Marks: 1 Each table must have a key. primary (Correct) secondary logical foreign

More information

Introduction to Transaction Processing Concepts and Theory

Introduction to Transaction Processing Concepts and Theory Chapter 4 Introduction to Transaction Processing Concepts and Theory Adapted from the slides of Fundamentals of Database Systems (Elmasri et al., 2006) 1 Chapter Outline Introduction to Transaction Processing

More information

Lock Granularity and Consistency Levels (Lecture 7, cs262a) Ali Ghodsi and Ion Stoica, UC Berkeley February 7, 2018

Lock Granularity and Consistency Levels (Lecture 7, cs262a) Ali Ghodsi and Ion Stoica, UC Berkeley February 7, 2018 Lock Granularity and Consistency Levels (Lecture 7, cs262a) Ali Ghodsi and Ion Stoica, UC Berkeley February 7, 2018 Papers Granularity of Locks and Degrees of Consistency in a Shared Database, J. N. Gray,

More information

Page 1. CS194-3/CS16x Introduction to Systems. Lecture 8. Database concurrency control, Serializability, conflict serializability, 2PL and strict 2PL

Page 1. CS194-3/CS16x Introduction to Systems. Lecture 8. Database concurrency control, Serializability, conflict serializability, 2PL and strict 2PL CS194-3/CS16x Introduction to Systems Lecture 8 Database concurrency control, Serializability, conflict serializability, 2PL and strict 2PL September 24, 2007 Prof. Anthony D. Joseph http://www.cs.berkeley.edu/~adj/cs16x

More information