Relational Database Management System 2014

Size: px
Start display at page:

Download "Relational Database Management System 2014"

Transcription

1 Unit-1: Procedural SQL data types Fill in the blank: 1. are used to defining a fully relational database. 2. Data can be presented to the user in different logical combinations, called. 3. Changes to the physical level must not require a change to an application based on the structure is known as. 4. Changes to the logical level must not require a change to an application based on the structure is known as. 5. Logical data independence is more difficult to achieve than. 6. must be specified separately from application programs and stored in the catalog. 7. rule define that primary key value will not null. 8. rule define that all data should presented in the table form. 9. A is a data type that is defined to be the same as that of another object. 10.Create row data type using the statement before you can reference it. 11.Creating or declaring of variables of type row that can be used to store. 12.Storing multiple SQL data type values as a single set, data type is used. 13.A data type is a structure that contains an ordered collection of data elements in which each element can be referenced by its ordinal position in the collection. 14.The ordinal position associated with each element, called. 15.To count total number of element in array function is used. 16.To delete the element of the array function is used. 17.To fetch first element of the array function is used. 18.To fetch next element of the array function is used. 19.In RDBMS the array index starting from the. 20.To check whether element is already exists in array function is used. Answer the following questions in short What is RDBMS? What is PL/SQL? State data types are available in PL/SQL. List out the advantage of an anchored data type? How to declare local variables of the anchored datatype? Page 1

2 6. How to declare variable of row datatype? 7. How to create row datatype? 8. How to declare variable of row datatype which contains two field studid(int) andname(varchar)? 9. What you mean by ordinary array? 10.What do you mean by cardinality of array? 11.How to declarearray variable? 12.How to assign a value to array? 13.How to store array element to another value? 14.How to move at first position in array? 15.How to move at next position in array? 16.How to determine if array element already exists? 17.How to delete element in array? 18.How to declare variable of integer array with student id and size 7? 19.Explain Boolean datatype. 20.What is a cursor? Why should it be used? 21.Explain cursor. 22.How to declare weekly typed Cursor variables? 23.How would you retrieve rows from a DB2 table in embedded SQL? 24.Where would you specify the DECLARE CURSOR statement? 25.What happens when you say OPEN CURSOR? 26.Is DECLARE CURSOR executable? 27. Can you have more than one cursor open at any one time in a program? 28.What is implicit cursor? 29.What is explicit cursor? 30.When you COMMIT, is the cursor closed? 31.What is the difference between cursor and parameterized cursor? Answer the following question in details Give the Difference between DBMS & RDBMS. Define the term RDBMS. Explain Codd s law in detail. List out datatype supported in SQL PL. Explain data type in detail. Demonstrate anchored data type with example. Demonstrate row data type with example. Demonstrate Boolean datatype with example. How to create and declare array variable? Perform the following operation on array. a. Declare integer array with name student and size is 5. b. Assign 5 elements in array. Page 2

3 c. Count total number of element in student. d. Restrict duplicate value while adding new element. e. Delete 2 and 3 element from student. 9. Write note on cursor data type. 10.Compare Row data type with Cursor data type. 11.Discuss cursor predicates with example. 12.Explain different between open course and close cursor with example. 13.How to Referencing cursor variables? Explain with example. 14.How to determine number of fetched rows in cursor? Explain with example. 15.What is the use of following term in cursor? a. CALL b. SET c. OPEN d. FETCH e. CLOSE 16.How to declare Cursor variables? Explain by taking different data types. Multiple choice questions. 1. All data should be presented to the user in table form represent a. Foundation rule b. Information rule c. Guaranteed access rule d. None of the above 2. Howthe data is stored, whether in arrays or linked lists must not require a change to an application based on the structure. a. Physical data independence b. Logical data independence c. Integrity data independence d. Distribution independence 3. SQL PL provides a. Statements for declaring variables b. Condition handlers c. Assigning values to variables d. For implementing procedural logic e. All of the above f. None of the above 4. Datatype that is defined to be the same as that of another object. a. Anchored data type b. Row data type Page 3

4 c. Boolean data type d. Cursor data type 5. Whether cursor is open or not can be determine by a. IS OPEN Function b. IS NOT OPEN function c. All of the Above d. None of the above 6. Single record- at a time means a. Low level language b. High level language c. All of the above d. None of the above 7. A field should be allowed to remain empty. a. Foundation rule b. Information rule c. Guaranteed access rule d. Treatment of NULL values 8. The system must support set at a time insert, update and delete operators. a. Guaranteed access rules b. View updating rule c. High level insert, update and delete d. Information rule 9. All data should be accessible without ambiguity a. Guaranteed access rule b. View updating rule c. Foundation d. Information rule 10.The ordinal position associated with each element,called a. Row variable b. Anchored variable c. Index d. All of the above 11.To delete the array element exist a. SET name=array_delete (name,1,2) b. SET name=array_delete(1,2,name) c. All of the above d. None of the above 12.How to know the element is exists or not in array? a. ARRAY_EXISTS(phones,2) b. ARRAY_EXISTS(1,phones,2) Page 4

5 c. All of the above d. None of the above 13.How to assign the value to any variable? a. SET a=12; b. SET myarray[1]=12,34,45; c. All of the above d. None of the above 14.An anchored type defines a data type based on another SQL object such as a a. Column b. Global variable c. SQL variable d. All of the above True or False 1. Logical independence is easy to achieve than Physical independence. 2. In Physical data independence rule change to the physical level must require a change to an application based on the structure. 3. If the system support single record at time is called high level language. 4. Data can be presented to the user in different logical combination, called views. 5. An Anchor variable can store the multiple values. 6. A Row data type is used to store multiple values. 7. An Anchor variable can be defined as local variable. 8. We cannot pass an anchor variable as parameter in SQL procedure. 9. Array index is staring from the For using the anchor variable first we have to create the anchor type. 11.We can store only the integer value in array. 12.The property of being strongly or weakly typed in defined when the data type is created. 13.Cursor variables can also be referenced as parameters in the CALL statement. 14.The system only support online database. 15.We can use direct the row data type in SQL PL block. 16.We can create an anchore variable for row. 17. We cannot create an anchore variable for the view. 18. Attribute should allow remaining empty. 19. Low level language cannot bypass the integrity rules expressed in the higher level relational language. Page 5

6 Unit 2 Control Flow Statements Fill in the blanks: 1. are used to define multiple branches of execution based on whether or not a condition was met. 2. If none of the condition is specified in the WHEN, and an ELSE clause is not specified, is issued at runtime. 3. CASE statement that use WHEN clause can be nested up to three level. 4. CASE statement that use a searched statement WHEN clause have limit to the number of nesting levels. 5. The and loops are typically used when you do not know how many times to iterate through the loop prior to entering it. 6. If a CASE statement is the only statement in the procedure body, the statement cannot end with. 7. The statement executes a statement or a group of statements until a search condition is true. 8. The loop used,when you want to ensure that the statements within the loop are executed at least once. 9. The statement is used to return an error or warning condition. 10.In statement, a label name cannot be the same as the name of the SQL procedure in which the label is used. 11.The statement is used to transfer the flow of control out of a loop or compound statement. 12. statement is used to conditionally terminate a stored procedure by returning the flow of control to the caller of the stored procures. 13. statement is used to exit from loop. 14. statement is used to cause processing to continue from the beginning from the loop. 15.Label is optional for the and loop statement. 16.Label is compulsory for the and loop statement. 17. statement is used to give alert statement. 18. statement is used to cause processing to continue from the beginning from the loop. 19. and type of case statement available. Page 6

7 True or False. 1. If statement selects an execution path based on the evaluation of a condition. 2. No privileges are required to invoke the IF statement. 3. You can make use of an ELSEIF statement to rewrite a ladder of nested IF... ELSE statements for readability. 4. In search condition, if the condition is unknown or false, processing of a block will be terminated. 5. There is a limit on the number of nested level in IF statements. 6. A case statement operates in a same way as a CASE expression. 7. If none of the condition is specified in the WHEN, the execution of the CASE statement is terminated. 8. In case statement, the data type of the expression prior to the first WHEN keyword must be comparable to the data types of each expression that follows the WHEN keywords. 9. If there is more than one CASE statement, then in such situation, semicolon cannot act as statement terminator. 10.It is not compulsory to put END CASE in both forms of CASE statements. 11.In LOOP statement, more than one label can be specified, for each SQL procedure statement. 12.In LOOPING statement, if an ending label is specified, the beginning label must be specified, and the two must match. 13.In Signal statement, signal-information must be specified within a trigger body. 14.RETURN statement only return constant value. 15.User can use more than one RETURN statement in a stored procedure. 16.RETURN statements can return more than one value. 17.The following statement will give error :set p =select * from dept where id=1; 18. RETURN statements can be used anywhere within the SQL procedure body. 19.LABLE is optional for the LEAVE and ITERATE statement. 20.LABLE is optional for the FOR and WHILE statement. Answer the following question in short 1. Define Conditional statements. 2. State Looping statements. 3. In which situation looping statement is used? 4. How to come out from loop statement? Give example. 5. What will be the output when rating is 10 AND new_salary=100? Explain. IF rating=1 THEN SET new_salary=new_salary+(new_salary*0.10); Page 7

