{"id":103254,"date":"2021-08-03T11:00:00","date_gmt":"2021-08-03T08:00:00","guid":{"rendered":"https:\/\/examples.javacodegeeks.com\/?p=103254"},"modified":"2022-07-08T15:14:21","modified_gmt":"2022-07-08T12:14:21","slug":"sql-tutorial-for-beginners","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/","title":{"rendered":"SQL Tutorial for Beginners"},"content":{"rendered":"<p>This is an SQL tutorial for beginners. We will discuss what is SQL and what it is used for.<\/p>\n<p>You can also check this tutorial in the following video:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.youtube.com\/watch?v=4aTGn2PrsT0\"><img decoding=\"async\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Tutorial-for-Beginners-1024x576.jpg\" alt=\"\" class=\"wp-image-113881\" width=\"512\" height=\"288\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Tutorial-for-Beginners-1024x576.jpg 1024w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Tutorial-for-Beginners-300x169.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Tutorial-for-Beginners-768x432.jpg 768w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Tutorial-for-Beginners.jpg 1280w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><figcaption>SQL Tutorial for Beginners &#8211; video<\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-1-why-to-learn-sql\">1. Why to Learn SQL<\/h2>\n<p><strong>SQL<\/strong> stands for Structured Query Language and is a standard language for accessing and manipulating databases. Although SQL is an ANSI\/ISO standard, there are different versions of the SQL language.<\/p>\n<p>A database contains tables that are identified by a name (e.g. Person, Invoice). Tables contain records (rows).<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-2-applications-of-sql\">2. Applications of SQL<\/h2>\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\"><img decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\" alt=\"sql tutorial\" class=\"wp-image-1204\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg 150w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo-70x70.jpg 70w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a><\/figure>\n<\/div>\n<p><a href=\"https:\/\/docs.oracle.com\/cd\/B19306_01\/server.102\/b14200\/intro.htm#:~:text=Structured%20Query%20Language%20(SQL)%20is,when%20executing%20the%20user's%20request.\">SQL<\/a> is used to retrieve and manipulate data in the database. It can be used to create new databased, tables, views, etc. We can also use SQL to write Stored Procedures as well. We can also use it to set permissions for tables, views, etc.<\/p>\n<p>SQL keywords are <strong>NOT<\/strong> case-sensitive. So select is the same as SELECT. Note that some databases require a semi-colon (;) at the end of each SQL statement.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-3-sql-tutorial-data-types\">3. SQL Tutorial &#8211; Data Types<\/h2>\n<p>A SQL data type defines what type of value a column in the table can hold. There is a subtle difference in the list of data types based on the database server you are using. Below we will discuss the data types available in the MySQL database. There are three main data types: String, Numeric, and date-time.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-3-1-string-data-type\">3.1 String Data Type<\/h3>\n<figure class=\"wp-block-table is-style-stripes\">\n<table>\n<tbody>\n<tr>\n<td><strong>Data type<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>CHAR(size)<\/td>\n<td>A FIXED length string (can contain letters, numbers, and special characters). The&nbsp;<em>size<\/em>&nbsp;parameter specifies the column length in characters &#8211; can be from 0 to 255. Default is 1<\/td>\n<\/tr>\n<tr>\n<td>VARCHAR(size)<\/td>\n<td>A VARIABLE length string (can contain letters, numbers, and special characters). The&nbsp;<em>size<\/em>&nbsp;parameter specifies the maximum column length in characters &#8211; can be from 0 to 65535<\/td>\n<\/tr>\n<tr>\n<td>BINARY(size)<\/td>\n<td>Equal to CHAR, but stores binary byte strings. The&nbsp;<em>size<\/em>&nbsp;parameter specifies the column length in bytes. Default is 1<\/td>\n<\/tr>\n<tr>\n<td>VARBINARY(size)<\/td>\n<td>Equal to VARCHAR, but stores binary byte strings. The&nbsp;<em>size<\/em>&nbsp;parameter specifies the maximum column length in bytes.<\/td>\n<\/tr>\n<tr>\n<td>TINYTEXT<\/td>\n<td>Holds a string with a maximum length of 255 characters<\/td>\n<\/tr>\n<tr>\n<td>TEXT(size)<\/td>\n<td>Holds a string with a maximum length of 65,535 bytes<\/td>\n<\/tr>\n<tr>\n<td>MEDIUMTEXT<\/td>\n<td>Holds a string with a maximum length of 16,777,215 characters<\/td>\n<\/tr>\n<tr>\n<td>LONGTEXT<\/td>\n<td>Holds a string with a maximum length of 4,294,967,295 characters<\/td>\n<\/tr>\n<\/tbody>\n<\/table><figcaption>SQL String Data Type<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\" id=\"h-3-2-numeric-data-type\">3.2 Numeric Data Type<\/h3>\n<figure class=\"wp-block-table is-style-stripes\">\n<table>\n<tbody>\n<tr>\n<td><strong>Data type<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>BIT(<em>size<\/em>)<\/td>\n<td>A bit-value type. The number of bits per value is specified in&nbsp;<em>size<\/em>. The&nbsp;<em>size<\/em>&nbsp;parameter can hold a value from 1 to 64. The default value for&nbsp;<em>size<\/em>&nbsp;is 1.<\/td>\n<\/tr>\n<tr>\n<td>TINYINT(<em>size<\/em>)<\/td>\n<td>A very small integer. Signed range is from -128 to 127. Unsigned range is from 0 to 255. The&nbsp;<em>size<\/em>&nbsp;parameter specifies the maximum display width (which is 255)<\/td>\n<\/tr>\n<tr>\n<td>SMALLINT(<em>size<\/em>)<\/td>\n<td>A small integer. Signed range is from -32768 to 32767. Unsigned range is from 0 to 65535. The&nbsp;<em>size<\/em>&nbsp;parameter specifies the maximum display width (which is 255)<\/td>\n<\/tr>\n<tr>\n<td>MEDIUMINT(<em>size<\/em>)<\/td>\n<td>A medium integer. Signed range is from -8388608 to 8388607. Unsigned range is from 0 to 16777215. The&nbsp;<em>size<\/em>&nbsp;parameter specifies the maximum display width (which is 255)<\/td>\n<\/tr>\n<tr>\n<td>INT(<em>size<\/em>) \/ INTEGER(<em>size<\/em>)<\/td>\n<td>A medium integer. Signed range is from -2147483648 to 2147483647. Unsigned range is from 0 to 4294967295. The&nbsp;<em>size<\/em>&nbsp;parameter specifies the maximum display width (which is 255)<\/td>\n<\/tr>\n<tr>\n<td>BIGINT(<em>size<\/em>)<\/td>\n<td>A large integer. Signed range is from -9223372036854775808 to 9223372036854775807. Unsigned range is from 0 to 18446744073709551615. The&nbsp;<em>size<\/em>&nbsp;parameter specifies the maximum display width (which is 255)<\/td>\n<\/tr>\n<tr>\n<td>FLOAT(p)<\/td>\n<td>A floating point number. MySQL uses the&nbsp;<em>p<\/em>&nbsp;value to determine whether to use FLOAT or DOUBLE for the resulting data type. If&nbsp;<em>p<\/em>&nbsp;is from 0 to 24, the data type becomes FLOAT. If&nbsp;<em>p<\/em>&nbsp;is from 25 to 53, the data type becomes DOUBLE<\/td>\n<\/tr>\n<tr>\n<td>DOUBLE(<em>size<\/em>,&nbsp;<em>d<\/em>)<\/td>\n<td>A normal-size floating point number. The total number of digits is specified in&nbsp;<em>size<\/em>. The number of digits after the decimal point is specified in the&nbsp;<em>d<\/em>&nbsp;parameter<\/td>\n<\/tr>\n<tr>\n<td>DECIMAL(<em>size<\/em>,&nbsp;<em>d<\/em>) \/ DEC(<em>size<\/em>,&nbsp;<em>d<\/em>)<\/td>\n<td>An exact fixed-point number. The total number of digits is specified in&nbsp;<em>size<\/em>. The number of digits after the decimal point is specified in the&nbsp;<em>d<\/em>&nbsp;parameter. The maximum number for&nbsp;<em>size<\/em>&nbsp;is 65. The maximum number for&nbsp;<em>d<\/em>&nbsp;is 30. The default value for&nbsp;<em>size<\/em>&nbsp;is 10. The default value for&nbsp;<em>d<\/em>&nbsp;is 0.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><figcaption>SQL Numeric Data Type<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\" id=\"h-3-3-boolean-data-type\">3.3 Boolean Data Type<\/h3>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>Data type<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>BOOL\/BOOLEAN<\/td>\n<td>Zero is considered as false, nonzero values are considered as true.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><figcaption>SQL Boolean Data Type<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\" id=\"h-3-4-large-objects\">3.4 Large Objects<\/h3>\n<figure class=\"wp-block-table is-style-stripes\">\n<table>\n<tbody>\n<tr>\n<td><strong>Data type<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>TINYBLOB<\/td>\n<td>For BLOBs (Binary Large Objects). Max length: 255 bytes<\/td>\n<\/tr>\n<tr>\n<td>BLOB(size)<\/td>\n<td>For BLOBs (Binary Large OBjects). Holds up to 65,535 bytes of data<\/td>\n<\/tr>\n<tr>\n<td>MEDIUMBLOB<\/td>\n<td>For BLOBs (Binary Large OBjects). Holds up to 16,777,215 bytes of data<\/td>\n<\/tr>\n<tr>\n<td>LONGBLOB<\/td>\n<td>For BLOBs (Binary Large OBjects). Holds up to 4,294,967,295 bytes of data<\/td>\n<\/tr>\n<\/tbody>\n<\/table><figcaption>SQL Large objects data types<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\" id=\"h-3-5-date-and-time-data-type\">3.5 Date and Time Data Type<\/h3>\n<figure class=\"wp-block-table is-style-stripes\">\n<table>\n<tbody>\n<tr>\n<td><strong>Data type<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>DATE<\/td>\n<td>A date. Format: YYYY-MM-DD. The supported range is from &#8216;1000-01-01&#8217; to &#8216;9999-12-31&#8217;<\/td>\n<\/tr>\n<tr>\n<td>DATETIME(<em>fsp<\/em>)<\/td>\n<td>A date and time combination. Format: YYYY-MM-DD hh:mm:ss. The supported range is from &#8216;1000-01-01 00:00:00&#8217; to &#8216;9999-12-31 23:59:59&#8217;. Adding DEFAULT and ON UPDATE in the column definition to get automatic initialization and updating to the current date and time<\/td>\n<\/tr>\n<tr>\n<td>TIMESTAMP(<em>fsp<\/em>)<\/td>\n<td>A timestamp. TIMESTAMP values are stored as the number of seconds since the Unix epoch (&#8216;1970-01-01 00:00:00&#8217; UTC). Format: YYYY-MM-DD hh:mm:ss. The supported range is from &#8216;1970-01-01 00:00:01&#8217; UTC to &#8216;2038-01-09 03:14:07&#8217; UTC. Automatic initialization and updating to the current date and time can be specified using DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP in the column definition<\/td>\n<\/tr>\n<tr>\n<td>TIME(<em>fsp<\/em>)<\/td>\n<td>A time. Format: hh:mm:ss. The supported range is from &#8216;-838:59:59&#8217; to &#8216;838:59:59&#8217;<\/td>\n<\/tr>\n<\/tbody>\n<\/table><figcaption>SQL Date and Time Data Type<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\" id=\"h-3-6-misc\">3.6 Misc<\/h3>\n<figure class=\"wp-block-table is-style-stripes\">\n<table>\n<tbody>\n<tr>\n<td><strong>Data type<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>ENUM(val1, val2, val3, &#8230;)<\/td>\n<td>A string object that can have only one value, chosen from a list of possible values. You can list up to 65535 values in an ENUM list. If a value is inserted that is not in the list, a blank value will be inserted. The values are sorted in the order you enter them<\/td>\n<\/tr>\n<tr>\n<td>SET(val1, val2, val3, &#8230;)<\/td>\n<td>A string object that can have 0 or more values, chosen from a list of possible values. You can list up to 64 values in a SET list<\/td>\n<\/tr>\n<\/tbody>\n<\/table><figcaption>SQL other types of data<\/figcaption><\/figure>\n<h2 class=\"wp-block-heading\" id=\"h-4-sql-statements\">4. SQL statements<\/h2>\n<h3 class=\"wp-block-heading\" id=\"h-4-1-sql-select-from-where\">4.1 SQL Select, From, Where<\/h3>\n<p>A <code>SELECT<\/code> keyword is used to return the data from the table. A <code>FROM<\/code> keyword is used to specify from where (table\/views) the data needs to be fetched. A <code>WHERE<\/code> keyword is used to apply filters before returning the data. It is used to extract only those records that fulfill a specified condition. Below are the list of operators which can be used in the <code>WHERE<\/code> clause:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<figure class=\"wp-block-table is-style-stripes\">\n<table>\n<tbody>\n<tr>\n<td><strong>Operator<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>=<\/td>\n<td>Equal<\/td>\n<\/tr>\n<tr>\n<td>&gt;<\/td>\n<td>Greater than<\/td>\n<\/tr>\n<tr>\n<td>&gt;=<\/td>\n<td>Greater than or equal<\/td>\n<\/tr>\n<tr>\n<td>&lt;<\/td>\n<td>Less than<\/td>\n<\/tr>\n<tr>\n<td>&lt;=<\/td>\n<td>Less than or equal<\/td>\n<\/tr>\n<tr>\n<td>!=<\/td>\n<td>Not equal<\/td>\n<\/tr>\n<tr>\n<td>BETWEEN<\/td>\n<td>Between a certain range<\/td>\n<\/tr>\n<tr>\n<td>LIKE<\/td>\n<td>Search for a pattern<\/td>\n<\/tr>\n<tr>\n<td>IN<\/td>\n<td>To specify multiple possible values for a column<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>The <code>WHERE<\/code> clause can be combined with the <code>AND<\/code>, <em><code>OR<\/code>,<\/em> and <code>NOT<\/code> operators. We can use the <code>ORDER<\/code> <code>BY<\/code><em> keyword to sort the result-set in<\/em> ascending or descending order.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT col1, col2 FROM table_name ORDER BY col1\n<\/pre>\n<\/div>\n<p>The data returned is stored in a result table, called the result-set.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT * FROM person WHERE first_name = &#039;Mike&#039;\n<\/pre>\n<\/div>\n<p>In the above query we are returning everything from the <em>person<\/em> table where the column <em>first_name<\/em> has a value <em>&#8216;Mike&#8217;<\/em>. The &#8216;*&#8217; after the <code>SELECT<\/code> statement is used to return all the columns for the given table. You can also specify the column name explicitly if you don&#8217;t want to return everything.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT title,surname FROM person WHERE first_name = &#039;Mike&#039;\n<\/pre>\n<\/div>\n<p>The above query will only return the <em>title<\/em> and the <em>surname column<\/em> values. We can use the <code>DISTINCT<\/code> keyword to filter out the duplicate values.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-4-2-insert-update-delete\">4.2 INSERT UPDATE DELETE<\/h3>\n<p>The <code>INSERT<\/code> statement is used to insert data into the table.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nINSERT INTO table (col1,col2) VALUES (val1,val2)\n<\/pre>\n<\/div>\n<p>Make sure the order of the values is in the same order as the columns in the table. If you are adding values for all the columns of the table, you do not need to specify the column names in the SQL query.<\/p>\n<p>The <code>UPDATE<\/code> statement is used to modify the existing records in a table.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nUPDATE table_name SET col1 = val1, col2 = val2 WHERE conditions...\n<\/pre>\n<\/div>\n<p>Be careful when updating records in a table! Notice the <code>WHERE<\/code> clause in the <code>UPDATE<\/code> statement. The <code>WHERE<\/code> clause specifies which record(s) that should be updated. If you omit the <code>WHERE<\/code> clause, all records in the table will be updated!<\/p>\n<p>The DELETE command is used to delete records in the table.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nDELETE FROM table_name WHERE conditions...\n<\/pre>\n<\/div>\n<p>Like <code>UPDATE<\/code> make sure you use the <code>WHERE<\/code> condition otherwise it will delete all the records in that table.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-4-3-views\">4.3 Views<\/h3>\n<p>A view is a virtual table based on the result-set of an SQL statement. A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database.You can add SQL statements and functions to a view and present the data as if the data were coming from one single table.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE VIEW view_name AS\nSELECT column1, column2, ...\nFROM table_name\nWHERE condition;\n<\/pre>\n<\/div>\n<p>A view always shows up-to-date data! The database engine recreates the view, every time a user queries it. A view can be updated with the&nbsp;<code>CREATE OR REPLACE VIEW<\/code>&nbsp;statement. A view is deleted with the&nbsp;<code>DROP VIEW<\/code>&nbsp;statement<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-5-sql-tutorial-summary\">5. SQL Tutorial &#8211; Summary<\/h2>\n<p>That was an SQL tutorial for beginners. Firstly, we discussed what SQL is. Then, we discussed its usage and its applications. Finally, we discussed the various commands available and how to use them. We also looked at the available data types and when to use them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is an SQL tutorial for beginners. We will discuss what is SQL and what it is used for. You can also check this tutorial in the following video: SQL Tutorial for Beginners &#8211; video 1. Why to Learn SQL SQL stands for Structured Query Language and is a standard language for accessing and manipulating &hellip;<\/p>\n","protected":false},"author":34,"featured_media":1204,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[],"class_list":["post-103254","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL Tutorial for Beginners - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This is an SQL tutorial for beginners. We will discuss what is SQL and what it is used for. You can also check this tutorial in the following video: SQL\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Tutorial for Beginners - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This is an SQL tutorial for beginners. We will discuss what is SQL and what it is used for. You can also check this tutorial in the following video: SQL\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-03T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-08T12:14:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Mohammad Meraj Zia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mohammad Meraj Zia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/\"},\"author\":{\"name\":\"Mohammad Meraj Zia\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/442b4f9b8a4aa7e12376464fc354f8ed\"},\"headline\":\"SQL Tutorial for Beginners\",\"datePublished\":\"2021-08-03T08:00:00+00:00\",\"dateModified\":\"2022-07-08T12:14:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/\"},\"wordCount\":1560,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"articleSection\":[\"sql\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/\",\"name\":\"SQL Tutorial for Beginners - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"datePublished\":\"2021-08-03T08:00:00+00:00\",\"dateModified\":\"2022-07-08T12:14:21+00:00\",\"description\":\"This is an SQL tutorial for beginners. We will discuss what is SQL and what it is used for. You can also check this tutorial in the following video: SQL\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"Bipartite Graph\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"sql\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/sql\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"SQL Tutorial for Beginners\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/442b4f9b8a4aa7e12376464fc354f8ed\",\"name\":\"Mohammad Meraj Zia\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/06\/IMG-20200324-WA0003-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/06\/IMG-20200324-WA0003-96x96.jpg\",\"caption\":\"Mohammad Meraj Zia\"},\"description\":\"Senior Java Developer\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/mohammad-zia\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Tutorial for Beginners - Java Code Geeks","description":"This is an SQL tutorial for beginners. We will discuss what is SQL and what it is used for. You can also check this tutorial in the following video: SQL","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:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/","og_locale":"en_US","og_type":"article","og_title":"SQL Tutorial for Beginners - Java Code Geeks","og_description":"This is an SQL tutorial for beginners. We will discuss what is SQL and what it is used for. You can also check this tutorial in the following video: SQL","og_url":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2021-08-03T08:00:00+00:00","article_modified_time":"2022-07-08T12:14:21+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","type":"image\/jpeg"}],"author":"Mohammad Meraj Zia","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Mohammad Meraj Zia","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/"},"author":{"name":"Mohammad Meraj Zia","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/442b4f9b8a4aa7e12376464fc354f8ed"},"headline":"SQL Tutorial for Beginners","datePublished":"2021-08-03T08:00:00+00:00","dateModified":"2022-07-08T12:14:21+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/"},"wordCount":1560,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","articleSection":["sql"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/","url":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/","name":"SQL Tutorial for Beginners - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","datePublished":"2021-08-03T08:00:00+00:00","dateModified":"2022-07-08T12:14:21+00:00","description":"This is an SQL tutorial for beginners. We will discuss what is SQL and what it is used for. You can also check this tutorial in the following video: SQL","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","width":150,"height":150,"caption":"Bipartite Graph"},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/sql-tutorial-for-beginners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/"},{"@type":"ListItem","position":4,"name":"sql","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/sql\/"},{"@type":"ListItem","position":5,"name":"SQL Tutorial for Beginners"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/442b4f9b8a4aa7e12376464fc354f8ed","name":"Mohammad Meraj Zia","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/06\/IMG-20200324-WA0003-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/06\/IMG-20200324-WA0003-96x96.jpg","caption":"Mohammad Meraj Zia"},"description":"Senior Java Developer","sameAs":["http:\/\/www.javacodegeeks.com\/"],"url":"https:\/\/examples.javacodegeeks.com\/author\/mohammad-zia\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/103254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=103254"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/103254\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=103254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=103254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=103254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}