SlideShare a Scribd company logo
Er. Nawaraj Bhandari
Topic 10
Supporting Transactions
Transactions
 A transaction is an operation carried out on the database.
 Transactions can generally be identified as retrievals, inserts, updates
and deletes. This is remembered by the acronym CRUD (Create,
Retrieve, Update and Delete).
 Transactions can be made up of one or more operations.
Identify Transactions
What do they do?
What tables do they affect?
What attributes do they affect?
How often do they run?
How many rows do they affect?
Transactions of Appointment System
Transaction 1 – Add a new patient
Transaction 2 – Delete a patient
Transaction 3 – Record a appointment
Transaction 4 – Show a detail list of patient and the appointments they
have had with the doctors
Transaction 5 – Show a list of patients
Transaction 6 – Update a patient record to change their address
 The tables required for this system are Patient, Appointment and
Doctor.
CRUD Matrix of Appointment System (Blank)
Transaction
Relation
Patient Appointment Doctor
T1
T2
T3
T4
T5
T6
CRUD Matrix of Appointment System
Transaction
Relation
Patient Appointment Doctor
T1 C
T2 D
T3 C
T4 R R R
T5 R
T6 U
Transactions in the Boat Hire System
a. Enter the details of all the boats. Update any details for boats. Delete
boats.
b. Enter the details for customers. Update any details for customers.
c. Enter the details for hiring of boats.
d. Enter the details for any damage to boats.
e. List the details of all the boats.
f. List the details of all the customers; their hire and for which boats.
g. List the details for damage, to which boats, during which hire periods and
for which customers.
h. Provide a summary of the hires for a particular period.
Transaction
Relation
Boat Customer Hire Damage
A
B
C
D
E
F
G
H
Blank CRUD Matrix
Transaction
Relation
Boat Customer Hire Damage
A C U D
B C U
C C
D C
E R
F R R R
G R R R R
H R
Completed CRUD Matrix
Literary agent
 Fill in the CRUD matrix below to show the following transactions.
Transaction 1. Add a new Author.
Transaction 2. Create a new agent and set up an appointment for her.
Transaction 3. Delete an author and all the appointments they have
had.
Transaction 4. Show a list of Agents details and the Appointments they
have had and with which Authors.
Transaction 5. Update an Agent’s address
Transaction 6. Delete an Appointment.
Roles in a System
 Not every user is the same.
 Users will need to access different parts of the system and access it
in different ways.
Boat Hire System - Roles
 Manager – should be able to access all parts of the system, because
their role means that they might have to add and delete any data and
be able to see anything.
 Admin Assistant – just carries out routine tasks, such as adding any
new customers and recording damage to boats.
Table/User Boat Customer Rental Damage
Manager CRUD CRUD CRUD CRUD
Admin
Assistant
R CRU CRU CRU
SQL Facilities to Manage Roles
 Grant – gives a particular role or user in the database system access
to an object (such as a table).
 Revoke – removes access to an object (such as a table) from a
particular role or user in the database system.
Grant
 GRANT CREATE ON Boat TO Admin;
This command will give the role of Admin the right to create data on
the table Boat.
 GRANT ALL ON Boat TO Manager;
This command will give the role of Manager the right to carry out any
operation on the table Boat.
Revoke
 REVOKE ALL ON Boat FROM Admin;
– this command will take away any access rights from the role of Admin
on the table Boat.
 REVOKE DELETE ON Boat FROM Manager;
– this command will take away the right to delete data from the Boat
table by the Manager.
Performance
 The term ‘Performance’ is generally used by database professionals to
refer to the way in which a query behaves when run against a
database.
 Increasingly, databases contain large amounts of data...
 The rate at which a query can return an answer can be slowed when it
has to sort though large numbers of records.
 Performance becomes an issue...
Indexes
 An index is a structure in a database that helps queries run more
quickly.
 An index is a data structure that stores the values for a specific
column in a table that makes easier to find a record.
 Improves performance
 Index can also be unique which will prevent a duplicate value from
being added to that column.
Improving Performance with the Use of Views
View of
selected rows
or columns of
these tables
Table 1
Table 2
Table 3
Query
View
 A view is a virtual table which
completely acts as a real table.
 The use of view as a way to improve
performance.
 Views can be used to combine tables,
so that instead of joining tables in a
query, the query will just access the
view and thus be quicker.
View
 We can perform different SQL queries.
 DESC department_worker_view;
