Example T1: T2: Constraint: Susan’s salary = Jane’s salary

Slides:



Advertisements
Similar presentations
Introduction to Relational Database Systems 1 Lecture 4.
Advertisements

Task: Add a Role To see this in PennWorks...click herehere Task Definition: Add additional roles to an existing employee’s record. Steps – From the Roles/Distributions.
Task: Add/Update Distributions To see this in PennWorks...click herehere Task Definition: Add, update or delete distribution(s). Steps – From the Task.
Task: Reclassification To see this in PennWorks...click herehere Task Definition: Reclassify an employee record. In this task – Update the information.
CA200 (based on the book by Prof. Jane M. Horgan)
3B-1 Human Resources Example u Key class: Employee l Structure: Number Name Salary Set of skills l Behaviour: Access attributes Update attributes u Database:
Cs44321 CS4432: Database Systems II Lecture #19 Database Consistency and Transactions Professor Elke A. Rundensteiner.
Work-in dept DID emp salarynames manage names EID Can be Pkey Solution for the Quiz –Problem 1.
Ch. 5 The Normal Curve Comparing histograms to the normal curve Interpretation of SDs and areas.

Data Analysis – Mean, Median, and Mode Mean, median and mode are different methods used to evaluate sets of data.
Manager Self-Service Presented by: Amanda Noday, Payroll Manager.
Click on “SUPERUSER” Please Enter Superuser Login Details and click on Login button.
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
MIRMA SPRING TRAINING 2014 PRESENTED BY JANE DRUMMOND EMPLOYEES AND THE SUNSHINE LAW EMPLOYMENT PRACTICS UPDATE.
Sample Problem Chapter 10 Determining social security withholding. The monthly salaries for December and the year-to-date earnings of the employees of.
Recap of SQL Lab no 8 Advance Database Management System.
GOALS BUSINESS MATH© Thomson/South-WesternLesson 1.1Slide 1 1.1Hourly Pay and Salary Calculate gross pay for hourly-rate employees Calculate gross pay.
How To: Query Task Definition: View and compare salary increase % and amounts across employee roles/pools using filters. Steps – From the Query menu option.
ANOVA GenderManagement Level Average Salary MaleSupervisory 47,500 MaleMid-level 68,000 MaleExecutive122,550 FemaleSupervisory 45,300 FemaleMid-level 61,000.
Support staff workplace responsibilities Scenario 2 - Murray.
JOB EVALUATION A Tool for Measuring Internal Equity September 2009.
Relational Algebra Sample Questions.
Tony Roupell K2 Technical Sales Specialist K2 Australia.
1 VIEW Structured Query Language (SQL) - Part IV.
Database Management COP4540, SCS, FIU Database Trigger.
Update on Retirement Advisory Committee March 17, 2011.
The Termination Process of an Employee Presented by: Susan Stimpson Elaine Saltsman Bethany College.
本课内容导读: 一、传统戏曲的表现内容 二、传统戏曲的特点 三、现代戏曲出现了哪些新变化 一、传统戏曲的表现内容 传统戏曲的表现内容大体来说可以分 为三类,通过下面三个戏曲片段的欣赏, 我们共同总结一下是哪三类。
Advanced SQL. SQL - Nulls Nulls are not equal to anything - Null is not even equal to Null where columna != ‘ABC’ --this will not return records where.
MUTIA NISRINA SARI JOB ANALYSIS. DEFINITION OF JOB ANALYSIS Job analysis is the process of collection and examination of work activities.
1 Headline Hiring Statistics.
I Wanted To Order This Book
Payroll Manual.
DML – INSERT COMMAND TABLE - EMPLOYEE ID NAME PLACE DOB SALARY 1 ARUN
LESSON 19-2 Maintaining Manufacturing Records
Comparison Operators Relational Operators.
Adjusting Entries Examples
Services Transportation Construction Retail Finance Wholesale -5.2%
2a. Number and percentage of construction establishments and employees, by establishment size, 2012 (With payroll) Establishment size.
(مفهوم شناسي، سياستها، قوانين و مقررات حاكم بر آن)
(مفهوم شناسي، سياستها، قوانين و مقررات حاكم بر آن)
To see this in Salary Increase Modeling ...click here.
To see this in Salary Increase Modeling ...click here.
28a. Percentage of employees having a high school diploma or higher education, by industry, 2005 (All types of employment)
Skills for Care update Laura Anthony Locality Manager – SW London.
To see this in Salary Increase Modeling ...click here.
“Manipulating Data” Lecture 6.
DATABASE SQL= Structure Query Language مبادئ قواعد بيانات
Job End Date Project Lisa Gamboa HR Consulting Group Manager
To see this in Salary Increase Modeling ...click here.
LESSON 12-1 Preparing Payroll Time Cards
ANALYZING A PAYROLL TIME CARD
“Manipulating Data” Lecture 6.
SQL Subquery.
26a. Percentage of employees covered and source of employment-based health insurance, by industry, 2005 (Wage-and-salary workers) 96%
ALA-APA Fiscal 2016 Year End Results Susan Hildreth – Treasurer
Using CASE Value expression
For Board Meeting Updated Projected Budget Deficits FY 2012/13 $ --
Section 5 Multiple Regression.
In Class Exercises Phil Tayco Slide version 1.1 San Jose City College
LESSON 19-2 Maintaining Manufacturing Records
LESSON 12-1 Preparing Payroll Time Cards
L.E.900 per month as basic salary (of which L.E.100 special security).
Changes to Annual Salary Distribution Policy SAPP
U = = (6.25%)  (3) The processor calculates the employee’s
Target Language English Created by Jane Driver.
ANALYZING A PAYROLL TIME CARD
Business Intent Presentation
Update on Professional Learning: Salary Days
Presentation transcript:

