

{"id":87231,"date":"2021-03-22T09:00:56","date_gmt":"2021-03-22T03:30:56","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=87231"},"modified":"2024-04-05T21:28:01","modified_gmt":"2024-04-05T15:58:01","slug":"sql-query","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/sql-query\/","title":{"rendered":"SQL Query &#8211; Insert, Select, Update and Delete"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:397,&quot;href&quot;:&quot;https:\\\/\\\/sonra.io\\\/xml\\\/how-to-insert-xml-data-into-sql-table&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20240902194955\\\/https:\\\/\\\/sonra.io\\\/xml\\\/how-to-insert-xml-data-into-sql-table\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-08 11:31:54&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-12 07:34:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-16 09:57:58&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-20 15:20:58&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-24 11:06:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-28 20:45:33&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-01 15:04:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-06 05:24:02&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-09 05:31:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-14 04:08:24&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-19 07:22:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-22 19:55:36&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-26 06:23:27&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-30 14:08:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-03 03:32:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-06 04:12:39&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-09 04:54:36&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-12 10:08:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-17 03:55:06&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-23 08:31:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-28 07:46:00&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-04 16:10:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-09 06:37:18&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-12 10:31:12&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-19 18:03:58&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-23 05:49:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-28 06:00:33&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-02 14:16:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-07 06:27:59&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-10 07:51:47&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-16 10:14:18&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-25 14:15:02&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-28 16:21:19&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-04 06:24:56&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-07 18:25:07&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-11 05:55:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-17 18:51:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-21 17:08:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-25 00:18:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-06 10:46:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-09 11:42:56&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-09 11:42:56&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>In this article, we will discuss some of the most important SQL queries &#8211; Insert, Select, Update, Delete. Insert, Update, and delete are the data manipulation query, and Select is the data query language. If you are not aware of basic SQL concepts, its recommended to learn <a href=\"https:\/\/data-flair.training\/blogs\/sql-tutorial\/\">what is SQL<\/a>?<\/p>\n<p>Let&#8217;s start our learning!!!<\/p>\n<h3>Creating SQL Database<\/h3>\n<p>First, we create our table DataFlair_Employee using the create query.<br \/>\n<strong>Syntax:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">CREATE TABLE tableName(columnName1 datatype,\r\ncolumnName2 datatype ,\r\ncolumnName3 datatype,\r\n\u2026\u2026.) ;\r\n<\/pre>\n<p><strong>Query :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">CREATE TABLE DataFlair_Employee (\r\nname_emp  varchar(50),\r\npost_emp varchar(50),\r\nemail varchar(50),\r\nage int,\r\nsalary int\r\n);\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87234\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1.png\" alt=\"Create SQL database\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Create-query-1-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>Executing the query, we get <strong>DataFlair_Employee<\/strong> table created with five columns namely &#8211;<\/p>\n<ul>\n<li>name_emp<\/li>\n<li>post_emp<\/li>\n<li>email<\/li>\n<li>age<\/li>\n<li>salary<\/li>\n<\/ul>\n<p>We can view the created table by executing a select query:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT * FROM DataFlair_Employee ;\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87235\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1.png\" alt=\"select SQL Database\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>We can now store our data in the table using the insert query to enter data we obtain.<\/p>\n<h3>SQL INSERT Statement<\/h3>\n<p>Insert statement is used to create and store new records in our database. We can insert multiple records at once, or we can also insert data into some columns of the database.<br \/>\n<strong>Syntax:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">INSERT INTO tableName(column1,column2,column3\u2026\u2026..) VALUES(value1,value2,value3\u2026\u2026) ;\r\n\r\n<\/pre>\n<p><strong>Type 1: Inserting multiple records in our database <\/strong><\/p>\n<p>Let us insert records of five employees in our database <strong>DataFlair_Employee<\/strong>. We can do this by executing an insert query containing data of the five records to be inserted.<\/p>\n<p><strong>Query :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">INSERT  INTO DataFlair_Employee (name_emp , post_emp , email , age , salary)\r\nValues ('Ram' ,  \"Intern\", 'ram@dataflair.com', 21 , 5000 ),\r\n('Shyam', \"Manager\", 'shyam@dataflair.com' , 25 , 25000),\r\n('Ria', \"Analyst\" , 'ram@dataflair.com', 23 , 21000),\r\n('Kavya', \"Senior Analyst\" , 'kavya@dataflair.com', 31 , 27500),\r\n('Aman', \"Database Operator\",' rish@dataflair.com' , 26 , 30000) ;\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87236\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query.png\" alt=\"SQL insert Query\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-Query-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>Executing the insert query, five records are inserted in our table DataFlair_Employee.<\/p>\n<p><strong>Type 2: Inserting a single record in the DataFlair_Employee table <\/strong><\/p>\n<p>Let us insert a single row of data in our database <strong>DataFlair_Employee<\/strong>. We can do this by executing an insert query containing a single row of data to be inserted into the database.<\/p>\n<p><strong>Query :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">INSERT INTO DataFlair_Employee (name_emp , post_emp , email , age , salary)\r\nValues ('Arun' ,  \"Intern\", 'arun@dataflair.com', 19 , 7000 );\r\n\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87237\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2.png\" alt=\"Insert in SQL Database\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-2-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>This way, we can insert a single record in our database.<\/p>\n<p><strong>Inserting data in specific columns only :<\/strong><\/p>\n<p>We have seen how to insert multiple and single records of data, but sometimes we have only some data available in that case, we can insert data into the specific columns.<br \/>\n<strong>Syntax :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">INSERT INTO tableName (column1,column3) VALUES (value1, value2) ;\r\n\r\n<\/pre>\n<p>Let us assume we have a new intern at DataFlair, and we only know his name, and the position and salary offered to him is known to us by default. To insert this record, we can use the following<\/p>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">INSERT INTO DataFlair_Employee (\r\nname_emp ,\r\n post_emp , \r\nsalary)\r\nValues ('Sachin' ,  \"Intern\", 7000 );\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87238\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3.png\" alt=\"SQL Insert Example\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Insert-query-3-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>Execution of the query the available data of the intern is stored in the table, and the columns whose data was not available are automatically set to <strong>NULL. <\/strong>This feature comes in handy when we have large amounts of data, and some chunks are missing in the data here and there. Also, if there is already data present in different formats like XML then you can <a href=\"https:\/\/sonra.io\/xml\/how-to-insert-xml-data-into-sql-table\/\">insert XML data into SQL tables<\/a>.<\/p>\n<h3>SQL UPDATE Statement<\/h3>\n<p>Data stored in a database needs to be changed and updated time and again to maintain the value data holds. The process is made easy by using the UPDATE statement.<\/p>\n<p>With the help of the Update statement, we are able to change and update the data by simply using the conditions required by us or the user.<\/p>\n<p>We use the where clause to specify the condition that we need to follow for the update of the data in the database.<\/p>\n<p><strong>Syntax :\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">UPDATE tableName SET column1 = value1, column2 = value2,... where condition;\r\n<\/pre>\n<p><strong>Type 1: Update a single column in the database<\/strong><br \/>\nSuppose we want to increase the salary of our manager at <strong>DataFlair<\/strong> from Rs 25,000 to Rs 30,000 and we need to update the same in our database to avoid any data inconsistency.<\/p>\n<p>We can do this by executing an update query on our database and changing the value of Shyam\u2019s salary to Rs 30,000.<br \/>\n<strong>Syntax :\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">UPDATE tableName SET column1 = value1, column2 = value2,... where condition;\r\n<\/pre>\n<p><strong>Query:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">UPDATE DataFlair_Employee SET salary = 30000 WHERE name_emp = 'Shyam'  ;<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87240\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2.png\" alt=\"Update Query in SQL\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-2-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>After the update query is executed, we can observe the salary of Shyam has changed to Rs 30,000.<\/p>\n<p><strong>Type 2: Update multiple columns in the database<\/strong><\/p>\n<p>Suppose Ram, who is an intern at <strong>DataFlair<\/strong>, is now promoted to a full-time employee and is offered a role of SDE now we need to update both his position and his salary.<\/p>\n<p>We can do this by executing an Update statement on the database with a condition where the name of the employee should be Ram.<br \/>\n<strong>Syntax :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">UPDATE tableName SET column1 = value1, column2 = value2,... where condition;\r\n<\/pre>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">UPDATE DataFlair_Employee SET salary = 20000 , post_emp = 'SDE' where name_emp = 'Ram'  ;\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87239\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1.png\" alt=\"SQL Update Query\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Update-query-1-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>After the execution, we can clearly see Ram has been promoted to the position of SDE, and salary has changed to Rs. 20000.<\/p>\n<h3>SQL SELECT Query<\/h3>\n<p>Select is a type of DQL statement, i.e. Data Query Statement, it is used to peek into the data before starting any sort of analysis on it.<\/p>\n<p>Select query helps us view whole data stored in data and gives us the power to view data that satisfies the conditions passed in by the user.<\/p>\n<p><strong>Syntax:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">ELECT * FROM tableName ;<\/pre>\n<p><strong>Type 1: View whole data stored in the table<\/strong><\/p>\n<p>We can display all the data stored in the table by using the select query.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT * FROM tableName ;<\/pre>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT * FROM DataFlair_Employee ;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87241\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1.png\" alt=\"SQL Select Query\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-Query-1-1-1-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>The above query returns us the whole database with all the stored data.<\/p>\n<p><strong>Type 2: View limited data using the LIMIT keyword<\/strong><\/p>\n<p>Let us view our database only with the first 2 rows of the data; we can do this by executing a Select statement with the LIMIT keyword.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT * FROM tableName LIMIT n ;<\/pre>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT * FROM dataflair_employee LIMIT 2 ;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87242\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2.png\" alt=\"Select Query in SQL\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-2-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p><strong>Type 3: View data that satisfies conditions entered by the user<\/strong><\/p>\n<p>Suppose we want to view the list of employees who earn more than Rs 28,000 per month, to obtain this data we can execute a Select statement with the condition of salary being more than Rs 28,000.<\/p>\n<p><strong>Syntax:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT * FROM tableName WHERE condition;<\/pre>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT * FROM DataFlair_Employee WHERE salary &gt; 28000 ;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87243\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1.png\" alt=\"Select query in SQL\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Select-query-3-1-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<h3>SQL DELETE Query<\/h3>\n<p>We need to keep our database useful and efficient at all times, and for that, we need to keep deleting the dead data from the database.<\/p>\n<p>The deletion of data not required by us is very important to keep the database clean. This helps us to get access to the current data without any filtering at the time of analysis of data stored.<\/p>\n<p><strong>Syntax :\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">DELETE FROM table_name WHERE condition;<\/pre>\n<h4>Type 1: Delete a single column from the database<\/h4>\n<p>Suppose an employee by the name Ria quits her job at DataFlair, so we need to delete her record from our database.<\/p>\n<p>We can do so by executing a delete query that deletes the column containing the data of Ria. This can be done by passing in the condition in where clause.<\/p>\n<p><strong>Syntax :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">DELETE FROM table_name WHERE condition;<\/pre>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">DELETE FROM DataFlair_Employee WHERE name_emp = 'Ria';<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87244\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1.png\" alt=\"SQL Delete Query\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-1-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>We can observe that after executing the delete query we no longer have an employee by the name Ria in our DataFlair_Employee database.<\/p>\n<h4>Type 2: Delete multiple columns from the database<\/h4>\n<p>Let us assume that the interns at <strong>DataFlair<\/strong> have completed their tenure and have left <strong>DataFlair<\/strong> with a great learning experience, but we need to keep our database updated no matter what.<\/p>\n<p>So we need to delete the records of interns from our database <strong>DataFlair_Employee<\/strong>. We can do this by executing a delete query that deletes all the records corresponding to interns.<\/p>\n<p><strong>Syntax:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">DELETE FROM table_name WHERE condition;<\/pre>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">DELETE FROM DataFlair_Employee WHERE post_emp = 'Intern';<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87245\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2.png\" alt=\"Delete Query in SQL\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-2-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>We can observe after the execution of the delete query all the records of the interns are removed from the database.<\/p>\n<h4>Type 3: Delete the table<\/h4>\n<p>We want to delete the whole table, and to do so, we need to execute a Delete query. It deletes all the data stored in the table, but the table attributes and the indexes remain intact.<\/p>\n<p><strong>Syntax :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">DELETE FROM table_name;<\/pre>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">DELETE FROM DataFlair_Employee;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87246\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3.png\" alt=\"SQL Delete database\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/Delete-query-3-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>We can observe that the details or the data stored in the table are deleted, but the table attributes, i.e. the columns and the attributes, remain intact.<\/p>\n<h3>Summary<\/h3>\n<p>Finally, We have studied and analyzed the SQL statements Insert, Update, Delete, and Select with examples. While executing the delete query, we should take care that we always include a Where clause. It specifies the condition of the data to be deleted, else all the data stored in the table will be deleted.<\/p>\n<p>We have learned how to output data according to the requirements of the user by using conditions in the Select statement.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will discuss some of the most important SQL queries &#8211; Insert, Select, Update, Delete. Insert, Update, and delete are the data manipulation query, and Select is the data query language.&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":87232,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[248,23851,23850,13514,23852],"class_list":["post-87231","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql","tag-add-constraint-sql-server","tag-sql-delete-query","tag-sql-insert-query","tag-sql-query","tag-sql-update-query"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Query - Insert, Select, Update and Delete - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn various types of SQL Queries like Insert query, select query, update query and delete query with syntax and 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:\/\/data-flair.training\/blogs\/sql-query\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Query - Insert, Select, Update and Delete - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn various types of SQL Queries like Insert query, select query, update query and delete query with syntax and examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/sql-query\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-22T03:30:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-05T15:58:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/SQL-Query.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Query - Insert, Select, Update and Delete - DataFlair","description":"Learn various types of SQL Queries like Insert query, select query, update query and delete query with syntax and 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:\/\/data-flair.training\/blogs\/sql-query\/","og_locale":"en_US","og_type":"article","og_title":"SQL Query - Insert, Select, Update and Delete - DataFlair","og_description":"Learn various types of SQL Queries like Insert query, select query, update query and delete query with syntax and examples.","og_url":"https:\/\/data-flair.training\/blogs\/sql-query\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-03-22T03:30:56+00:00","article_modified_time":"2024-04-05T15:58:01+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/SQL-Query.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/sql-query\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/sql-query\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"SQL Query &#8211; Insert, Select, Update and Delete","datePublished":"2021-03-22T03:30:56+00:00","dateModified":"2024-04-05T15:58:01+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sql-query\/"},"wordCount":1246,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sql-query\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/SQL-Query.jpg","keywords":["add constraint sql server","SQL Delete Query","SQL Insert query","SQL Query","SQL Update Query"],"articleSection":["SQL Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/sql-query\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/sql-query\/","url":"https:\/\/data-flair.training\/blogs\/sql-query\/","name":"SQL Query - Insert, Select, Update and Delete - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sql-query\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sql-query\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/SQL-Query.jpg","datePublished":"2021-03-22T03:30:56+00:00","dateModified":"2024-04-05T15:58:01+00:00","description":"Learn various types of SQL Queries like Insert query, select query, update query and delete query with syntax and examples.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/sql-query\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/sql-query\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/sql-query\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/SQL-Query.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/03\/SQL-Query.jpg","width":1200,"height":628,"caption":"SQL Query"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/sql-query\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"SQL Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/sql\/"},{"@type":"ListItem","position":3,"name":"SQL Query &#8211; Insert, Select, Update and Delete"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/87231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=87231"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/87231\/revisions"}],"predecessor-version":[{"id":135349,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/87231\/revisions\/135349"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/87232"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=87231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=87231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=87231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}