De-Normalisation
 Normalising our data model means we will have the minimum amount
of redundancy.
 If we are running a query that joins tables, this will be slower than
running a query against a single table or view. This can have an effect
on performance.
 Denormalisation can be done by including an attribute in a table that
should not be there according to the rules of normalisation.
References
 http://stackoverflow.com/questions/7605707/clustered-vs-non-
clustered
ANY QUESTIONS?

More Related Content

What's hot

Degrees of data abstraction
Degrees of data abstractionDegrees of data abstraction
Degrees of data abstractionMary May Porto
 
Database Design
Database Design Database Design
Database Design
Er. Nawaraj Bhandari
 
Data Abstraction
Data AbstractionData Abstraction
Data Abstraction
A. S. M. Shafi
 
Air Line Management System | DBMS project
Air Line Management System | DBMS projectAir Line Management System | DBMS project
Air Line Management System | DBMS project
AniketHandore
 
Relational Model in dbms & sql database
Relational Model in dbms & sql databaseRelational Model in dbms & sql database
Relational Model in dbms & sql database
gourav kottawar
 
Data abstraction in DBMS
Data abstraction in DBMSData abstraction in DBMS
Data abstraction in DBMS
Papan Sarkar
 
data manipulation language
data manipulation languagedata manipulation language
data manipulation language
JananiSelvaraj10
 
Database Languages.pptx
Database Languages.pptxDatabase Languages.pptx
Database Languages.pptx
MuhammadFarhan858304
 
CQRS introduction
CQRS introductionCQRS introduction
CQRS introductionYura Taras
 
Introduction to DBMS and SQL Overview
Introduction to DBMS and SQL OverviewIntroduction to DBMS and SQL Overview
Introduction to DBMS and SQL Overview
Prabu U
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
DAGEOP LTD
 
Db4 th
Db4 thDb4 th
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
zahid6
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
FaisalGhffar
 
Rdbms
RdbmsRdbms
Data Models
Data ModelsData Models
Data Models
BHARATH KUMAR
 
database management system
database  management systemdatabase  management system
database management system
Vivek Kumar
 

What's hot (20)

Degrees of data abstraction
Degrees of data abstractionDegrees of data abstraction
Degrees of data abstraction
 
RDBMS.ppt
RDBMS.pptRDBMS.ppt
RDBMS.ppt
 
Database Design
Database Design Database Design
Database Design
 
Data Abstraction
Data AbstractionData Abstraction
Data Abstraction
 
Air Line Management System | DBMS project
Air Line Management System | DBMS projectAir Line Management System | DBMS project
Air Line Management System | DBMS project
 
Relational Model in dbms & sql database
Relational Model in dbms & sql databaseRelational Model in dbms & sql database
Relational Model in dbms & sql database
 
Data abstraction in DBMS
Data abstraction in DBMSData abstraction in DBMS
Data abstraction in DBMS
 
data manipulation language
data manipulation languagedata manipulation language
data manipulation language
 
Database Languages.pptx
Database Languages.pptxDatabase Languages.pptx
Database Languages.pptx
 
CQRS introduction
CQRS introductionCQRS introduction
CQRS introduction
 
Introduction to DBMS and SQL Overview
Introduction to DBMS and SQL OverviewIntroduction to DBMS and SQL Overview
Introduction to DBMS and SQL Overview
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
 
Db4 th
Db4 thDb4 th
Db4 th
 
Dbms viva questions
Dbms viva questionsDbms viva questions
Dbms viva questions
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
Rdbms
RdbmsRdbms
Rdbms
 
Data Models
Data ModelsData Models
Data Models
 
database management system
database  management systemdatabase  management system
database management system
 
Dbms
DbmsDbms
Dbms
 

Similar to Supporting Transactions

Transaction
TransactionTransaction
Day01 01 software requirement concepts
Day01 01 software requirement conceptsDay01 01 software requirement concepts
Day01 01 software requirement concepts
Namtướcbóngđêm Virut
 
Teradata 13.10
Teradata 13.10Teradata 13.10
Teradata 13.10
Teradata
 
Trigger in DBMS
Trigger in DBMSTrigger in DBMS
Trigger in DBMS
A. S. M. Shafi
 
Data Dictionary Similarities Discussion.docx
Data Dictionary Similarities Discussion.docxData Dictionary Similarities Discussion.docx
Data Dictionary Similarities Discussion.docx
studywriters
 