Example T1: T2: Constraint: Susan’s salary = Jane’s salary UPDATE Employee SET salary = salary + 100 WHERE name = ‘Susan’ WHERE name = ‘Jane’ T2: UPDATE Employee SET salary = salary * 2 WHERE name = ‘Susan’ WHERE name = ‘Jane’ Constraint: Susan’s salary = Jane’s salary

(A: Susan’s salary, B: Jane’s salary) Example T1: Read(A) A <- A+100 Write(A) Read(B) B <- B+100 Write(B) T2: Read(A) A <- A*2 Write(A) Read(B) B <- B*2 Write(B) (A: Susan’s salary, B: Jane’s salary) Constraint: A=B

Schedule A A B 25 25 125 250 250 250 T1 Read(A); A <- A+100; 25 25 125 250 250 250 T1 Read(A); A <- A+100; Write(A); Read(B); B <- B+100; Write(B); T2 Read(A);A <- A*2; Write(A); Read(B);B <- B*2; Write(B)

Schedule B A B 25 25 50 150 150 150 T1 Read(A); A <- A+100 25 25 50 150 150 150 T1 Read(A); A <- A+100 Write(A); Read(B); B <- B+100; Write(B); T2 Read(A);A <- A*2; Write(A); Read(B);B <- B*2; Write(B);

Schedule C A B 25 25 T1 T2 Read(A); A <- A+100 125 Write(A); 250 25 25 125 250 250 250 T1 Read(A); A <- A+100 Write(A); Read(B); B <- B+100; Write(B); T2 Read(A);A <- A*2; Write(A); Read(B);B <- B*2; Write(B);

Schedule D A B 25 25 T1 T2 Read(A); A <- A+100 125 Write(A); 250 25 25 125 250 50 150 250 150 T1 Read(A); A <- A+100 Write(A); Read(B); B <- B+100; Write(B); T2 Read(A);A <- A*2; Write(A); Read(B);B <- B*2; Write(B);

Precedence Graph and Conflict Serializability PRECEDENCE GRAPH P(S) Nodes: transactions in S Edges: Ti -> Tj if 1) pi(A), qj(A) are actions in S 2) pi(A) precedes qj(A) 3) At least one of pi, qj is a write THEOREM: P(S) is acyclic <=> S is conflict serializable

Rigorous Two-Phase Locking Rule (1) Ti locks tuple A before read/write Rule (2) If Ti holds the lock on A, no other transaction is granted the lock on A Rule (3) Release the lock at commit 8 8

Rigorous Two-Phase Locking (R2PL) # locks held by Ti Time Commit 9 9

Two-Phase Locking (2PL) Rule (1) Ti locks tuple A before read/write Rule (2) If Ti holds the lock on A, no other transaction is granted the lock on A Rule (3): Growing stage: Ti may obtain locks, but may not release any lock Shrinking stage: Ti my release locks, but may not obtain any new locks 10 10

Two-Phase Locking # locks held by Ti Time Growing Shrinking Phase Phase 11 11

Logging Log T1 Read(A); A←A-50; Write(A); Read(B); B←B+50; Write(B); Commit T2 Read(C);C←C*2; Write(C); Commit 1 <T1, start> 2 <T1, A, 100, 50> 3 <T2, start> 4 <T2, C, 100, 200> 5 <T2, commit> 6 <T1, B, 100, 150> 7 <T1, commit> 12 12

SQL Isolation Levels Dirty read Non-repeatable read Phantom Read uncommitted Y Read committed N Repeatable read Serializable

Dirty Read May be Okay T2: T1: SELECT salary UPDATE Employee FROM Employee WHERE name = ‘John’ T1: UPDATE Employee SET salary = salary + 100 After T1 updates John’s salary, T2 should wait until T1 commits Sometimes, it may be okay to read uncommitted John’s salary

Non-repeatable Read May Be Okay UPDATE Employee SET salary = salary + 100 WHERE name = ‘John’ T2: (S1) SELECT salary FROM Employee ... (S2) SELECT salary FROM Employee To guarantee “Isolation,” S1 and S2 should return the same value Sometimes it may be okay to return different value

Phantom May Be Okay Originally, SUM(Employee.salary) = $100,000 T1: INSERT INTO Employee (e1, 1000), (e2, 1000) T2: SELECT SUM(salary) FROM Employee T2 should return either $100,000 or $102,000 Sometimes, it may be fine for T2 to see only e2 and return $101,000

Mixing Isolation Levels T1: T2: UPDATE Employee SELECT salary SET salary = salary + 100 FROM Employee ROLLBACK WHERE name = ‘John’ T1: Serializable, T2: Serializable. What may T2 return? T1: Serializable, T2: Read uncommitted, What may T2 return?