8 ELSEIF rating=2 THEN SET new_salary=new_salary+(new_salary*0.05); ELSE SET new_salary=new_salary+(new_salary*0.02); END IF; 6. What will be the output when rating is 10 AND new_salary=100? Explain. CASE WHEN rating >=1 AND rating < 4 THEN UPDATE EMPLOYEE SET SALARY = SALARY*1.10, BONUS=1000 WHERE EMPNO=employee_num; WHEN rating >=4 AND rating<8 THEN UPDATE EMPLOYEE SET SALARY=SALARY*1.05,BONUS=500 WHERE EMPNO=employee_num; ELSE UPDATE EMPLOYEE SET SALARY=SALARY=SALARY*1.03,BONUS=0 WHERE EMPNO=employee_num; END CASE 7. CompareLOOP with WHILE statements? 8. What are the differences between IF and CASE statements? 9. Explain difference between LOOP and REPEAT statement. 10.What is the difference between WHILE statements and REPEAT statements? 11.In which situation you required to use WHILE statement and FOR LOOP statement? 12.Explain the purpose of using RETURN statement. 13.Is it necessary to use label in LOOP statements? If yes then justify your answer. 14.Provide the construct of FOR statement and explain its components. 15.How while statement executed in SQL/PL? 16.How LOOP statement executed in SQL/PL? 17.In which situation you can use ITERATE statement? 18.Compare ITERATE with LEAVE statement. 19.For checking only one condition which statement is used? 20.When users want to check multiple statements then which statement is used? 21.Define the simple case statement. 22.Define the search case statement. 23.In which statement the labels are not required? Page 8

9 Answer the following question in details. 1. List out Conditional flow statements. Explain conditional flow statements with example. 2. State Looping flow statements.what is different between FOR and WHILE statements? Explain with example. 3. How many forms are there of IF statement? Explain each with example. 4. Explain all Looping flow statement with example. 5. How many forms are there of CASE statement? Explain each with example. 6. Explain the SIGNAL statement with example. 7. Explain Looping statement with example. 8. When user can use RETURN statement? Explain it with suitable Example. 9. In which situation LEAVE statement is used? 10.What is the significance of using labels in SQL /PL? 11.Compare FOR with WHILE statement. 12. Explain Differentiate between FOR and LOOP statement. 13.Write a note on set statement. 14.What is use of IF than ELSE statement? write the block to find the number is even or odd. Practical based questions: 15.Take three numbers and find the maximum number. 16.Write a block to find the factorial of a given number. 17.Write a block to generate the Fibonacci series. 18.Write a block to find the given number is prime or non-prime number. 19.Write a block to calculate the bounce using following condition: (1) Take input as salary and check if salary >20000 than give bounce 1000 on existing salary. 20.Write a block to calculate the percentage using following condition: (1) Take 5 inputs as subject marks out of 100 marks. 21.Write a block to calculate discount using following condition:(1) Take 5 item price and make sum of them, if total purchase > 5000 than give 10% discount. 22.Write a block to find the value of A depending on the following formula: A = B+C*D^2-E/4 Page 9

10 Unit-3Application development using Procedural SQL Fill in the blanks: Procedure name is an SQL identifier with a maximum length of. Reads SQL data in UDF indicates that do not SQL data. A scalar function returns a value each time it is invoked. statement is required to fetch rows from a SQL /PL cursor. statement is used to close the cursor. are used to test the state of the cursor. attribute is the logical opposite of the IS FOUND attribute., and are statements are used as parameter in procedure. 9. Function returns values. 10. statement is used to call the stored procedure. 11.Functions can be dropped using statement. 12. and not return values. 13.No type checking is performed when values are assigned to cursor variables. 14. Statement is used to set value to cursor variable. 15. predicate can be used to determine if the cursor contains rows after the execution of a FETCH statement. 16. typed cursor requires row definition. 17. function is used to determine the number of fetched rows for a cursor. 18. typed cursor not requires row definition. 19. is a logical group set of SQL /PL statement that perform the particular task. 20. statement is define that cursor is in closing state. 21.SQL /PL functions are created by executing statement. Answer the following question in short: Define function. What is the use of cursor predicates? List out types of cursors. How to refer cursor variable? What is the use of FETCH statement? When will you use Is OPEN statement? What the use is of Is FOUND statement? Page 10

11 8. How to determine whether cursor contains rows after the execution of the fetch statement? 9. How to declare weakly typed cursor? 10. Strongly typed cursor requires row definition justify your answer. 11.Write the syntax for user defines function. 12.What is the difference between procedure and function? 13.Write the syntax for stored procedure. 14.How to call stored procedure? 15.What is use if IN keyword in function? 16.Explain the use of OUT keyword in function. 17.How to delete user define function? 18.Write the use of function. 19.How many values return in function? 20.What is the significance of argument in stored procedure? 21.What is In Out Inoutparameter in stored procedure. 22.How to access 5threcord in a cursor results set query? 23.What is use of INOUT keyword in function? 24.When we need to provide row data type definition in cursor? Answer the following question in details. 1. What is use of procedure? What are the benefits of it? 2. What is procedure? Write the syntax of creating stored procedure with proper example. 3. Compare function with procedure. 4. How many basic statements are required to create cursor? Explain each with example. 5. Write a note on user define function. 6. What is cursor? Explain all predicates with appropriate example. 7. Differentiate cursor and for loop with example. 8. Explain OPEN statement incursor. 9. What is the different between a weak and a strong cursor type? 10.What is the advantage of cursor? 11.Explain different between strong and weak cursor type. Practical based questions: 12.Write function that finds whether the input parameter is an even or odd numbers. Page 11

12 13. Write a function that finds whether the input parameter is a prime number or not. 14.Write SQL/PL block to display the top five highest paid workers who are specialized in POLISHING.WORKER(Workerid,name,wage_per_hour,specialised_In,manager _id) 15.Write a function, which returns the number of workers with same skill as that of the worker whose id is passed as parameter. 16.Write function, which returns the total number of incomplete task. 17.Write SQL /PL block which will give a raise in internal marks to the student as per following condition. 1) If students internal marks < 35 increase by 20% in marks. 2) If students internal marks >40 increase by 30% in marks. 18.Consider table: Bank_branch(empno,ename,acc_type,balance,branch_code) Branch(branch_code,city) Write a procedure to give 20% bonus to all employees from bardoli branch having saving account. 19.Write function, which finds out whether the given worker is earning more than his manager. Worker(worked,name,wage_per_hour,specialised_in,magager_id) 20. Write a function to validate whether the input code is in the right format. The code should be of length seven characters. The first character should not be a digit but the rest of the characters except the fourth one should be digit. The fourth character should be a -. In short code should be in following format #$$-$$$ where # is not digit and $ are all digits. Ex: A is a valid code. Multiple choice questions. 1. Special programming construct that allow data to be manipulated on row by row basis is known as. (a) Cursor (b) For loop (c)anchor data type (d) Row data type 2. We need to provide row data type definition in (a) Strongly typed cursor (b) Weakly typed cursor Page 12

13 (c) All of the above (d) None of these 3. Weakly typed cursor variable are useful when (a) Result set with unknown row definition (b) Result set with specific row definition (c) Result set with row definition with less no of column (d) Result set with row definition with more no of column 4. If the function definition contains all the SQL-PL statements (no queries) then which statement will you use (a) Language sql contains sql data. (b) Language sql reads sql data. (c) Language sql modifies sql data. 5. User define function are used to return (a) Single value (b) Whole table (c) a & b both 6. Out variable in stored procedure is used to (a) Store the data (b) Take a input (c) Return value 7. If I don t write contains / read / modifies in Procedure then default value is (a) Contains (b) Reads (c) Modifies 8. Strongly typed cursor performs strong type checking at (a)assignment time (b) Calling a cursor (c) Opening a cursor (d) closing a cursor 9. Procedure can be called by (a) Call proc_name() statement in other block (b) Call proc_name() statement on sql prompt (c) Call proc_name() statement in other function 10.Assume that C1 is cursor variable. Which predicate will you use to check that Page 13

