SlideShare a Scribd company logo
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';
 

More Related Content

What's hot

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
 
Manipulating data
Manipulating dataManipulating data
Manipulating data
Syed Zaid Irshad
 
Introduction to oracle functions
Introduction to oracle functionsIntroduction to oracle functions
Introduction to oracle functions
Nitesh Singh
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
sinhacp
 
Les02
Les02Les02
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 base
Salman Memon
 
Les04
Les04Les04
SQL
SQLSQL
Sql
SqlSql
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive data
Amrit Kaur
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
Dhananjay Goel
 
Les04
Les04Les04
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
Felipe Costa
 
Oracle SQL Advanced
Oracle SQL AdvancedOracle SQL Advanced
Oracle SQL Advanced
Dhananjay Goel
 

What's hot (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
 

Viewers also liked

DLM knowledge-sharing
DLM knowledge-sharingDLM knowledge-sharing
DLM knowledge-sharing
Eric 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 Warehousing
Teradata
 
SAP BO and Teradata best practices
SAP BO and Teradata best practicesSAP BO and Teradata best practices
SAP BO and Teradata best practices
Dmitry 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 Architecture
Mohammad Tahoon
 
Teradata introduction
Teradata introductionTeradata introduction
Teradata introduction
Rameejmd
 
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
BigClasses Com
 
Teradata vs-exadata
Teradata vs-exadataTeradata vs-exadata
Teradata vs-exadataLouis liu
 

Viewers also liked (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
 

Similar to Les08

e computer notes - Manipulating data
e computer notes - Manipulating datae computer notes - Manipulating data
e computer notes - Manipulating dataecomputernotes
 
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)
Vidyasagar Mundroy
 
DOODB_LAB.pptx
DOODB_LAB.pptxDOODB_LAB.pptx
DOODB_LAB.pptx
FilestreamFilestream
 
DML Commands
DML CommandsDML Commands
Sql modifying data - MYSQL part I
Sql modifying data - MYSQL part ISql modifying data - MYSQL part I
Sql modifying data - MYSQL part I
Ahmed Farag
 
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
TheVerse1
 
Basic SQL Statments
Basic SQL StatmentsBasic SQL Statments
Basic SQL Statments
Umair Shakir
 
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
Abhishek590097
 
Les09.ppt
Les09.pptLes09.ppt
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptx
EllenGracePorras
 
SQL Query
SQL QuerySQL Query
SQL Query
Imam340267
 
Assignment#02
Assignment#02Assignment#02
Assignment#02
Sunita Milind Dol
 
Sql DML
Sql DMLSql DML
Sql DML
Vikas Gupta
 
Sql DML
Sql DMLSql DML
Sql DML
Vikas Gupta
 
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
Thuan Nguyen
 

Similar to 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
 

More from 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
 

Recently uploaded

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.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.  

Editor's Notes

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