{"id":193878,"date":"2025-03-03T06:30:00","date_gmt":"2025-03-03T05:30:00","guid":{"rendered":"https:\/\/liora.io\/en\/?p=193878"},"modified":"2026-02-06T07:48:12","modified_gmt":"2026-02-06T06:48:12","slug":"managing-table-data-in-sql","status":"publish","type":"post","link":"https:\/\/liora.io\/en\/managing-table-data-in-sql","title":{"rendered":"Managing Table Data: INSERT, UPDATE, DELETE with SQL"},"content":{"rendered":"<strong>Tables store data that can be used or referenced in the future. Over time, it is common to modify this data to ensure it remains relevant and up-to-date. In this article, you will learn three essential SQL commands to modify data: UPDATE, INSERT, and DELETE.<\/strong>\n\n<style><br \/>\n.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}<\/style>\n<h2><b>UPDATE: Changing Existing Data<\/b><\/h2>\nThe UPDATE statement allows you to modify existing records in a table.\n\n<b>Example:<\/b>\n\nImagine you have a <b>Product Information Table (<\/b><b>product_info<\/b><b>)<\/b> for your kitchenware business. This table contains details about all products, including attributes such as product_id, product_name, weight, material, fabrication_country, cost, and price.\n\n<b>Before Update:<\/b>\n\n<style><br \/>\n.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=\".svg\"]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}<\/style>\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"1102\" height=\"152\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image3-2.webp\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image3-2.webp 1102w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image3-2-300x41.webp 300w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image3-2-1024x141.webp 1024w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image3-2-768x106.webp 768w\" sizes=\"(max-width: 1102px) 100vw, 1102px\">\n\nIf the cost of borosilicate glass, used in your glass baking pan, increases, you need to update the cost data for this specific product.\n\n<b>SQL Script:<\/b>\n<p style=\"padding-left: 40px;\">UPDATE product_info<\/p>\n<p style=\"padding-left: 40px;\">SET cost = cost * 1.25<\/p>\n<p style=\"padding-left: 40px;\">WHERE product_name = &#8216;baking pan&#8217; AND material = &#8216;glass&#8217;;<\/p>\n<b>After Update:<\/b>\n\n<img decoding=\"async\" width=\"1102\" height=\"152\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2.webp\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2.webp 1102w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2-300x41.webp 300w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2-1024x141.webp 1024w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2-768x106.webp 768w\" sizes=\"(max-width: 1102px) 100vw, 1102px\">\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center\"><div class=\"wp-block-button \"><a class=\"wp-block-button__link wp-element-button \" href=\"\/en\/courses\/data-ai\/data-scientist\">Master SQL for data science<\/a><\/div><\/div>\n\n<h2><b>INSERT: Adding New Data<\/b><\/h2>\nThe INSERT statement allows you to add new records to a table.\n\n<b>Example:<\/b>\n\nAs environmental concerns grow, sustainable materials are becoming popular. You decide to introduce a new baking pan made of <b>carbon steel<\/b>, which is durable, versatile, and heat-tolerant. You can use INSERT to add this new product to your table.\n\n<b>Before Insert:<\/b>\n\n<img decoding=\"async\" width=\"1102\" height=\"152\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2.webp\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2.webp 1102w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2-300x41.webp 300w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2-1024x141.webp 1024w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image1-2-768x106.webp 768w\" sizes=\"(max-width: 1102px) 100vw, 1102px\">\n\n<b>SQL Script:<\/b>\n<p style=\"padding-left: 40px;\">INSERT INTO product_info (product_id, product_name, weight, material, fabrication_country, cost, price)<\/p>\n<p style=\"padding-left: 40px;\">VALUES (235, &#8216;baking pan&#8217;, 0.25, &#8216;carbon steel&#8217;, &#8216;France&#8217;, 9, 16);<\/p>\n<b>After Insert:<\/b>\n\n<img decoding=\"async\" width=\"1138\" height=\"200\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image6-2.webp\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image6-2.webp 1138w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image6-2-300x53.webp 300w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image6-2-1024x180.webp 1024w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image6-2-768x135.webp 768w\" sizes=\"(max-width: 1138px) 100vw, 1138px\">\n<a href=\"\/en\/courses\/data-ai\/data-scientist\">\nLearn SQL\n<\/a>\n<h2><b>DELETE: Removing Data<\/b><\/h2>\nThe DELETE statement allows you to remove records from a table.\n\n<b>Example:<\/b>\n\nDue to global supply chain disruptions, you decide to discontinue a <b>stoneware baking pan<\/b>. To remove it from your product catalog, use the DELETE statement.\n\n<b>Before Delete:<\/b>\n\n<img decoding=\"async\" width=\"1138\" height=\"198\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image5-2.webp\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image5-2.webp 1138w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image5-2-300x52.webp 300w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image5-2-1024x178.webp 1024w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image5-2-768x134.webp 768w\" sizes=\"(max-width: 1138px) 100vw, 1138px\">\n\n<b>SQL Script:<\/b>\n<p style=\"padding-left: 40px;\">DELETE FROM product_info<\/p>\n<p style=\"padding-left: 40px;\">WHERE product_name = &#8216;baking pan&#8217; AND material = &#8216;stoneware&#8217;;<\/p>\n<b>After Delete:<\/b>\n\n<img decoding=\"async\" width=\"1104\" height=\"150\" src=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image4-2.webp\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image4-2.webp 1104w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image4-2-300x41.webp 300w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image4-2-1024x139.webp 1024w, https:\/\/liora.io\/app\/uploads\/sites\/9\/2025\/02\/image4-2-768x104.webp 768w\" sizes=\"(max-width: 1104px) 100vw, 1104px\">\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center\"><div class=\"wp-block-button \"><a class=\"wp-block-button__link wp-element-button \" href=\"\/en\/courses\/data-ai\/data-scientist\">Learn more about SQL<\/a><\/div><\/div>\n\n<h2><b>Conclusion<\/b><\/h2>\nUnderstanding how to modify data in SQL is crucial for maintaining accurate and up-to-date databases. Here\u2019s a quick recap:\n<ul>\n \t<li><b>UPDATE<\/b> modifies existing records.<\/li>\n \t<li><b>INSERT<\/b> adds new records.<\/li>\n \t<li><b>DELETE<\/b> removes records from a table.<\/li>\n<\/ul>\nMastering these commands will help you manage databases efficiently and keep your data relevant!\n\n<a href=\"\/en\/courses\/data-ai\/\">\nDiscover our Data Science courses\n<\/a>","protected":false},"excerpt":{"rendered":"<p>Tables store data that can be used or referenced in the future. Over time, it is common to modify this data to ensure it remains relevant and up-to-date. In this article, you will learn three essential SQL commands to modify data: UPDATE, INSERT, and DELETE. UPDATE: Changing Existing Data The UPDATE statement allows you to [&hellip;]<\/p>\n","protected":false},"author":99,"featured_media":193880,"comment_status":"open","ping_status":"open","sticky":false,"template":"elementor_theme","format":"standard","meta":{"_acf_changed":false,"editor_notices":[],"footnotes":""},"categories":[2433],"class_list":["post-193878","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai"],"acf":[],"_links":{"self":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/193878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/users\/99"}],"replies":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/comments?post=193878"}],"version-history":[{"count":5,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/193878\/revisions"}],"predecessor-version":[{"id":205590,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/193878\/revisions\/205590"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media\/193880"}],"wp:attachment":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media?parent=193878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/categories?post=193878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}