14 the cursor is open or not? (a) Is open (b)is Get (c )Is found (d)is not open 11.Function may return (a) Constant value (b) A variable (c) Null values (d) All of the above 12.What will be returns values? (a) function (b) procedure (c) cursor (d) All of the above 13.Which statement is supported cursor? (a) IS NOT FOUND (b) IS OPEN (c) IS NOT OPEN (d) All of the above 14.If the value of salary is then which value return by function? Create function get_sal(salary int) returns int Begin Declare I int; Case When salary <= then set i=salary+1000; When salary <= then set i= salary+15000; Else set i=0; End case; Return I; End; (a) (b) (c) (d) What will not return the values? (a) function (b) procedure (c) cursor (d) both b and c Page 14

15 (e) both a and b 16.Which clause will be used when procedure just except input as parameter? (a) Out (b) In (c) Not out (d) Not in 17.Which clause will be used when procedure just except output as parameter? (a) Out (b) In (c) Not out (d) Not in 18.Which scalar function is used to know how many rows are associated with cursor? (a) Cursor_rowcount (b) Row_cursorcount (c) Count_cursor (d) Count _cursorrow 19.Which statement is used to retrieve the row from the cursor? (a) Fetch (b) Not found (c) retrive (d) is open 20.Is open predicate is used in? (a) function (b) cursor (c) procedure (d) None of the above True or False We can create function with argument. Function does return value. Procedure does return value. IS OPEN is used to open cursor state. IS FOUND predicate can be used to determine if the cursor contains rows after the execution of a FETCH statement. 6. Call procedure statement is used to call procedure. 7. IS OPEN statement is used to test the state of the cursor. 8. We can call function only single time. Page 15

16 9. We cannot call any function only single time. 10.We can pass cursor as parameter in function. 11.We can pass parameter in procedure. 12.Is not open predicate is used to check whether the cursor state is open or not. 13.Using Call procedure statement to call the function. 14.We can perform operation on weekly typed cursor. 15.We cannot delete any function. 16.Procedure does not support INOUT variable as argument. 17.There is no different between procedure and function. 18.Strongly typed cursor requires row definition. 19.Store procedure can help to improve application performance and reduce database access traffic. 20.Store procedures easily call whenever required. Unit-4 Triggers Fill in the blanks 1. Trigger definitions are stored in table. 2. Contains the trigger definition information, one row for each trigger defined. 3. Contains one row for every dependency of trigger on some other object. 4. trigger activated before integrity constraints are checked. 5. trigger occur after the trigger event executes, and after the database manager checks all constraints. 6. is used to avoid cascading effects. 7. is used after the trigger name. 8. is used to ensure that a new data value is within the proper range. 9. can be used to ensure cross-table dependencies are maintained. 10. is used to Instead-of triggers allows the user to control how modifications applied to view. 11. is used to reduce maintenance of application. 12.Data can be presented to the user in different logical combinations, is called. 13. or are not allowed in trigger. 14.A is a special kind of stored procedure that automatically Page 16

17 executes when an event occurs in the database server. 15. is the default when FOR is the only keyword specified. Answer the following question in short. 1. Define trigger. 2. List out statement when trigger event is used. 3. Which information store in system catalog table? 4. List out catalog view. 5. What is use of SYSCAT.TRIGGERS? 6. Explain different ways of trigger. 7. In which condition the before trigger is used? 8. Which operation is not allowed before trigger? 9. In which condition the before trigger is used? 10.What is used of cascading trigger? 11.Explain instead of trigger. 12.Which table is used to trigger definition? 13.What is database level trigger? 14.What is used of SYSCAT.TRIDEP? 15.What is view? Answer the following question in details. 1. What is trigger? Explain with example. 2. Explain activation way of trigger with example. 3. Explain syntax of trigger. 4. What is use of before trigger? Explain with example. 5. What is use of after trigger? Explain with example. 6. What is cascading trigger? Explain with appropriate example. 7. Explain trigger usage in detail. 8. What is view? Can trigger used with view? Explain with example. Practical based questions 9. Write database trigger, which is fired every time a new disease is added.this trigger checks whether any of the symptoms matches the symptoms of a disease that is already added. If it does, then the fieldno_disease is incremented by one for that particular symptom row in the SYMPTOM table. SYMPTOM (SYMPTOM, NO_DISEASE) DISEASE (DISEASE_NAME,SYMPTOM1,SYMPTOM2,SYMPTOM3) 10. Write a trigger, which accepts applicants whose age is between 18 to 30 only. Page 17

18 Using following table: APPLICANT( AID,ANAME,ADDR,BIRTH_DT) 11. Write a trigger, which allows only those entrance test centre to be inserted which have a minimum capacity of 100. If the capacity is less than 100 then it makes it to 100. Using following table: ENTRANCE_TEST( EITD,ETNAME,MAX_SCORE,CUT_SCORE) 12. Write a trigger to calculate and insert commission on the basis of salary whenever new data is inserted in work table. i. If salary < 5000 then comm =0.5% of salary. ii. If salary < then comm =0.10% of salary. iii. If salary <15000 then comm =0.15% of salary. iv. Else 0.20%. Using following tables: WORK(EMPNO,ENAME,JOB,SAL,COMM) AUDIT_WORK(EMPNO,ENAME,OLD_SAL,NEW_SAL,CDATE) 13. Write a trigger that insert record in AUDIT_WORK whenever any changes occurs in work table.(note : use above tables) Multiple choice questions. 1. Which type of DML statement use in trigger? (a) INSERT (b) UPDATE (c) DELETE (d) All of above 2. Which type of trigger use in db2? (a) Before trigger (b) After trigger (c) Instead of trigger (d) All of above 3. Which place trigger definitions are stored? (a) SYSTEM CATALOG TABLE (b) SYSTEM DATABASE TABLE (c) Data dictionary (d) All of above 4. Which are the catalog views? (a) SYSCAT.TRIGGERS (b) SYSCAT.TRIDEP (c) Both (a) and (b) Page 18

19 (d) None of above 5. Which catalog views contains one row for every dependency of trigger on some other object? (a) SYSCAT.TRIGGERS (b) SYSCAT.TRIDEP (c) Both (a) and (b) (d) None of above 6. Which catalog views Contains the trigger definition information, one row for each trigger defined. (a) SYSCAT.TRIGGERS (b) SYSCAT.TRIDEP (c) Both (a) and (b) (d) None of above 7. Which trigger is activated before integrity constraints check? (a) Before trigger (b) After trigger (c) Instead of trigger (d) All of above 8. Which trigger is used to database manager checks all constraints? (a) Before trigger (b) After trigger (c) Instead of trigger (d) All of above 9. Which operations are not allowed in before trigger? (a) DML (b) DDL (c) Both (a) and (b) (d) None of above 10. Which is used to avoid cascading effects? (a) Cascading effect (b) No cascade (c) Cascading trigger (d) All of above 11. What are the trigger usages? (a) Data validation (b) Data integrity Page 19

20 (c) Data conditioning (d) All of above 12.Which allows the user to control how modifications applied to view? (a) Before trigger (b) After trigger (c) Instead of trigger (d) All of above 13. Which are restrictions in instead of trigger? (a) Only allow on view (a) Always for each row (a) Default values get passed as null. (b) All of above True or False Trigger definitions are stored in system catalog table. A trigger is set of execution action that occurs automatically. Trigger is defined for specific table. A multiple triggers defined for a given table, the order of given trigger activation is based on the trigger creation timestamp. 5. After trigger activated before integrity constraints check. 6. DDL operation not allowed in before trigger. 7. No cascade is used before the trigger name. 8. Data integrity used to ensure cross-table dependencies are maintained. 9. Using trigger can reduce maintenance of application 10.Instead-of triggers allows the user to control how modifications applied to view. 11.Instead of trigger used only on tables, not on view. 12.No cascade is used to remove the effect of cascading. 13.ROLLBACK and COMMIT not allowed in trigger. Unit-5: Transaction Processing Fill in the blanks Page 20

