{"id":282,"date":"2015-12-03T14:27:44","date_gmt":"2015-12-03T07:27:44","guid":{"rendered":"http:\/\/www.sqlitetutorial.net\/?page_id=282"},"modified":"2022-04-03T15:03:20","modified_gmt":"2022-04-03T08:03:20","slug":"sqlite-update","status":"publish","type":"page","link":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/","title":{"rendered":"SQLite Update"},"content":{"rendered":"\r\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to use SQLite <code>UPDATE<\/code> statement to update data of existing rows in the table.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Introduction to SQLite UPDATE statement<\/h2>\r\n\r\n\r\n\r\n<p>To update existing data in a table, you use SQLite <code>UPDATE<\/code> statement. The following illustrates the syntax of the <code>UPDATE<\/code> statement:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">UPDATE<\/span> <span class=\"hljs-keyword\">table<\/span>\r\n<span class=\"hljs-keyword\">SET<\/span> column_1 = new_value_1,\r\n    column_2 = new_value_2\r\n<span class=\"hljs-keyword\">WHERE<\/span>\r\n    search_condition \r\n<span class=\"hljs-keyword\">ORDER<\/span> column_or_expression\r\n<span class=\"hljs-keyword\">LIMIT<\/span> <span class=\"hljs-keyword\">row_count<\/span> <span class=\"hljs-keyword\">OFFSET<\/span> <span class=\"hljs-keyword\">offset<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p>In this syntax:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\"><li>First, specify the table where you want to update after the <code>UPDATE<\/code> clause.<\/li><li>Second, set new value for each column of the table in the <code>SET<\/code> clause.<\/li><li>Third, specify rows to update using a condition in the <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-where\/\">WHERE<\/a><\/code> clause. The <code>WHERE<\/code> clause is optional. If you skip it, the <code>UPDATE<\/code> statement will update data in all rows of the table.<\/li><li>Finally, use the <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-order-by\/\">ORDER BY<\/a><\/code> and <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-limit\/\">LIMIT<\/a><\/code> clauses in the <code>UPDATE<\/code> statement to specify the number of rows to update.<\/li><\/ul>\r\n\r\n\r\n\r\n<p>Notice that if use a negative value in the <code>LIMIT<\/code> clause, SQLite assumes that there are no limit and updates all rows that meet the condition in the preceding <code>WHERE<\/code> clause.<\/p>\r\n\r\n\r\n\r\n<p>The <code>ORDER BY<\/code> clause should always goes with the <code>LIMIT<\/code> clause to specify exactly which rows to be updated. Otherwise, you will never know which row will be actually updated; because without the <code>ORDER BY<\/code> clause, the order of rows in the table is unspecified.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">SQLite UPDATE statement examples<\/h2>\r\n\r\n\r\n\r\n<p>We will use the <code>employees<\/code> table in the <a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-sample-database\/\">sample database<\/a> to demonstrate the <code>UPDATE<\/code> statement.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"193\" height=\"344\" src=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png\" alt=\"\" class=\"wp-image-1562\" srcset=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png 193w, https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees-168x300.png 168w\" sizes=\"auto, (max-width: 193px) 100vw, 193px\" \/><\/figure>\r\n\r\n\r\n\r\n<p>The following <code>SELECT<\/code> statement gets partial data from the <code>employees<\/code> table:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\r\n\temployeeid,\r\n\tfirstname,\r\n\tlastname,\r\n\ttitle,\r\n\temail\r\n<span class=\"hljs-keyword\">FROM<\/span>\r\n\temployees;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-update\/#1\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"584\" height=\"186\" src=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Table-Example.jpg\" alt=\"SQLite Update Table Example\" class=\"wp-image-300\" srcset=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Table-Example.jpg 584w, https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Table-Example-300x96.jpg 300w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">1) Update one column example<\/h3>\r\n\r\n\r\n\r\n<p>Suppose, Jane got married and she wanted to change her last name to her husband&#8217;s last name i.e., <code>Smith<\/code>. In this case, you can update Jane&#8217;s last name using the following statement:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">UPDATE<\/span> employees\r\n<span class=\"hljs-keyword\">SET<\/span> lastname = <span class=\"hljs-string\">'Smith'<\/span>\r\n<span class=\"hljs-keyword\">WHERE<\/span> employeeid = <span class=\"hljs-number\">3<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-update\/#2\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\r\n\r\n\r\n\r\n<p>The expression in the <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-where\/\">WHERE<\/a><\/code> clause makes sure that we update Jane&#8217;s record only. We set the <code>lastname<\/code> column to a literal string <code>'Smith'<\/code>.<\/p>\r\n\r\n\r\n\r\n<p>To verify the <code>UPDATE<\/code>, you use the following statement:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\r\n\temployeeid,\r\n\tfirstname,\r\n\tlastname,\r\n\ttitle,\r\n\temail\r\n<span class=\"hljs-keyword\">FROM<\/span>\r\n\temployees\r\n<span class=\"hljs-keyword\">WHERE<\/span>\r\n\temployeeid = <span class=\"hljs-number\">3<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-update\/#3\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"562\" height=\"42\" src=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-One-Column-Example.jpg\" alt=\"SQLite Update One Column Example\" class=\"wp-image-302\" srcset=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-One-Column-Example.jpg 562w, https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-One-Column-Example-300x22.jpg 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">2) Update multiple columns example<\/h3>\r\n\r\n\r\n\r\n<p>Suppose <code>Park Margaret<\/code> locates&nbsp;in <code>Toronto<\/code> and you want to change his address, city, and state information. You can use the <code>UPDATE<\/code> statement to update multiple columns as follows:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">UPDATE<\/span> employees\r\n<span class=\"hljs-keyword\">SET<\/span> city = <span class=\"hljs-string\">'Toronto'<\/span>,\r\n    state = <span class=\"hljs-string\">'ON'<\/span>,\r\n    postalcode = <span class=\"hljs-string\">'M5P 2N7'<\/span>\r\n<span class=\"hljs-keyword\">WHERE<\/span>\r\n    employeeid = <span class=\"hljs-number\">4<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-update\/#4\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\r\n\r\n\r\n\r\n<p>To verify the <code>UPDATE<\/code>, you use the following statement:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\r\n\temployeeid,\r\n\tfirstname,\r\n\tlastname,\r\n\tstate,\r\n\tcity,\r\n\tPostalCode\r\n<span class=\"hljs-keyword\">FROM<\/span>\r\n\temployees\r\n<span class=\"hljs-keyword\">WHERE<\/span>\r\n\temployeeid = <span class=\"hljs-number\">4<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-update\/#5\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"477\" height=\"41\" src=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Multiple-Columns-Example.jpg\" alt=\"SQLite Update Multiple Columns Example\" class=\"wp-image-303\" srcset=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Multiple-Columns-Example.jpg 477w, https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Multiple-Columns-Example-300x26.jpg 300w\" sizes=\"auto, (max-width: 477px) 100vw, 477px\" \/><\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">3) Update with ORDER BY and LIMIT clauses example<\/h3>\r\n\r\n\r\n\r\n<p class=\"note\">Notice that you need to build SQLite with <a href=\"https:\/\/www.sqlite.org\/compile.html#enable_update_delete_limit\">SQLITE_ENABLE_UPDATE_DELETE_LIMIT<\/a> option in order to perform <code>UPDATE<\/code> statement with optional <code>ORDER BY<\/code> and <code>LIMIT<\/code> clauses.<\/p>\r\n\r\n\r\n\r\n<p>Let&#8217;s check the email addresses of employees in the <code>employees<\/code> table:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\r\n\temployeeid,\r\n\tfirstname,\r\n\tlastname,\r\n\temail\r\n<span class=\"hljs-keyword\">FROM<\/span>\r\n\temployees;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-update\/#6\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"435\" height=\"184\" src=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Order-By-Limit.jpg\" alt=\"SQLite Update Order By Limit\" class=\"wp-image-304\" srcset=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Order-By-Limit.jpg 435w, https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Order-By-Limit-300x127.jpg 300w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><\/figure>\r\n\r\n\r\n\r\n<p>To update one row in the <code>employees<\/code> table, you use <code>LIMIT 1<\/code> clause. To make sure that you update the first row of employees sorted by the first name, you add the <code>ORDER BY firstname<\/code> clause.<\/p>\r\n\r\n\r\n\r\n<p>So the following statement updates email of <code>Andrew Adams<\/code>:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">UPDATE<\/span> employees\r\n<span class=\"hljs-keyword\">SET<\/span> email = <span class=\"hljs-keyword\">LOWER<\/span>(\r\n\tfirstname || <span class=\"hljs-string\">\".\"<\/span> || lastname || <span class=\"hljs-string\">\"@chinookcorp.com\"<\/span>\r\n)\r\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\r\n\tfirstname\r\n<span class=\"hljs-keyword\">LIMIT<\/span> <span class=\"hljs-number\">1<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-update\/#7\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"470\" height=\"180\" src=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Order-By-Limit-Example.jpg\" alt=\"SQLite Update Order By Limit Example\" class=\"wp-image-305\" srcset=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Order-By-Limit-Example.jpg 470w, https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-Order-By-Limit-Example-300x115.jpg 300w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/figure>\r\n\r\n\r\n\r\n<p>The new email is the combination of the first name, dot (.), last name and the suffix <code>@chinookcorp.com<\/code><\/p>\r\n\r\n\r\n\r\n<p>The <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-functions\/sqlite-lower\/\">LOWER()<\/a><\/code> function converts the email to lower case.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">4) Update all rows example<\/h3>\r\n\r\n\r\n\r\n<p>To update all rows in the &nbsp;<code>employees<\/code> table, you skip the <code>WHERE<\/code> clause. For example, the following <code>UPDATE<\/code> statement changes all email addresses of all employees to lowercase:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">UPDATE<\/span> employees\r\n<span class=\"hljs-keyword\">SET<\/span> email = <span class=\"hljs-keyword\">LOWER<\/span>(\r\n\tfirstname || <span class=\"hljs-string\">\".\"<\/span> || lastname || <span class=\"hljs-string\">\"@chinookcorp.com\"<\/span>\r\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-update\/#8\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"485\" height=\"182\" src=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-all-Rows-Example.jpg\" alt=\"SQLite Update all Rows Example\" class=\"wp-image-306\" srcset=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-all-Rows-Example.jpg 485w, https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-all-Rows-Example-300x113.jpg 300w, https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-Update-all-Rows-Example-270x100.jpg 270w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><\/figure>\r\n\r\n\r\n\r\n<p>In this tutorial, you have learned how to use the SQLite <code>UPDATE<\/code> statement to update existing data in a table.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">References<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.sqlite.org\/lang_update.html\">https:\/\/www.sqlite.org\/lang_update.html <\/a>&#8211; SQLite Update statement<\/li><\/ul>\r\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"282\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\"\n\t\t\t\tdata-post-title=\"SQLite Update\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"282\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\"\n\t\t\t\tdata-post-title=\"SQLite Update\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to use SQLite UPDATE statement to update data of existing rows in the table.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2,"menu_order":30,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-282","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Learn SQLite UPDATE Statement with Examples<\/title>\n<meta name=\"description\" content=\"This tutorial shows you how to use SQLite UPDATE statement to update existing data in a table. You will also see the UPDATE in action via several examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn SQLite UPDATE Statement with Examples\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you how to use SQLite UPDATE statement to update existing data in a table. You will also see the UPDATE in action via several examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\" \/>\n<meta property=\"og:site_name\" content=\"SQLite Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-03T08:03:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/#\/schema\/person\/6d69b968cad0102e30d6694ed8dc6427\"},\"headline\":\"SQLite Update\",\"datePublished\":\"2015-12-03T07:27:44+00:00\",\"dateModified\":\"2022-04-03T08:03:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\"},\"wordCount\":497,\"image\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\",\"url\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\",\"name\":\"Learn SQLite UPDATE Statement with Examples\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png\",\"datePublished\":\"2015-12-03T07:27:44+00:00\",\"dateModified\":\"2022-04-03T08:03:20+00:00\",\"description\":\"This tutorial shows you how to use SQLite UPDATE statement to update existing data in a table. You will also see the UPDATE in action via several examples.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#primaryimage\",\"url\":\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png\",\"contentUrl\":\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png\",\"width\":193,\"height\":344,\"caption\":\"SQLite concat_ws() Function\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlitetutorial.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQLite Update\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/#website\",\"url\":\"https:\/\/www.sqlitetutorial.net\/\",\"name\":\"SQLite Tutorial\",\"description\":\"A Step-by-step SQLite Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlitetutorial.net\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/#\/schema\/person\/6d69b968cad0102e30d6694ed8dc6427\",\"name\":\"admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learn SQLite UPDATE Statement with Examples","description":"This tutorial shows you how to use SQLite UPDATE statement to update existing data in a table. You will also see the UPDATE in action via several examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/","og_locale":"en_US","og_type":"article","og_title":"Learn SQLite UPDATE Statement with Examples","og_description":"This tutorial shows you how to use SQLite UPDATE statement to update existing data in a table. You will also see the UPDATE in action via several examples.","og_url":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/","og_site_name":"SQLite Tutorial","article_modified_time":"2022-04-03T08:03:20+00:00","og_image":[{"url":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#article","isPartOf":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/"},"author":{"name":"admin","@id":"https:\/\/www.sqlitetutorial.net\/#\/schema\/person\/6d69b968cad0102e30d6694ed8dc6427"},"headline":"SQLite Update","datePublished":"2015-12-03T07:27:44+00:00","dateModified":"2022-04-03T08:03:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/"},"wordCount":497,"image":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/","url":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/","name":"Learn SQLite UPDATE Statement with Examples","isPartOf":{"@id":"https:\/\/www.sqlitetutorial.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png","datePublished":"2015-12-03T07:27:44+00:00","dateModified":"2022-04-03T08:03:20+00:00","description":"This tutorial shows you how to use SQLite UPDATE statement to update existing data in a table. You will also see the UPDATE in action via several examples.","breadcrumb":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlitetutorial.net\/sqlite-update\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#primaryimage","url":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png","contentUrl":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2018\/11\/employees.png","width":193,"height":344,"caption":"SQLite concat_ws() Function"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlitetutorial.net\/sqlite-update\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlitetutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQLite Update"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlitetutorial.net\/#website","url":"https:\/\/www.sqlitetutorial.net\/","name":"SQLite Tutorial","description":"A Step-by-step SQLite Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlitetutorial.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlitetutorial.net\/#\/schema\/person\/6d69b968cad0102e30d6694ed8dc6427","name":"admin"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages\/282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/comments?post=282"}],"version-history":[{"count":1,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages\/282\/revisions"}],"predecessor-version":[{"id":2789,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages\/282\/revisions\/2789"}],"up":[{"embeddable":true,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages\/2"}],"wp:attachment":[{"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/media?parent=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}