Transactions

Total Page:16

File Type:pdf, Size:1020Kb

Transactions Transactions Controlling Concurrent Behavior Lecture 13 Sub-sets of SQL Data retrieval: SELECT Data Manipulation Language (DML): INSERT, UPDATE, DELETE Data Definition Language (DDL): CREATE, ALTER, DROP, RENAME • Transaction control: COMMIT, ROLLBACK Data Control Language (DCL): GRANT, REVOKE Busy, busy, busy... • In production environments, it is unlikely that we can limit our system to just one user at a time. – Consequently, it is possible for multiple queries to be submitted at approximately the same time. • If all of the queries were very small (i.e., in terms of time), we could probably just execute them on a first-come-first- served basis. • However, many queries are both complex and time consuming. – Executing these queries would make other queries wait a long time for a chance to execute. • So, in practice, the DBMS may be running many different queries at about the same time. Concurrency: two people—one bank account problem • Before withdrawing money, each needs to check if the balance is sufficient • Initially there is 100$ on the account Ryan Monica Balance1 = r(Ryan) 100 Balance2 = r(Monica) 100 Balance2 -= 50 w(Monica) Balance2 50 Balance1 -= 100 w(Ryan) Balance1 0 In fact, the withdrawn amount is 150$ The problem is that the reading and writing operations should be performed as one transaction, their combination should be atomic Transactions • DBMS groups your SQL statements into transactions. • A transaction (ORACLE) consists of series of DML statements, one DDL statement or one DCL statement • By default, your transaction starts with the first executable SQL statement that you issue. The transaction ends when one of the following occurs: – A COMMIT or ROLLBACK are issued – A DDL (CREATE, ALTER, DROP …) or DCL (GRANT, REVOKE) statement is issued – A user properly exits (COMMIT) – System crashes (ROLLBACK) • Once the transaction ends, a new transaction starts with your next executable statement AUTOCOMMIT • Environment variable AUTOCOMMIT is by default set to OFF • A user can set it to SET AUTOCOMMIT ON SET AUTOCOMMIT IMMEDIATE and every SQL statement is written to disk as soon as it is issued. Every statement becomes a transaction • In the middle of transaction, the user can see the changed data by issuing SELECT queries. The user is getting the data from the temporary storage area. Other users cannot see the changes until transaction has been committed Concurrent Modifications • Unlike operating systems, which support interaction of processes, a DMBS needs to keep processes from troublesome interactions. • Even when there is no “failure,” several transactions can interact to turn a consistent state into an inconsistent state. COMMIT and ROLLBACK • The SQL statement COMMIT causes a transaction to complete. – It’s database modifications are now permanent in the database. • The SQL statement ROLLBACK also causes the transaction to end, but by aborting. – No effects on the database. • Failures like division by 0 or a constraint violation can also cause rollback, even if the programmer does not request it. ACID Transactions • ACID transactions are: – Atomic : Whole transaction or none is done. – Consistent : Database constraints preserved. – Isolated : It appears to the user as if only one process executes at a time. • That is, even though actions of several transactions might be interleaved, the net effect is identical to executing all transactions one after another in some serial order. – Durable : Effects of a process survive a crash. • Optional: weaker forms of transactions are often supported as well. Interleaving • For performance reasons, a DBMS has to interleave the actions of several transactions. However, the interleaving must be done carefully… • Consider two transactions T1 and T2, each of which, when running alone preserves database consistency: – T1 transfers $100 from A to B, and – T2 increments both A and B by 1% (e.g. daily interest) – Consider the following interleaving. (1) T1 deducts $100 from A, (2) T2 increments both A and B by 1%, (3) T1 adds $100 to B. – What’s the problem? – B just lost $1. Transactions and Schedules • A transaction is a list of actions. The actions could be: – read, write, commit, abort • A schedule is a list of actions from a set of transactions. E.g. T1 T2 r(A) w(A) r(B) w(B) commit r(C) w(C) commit Anomalies: Reading Uncommitted Data T1 T2 r(A) w(A) r(A) w(A) r(B) w(B) commit r(B) w(B) commit • T1 transfers $100 from A to B, and • T2 increments both A and B by 1% (e.g. daily interest) • The problem is that the bank didn’t pay interest on the $100 that was being transferred. • Of course there would be no problem if we executed T1 and after that T2, or vice versa. Anomalies: Unrepeatable Reads • Suppose that A is the number of copies available for a book. • Transactions T1 and T2 both place an order for this book. First they check the availability of the book. • Consider now the following: 1. T1 checks whether A is greater than 1. Suppose T1 sees (reads) value 1. 2. T2 also reads A and sees 1. 3. T2 decrements A to 0. 4. T2 commits. 5. T1 tries to decrement A, which is now 0, and gets an error because some integrity check doesn’t allow it. • This situation can never arise in a serial execution of T1 and T2. Anomalies: Overwriting uncommitted data • Suppose that Larry and Harry are two employees, and their salaries must be kept equal. • T1 sets their salaries to $1000 and • T2 sets their salaries to $2000. • Now consider the following schedule: T1 T2 r(Larry) w(Larry) r(Harry) w(Harry) r(Harry) $1000 to Harry w(Harry) r(Larry) $2000 to Larry w(Larry) commit commit Unfortunately, Harry will be paid less than Larry. Summarizing the Terminology • A transaction (model) is a sequence of r and w actions on database elements. • A schedule is a sequence of reads/writes actions performed by a collection of transactions. • Serial Schedule = All actions for each transaction are consecutive. r1(A); w1(A); r1(B); w1(B); r2(A); w2(A); r2(B); w2(B); … • Serializable Schedule: A schedule whose “effect” is equivalent to that of some serial schedule. We will introduce a sufficient condition for serializability. Conflicts • There is a conflict if two transactions (i.e. ri, rj, wi, or wj ) access the same data (X or Y) and at least one of them is a write. • ri(X); rj(Y) ≡ rj(Y); ri(X) – i.e. we can always flip ri(X); rj(Y) (even when X=Y). • We can flip ri(X); wj(Y) as long as X≠Y • However, ri(X); wj (X) wj(X); ri (X) – In the RHS, Ti reads the value of X written by Tj, whereas it is not so in the LHS. • We can flip wi(X); wj(Y); provided X≠Y • However, wi(X); wj(X) wj(X); wi(X); – The final value of X may be different depending on which write occurs last. Conflicts (Cont’d) Summarizing, there is a conflict if one of these two conditions hold. 1. A read and a write of the same X, or 2. Two writes of the same X • Such actions conflict in general and may not be swapped in order. • All other events (reads/writes) may be swapped without changing the effect of the schedule (on the DB). Definition • A schedule is conflict-serializable if it can be converted into a serial schedule by a series of non-conflicting swaps of adjacent elements Example r1(A); w1(A); r2(A); w2(A); r1(B); w1(B); r2(B); w2(B) r1(A); w1(A); r2(A); w2(A); r1(B); w1(B); r2(B); w2(B) r1(A); w1(A); r2(A); r1(B); w2(A); w1(B); r2(B); w2(B) r1(A); w1(A); r1(B); r2(A); w2(A); w1(B); r2(B); w2(B) r1(A); w1(A); r1(B); r2(A); w1(B); w2(A); r2(B); w2(B) r1(A); w1(A); r1(B); w1(B); r2(A)w2(A); r2(B); w2(B) Conflict-serializability • Sufficient condition for serializability but not necessary. Example S1: w1(Y); w1(X); w2(Y); w2(X); w3(X); -- This is serial S2: w1(Y); w2(Y); w2(X); w1(X); w3(X); • S2 isn’t conflict serializable, but it is serializable. It has the same effect as S1. – Intuitively, the values of X written by T1 and T2 have no effect, since T3 overwrites them. Serializability/precedence Graphs • Non-swappable pairs of actions represent potential conflicts between transactions. • The existence of non-swappable actions enforces an ordering on the transactions that include these actions. • Nodes: transactions {T1,…,Tk} • Arcs: There is an arc from Ti to Tj if they have conflict access to the same database element X and Ti is first; in written Ti <S Tj. Precedence graphs example 1 r2(A); r1(B); w2(A); r3(A); w1(B); w3(A); r2(B); w2(B) Note the following: .w1(B) <S r2(B) .r2(A) <S w3(A) 1 2 3 These are conflicts since they contain a read/write Conflict serializable on the same element They cannot be swapped. Therefore T1 < T2 < T3 21 Precedence graphs example 2 r2(A); r1(B); w2(A); r2(B); r3(A); w1(B); w3(A); w2(B) Note the following: .r1(B) <S w2(B) 1 2 3 .w2(A) <S w3(A) .r2(B) <S w1(B) Not conflict serializable Here, we have T1 < T2 < T3, but we also have T2 < T1 22 • If there is a cycle in the graph – Then, there is no serial schedule which is conflict- equivalent to S.
Recommended publications
  • Sql Server to Aurora Postgresql Migration Playbook
    Microsoft SQL Server To Amazon Aurora with Post- greSQL Compatibility Migration Playbook 1.0 Preliminary September 2018 © 2018 Amazon Web Services, Inc. or its affiliates. All rights reserved. Notices This document is provided for informational purposes only. It represents AWS’s current product offer- ings and practices as of the date of issue of this document, which are subject to change without notice. Customers are responsible for making their own independent assessment of the information in this document and any use of AWS’s products or services, each of which is provided “as is” without war- ranty of any kind, whether express or implied. This document does not create any warranties, rep- resentations, contractual commitments, conditions or assurances from AWS, its affiliates, suppliers or licensors. The responsibilities and liabilities of AWS to its customers are controlled by AWS agree- ments, and this document is not part of, nor does it modify, any agreement between AWS and its cus- tomers. - 2 - Table of Contents Introduction 9 Tables of Feature Compatibility 12 AWS Schema and Data Migration Tools 20 AWS Schema Conversion Tool (SCT) 21 Overview 21 Migrating a Database 21 SCT Action Code Index 31 Creating Tables 32 Data Types 32 Collations 33 PIVOT and UNPIVOT 33 TOP and FETCH 34 Cursors 34 Flow Control 35 Transaction Isolation 35 Stored Procedures 36 Triggers 36 MERGE 37 Query hints and plan guides 37 Full Text Search 38 Indexes 38 Partitioning 39 Backup 40 SQL Server Mail 40 SQL Server Agent 41 Service Broker 41 XML 42 Constraints
    [Show full text]
  • Declare in Select Statement Sql
    Declare In Select Statement Sql hyperbatically.Israelitish Rube Saturate intergrades and well-nigh.proxy Whit Armour-plated often infibulate Bentley some alwayssuperchargers nickelize unprofessionally his pinnacles if orSaunders tranquilize is sceptical judicially. or nickeled Dynamic SQL statements can be built interactively with flame from users having network or no plague of SQL. We know loop over Rows with foreach, the SET statement will override the road value worth the variable and diminish the NULL value. Run your apps wherever you live them. The SET statement errors out if your query returns more limit one result set as shown below. It makes life easier if the lists in sediment input strings start my end just a comma. Thank you for fashion feedback! MEAN, analytics, and myself first. Foreach Loop container to merit each work the tables in Tables. Postnummer är en bra geografisk indelning för att visualisera kunddata, however, can manage APIs with a fully managed gateway. Repeats a statement or dam of statements while has given. SQL, the compact clause is placed between the INSERT and VALUES clause. Enterprise are for employees to somewhere find company information. On the right where my Excel Worksheet and the Message Box jump the country output going my VBA Macro. Platform for BI, it is machine to beloved that parameters are added to the collection in the american they appear benevolent the SQL, they will emit because of the brightest gravitational waves in entire universe. HAVING clause with any valid SQL expression one is evaluated as inferior true or false label each beat in source query.
    [Show full text]
  • Data Definition Guide © 2020 Embarcadero Technologies, Inc
    Product Documentation InterBase 2020 Update 1 Data Definition Guide © 2020 Embarcadero Technologies, Inc. Embarcadero, the Embarcadero Technologies logos, and all other Embarcadero Technologies product or service names are trademarks or registered trademarks of Embar- cadero Technologies, Inc. All other trademarks are property of their respective owners. Embarcadero Technologies, Inc. is a leading provider of award-winning tools for application developers. Embarcadero enables developers to design systems right, build them faster and run them better, regard- less of their platform or programming language. Ninety of the Fortune 100 and an active community of more than three million users worldwide rely on Embarcadero products to increase productivity, reduce costs and accelerate innovation. The company's flagship tools include: Embarcadero® RAD Studio™, Del- phi®, C++Builder®, JBuilder®, and the IoT Award winning InterBase®. Founded in 1993, Embarcadero is headquartered in Austin, with offices located around the world. Embarcadero is online at www.embar- cadero.com. May, 2020 Table of Contents 2.4. Creating Read-only Databases ............. 23 TABLE OF CONTENTS 3. Altering a Database ................................... 23 4. Dropping a Database ................................ 24 5. Creating a Database Shadow ................... 25 DATA DEFINITION GUIDE .............................. 1 5.1. Advantages of Creating a Database Shadow ......................................................... 25 USING THE DATA DEFINITION GUIDE ......... 2 5.2.
    [Show full text]
  • Dml Commands with Examples
    Dml Commands With Examples Unauthorized and owner-occupied Claus kithe so forthright that Sanford drest his hanging. Hollowed and marshy Sly muted stumpily and accentuate his myopes orthographically and doggedly. Infect and bum Welsh never peek expressively when Derrick snack his arrayal. Read this chapter while sitting at your computer and try out the examples shown. Why do I have to complete a CAPTCHA? Keyword that represents the database object. Plus displays the command prompt again. Oracle messages, or to your operating system manual for system messages. Privacy settings. Learners are offered a joint certificate by the Indian Institute of Management, Indore, and Jigsaw Academy. Drop the original table. These tables will be the reference tables to define positions and departments. And adding data to modifying a table and setting user permissions is accomplished basic! The commonly known DML commands are INSERT, UPDATE and DELETE. DDL statements operate on the entire table. By default, it is a cascade. Messaging service for event ingestion and delivery. Select the document type. It is very useful for my research. The SELECT command used to retrieve data from a tables. List few commands of DDL, DML, and DCL. Data Manipulation Language commands. SQL function and how to call it in various places such as an assignment statement, a Boolean expression, and an SQL statement. This command used to delete all the rows from the table and free the space containing the table. CREATE, DROP, SHOW, TRUNCATE, DESCRIBE, ALTER statements etc. Also specifies what action to take based on the outcome. Everything ranging from creating a table and adding data to modifying a table and setting user permissions is accomplished using Basic SQL commands.
    [Show full text]
  • Progress® Datadirect® for JDBC™ for Apache Cassandra™ User's Guide
    Progress® DataDirect® for JDBC™ for Apache Cassandra™ User's Guide 6.0.0 Release Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. These materials and all Progress® software products are copyrighted and all rights are reserved by Progress Software Corporation. The information in these materials is subject to change without notice, and Progress Software Corporation assumes no responsibility for any errors that may appear therein. The references in these materials to specific platforms supported are subject to change. Corticon, DataDirect (and design), DataDirect Cloud, DataDirect Connect, DataDirect Connect64, DataDirect XML Converters, DataDirect XQuery, DataRPM, Deliver More Than Expected, Icenium, Kendo UI, NativeScript, OpenEdge, Powered by Progress, Progress, Progress Software Developers Network, Rollbase, SequeLink, Sitefinity (and Design), SpeedScript, Stylus Studio, TeamPulse, Telerik, Telerik (and Design), Test Studio, and WebSpeed are registered trademarks of Progress Software Corporation or one of its affiliates or subsidiaries in the U.S. and/or other countries. Analytics360, AppServer, BusinessEdge, DataDirect Spy, SupportLink, DevCraft, Fiddler, JustAssembly, JustDecompile, JustMock, Kinvey, NativeScript Sidekick, OpenAccess, ProDataSet, Progress Results, Progress Software, ProVision, PSE Pro, Sitefinity, SmartBrowser, SmartComponent, SmartDataBrowser, SmartDataObjects, SmartDataView, SmartDialog, SmartFolder, SmartFrame, SmartObjects, SmartPanel, SmartQuery, SmartViewer, SmartWindow, and WebClient are trademarks or service marks of Progress Software Corporation and/or its subsidiaries or affiliates in the U.S. and other countries. Java is a registered trademark of Oracle and/or its affiliates. Any other marks contained herein may be trademarks of their respective owners. Please refer to the readme applicable to the particular Progress product release for any third-party acknowledgements required to be provided in the documentation associated with the Progress product.
    [Show full text]
  • Progress Datadirect for ODBC for Apache Cassandra User©S Guide and Reference
    Progress DataDirect for ODBC for Apache Cassandra User©s Guide and Reference Release 8.0.0 Copyright © 2020 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved. These materials and all Progress® software products are copyrighted and all rights are reserved by Progress Software Corporation. The information in these materials is subject to change without notice, and Progress Software Corporation assumes no responsibility for any errors that may appear therein. The references in these materials to specific platforms supported are subject to change. Corticon, DataDirect (and design), DataDirect Cloud, DataDirect Connect, DataDirect Connect64, DataDirect XML Converters, DataDirect XQuery, DataRPM, Defrag This, Deliver More Than Expected, Icenium, Ipswitch, iMacros, Kendo UI, Kinvey, MessageWay, MOVEit, NativeChat, NativeScript, OpenEdge, Powered by Progress, Progress, Progress Software Developers Network, SequeLink, Sitefinity (and Design), Sitefinity, SpeedScript, Stylus Studio, TeamPulse, Telerik, Telerik (and Design), Test Studio, WebSpeed, WhatsConfigured, WhatsConnected, WhatsUp, and WS_FTP are registered trademarks of Progress Software Corporation or one of its affiliates or subsidiaries in the U.S. and/or other countries. Analytics360, AppServer, BusinessEdge, DataDirect Autonomous REST Connector, DataDirect Spy, SupportLink, DevCraft, Fiddler, iMail, JustAssembly, JustDecompile, JustMock, NativeScript Sidekick, OpenAccess, ProDataSet, Progress Results, Progress Software, ProVision, PSE Pro,
    [Show full text]
  • Database Reliability Engineering DESIGNING and OPERATING RESILIENT DATABASE SYSTEMS
    Database Reliability Engineering DESIGNING AND OPERATING RESILIENT DATABASE SYSTEMS Laine Campbell & Charity Majors Database Reliability Engineering Designing and Operating Resilient Database Systems Laine Campbell and Charity Majors Beijing Boston Farnham Sebastopol Tokyo Database Reliability Engineering by Laine Campbell and Charity Majors Copyright © 2018 Laine Campbell and Charity Majors. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com/safari). For more information, contact our corporate/insti‐ tutional sales department: 800-998-9938 or [email protected]. Editors: Courtney Allen and Virginia Wilson Indexer: Ellen Troutman-Zaig Production Editor: Melanie Yarbrough Interior Designer: David Futato Copyeditor: Bob Russell, Octal Publishing, Inc. Cover Designer: Karen Montgomery Proofreader: Matthew Burgoyne Illustrator: Rebecca Demarest November 2017: First Edition Revision History for the First Edition 2017-10-26: First Release See http://oreilly.com/catalog/errata.csp?isbn=9781491925942 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Database Reliability Engineering, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk.
    [Show full text]
  • Connecting to Your Database
    Connecting to Your Database Appeon PowerBuilder® 2019 R2 FOR WINDOWS DOCUMENT ID: DC37776-01-1900-01 LAST REVISED: March 24, 2020 Copyright © 2019 Appeon. All rights reserved. This publication pertains to Appeon software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement. Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Appeon Inc. Appeon and other Appeon products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Appeon Inc. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP and SAP affiliate company. Java and all Java-based marks are trademarks or registered trademarks of Oracle and/or its affiliates in the U.S. and other countries. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. All other company and product names mentioned may be trademarks of the respective companies with which they are associated. Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.
    [Show full text]
  • Scaling In-Memory Databases on Multicores
    João Paulo da Conceição Soares Mestre em Engenharia Informática Scaling In-Memory databases on multicores Dissertação para obtenção do Grau de Doutor em Engenharia Informática Orientador: Nuno Manuel Ribeiro Preguiça, Professor Associado, Faculdade de Ciências e Tecnologia Universidade Nova de Lisboa Júri Presidente: José Legatheaux Martins Arguentes: Fernando Pedone Alysson N. Bessani Vogais: Rodrigo M. Rodrigues João M. Lourenço Nuno M. Preguiça Outubro, 2015 Scaling In-Memory databases on multicores Copyright © João Paulo da Conceição Soares, Faculty of Sciences and Technology, NOVA University of Lisbon. The Faculdade de Ciências e Tecnologia and the Universidade NOVA de Lisboa have the right, perpetual and without geographical boundaries, to file and publish this dissertation through printed copies reproduced on paper or on digital form, or by any other means known or that may be invented, and to disseminate through scientific repositories and admit its copying and distribution for non-commercial, educational or research purposes, as long as credit is given to the author and editor. Este documento foi gerado utilizando o processador (pdf)LATEX, com base no template “unlthesis” [1] desenvolvido no Dep. Informática da FCT-NOVA [2]. [1] https://github.com/joaomlourenco/unlthesis [2] http://www.di.fct.unl.pt To my parents and my brother, and to my wife and son. Acknowledgements The work presented in this dissertation would not have been possible without the collab- oration of a number of people to whom I would like to express my gratitude. First and foremost I would like to deeply thank my thesis advisor Nuno Preguiça, who, patiently, always helped me to overcome all the challenges that I had to face during my PhD studies.
    [Show full text]
  • Firebird 2.0.7 Release Notes
    Firebird 2.0.7 Release Notes Helen Borrie (Collator/Editor) 5 April 2012 - Document v. 0207_02 - for Firebird 2.0.7 Firebird 2.0.7 Release Notes 5 April 2012 - Document v. 0207_02 - for Firebird 2.0.7 Helen Borrie (Collator/Editor) Table of Contents 1. General Notes .................................................................................................................................... 1 Sub-release 2.0.7 ............................................................................................................................ 1 Sub-release 2.0.6 ............................................................................................................................ 1 Sub-release 2.0.5 ............................................................................................................................ 1 Important Change to API DPB Parameters .............................................................................. 2 Recently Discovered Issues with gfix ...................................................................................... 2 Sub-release 2.0.4 ............................................................................................................................ 2 Sub-release 2.0.3 ............................................................................................................................ 3 Known Issues ........................................................................................................................ 3 Sub-release 2.0.2 ...........................................................................................................................
    [Show full text]
  • Database Migration from Mysql to RDM Server
    MIGRATION GUIDE Database Migration from MySQL to RDM Server A Raima Inc. Embedded Database Migration Guide Published: May, 2009 Author: Daigoro F. Toyama Senior Software Engineer [email protected] Copyright: Raima Inc. All rights reserved Abstract: This document is designed to act as a quick guide to the database migration from MySQL to RDM Server by exposing the differences between the two products with regards to the data types, features and SQL statement syntaxes supported differently between them. This article is relative to the following versions of RDM: In this document, MySQL refers to MySQL 6.0. Likewise, RDM Server (or RDMs) refers to RDM Server 8.2. http://www.raima.com Migration Guide Contents: Abstract: ................................................................................................................................................ 1 Contents: ............................................................................................................................................... 2 Overview................................................................................................................................................ 4 Data Types ............................................................................................................................................ 4 Data Definition Language Statements .................................................................................................... 5 ALTER DATABASE / SCHEMA ........................................................................................................
    [Show full text]
  • SQL Transactions
    DBTechNet DBTech VET SQL Transactions Theory and hands-on exercises In English This publication has been developed in the framework of the project DBTech VET Teachers (DBTech VET). Code: 2012-1-FI1-LEO05-09365. DBTech VET is Leonardo da Vinci Multilateral Transfer of Innovation project, funded by the European Commission and project partners. www.DBTechNet.org DBTech VET Disclaimers This project has been funded with support from the European Commission. This publication [communication] reflects the views only of the authors, and the Commission cannot be held responsible for any use which may be made of the information contained therein. Trademarks of products mentioned are trademarks of the product vendors. SQL Transactions – Theory and Hands-on Exercises Version 1.4 of the first edition 2013 Authors: Martti Laiho, Dimitris A. Dervos, Kari Silpiö Production: DBTech VET Teachers project ISBN 978-952-93-2420-0 (paperback) ISBN 978-952-93-2421-7 (PDF) SQL Transactions – Student's Guide Objectives Reliable data access must be based on properly designed SQL transactions with ZERO TOLERANCE for incorrect data. A programmer who does not understand the required transaction technology can easily violate the data integrity in a database contents and block or slow down the production performance. Just like in traffic, the rules in accessing database must be known and obeyed. The purpose of this tutorial is to present the basics of transaction programming using the mainstream DBMS products. Some typical problems and transaction tuning possibilities are also presented. Target user groups The target groups of this tutorial include teachers, trainers, and students in vocational institutes and industry-oriented higher education institutes.
    [Show full text]