21 1. A DBMS is if at most one user at a time can use the system. 2. allows the computer to execute multiple programs at the same time. 3. The size of a data item is called. 4. is write the value of program variable x into the database item named x. 5. When transaction t reads an item twice and the item is changed by another transaction between two reads is called. 6. A transaction goes into an state immediately after its execution start. 7. A transaction goes into state if one of the checks fails. 8. A transaction is a sequence of and actions that are grouped together to from a database access. 9. The ACID properties of a transaction are (a) (b) (c) (d). 10.The of the DBMS ensures the atomicity of each transaction. 11.A consistent database state is one in which all constraints are satisfied. 12.A transaction that changes the contents of the database must alter the database from one to another. 13. The isolation property is the responsibility of the of DBMS. 14. A transaction that completes its execution successfully is said to be. 15. The objective of is to find non serial schedules. 16. are system with large databases and hundreds of concurrent users executing database transaction. 17.The keeps track of all transaction operations that affect the values of database items. 18. should be enforced by the concurrency control and recovery methods of the DBMS. 19.A single SQL statement is always considered to be. 20.Transaction is a of work that represents real world events of any organization or an enterprise. Answer the following question in short What is the Transaction? Define the Transaction processing System. What is granularity? Define Atomicity. State the characteristics of atomicity. Which are basic operations in Transaction? Define the Dirty read problem. Page 21

22 8. List out ACID properties. 9. What is meaning of the read-only transaction? 10.When we say that the transaction in the committed state? 11.Write a step for executing the read_item(x). 12.Define partially committed state? 13.Give the definition of Rollback. 14.What you mean by interleaved in TPS? 15.What is lock table? 16.When Exclusive lock is applied? How it restriction other transaction? 17.What is conflict serializability? 18.What is Phantoms? 19.What is the two-phase locking? 20.Define isolation. Answer the following question in details Why Recovery is needed? Explain in detail. Explain ACID property in detail. Explain the concurrency control techniques. What is a transaction? What are its properties? Why are transactions important units of operation in a DBMS? 5. What is consistent database state and how is it achieved? 6. What do you mean by atomicity? Why it is important? Explain with an example. 7. What do you mean by consistency? Why it is important? Explain with an example. 8. Explain the truncation state and additional Operation. 9. List and explain the desirable property of transaction. 10.Write the algorithm for the Conflict serializability of scheduling. 11.Write an algorithm for shared lock. 12.Explain two-phase locking protocols? Write its advantage and disadvantages. 13.Draw a state diagram and discussed the typical states that a transaction goes through during executions. 14.How the concept of serializability useful for concurrency control? 15.Discuss the actions taken by the read_item and write_item operations on a database. 16.Describe situation where each of the different isolation levels would be useful for transaction processing. 17.Which of the following schedules is (conflict) serializable? For each serializable schedule,determine the equivalent serial schedules. A: r1(x);r3(x);w1(x);r2(x);w3(x); Page 22

23 B: r1(x);r3(x);w3(x);w1(x); r2(x); C: r3(x);r2(x);w3(x);r1(x);w1(x); D: r3(x);r2(x);r1(x);w3(x);w1(x); 18.What are the different types of lock? 19.Discuss how serializability is used to enforce concurrency control in a database system. Why is serializability sometimes considered too restrictive as a measure of correctness for schedules? 20.What is serializability? What is its objective? Multiple choice questions. 1. A DBMS is if at most one user at a time can use the system. (a) multi user (b) single user (c) couple user (d) All of the above 2. A DBMS is if at most many users at a time can use the system. (a) multi user (b) single user (c) couple user (d) All of the above 3. If the computer system has multiple hardware processor than it call? (a) multi-processing (b) single processing (c) Parallel processing (d) none of the above 4. If the database operations in a transaction do not update but only retrieve data the transaction is (a) Write (b) Read write (c) read only (d) write read 5. The size of the data item is called? (a) data size (b) memory (c) granularity (d) storage 6. When two transactions that access the same database items have their operations interleaved in a way that makes the values of some database items incorrect this problem is call? (a) the lost update problem (b) dirty read (c) summary problem (d) none of them 7. If the updated items are accessed by another transaction before it is changed this problem call? (a) the lost update problem (b) dirty read (c) summary problem (d) none of them 8. If transactions fail because of hardware crashed or network error then this error call? (a)a computer failure (b) system error (c) Disk failure (d) local error Page 23

24 9. Which of the following is the activity of coordinating the actions of process that operate in parallel and access shared data? (a) Transaction management (b) Recovery management (c) Concurrency control (d) None of these 10. Which of the following is transaction property? (a) Isolation (b) Durability (c) Atomicity (d) All of these 11.Which of the following ensures the consistency of the transactions? (a)application programmer (b) concurrency control (c) Recovery management (d) Transaction management 12.Which of the following ensures the durability of the transactions? (a)application programmer (b) concurrency control (c) Recovery management (d) Transaction management 13.Which of the following ensures the isolation of the transactions? (a)application programmer (b) concurrency control (c) Recovery management (d) Transaction management 14.Which of the following ensures the atomicity of the transactions? (a)application programmer (b) concurrency control (c) Recovery management (d) Transaction management 15.Which of the following is a transaction state? (a)active (b) commit (c) Aborted (d) All of these 16.Which of the following is not a transaction management SQL command? (a)commit (b) SELECT (c) SAVEPOINT (d) ROLLBACK 17.Which of the following is a statement after which you cannot issue a COMMIT command? (a)select (b) INSERT (c) UPDATE (d) DELETE 18.Transaction can include following basic database access operations: (a)read_item(x) (b) write_item(x) (c) both (a) and (b)(d) None of these 19.The way to undo the effects of a committed transaction is? (a)recovery (b) Rollback (c)compensating transaction (d) None of these 20. Logical unit of database processing can include following operation. (a) READ and WRITE (b) DELETE (c) UPDATE (d) None of these Page 24

25 True or False 1. The transaction consists of all the operation executed between the beginning and end of the transaction. 2. The changes made to the database by an aborted transaction should be revered or undone. 3. A transaction that is either committed or aborted is said to be terminated. 4. Serializability describes the concurrent execution of several transactions. 5. Application programmer ensures the consistency of the transaction. 6. Transaction management ensures the durability of a transaction. 7. Logical unit of database include only one operation. 8. In multiuser system many user can use system concurrently. 9. A transaction is an atomic unit of work that is either completed in its entirety or not done at all. 10.The log keeps track of all transaction operations that do not affect the values of database items. 11.ACID should be enforced by the concurrency control and recovery methods of the DBMS. 12.A multiple SQL statement is always considered to be atomic. 13.The difference between a serial and Serializable schedule is that a serial schedule is not interleaved, but Serializable schedule is interleaved. 14.The DBMS automatically update the transaction log while executing that modifies the database. 15.A committed transaction that has performed updates transforms the database into a new consistent state. Unit- 6: Concurrency Control Fill in the blanks 1. execution of transaction are based on the concept of locking data items. 2. A binary lock can have 1 indicate. 3. is an operation which removes these permissions from the data item. 4. requires that all transactions should be well-formed. 5. Two phase locking protocols can produce. 6. A must release all its exclusive lock only when it is committed or abort. Page 25

26 7. protocols ensure that the system will never enter into a deadlock state. 8. The scheduler maintains a for detecting cycle. 9. phase transaction can read values of committed data items from the database. 10.The modification of Basic TO algorithm is known as. 11.A shared/exclusive or (read/write) lock uses lock. 12.In a growing phase, a transaction acquires all the required locks without any data. 13.In a shrinking phase, a transaction release and cannot obtain any lock. 14.Two-phase locking is a method of controlling in which all locking operations precede the first unlocking operation. 15.A shared lock exists when concurrent transactions are granted access on the basis of a common lock. 16.Optimistic concurrency control techniques are also called concurrency scheme. Answer the following question in short. 1. Why locking required? 2. List out type of locks used in concurrency control. 3. What is locking? 4. What is unlocking? 5. State all locks mode. 6. Explain exclusive mode. 7. What is lock table? 8. Why lock manager required? 9. What process done in two phase locking? 10.Define Strict 2PL. 11.What is deadlock? 12.List the different deadlock prevention schemes. 13.What is starvation? 14.List out solution for starvation. 15.What is time stamp ordering? 16.List out phases of concurrency control protocol. 17.Define wait-die protocols. 18.What types of locks are needed for inserts and delete operation? 19.What is predicate lock? 20.List two multi version techniques for concurrency control. Page 26