22827361 ab initio-fa-qs
22827361 ab initio-fa-qs22827361 ab initio-fa-qs
22827361 ab initio-fa-qsCapgemini
 
Chapter Five Physical Database Design.pptx
Chapter Five Physical Database Design.pptxChapter Five Physical Database Design.pptx
Chapter Five Physical Database Design.pptx
haymanot taddesse
 
Teradata Tutorial for Beginners
Teradata Tutorial for BeginnersTeradata Tutorial for Beginners
Teradata Tutorial for Beginners
rajkamaltibacademy
 
Potter’S Wheel
Potter’S WheelPotter’S Wheel
Potter’S Wheel
Dr Anjan Krishnamurthy
 
sultana.pptx
sultana.pptxsultana.pptx
sultana.pptx
SameerSameer90
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answers
LakshmiSarvani6
 
New folderIMAG2318.jpgNew folderIMAG2319.jpgNew folder.docx
New folderIMAG2318.jpgNew folderIMAG2319.jpgNew folder.docxNew folderIMAG2318.jpgNew folderIMAG2319.jpgNew folder.docx
New folderIMAG2318.jpgNew folderIMAG2319.jpgNew folder.docx
henrymartin15260
 
online blood bank system design
online blood bank system designonline blood bank system design
online blood bank system design
Rohit Jawale
 
transaction management, concept & State
transaction management, concept & Statetransaction management, concept & State
transaction management, concept & State
Surya Swaroop
 
RDB - Repairable Database Systems
RDB - Repairable Database SystemsRDB - Repairable Database Systems
RDB - Repairable Database SystemsAlexey Smirnov
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013
Prosanta Ghosh
 

Similar to Supporting Transactions (20)

Transaction
TransactionTransaction
Transaction
 
Sdd 4
Sdd 4Sdd 4
Sdd 4
 
Day01 01 software requirement concepts
Day01 01 software requirement conceptsDay01 01 software requirement concepts
Day01 01 software requirement concepts
 
Teradata 13.10
Teradata 13.10Teradata 13.10
Teradata 13.10
 
Trigger in DBMS
Trigger in DBMSTrigger in DBMS
Trigger in DBMS
 
Database Testing
Database TestingDatabase Testing
Database Testing
 
Data Dictionary Similarities Discussion.docx
Data Dictionary Similarities Discussion.docxData Dictionary Similarities Discussion.docx
Data Dictionary Similarities Discussion.docx
 
SQL
SQLSQL
SQL
 
22827361 ab initio-fa-qs
22827361 ab initio-fa-qs22827361 ab initio-fa-qs
22827361 ab initio-fa-qs
 
Chapter Five Physical Database Design.pptx
Chapter Five Physical Database Design.pptxChapter Five Physical Database Design.pptx
Chapter Five Physical Database Design.pptx
 
Teradata Tutorial for Beginners
Teradata Tutorial for BeginnersTeradata Tutorial for Beginners
Teradata Tutorial for Beginners
 
Potter’S Wheel
Potter’S WheelPotter’S Wheel
Potter’S Wheel
 
sultana.pptx
sultana.pptxsultana.pptx
sultana.pptx
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answers
 
BA371deliv3
BA371deliv3BA371deliv3
BA371deliv3
 
New folderIMAG2318.jpgNew folderIMAG2319.jpgNew folder.docx
New folderIMAG2318.jpgNew folderIMAG2319.jpgNew folder.docxNew folderIMAG2318.jpgNew folderIMAG2319.jpgNew folder.docx
New folderIMAG2318.jpgNew folderIMAG2319.jpgNew folder.docx
 
online blood bank system design
online blood bank system designonline blood bank system design
online blood bank system design
 
transaction management, concept & State
transaction management, concept & Statetransaction management, concept & State
transaction management, concept & State
 
RDB - Repairable Database Systems
RDB - Repairable Database SystemsRDB - Repairable Database Systems
RDB - Repairable Database Systems
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013
 

Recently uploaded

MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 

Recently uploaded (20)

MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 

