{"id":17,"date":"2021-03-19T12:01:56","date_gmt":"2021-03-19T12:01:56","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/?page_id=17"},"modified":"2022-12-08T14:57:54","modified_gmt":"2022-12-08T14:57:54","slug":"sql-insert","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/national-5\/sql-insert\/","title":{"rendered":"SQL INSERT"},"content":{"rendered":"<p>The INSERT command is used to <strong>add new records<\/strong> to a table.<\/p>\n<h1>Method 1 &#8211; You have values for all the fields<\/h1>\n<p>The order of the values must be in the same order as the columns in the table<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">INSERT INTO customers\r\nVALUES (1, 'Kelly', 'Jill', '555-1040', 'someone@microsoft.com')\r\n\r\n<\/pre>\n<h1>Method 2 \u2013 You have values for some of the fields:<\/h1>\n<p>Values must be entered for all required columns, otherwise the record cannot be added to the table<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\n\r\nINSERT INTO customers (customer_id, last_name, first_name)\r\nVALUES (1, 'Kelly', 'Jill')\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The INSERT command is used to add new records to a table. Method 1 &#8211; You have values for all the fields The order of the values must be in the same order as the columns in the table INSERT INTO customers VALUES (1, &#8216;Kelly&#8217;, &#8216;Jill&#8217;, &#8216;555-1040&#8217;, &#8216;someone@microsoft.com&#8217;) Method 2 \u2013 You have values for some of the fields: Values must be entered for all required columns, otherwise the record<\/p>\n<p><a class=\"more-link\" href=\"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/national-5\/sql-insert\/\">Read More<\/a><\/p>\n","protected":false},"author":7,"featured_media":0,"parent":66,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-17","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/wp-json\/wp\/v2\/pages\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":10,"href":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/wp-json\/wp\/v2\/pages\/17\/revisions"}],"predecessor-version":[{"id":637,"href":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/wp-json\/wp\/v2\/pages\/17\/revisions\/637"}],"up":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/wp-json\/wp\/v2\/pages\/66"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/sh\/ahscomputingsql\/wp-json\/wp\/v2\/media?parent=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}