27 Answer the following question in details What is lock? Describe the types of locks used in concurrency control. What is two phase locking protocol? How does it guarantee serializability? Compare binary locks to exclusive/shared locks. Describe the wait-die and wound-wait protocol for deadlock prevention. Describe the cautions waiting, no waiting and timeout protocols for deadlock prevention. 6. What are the rules followed when shared/exclusive locking scheme is used? 7. Prove that strict two-phase locking guarantees strict schedules. 8. Prove that the wait die and wound-wait protocols avoid deadlock and starvation. 9. What is deadlock? How can a deadlock be avoided? 10.What is locking? What is the relevance of lock in database management system? How does a lock work? 11.Discuss the actions taken by read_item and write_item operation on a database. 12.How two phase locking works? Explain using an example. 13.What is timestamp ordering? What are the variants of timestamp ordering? 14. Discuss how a conflict resolved in a timestamp. What are the drawbacks of a timestamp? 15.List the advantages, problems and application of optimistic method of concurrency control. Multiple choice questions. 1. The concurrency control has the following problem: (a) lost updates (b) dirty read (c)unrepeatable read (d) all of these 2. Timestamp must have following properties namely: (a) uniqueness (b) monotonicity (c) both (a) and (b) (d) none of these 3. Which of the following is validation based concurrency control? (a) Read (b) Write (c) Validation (d) all of these 4. The READ and WRITE operations of database with in the same transaction must have (a) same timestamp (b) different timestamp (c)no timestamp (d) none of these 5. Which of the following transaction state when the normal execution of the Page 27

28 transaction cannot proceed? (a) failed (b) active (c) terminated (d) aborted 6. Locking can take place at the following levels: (a) page level (b) database level (c) row level (d) all of these 7. In binary locking,there are (a) one state of locking (b) two state of locking (c) three state of locking (d) none of these 8. Which of the following is not a deadlock handing strategy? (a) Timeout (b) Deadlock annihilation (c) Deadlock prevention (d) Deadlock detection 9. In which of the following schedule are the transactions performed one after another, one at a time? (a) No serial schedule (b) conflict serializable schedule (c) serial schedule (d) none of these 10.A shared lock exists when concurrent transactions are granted the following access on the basis of a common lock: (a) READ (b) WRITE (c) SHRINK (d) UPDATE 11.In a growing phase, a transaction acquire all the required locks (a) by locking data (b) without unlocking any data (c) none of these (d) with unlocking any data 12.In optimistic methods, each transaction moves through the following phases: (a) read phase (b) validation phase (c) write phase (d) all of these 13.The basic variants of timestamp-based methods of concurrency control are (a) total timestamp ordering (b) partial timestamp ordering (c) multi version timestamp ordering (d) All of these 14.Which of the following is an optimistic concurrency control method? (a) Validation-based (b) Time stamp ordering (c) Lock based (d) None of these 15.Which prevention protocols ensure that the system will never enter into a deadlock state? (a) Timeout (b) Deadlock annihilation (c) Deadlock prevention (d) Deadlock detection True or False 1. The objective of concurrency control is to schedule or arrange the transaction Page 28

29 in such a way as to avoid any interference. 2. Incurrent analysis problem is also known as dirty read or unrepeatable read. 3. A consistent database state is one in which all data integrity constraints are satisfied. 4. The serial execution always leaves the database in a consistent state although different results could be produced depending on the order of execution. 5. Cascading rollbacks are not desirable. 6. Two types of locks are READ and WRITE locks. 7. In the two-phase locking, every transaction is divided into (a) growing phase (b) shrinking phase. 8. The size of lock item determines the granularity of the lock. 9. There is no deadlock in the timestamp method of concurrency control. 10.A transaction that changes the contents of the database must alter the database from one consistent state to another. 11.A transaction is said to be in committed state if it has partially committed, and it can be ensured that it will never be aborted. 12.A lost update problem occurs when two transactions that access the same database items have their operations in a way that makes the value of some database item incorrect. 13.Serializability describes the concurrent execution of several transactions. 14.In a shrinking phase, a transaction releases all locks and cannot obtain any new lock. 15.A deadlock in a distributed system may be either local or global. Page 29

Transaction Management

Transaction Management Transaction Management 1) Explain properties of a transaction? (JUN/JULY 2015) Transactions should posses the following (ACID) properties: Transactions should possess several properties. These are often

More information

Chapter 7 (Cont.) Transaction Management and Concurrency Control

Chapter 7 (Cont.) Transaction Management and Concurrency Control Chapter 7 (Cont.) Transaction Management and Concurrency Control In this chapter, you will learn: What a database transaction is and what its properties are What concurrency control is and what role it

More information

Chapter 20 Introduction to Transaction Processing Concepts and Theory

Chapter 20 Introduction to Transaction Processing Concepts and Theory Chapter 20 Introduction to Transaction Processing Concepts and Theory - Logical units of DB processing - Large database and hundreds of transactions - Ex. Stock market, super market, banking, etc - High

More information

Foundation of Database Transaction Processing. Copyright 2012 Pearson Education, Inc.

Foundation of Database Transaction Processing. Copyright 2012 Pearson Education, Inc. Foundation of Database Transaction Processing Copyright 2012 Pearson Education, Inc. Chapter Outline - 17.1 Introduction to Transaction Processing - 17.2 Transaction and System Concepts - 17.3 Desirable

More information

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 13 Managing Transactions and Concurrency

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition Chapter 13 Managing Transactions and Concurrency Objectives In this chapter, you will learn: What a database transaction

More information

transaction - (another def) - the execution of a program that accesses or changes the contents of the database

transaction - (another def) - the execution of a program that accesses or changes the contents of the database Chapter 19-21 - Transaction Processing Concepts transaction - logical unit of database processing - becomes interesting only with multiprogramming - multiuser database - more than one transaction executing

More information

Transaction Management

Transaction Management Transaction Management Imran Khan FCS, IBA In this chapter, you will learn: What a database transaction is and what its properties are How database transactions are managed What concurrency control is

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

Transaction Management. Pearson Education Limited 1995, 2005

Transaction Management. Pearson Education Limited 1995, 2005 Chapter 20 Transaction Management 1 Chapter 20 - Objectives Function and importance of transactions. Properties of transactions. Concurrency Control Deadlock and how it can be resolved. Granularity of

More information

Introduction to Computer Science and Business

Introduction to Computer Science and Business Introduction to Computer Science and Business The Database Programming with PL/SQL course introduces students to the procedural language used to extend SQL in a programatic manner. This course outline

More information

Chapter 22. Transaction Management

Chapter 22. Transaction Management Chapter 22 Transaction Management 1 Transaction Support Transaction Action, or series of actions, carried out by user or application, which reads or updates contents of database. Logical unit of work on

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

Transaction Processing Concepts and Theory. Truong Tuan Anh CSE-HCMUT

Transaction Processing Concepts and Theory. Truong Tuan Anh CSE-HCMUT 1 Transaction Processing Concepts and Theory Truong Tuan Anh CSE-HCMUT 2 Outline Introduction to Transaction Processing Transaction and System Concepts Desirable Properties of Transactions Characterizing

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

Intro to Transactions

Intro to Transactions Reading Material CompSci 516 Database Systems Lecture 14 Intro to Transactions [RG] Chapter 16.1-16.3, 16.4.1 17.1-17.4 17.5.1, 17.5.3 Instructor: Sudeepa Roy Acknowledgement: The following slides have

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

L i (A) = transaction T i acquires lock for element A. U i (A) = transaction T i releases lock for element A

L i (A) = transaction T i acquires lock for element A. U i (A) = transaction T i releases lock for element A Lock-Based Scheduler Introduction to Data Management CSE 344 Lecture 20: Transactions Simple idea: Each element has a unique lock Each transaction must first acquire the lock before reading/writing that

More information

Chapter 5. Concurrency Control Techniques. Adapted from the slides of Fundamentals of Database Systems (Elmasri et al., 2006)

Chapter 5. Concurrency Control Techniques. Adapted from the slides of Fundamentals of Database Systems (Elmasri et al., 2006) Chapter 5 Concurrency Control Techniques Adapted from the slides of Fundamentals of Database Systems (Elmasri et al., 2006) Chapter Outline Purpose of Concurrency Control Two-Phase Locking Techniques Concurrency

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 20 Introduction to Transaction Processing Concepts and Theory Introduction Transaction Describes local unit of database processing Transaction processing systems Systems with large databases and

More information

