SlideShare une entreprise Scribd logo
1  sur  54
Manipulating Data
Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data Manipulation Language ,[object Object],[object Object],[object Object],[object Object],[object Object]
Adding a New Row to a Table DEPARTMENTS  New  row … insert a new row into the  DEPARMENTS  table…
The  INSERT  Statement Syntax ,[object Object],[object Object],INSERT INTO table  [( column  [ , column... ])] VALUES (value  [ , value... ]);
Inserting New Rows ,[object Object],[object Object],[object Object],[object Object],INSERT INTO departments(department_id, department_name,  manager_id, location_id) VALUES  (70, 'Public Relations', 100, 1700); 1 row created.
Inserting Rows with Null Values ,[object Object],INSERT INTO departments VALUES (100, 'Finance', NULL, NULL); 1 row created. INSERT INTO departments (department_id,  department_name  ) VALUES (30, 'Purchasing'); 1 row created. ,[object Object]
Inserting Special Values ,[object Object],[object Object],INSERT INTO employees (employee_id,  first_name, last_name,  email, phone_number, hire_date, job_id, salary,  commission_pct, manager_id, department_id) VALUES   (113,  'Louis', 'Popp',  'LPOPP', '515.124.4567',  SYSDATE, 'AC_ACCOUNT', 6900,  NULL, 205, 100); 1 row created.
Inserting Specific Date Values ,[object Object],[object Object],INSERT INTO employees VALUES  (114,  'Den', 'Raphealy',  'DRAPHEAL', '515.127.4561', TO_DATE('FEB 3, 1999', 'MON DD, YYYY'), 'AC_ACCOUNT', 11000, NULL, 100, 30); 1 row created.
Creating a Script  ,[object Object],[object Object],INSERT INTO departments  (department_id, department_name, location_id) VALUES  (&department_id, '&department_name',&location); 1 row created.
[object Object],[object Object],[object Object],Copying Rows  from Another Table INSERT INTO sales_reps(id, name, salary, commission_pct) SELECT employee_id, last_name, salary, commission_pct FROM  employees WHERE  job_id LIKE '%REP%'; 4 rows created.
Changing Data in a Table EMPLOYEES Update rows in the  EMPLOYEES  table.
The  UPDATE  Statement Syntax ,[object Object],[object Object],UPDATE table SET column  =  value  [,  column  =  value, ... ] [WHERE  condition ];
[object Object],[object Object],Updating Rows in a Table UPDATE employees SET  department_id = 70 WHERE  employee_id = 113; 1 row updated. UPDATE  copy_emp SET  department_id = 110; 22 rows updated.
Updating Two Columns with a Subquery ,[object Object],[object Object],UPDATE  employees SET  job_id  = (SELECT  job_id  FROM  employees  WHERE  employee_id = 205),  salary  = (SELECT  salary  FROM  employees  WHERE  employee_id = 205)  WHERE  employee_id  =  114; 1 row updated.
Updating Rows Based  on Another Table ,[object Object],[object Object],UPDATE  copy_emp SET  department_id  =  (SELECT department_id FROM employees WHERE employee_id = 100) WHERE  job_id  =  (SELECT job_id FROM employees WHERE employee_id = 200); 1 row updated.
Updating Rows:  Integrity Constraint Error ,[object Object],UPDATE employees * ERROR at line 1: ORA-02291: integrity constraint (HR.EMP_DEPT_FK) violated - parent key not found UPDATE employees SET  department_id = 55 WHERE  department_id = 110;
Removing a Row from a Table  Delete a row from the  DEPARTMENTS  table. DEPARTMENTS
The  DELETE  Statement ,[object Object],[object Object],DELETE [FROM]   table [WHERE   condition ];
[object Object],[object Object],Deleting Rows from a Table DELETE FROM departments WHERE  department_name = 'Finance'; 1 row deleted. DELETE FROM  copy_emp; 22 rows deleted.
Deleting Rows Based  on Another Table ,[object Object],[object Object],DELETE FROM employees WHERE  department_id = (SELECT department_id FROM  departments WHERE  department_name LIKE '%Public%'); 1 row deleted.
Deleting Rows:  Integrity Constraint Error ,[object Object],DELETE FROM departments WHERE  department_id = 60; DELETE FROM departments * ERROR at line 1: ORA-02292: integrity constraint (HR.EMP_DEPT_FK) violated - child record found
Using a Subquery in an  INSERT  Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using a Subquery in an  INSERT  Statement ,[object Object],SELECT employee_id, last_name, email, hire_date,  job_id, salary, department_id FROM  employees WHERE  department_id = 50;
Using the  WITH CHECK OPTION  Keyword on DML Statements ,[object Object],[object Object],INSERT INTO  (SELECT employee_id, last_name, email, hire_date, job_id, salary FROM  employees  WHERE  department_id = 50  WITH CHECK OPTION ) VALUES (99998, 'Smith', 'JSMITH', TO_DATE('07-JUN-99', 'DD-MON-RR'),  'ST_CLERK', 5000); INSERT INTO * ERROR at line 1: ORA-01402: view WITH CHECK OPTION where-clause violation
Overview of the Explicit Default Feature ,[object Object],[object Object],[object Object],[object Object]
Using Explicit Default Values ,[object Object],[object Object],INSERT INTO departments (department_id, department_name, manager_id)  VALUES (300, 'Engineering',  DEFAULT ); UPDATE departments  SET manager_id =  DEFAULT  WHERE department_id = 10;
The  MERGE  Statement ,[object Object],[object Object],[object Object],[object Object],[object Object]
The  MERGE  Statement Syntax ,[object Object],[object Object],MERGE INTO  table_name   table_alias USING ( table|view|sub_query )  alias ON ( join condition ) WHEN MATCHED THEN UPDATE SET  col1 = col_val1, col2 = col2_val WHEN NOT MATCHED THEN INSERT ( column_list ) VALUES ( column_values );
Merging Rows ,[object Object],[object Object],MERGE INTO copy_emp  c USING employees e ON (c.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET c.first_name  = e.first_name, c.last_name  = e.last_name, ... c.department_id  = e.department_id WHEN NOT MATCHED THEN INSERT VALUES(e.employee_id, e.first_name, e.last_name, e.email, e.phone_number, e.hire_date, e.job_id, e.salary, e.commission_pct, e.manager_id,  e.department_id);
Merging Rows MERGE INTO copy_emp c USING employees e ON (c.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET ... WHEN NOT MATCHED THEN INSERT VALUES...; SELECT *  FROM COPY_EMP; no rows selected SELECT *  FROM COPY_EMP; 20 rows selected.
Database Transactions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Database Transactions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Advantages of  COMMIT   and  ROLLBACK  Statements ,[object Object],[object Object],[object Object],[object Object]
Controlling Transactions ROLLBACK  to SAVEPOINT B ROLLBACK  to SAVEPOINT A ROLLBACK SAVEPOINT B SAVEPOINT A DELETE INSERT UPDATE INSERT COMMIT Time Transaction
Rolling Back Changes  to a Marker ,[object Object],[object Object],UPDATE... SAVEPOINT update_done; Savepoint created. INSERT... ROLLBACK TO update_done; Rollback complete.
[object Object],[object Object],[object Object],[object Object],[object Object],Implicit Transaction Processing
State of the Data  Before  COMMIT  or  ROLLBACK ,[object Object],[object Object],[object Object],[object Object]
State of the Data after  COMMIT ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],Committing Data COMMIT; Commit complete. DELETE FROM employees WHERE  employee_id = 99999; 1 row deleted. INSERT INTO departments  VALUES (290, 'Corporate Tax', NULL, 1700); 1 row inserted.
State of the Data After ROLLBACK ,[object Object],[object Object],[object Object],[object Object],[object Object],DELETE FROM copy_emp; 22 rows deleted. ROLLBACK; Rollback complete.
Statement-Level Rollback ,[object Object],[object Object],[object Object],[object Object]
Read Consistency ,[object Object],[object Object],[object Object],[object Object],[object Object]
Implementation of Read Consistency SELECT  * FROM userA.employees; UPDATE employees SET  salary = 7000 WHERE  last_name = 'Goyal'; Data blocks Rollback segments changed and  unchanged data before change “old” data User A User B Read consistent image
Locking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Implicit Locking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary Description Adds a new row to the table Modifies existing rows in the table Removes existing rows from the table Conditionally inserts or updates data in a table Makes all pending changes permanent Is used to rollback to the savepoint marker Discards all pending data changes Statement INSERT UPDATE DELETE MERGE COMMIT SAVEPOINT ROLLBACK In this lesson, you should have learned how to use DML statements and control transactions.
Practice 8 Overview ,[object Object],[object Object],[object Object],[object Object]
 
 
 
 
Read Consistency Example Output  Time  Session 1  Session 2 t1 t2 t3 t4 t5 SELECT salary FROM employees WHERE  last_name='King'; 24000 UPDATE employees SET  salary=salary+10000 WHERE  last_name='King'; 24000 COMMIT; 34000 SELECT salary FROM employees WHERE  last_name='King'; SELECT salary FROM employees WHERE  last_name='King';
 

Contenu connexe

Tendances

Sql server ___________session 3(sql 2008)
Sql server  ___________session 3(sql 2008)Sql server  ___________session 3(sql 2008)
Sql server ___________session 3(sql 2008)Ehtisham Ali
 
Intro to tsql unit 9
Intro to tsql   unit 9Intro to tsql   unit 9
Intro to tsql unit 9Syed Asrarali
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Achmad Solichin
 
Introduction to oracle functions
Introduction to oracle functionsIntroduction to oracle functions
Introduction to oracle functionsNitesh Singh
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functionssinhacp
 
Les02 (restricting and sorting data)
Les02 (restricting and sorting data)Les02 (restricting and sorting data)
Les02 (restricting and sorting data)Achmad Solichin
 
Manipulating Data Oracle Data base
Manipulating Data Oracle Data baseManipulating Data Oracle Data base
Manipulating Data Oracle Data baseSalman Memon
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive dataAmrit Kaur
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries LectureFelipe Costa
 

Tendances (20)

Les20
Les20Les20
Les20
 
Sql server ___________session 3(sql 2008)
Sql server  ___________session 3(sql 2008)Sql server  ___________session 3(sql 2008)
Sql server ___________session 3(sql 2008)
 
Intro to tsql unit 9
Intro to tsql   unit 9Intro to tsql   unit 9
Intro to tsql unit 9
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
Manipulating data
Manipulating dataManipulating data
Manipulating data
 
Introduction to oracle functions
Introduction to oracle functionsIntroduction to oracle functions
Introduction to oracle functions
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 
Module03
Module03Module03
Module03
 
Les02
Les02Les02
Les02
 
Les02 (restricting and sorting data)
Les02 (restricting and sorting data)Les02 (restricting and sorting data)
Les02 (restricting and sorting data)
 
Manipulating Data Oracle Data base
Manipulating Data Oracle Data baseManipulating Data Oracle Data base
Manipulating Data Oracle Data base
 
Les04
Les04Les04
Les04
 
SQL
SQLSQL
SQL
 
Sql
SqlSql
Sql
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive data
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Les11
Les11Les11
Les11
 
Les04
Les04Les04
Les04
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
 
Oracle SQL Advanced
Oracle SQL AdvancedOracle SQL Advanced
Oracle SQL Advanced
 

En vedette

DLM knowledge-sharing
DLM knowledge-sharingDLM knowledge-sharing
DLM knowledge-sharingEric Ren
 
5 Years of Progress in Active Data Warehousing
5 Years of Progress in Active Data Warehousing5 Years of Progress in Active Data Warehousing
5 Years of Progress in Active Data WarehousingTeradata
 
SAP BO and Teradata best practices
SAP BO and Teradata best practicesSAP BO and Teradata best practices
SAP BO and Teradata best practicesDmitry Anoshin
 
Teradata introduction - A basic introduction for Taradate system Architecture
Teradata introduction - A basic introduction for Taradate system ArchitectureTeradata introduction - A basic introduction for Taradate system Architecture
Teradata introduction - A basic introduction for Taradate system ArchitectureMohammad Tahoon
 
Teradata introduction
Teradata introductionTeradata introduction
Teradata introductionRameejmd
 
Introduction to Teradata And How Teradata Works
Introduction to Teradata And How Teradata WorksIntroduction to Teradata And How Teradata Works
Introduction to Teradata And How Teradata WorksBigClasses Com
 
Teradata vs-exadata
Teradata vs-exadataTeradata vs-exadata
Teradata vs-exadataLouis liu
 

En vedette (7)

DLM knowledge-sharing
DLM knowledge-sharingDLM knowledge-sharing
DLM knowledge-sharing
 
5 Years of Progress in Active Data Warehousing
5 Years of Progress in Active Data Warehousing5 Years of Progress in Active Data Warehousing
5 Years of Progress in Active Data Warehousing
 
SAP BO and Teradata best practices
SAP BO and Teradata best practicesSAP BO and Teradata best practices
SAP BO and Teradata best practices
 
Teradata introduction - A basic introduction for Taradate system Architecture
Teradata introduction - A basic introduction for Taradate system ArchitectureTeradata introduction - A basic introduction for Taradate system Architecture
Teradata introduction - A basic introduction for Taradate system Architecture
 
Teradata introduction
Teradata introductionTeradata introduction
Teradata introduction
 
Introduction to Teradata And How Teradata Works
Introduction to Teradata And How Teradata WorksIntroduction to Teradata And How Teradata Works
Introduction to Teradata And How Teradata Works
 
Teradata vs-exadata
Teradata vs-exadataTeradata vs-exadata
Teradata vs-exadata
 

Similaire à Les08 (20)

e computer notes - Manipulating data
e computer notes - Manipulating datae computer notes - Manipulating data
e computer notes - Manipulating data
 
Les06
Les06Les06
Les06
 
Les09
Les09Les09
Les09
 
Database Systems - SQL - DDL Statements (Chapter 3/3)
Database Systems - SQL - DDL Statements (Chapter 3/3)Database Systems - SQL - DDL Statements (Chapter 3/3)
Database Systems - SQL - DDL Statements (Chapter 3/3)
 
DOODB_LAB.pptx
DOODB_LAB.pptxDOODB_LAB.pptx
DOODB_LAB.pptx
 
DML Commands
DML CommandsDML Commands
DML Commands
 
Sql modifying data - MYSQL part I
Sql modifying data - MYSQL part ISql modifying data - MYSQL part I
Sql modifying data - MYSQL part I
 
2. DBMS Experiment - Lab 2 Made in SQL Used
2. DBMS Experiment - Lab 2 Made in SQL Used2. DBMS Experiment - Lab 2 Made in SQL Used
2. DBMS Experiment - Lab 2 Made in SQL Used
 
Basic SQL Statments
Basic SQL StatmentsBasic SQL Statments
Basic SQL Statments
 
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQueryPPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
 
Les09.ppt
Les09.pptLes09.ppt
Les09.ppt
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptx
 
SQL Query
SQL QuerySQL Query
SQL Query
 
Sql dml & tcl 2
Sql   dml & tcl 2Sql   dml & tcl 2
Sql dml & tcl 2
 
Assignment#02
Assignment#02Assignment#02
Assignment#02
 
Sql DML
Sql DMLSql DML
Sql DML
 
Sql DML
Sql DMLSql DML
Sql DML
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03
 

Plus de Vijay Kumar (14)

Les19
Les19Les19
Les19
 
Les15
Les15Les15
Les15
 
Les16
Les16Les16
Les16
 
Les14
Les14Les14
Les14
 
Les13
Les13Les13
Les13
 
Les12
Les12Les12
Les12
 
Les10
Les10Les10
Les10
 
Les07
Les07Les07
Les07
 
Les09
Les09Les09
Les09
 
Les06
Les06Les06
Les06
 
Les05
Les05Les05
Les05
 
Les04
Les04Les04
Les04
 
Les03
Les03Les03
Les03
 
Les02
Les02Les02
Les02
 

Dernier

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Dernier (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Les08

  • 2.
  • 3.
  • 4. Adding a New Row to a Table DEPARTMENTS New row … insert a new row into the DEPARMENTS table…
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. Changing Data in a Table EMPLOYEES Update rows in the EMPLOYEES table.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. Removing a Row from a Table Delete a row from the DEPARTMENTS table. DEPARTMENTS
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. Merging Rows MERGE INTO copy_emp c USING employees e ON (c.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET ... WHEN NOT MATCHED THEN INSERT VALUES...; SELECT * FROM COPY_EMP; no rows selected SELECT * FROM COPY_EMP; 20 rows selected.
  • 32.
  • 33.
  • 34.
  • 35. Controlling Transactions ROLLBACK to SAVEPOINT B ROLLBACK to SAVEPOINT A ROLLBACK SAVEPOINT B SAVEPOINT A DELETE INSERT UPDATE INSERT COMMIT Time Transaction
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44. Implementation of Read Consistency SELECT * FROM userA.employees; UPDATE employees SET salary = 7000 WHERE last_name = 'Goyal'; Data blocks Rollback segments changed and unchanged data before change “old” data User A User B Read consistent image
  • 45.
  • 46.
  • 47. Summary Description Adds a new row to the table Modifies existing rows in the table Removes existing rows from the table Conditionally inserts or updates data in a table Makes all pending changes permanent Is used to rollback to the savepoint marker Discards all pending data changes Statement INSERT UPDATE DELETE MERGE COMMIT SAVEPOINT ROLLBACK In this lesson, you should have learned how to use DML statements and control transactions.
  • 48.
  • 49.  
  • 50.  
  • 51.  
  • 52.  
  • 53. Read Consistency Example Output Time Session 1 Session 2 t1 t2 t3 t4 t5 SELECT salary FROM employees WHERE last_name='King'; 24000 UPDATE employees SET salary=salary+10000 WHERE last_name='King'; 24000 COMMIT; 34000 SELECT salary FROM employees WHERE last_name='King'; SELECT salary FROM employees WHERE last_name='King';
  • 54.  

Notes de l'éditeur

  1. Schedule: Timing Topic 60 minutes Lecture 30 minutes Practice 90 minutes Total