Supporting Transactions

  • 1. Er. Nawaraj Bhandari Topic 10 Supporting Transactions
  • 2. Transactions  A transaction is an operation carried out on the database.  Transactions can generally be identified as retrievals, inserts, updates and deletes. This is remembered by the acronym CRUD (Create, Retrieve, Update and Delete).  Transactions can be made up of one or more operations.
  • 3. Identify Transactions What do they do? What tables do they affect? What attributes do they affect? How often do they run? How many rows do they affect?
  • 4. Transactions of Appointment System Transaction 1 – Add a new patient Transaction 2 – Delete a patient Transaction 3 – Record a appointment Transaction 4 – Show a detail list of patient and the appointments they have had with the doctors Transaction 5 – Show a list of patients Transaction 6 – Update a patient record to change their address  The tables required for this system are Patient, Appointment and Doctor.
  • 5. CRUD Matrix of Appointment System (Blank) Transaction Relation Patient Appointment Doctor T1 T2 T3 T4 T5 T6
  • 6. CRUD Matrix of Appointment System Transaction Relation Patient Appointment Doctor T1 C T2 D T3 C T4 R R R T5 R T6 U
  • 7. Transactions in the Boat Hire System a. Enter the details of all the boats. Update any details for boats. Delete boats. b. Enter the details for customers. Update any details for customers. c. Enter the details for hiring of boats. d. Enter the details for any damage to boats. e. List the details of all the boats. f. List the details of all the customers; their hire and for which boats. g. List the details for damage, to which boats, during which hire periods and for which customers. h. Provide a summary of the hires for a particular period.
  • 8. Transaction Relation Boat Customer Hire Damage A B C D E F G H Blank CRUD Matrix
  • 9. Transaction Relation Boat Customer Hire Damage A C U D B C U C C D C E R F R R R G R R R R H R Completed CRUD Matrix
  • 10. Literary agent  Fill in the CRUD matrix below to show the following transactions. Transaction 1. Add a new Author. Transaction 2. Create a new agent and set up an appointment for her. Transaction 3. Delete an author and all the appointments they have had. Transaction 4. Show a list of Agents details and the Appointments they have had and with which Authors. Transaction 5. Update an Agent’s address Transaction 6. Delete an Appointment.
  • 11. Roles in a System  Not every user is the same.  Users will need to access different parts of the system and access it in different ways.
  • 12. Boat Hire System - Roles  Manager – should be able to access all parts of the system, because their role means that they might have to add and delete any data and be able to see anything.  Admin Assistant – just carries out routine tasks, such as adding any new customers and recording damage to boats. Table/User Boat Customer Rental Damage Manager CRUD CRUD CRUD CRUD Admin Assistant R CRU CRU CRU
  • 13. SQL Facilities to Manage Roles  Grant – gives a particular role or user in the database system access to an object (such as a table).  Revoke – removes access to an object (such as a table) from a particular role or user in the database system.
  • 14. Grant  GRANT CREATE ON Boat TO Admin; This command will give the role of Admin the right to create data on the table Boat.  GRANT ALL ON Boat TO Manager; This command will give the role of Manager the right to carry out any operation on the table Boat.
  • 15. Revoke  REVOKE ALL ON Boat FROM Admin; – this command will take away any access rights from the role of Admin on the table Boat.  REVOKE DELETE ON Boat FROM Manager; – this command will take away the right to delete data from the Boat table by the Manager.
  • 16. Performance  The term ‘Performance’ is generally used by database professionals to refer to the way in which a query behaves when run against a database.  Increasingly, databases contain large amounts of data...  The rate at which a query can return an answer can be slowed when it has to sort though large numbers of records.  Performance becomes an issue...
  • 17. Indexes  An index is a structure in a database that helps queries run more quickly.  An index is a data structure that stores the values for a specific column in a table that makes easier to find a record.  Improves performance  Index can also be unique which will prevent a duplicate value from being added to that column.
  • 18. Improving Performance with the Use of Views View of selected rows or columns of these tables Table 1 Table 2 Table 3 Query
  • 19. View  A view is a virtual table which completely acts as a real table.  The use of view as a way to improve performance.  Views can be used to combine tables, so that instead of joining tables in a query, the query will just access the view and thus be quicker.
  • 20. View  We can perform different SQL queries.  DESC department_worker_view;
  • 21. De-Normalisation  Normalising our data model means we will have the minimum amount of redundancy.  If we are running a query that joins tables, this will be slower than running a query against a single table or view. This can have an effect on performance.  Denormalisation can be done by including an attribute in a table that should not be there according to the rules of normalisation.

Editor's Notes

  1. Added Slide
  2. Added Slide
  3. Added Slide
  4. clustered index determines the physical order of the rows in the database