Transaction Management Chapter 11. Class 9: Transaction Management 1

Transaction Management Chapter 11. Class 9: Transaction Management 1 Transaction Management Chapter 11 Class 9: Transaction Management 1 The Concurrent Update Problem To prevent errors from being introduced when concurrent updates are attempted, the application logic must

More information

Transaction Processing: Basics - Transactions

Transaction Processing: Basics - Transactions Transaction Processing: Basics - Transactions Transaction is execution of program that accesses DB Basic operations: 1. read item(x): Read DB item X into program variable 2. write item(x): Write program

More information

Overview. Introduction to Transaction Management ACID. Transactions

Overview. Introduction to Transaction Management ACID. Transactions Introduction to Transaction Management UVic C SC 370 Dr. Daniel M. German Department of Computer Science Overview What is a transaction? What properties transactions have? Why do we want to interleave

More information

Transaction Management: Introduction (Chap. 16)

Transaction Management: Introduction (Chap. 16) Transaction Management: Introduction (Chap. 16) CS634 Class 14 Slides based on Database Management Systems 3 rd ed, Ramakrishnan and Gehrke What are Transactions? So far, we looked at individual queries;

More information

CSE 444: Database Internals. Lectures Transactions

CSE 444: Database Internals. Lectures Transactions CSE 444: Database Internals Lectures 13-14 Transactions CSE 444 - Spring 2014 1 Announcements Lab 2 is due TODAY Lab 3 will be released today, part 1 due next Monday HW4 is due on Wednesday HW3 will be

More information

Intro to Transaction Management

Intro to Transaction Management Intro to Transaction Management CMPSCI 645 May 3, 2006 Gerome Miklau Slide content adapted from Ramakrishnan & Gehrke, Zack Ives 1 Concurrency Control Concurrent execution of user programs is essential

More information

What are Transactions? Transaction Management: Introduction (Chap. 16) Major Example: the web app. Concurrent Execution. Web app in execution (CS636)

What are Transactions? Transaction Management: Introduction (Chap. 16) Major Example: the web app. Concurrent Execution. Web app in execution (CS636) What are Transactions? Transaction Management: Introduction (Chap. 16) CS634 Class 14, Mar. 23, 2016 So far, we looked at individual queries; in practice, a task consists of a sequence of actions E.g.,

More information

5. Single-row function

5. Single-row function 1. 2. Introduction Oracle 11g Oracle 11g Application Server Oracle database Relational and Object Relational Database Management system Oracle internet platform System Development Life cycle 3. Writing

More information

DB2 Lecture 10 Concurrency Control

DB2 Lecture 10 Concurrency Control DB2 Lecture 10 Control Jacob Aae Mikkelsen November 28, 2012 1 / 71 Jacob Aae Mikkelsen DB2 Lecture 10 Control ACID Properties Properly implemented transactions are commonly said to meet the ACID test,

More information

CSE 190D Database System Implementation

CSE 190D Database System Implementation CSE 190D Database System Implementation Arun Kumar Topic 6: Transaction Management Chapter 16 of Cow Book Slide ACKs: Jignesh Patel 1 Transaction Management Motivation and Basics The ACID Properties Transaction

More information

Security Mechanisms I. Key Slide. Key Slide. Security Mechanisms III. Security Mechanisms II

Security Mechanisms I. Key Slide. Key Slide. Security Mechanisms III. Security Mechanisms II Database Facilities One of the main benefits from centralising the implementation data model of a DBMS is that a number of critical facilities can be programmed once against this model and thus be available

More information

A can be implemented as a separate process to which transactions send lock and unlock requests The lock manager replies to a lock request by sending a lock grant messages (or a message asking the transaction

More information

Concurrency Control. Transaction Management. Lost Update Problem. Need for Concurrency Control. Concurrency control

Concurrency Control. Transaction Management. Lost Update Problem. Need for Concurrency Control. Concurrency control Concurrency Control Process of managing simultaneous operations on the database without having them interfere with one another. Transaction Management Concurrency control Connolly & Begg. Chapter 19. Third

More information

UNIT 2 Set Operators

UNIT 2 Set Operators Course Title: Database Systems ( M.C.A 1 st Semester ) (Evening Batch) UNIT 2 Set Operators Set operators are used to join the results of two (or more) SELECT statements.the SET operators available in

More information

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 17-1

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 17-1 Slide 17-1 Chapter 17 Introduction to Transaction Processing Concepts and Theory Chapter Outline 1 Introduction to Transaction Processing 2 Transaction and System Concepts 3 Desirable Properties of Transactions

More information

1Z0-144 Q&As Oracle Database 11g: Program with PL/ SQL

1Z0-144 Q&As Oracle Database 11g: Program with PL/ SQL CertBus.com 1Z0-144 Q&As Oracle Database 11g: Program with PL/ SQL Pass Oracle 1Z0-144 Exam with 100% Guarantee Free Download Real Questions & Answers PDF and VCE file from: 100% Passing Guarantee 100%

More information

Unit 10.5 Transaction Processing: Concurrency Zvi M. Kedem 1

Unit 10.5 Transaction Processing: Concurrency Zvi M. Kedem 1 Unit 10.5 Transaction Processing: Concurrency 2016 Zvi M. Kedem 1 Concurrency in Context User Level (View Level) Community Level (Base Level) Physical Level DBMS OS Level Centralized Or Distributed Derived

More information

Chapter 18 Concurrency Control Techniques

Chapter 18 Concurrency Control Techniques Chapter 18 Concurrency Control Techniques Copyright 2004 Pearson Education, Inc. Chapter 18 Outline Databases Concurrency Control 1 Purpose of Concurrency Control 2 Two-Phase locking 5 Limitations of CCMs

More information

PL/SQL Block structure

PL/SQL Block structure PL/SQL Introduction Disadvantage of SQL: 1. SQL does t have any procedural capabilities. SQL does t provide the programming technique of conditional checking, looping and branching that is vital for data

More information

TRANSACTION MANAGEMENT

TRANSACTION MANAGEMENT TRANSACTION MANAGEMENT CS 564- Spring 2018 ACKs: Jeff Naughton, Jignesh Patel, AnHai Doan WHAT IS THIS LECTURE ABOUT? Transaction (TXN) management ACID properties atomicity consistency isolation durability

More information

Concurrency Control Techniques

Concurrency Control Techniques Concurrency Control Techniques Chapter 18 March 24, 2008 ADBS: Concurrency control 1 Chapter Objectives Discusses a number of concurrency control techniques that are used to insure the noninterference

More information

TRANSACTION PROCESSING PROPERTIES OF A TRANSACTION TRANSACTION PROCESSING PROPERTIES OF A TRANSACTION 4/3/2014

TRANSACTION PROCESSING PROPERTIES OF A TRANSACTION TRANSACTION PROCESSING PROPERTIES OF A TRANSACTION 4/3/2014 TRANSACTION PROCESSING SYSTEMS IMPLEMENTATION TECHNIQUES TRANSACTION PROCESSING DATABASE RECOVERY DATABASE SECURITY CONCURRENCY CONTROL Def: A Transaction is a program unit ( deletion, creation, updating

More information

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 18-1

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 18-1 Slide 18-1 Chapter 18 Concurrency Control Techniques Chapter 18 Outline Databases Concurrency Control 1. Purpose of Concurrency Control 2. Two-Phase locking 3. Limitations of CCMs 4. Index Locking 5. Lock

More information

Multi-User-Synchronization

Multi-User-Synchronization Chapter 10 Multi-User-Synchronization Database Systems p. 415/569 Why Run TAs Concurrently? We could run all TAs serially (one after the other) This would prevent all unwanted side effects However, this

More information

Distributed Database Management System UNIT-2. Concurrency Control. Transaction ACID rules. MCA 325, Distributed DBMS And Object Oriented Databases

Distributed Database Management System UNIT-2. Concurrency Control. Transaction ACID rules. MCA 325, Distributed DBMS And Object Oriented Databases Distributed Database Management System UNIT-2 Bharati Vidyapeeth s Institute of Computer Applications and Management, New Delhi-63,By Shivendra Goel. U2.1 Concurrency Control Concurrency control is a method

More information

Seminar 3. Transactions. Concurrency Management in MS SQL Server

Seminar 3. Transactions. Concurrency Management in MS SQL Server Seminar 3 Transactions Concurrency Management in MS SQL Server Transactions in SQL Server SQL Server uses transactions to compose multiple operations in a single unit of work. Each user's work is processed

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

Oracle SQL & PL SQL Course

Oracle SQL & PL SQL Course Oracle SQL & PL SQL Course Complete Practical & Real-time Training Job Support Complete Practical Real-Time Scenarios Resume Preparation Lab Access Training Highlights Placement Support Support Certification

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

Database Systems CSE 414

Database Systems CSE 414 Database Systems CSE 414 Lecture 27: Transaction Implementations 1 Announcements Final exam will be on Dec. 14 (next Thursday) 14:30-16:20 in class Note the time difference, the exam will last ~2 hours

More information

ECE 650 Systems Programming & Engineering. Spring 2018

ECE 650 Systems Programming & Engineering. Spring 2018 ECE 650 Systems Programming & Engineering Spring 2018 Database Transaction Processing Tyler Bletsch Duke University Slides are adapted from Brian Rogers (Duke) Transaction Processing Systems Systems with

More information

Implementing Isolation

Implementing Isolation CMPUT 391 Database Management Systems Implementing Isolation Textbook: 20 & 21.1 (first edition: 23 & 24.1) University of Alberta 1 Isolation Serial execution: Since each transaction is consistent and

More information

ISSN: Monica Gahlyan et al, International Journal of Computer Science & Communication Networks,Vol 3(3),

ISSN: Monica Gahlyan et al, International Journal of Computer Science & Communication Networks,Vol 3(3), Waiting Algorithm for Concurrency Control in Distributed Databases Monica Gahlyan M-Tech Student Department of Computer Science & Engineering Doon Valley Institute of Engineering & Technology Karnal, India

More information

CHAPTER 3 RECOVERY & CONCURRENCY ADVANCED DATABASE SYSTEMS. Assist. Prof. Dr. Volkan TUNALI

CHAPTER 3 RECOVERY & CONCURRENCY ADVANCED DATABASE SYSTEMS. Assist. Prof. Dr. Volkan TUNALI CHAPTER 3 RECOVERY & CONCURRENCY ADVANCED DATABASE SYSTEMS Assist. Prof. Dr. Volkan TUNALI PART 1 2 RECOVERY Topics 3 Introduction Transactions Transaction Log System Recovery Media Recovery Introduction

More information

Concurrency Control in Distributed Systems. ECE 677 University of Arizona

Concurrency Control in Distributed Systems. ECE 677 University of Arizona Concurrency Control in Distributed Systems ECE 677 University of Arizona Agenda What? Why? Main problems Techniques Two-phase locking Time stamping method Optimistic Concurrency Control 2 Why concurrency

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

TRANSACTION PROPERTIES

TRANSACTION PROPERTIES Transaction Is any action that reads from and/or writes to a database. A transaction may consist of a simple SELECT statement to generate a list of table contents; it may consist of series of INSERT statements

More information

CSE 344 MARCH 9 TH TRANSACTIONS

CSE 344 MARCH 9 TH TRANSACTIONS CSE 344 MARCH 9 TH TRANSACTIONS ADMINISTRIVIA HW8 Due Monday Max Two Late days Exam Review Sunday: 5pm EEB 045 CASE STUDY: SQLITE SQLite is very simple More info: http://www.sqlite.org/atomiccommit.html

More information

Information Systems (Informationssysteme)

Information Systems (Informationssysteme) Information Systems (Informationssysteme) Jens Teubner, TU Dortmund jens.teubner@cs.tu-dortmund.de Summer 2016 c Jens Teubner Information Systems Summer 2016 1 Part VIII Transaction Management c Jens Teubner

More information

CSC 261/461 Database Systems Lecture 21 and 22. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101

CSC 261/461 Database Systems Lecture 21 and 22. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101 CSC 261/461 Database Systems Lecture 21 and 22 Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101 Announcements Project 3 (MongoDB): Due on: 04/12 Work on Term Project and Project 1 The last (mini)

More information

Transaction Processing: Concurrency Control ACID. Transaction in SQL. CPS 216 Advanced Database Systems. (Implicit beginning of transaction)

Transaction Processing: Concurrency Control ACID. Transaction in SQL. CPS 216 Advanced Database Systems. (Implicit beginning of transaction) Transaction Processing: Concurrency Control CPS 216 Advanced Database Systems ACID Atomicity Transactions are either done or not done They are never left partially executed Consistency Transactions should

More information

Topics in Reliable Distributed Systems

Topics in Reliable Distributed Systems Topics in Reliable Distributed Systems 049017 1 T R A N S A C T I O N S Y S T E M S What is A Database? Organized collection of data typically persistent organization models: relational, object-based,

More information

Weak Levels of Consistency

Weak Levels of Consistency Weak Levels of Consistency - Some applications are willing to live with weak levels of consistency, allowing schedules that are not serialisable E.g. a read-only transaction that wants to get an approximate

More information

Module 15: Managing Transactions and Locks

Module 15: Managing Transactions and Locks Module 15: Managing Transactions and Locks Overview Introduction to Transactions and Locks Managing Transactions SQL Server Locking Managing Locks Introduction to Transactions and Locks Transactions Ensure

More information

T ransaction Management 4/23/2018 1

T ransaction Management 4/23/2018 1 T ransaction Management 4/23/2018 1 Air-line Reservation 10 available seats vs 15 travel agents. How do you design a robust and fair reservation system? Do not enough resources Fair policy to every body

More information

II B.Sc(IT) [ BATCH] IV SEMESTER CORE: RELATIONAL DATABASE MANAGEMENT SYSTEM - 412A Multiple Choice Questions.

II B.Sc(IT) [ BATCH] IV SEMESTER CORE: RELATIONAL DATABASE MANAGEMENT SYSTEM - 412A Multiple Choice Questions. Dr.G.R.Damodaran College of Science (Autonomous, affiliated to the Bharathiar University, recognized by the UGC)Re-accredited at the 'A' Grade Level by the NAAC and ISO 9001:2008 Certified CRISL rated

More information

Introduction to Data Management CSE 344

Introduction to Data Management CSE 344 Introduction to Data Management CSE 344 Unit 7: Transactions Schedules Implementation Two-phase Locking (3 lectures) 1 Class Overview Unit 1: Intro Unit 2: Relational Data Models and Query Languages Unit

More information

Databases - Transactions

Databases - Transactions Databases - Transactions Gordon Royle School of Mathematics & Statistics University of Western Australia Gordon Royle (UWA) Transactions 1 / 34 ACID ACID is the one acronym universally associated with

More information

h p:// Authors: Tomáš Skopal, Irena Holubová Lecturer: Mar n Svoboda, mar

h p://  Authors: Tomáš Skopal, Irena Holubová Lecturer: Mar n Svoboda, mar B0B36DBS, BD6B36DBS: Database Systems h p://www.ksi.m.cuni.cz/~svoboda/courses/172-b0b36dbs/ Lecture 9 Database Transac ons Authors: Tomáš Skopal, Irena Holubová Lecturer: Mar n Svoboda, mar n.svoboda@fel.cvut.cz

More information

Integrity Constraints, Triggers, Transactions and Procedures

Integrity Constraints, Triggers, Transactions and Procedures Integrity Constraints, Triggers, Transactions and Procedures Database and Web Applications Laboratory João Correia Lopes INESC TEC, Faculdade de Engenharia, Universidade do Porto 19 March 2018 1 / 40 Introduction

More information

Chapter 13 : Concurrency Control

Chapter 13 : Concurrency Control Chapter 13 : Concurrency Control Chapter 13: Concurrency Control Lock-Based Protocols Timestamp-Based Protocols Validation-Based Protocols Multiple Granularity Multiversion Schemes Insert and Delete Operations

More information

Database Systems. Announcement

Database Systems. Announcement Database Systems ( 料 ) December 27/28, 2006 Lecture 13 Merry Christmas & New Year 1 Announcement Assignment #5 is finally out on the course homepage. It is due next Thur. 2 1 Overview of Transaction Management

More information

Introduction to Data Management CSE 414

Introduction to Data Management CSE 414 Introduction to Data Management CSE 414 Lecture 23: Transactions CSE 414 - Winter 2014 1 Announcements Webquiz due Monday night, 11 pm Homework 7 due Wednesday night, 11 pm CSE 414 - Winter 2014 2 Where

More information

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered

More information

Chapter 15 : Concurrency Control

Chapter 15 : Concurrency Control Chapter 15 : Concurrency Control What is concurrency? Multiple 'pieces of code' accessing the same data at the same time Key issue in multi-processor systems (i.e. most computers today) Key issue for parallel

More information

Intro to DB CHAPTER 15 TRANSACTION MNGMNT

Intro to DB CHAPTER 15 TRANSACTION MNGMNT Intro to DB CHAPTER 15 TRANSACTION MNGMNT Chapter 15: Transactions Transaction Concept Transaction State Implementation of Atomicity and Durability Concurrent Executions Serializability Recoverability

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

Introduction to Data Management CSE 344

Introduction to Data Management CSE 344 Introduction to Data Management CSE 344 Lecture 22: More Transaction Implementations 1 Review: Schedules, schedules, schedules The DBMS scheduler determines the order of operations from txns are executed

More information

CSE 344 MARCH 25 TH ISOLATION

CSE 344 MARCH 25 TH ISOLATION CSE 344 MARCH 25 TH ISOLATION ADMINISTRIVIA HW8 Due Friday, June 1 OQ7 Due Wednesday, May 30 Course Evaluations Out tomorrow TRANSACTIONS We use database transactions everyday Bank $$$ transfers Online

More information

2 Copyright 2015 M. E. Kabay. All rights reserved. 4 Copyright 2015 M. E. Kabay. All rights reserved.

2 Copyright 2015 M. E. Kabay. All rights reserved. 4 Copyright 2015 M. E. Kabay. All rights reserved. Application Controls CSH6 Chapter 52 Application Controls Myles Walsh Topics Protection in Development Protecting Databases Protecting Batch Files Ensuring that Information in the System is Valid 1 Copyright

More information

Analysis of Transaction and Concurrency Mechanism in Two Way Waiting Algorithm for different Databases

Analysis of Transaction and Concurrency Mechanism in Two Way Waiting Algorithm for different Databases Analysis of Transaction and Concurrency Mechanism in Two Way Waiting Algorithm for different Databases K.CHANDRA SEKHAR Associate Professer, Govt. Degree College(W),Madanapalli. Research Scholer,S.V.University,

More information

Database Tuning and Physical Design: Execution of Transactions

Database Tuning and Physical Design: Execution of Transactions Database Tuning and Physical Design: Execution of Transactions Spring 2018 School of Computer Science University of Waterloo Databases CS348 (University of Waterloo) Transaction Execution 1 / 20 Basics

More information

Problems Caused by Failures

Problems Caused by Failures Problems Caused by Failures Update all account balances at a bank branch. Accounts(Anum, CId, BranchId, Balance) Update Accounts Set Balance = Balance * 1.05 Where BranchId = 12345 Partial Updates - Lack

More information

CS 5300 module6. Problem #1 (10 Points) a) Consider the three transactions T1, T2, and T3, and the schedules S1 and S2.

CS 5300 module6. Problem #1 (10 Points) a) Consider the three transactions T1, T2, and T3, and the schedules S1 and S2. Name CS 5300 module6 Student ID Problem #1 (10 Points) a) Consider the three transactions T1, T2, and T3, and the schedules S1 and S2. T1: r1(x); r1(z); w1(x); T2: r2(y); r2(z); w2(y); T3: w3(x); r3(y);

More information

For more Articles Go To: Whatisdbms.com CONCURRENCY CONTROL PROTOCOL

For more Articles Go To: Whatisdbms.com CONCURRENCY CONTROL PROTOCOL For more Articles Go To: Whatisdbms.com CONCURRENCY CONTROL PROTOCOL In the multi-user system, we all know that multiple transactions run in parallel, thus trying to access the same data and suppose if

More information

Database Systems CSE 414

Database Systems CSE 414 Database Systems CSE 414 Lecture 22: Transaction Implementations CSE 414 - Spring 2017 1 Announcements WQ7 (last!) due on Sunday HW7: due on Wed, May 24 using JDBC to execute SQL from Java using SQL Server

More information

CS352 Lecture - Concurrency

CS352 Lecture - Concurrency CS352 Lecture - Concurrency Objectives: Last revised 11/16/06 1. To introduce locking as a means of preserving the serializability of concurrent schedules. 2. To briefly introduce other approaches to this

More information

CS Reading Packet: "Transaction management, part 2"

CS Reading Packet: Transaction management, part 2 CS 325 - Reading Packet: "Transaction management, part 2" p. 1 Sources: CS 325 - Reading Packet: "Transaction management, part 2" * Ricardo, "Databases Illuminated", Chapter 10, Jones and Bartlett. * Kroenke,

More information

Goal of Concurrency Control. Concurrency Control. Example. Solution 1. Solution 2. Solution 3

Goal of Concurrency Control. Concurrency Control. Example. Solution 1. Solution 2. Solution 3 Goal of Concurrency Control Concurrency Control Transactions should be executed so that it is as though they executed in some serial order Also called Isolation or Serializability Weaker variants also

More information

Databases - Transactions II. (GF Royle, N Spadaccini ) Databases - Transactions II 1 / 22

Databases - Transactions II. (GF Royle, N Spadaccini ) Databases - Transactions II 1 / 22 Databases - Transactions II (GF Royle, N Spadaccini 2006-2010) Databases - Transactions II 1 / 22 This lecture This lecture discusses how a DBMS schedules interleaved transactions to avoid the anomalies

More information

Transaction Management and Concurrency Control. Chapter 16, 17

Transaction Management and Concurrency Control. Chapter 16, 17 Transaction Management and Concurrency Control Chapter 16, 17 Instructor: Vladimir Zadorozhny vladimir@sis.pitt.edu Information Science Program School of Information Sciences, University of Pittsburgh

More information

Question Bank PL/SQL Fundamentals-I

Question Bank PL/SQL Fundamentals-I Question Bank PL/SQL Fundamentals-I UNIT-I Fundamentals of PL SQL Introduction to SQL Developer, Introduction to PL/SQL, PL/SQL Overview, Benefits of PL/SQL, Subprograms, Overview of the Types of PL/SQL

More information

Concurrency Control - Two-Phase Locking

Concurrency Control - Two-Phase Locking Concurrency Control - Two-Phase Locking 1 Last time Conflict serializability Protocols to enforce it 2 Big Picture All schedules Want this as big as possible Conflict Serializable Schedules allowed by

More information

BCA204T: DATA BASE MANAGEMENT SYSTEMS

BCA204T: DATA BASE MANAGEMENT SYSTEMS BCA204T: DATA BASE MANAGEMENT SYSTEMS Page 1 of 12 BCA204T: DATA BASE MANAGEMENT SYSTEMS Unit - V Transaction Processing Concepts: Introduction, Transaction and System Concepts, Desirable properties of

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

CMSC 424 Database design Lecture 22 Concurrency/recovery. Mihai Pop

CMSC 424 Database design Lecture 22 Concurrency/recovery. Mihai Pop CMSC 424 Database design Lecture 22 Concurrency/recovery Mihai Pop Admin Signup sheet for project presentations Recap...1 ACID properties: Atomicity (recovery) Consistency (transaction design,, concurrency

More information

Part VII Data Protection

Part VII Data Protection Part VII Data Protection Part VII describes how Oracle protects the data in a database and explains what the database administrator can do to provide additional protection for data. Part VII contains the

More information

DATABASE TRANSACTIONS. CS121: Relational Databases Fall 2017 Lecture 25

DATABASE TRANSACTIONS. CS121: Relational Databases Fall 2017 Lecture 25 DATABASE TRANSACTIONS CS121: Relational Databases Fall 2017 Lecture 25 Database Transactions 2 Many situations where a sequence of database operations must be treated as a single unit A combination of

More information

CSE 530A ACID. Washington University Fall 2013

CSE 530A ACID. Washington University Fall 2013 CSE 530A ACID Washington University Fall 2013 Concurrency Enterprise-scale DBMSs are designed to host multiple databases and handle multiple concurrent connections Transactions are designed to enable Data

More information

Transaction Management: Concurrency Control

Transaction Management: Concurrency Control Transaction Management: Concurrency Control Yanlei Diao Slides Courtesy of R. Ramakrishnan and J. Gehrke DBMS Architecture Query Parser Query Rewriter Query Optimizer Query Executor Lock Manager Concurrency

More information

A transaction is a sequence of one or more processing steps. It refers to database objects such as tables, views, joins and so forth.

A transaction is a sequence of one or more processing steps. It refers to database objects such as tables, views, joins and so forth. 1 2 A transaction is a sequence of one or more processing steps. It refers to database objects such as tables, views, joins and so forth. Here, the following properties must be fulfilled: Indivisibility

More information