{"id":97056,"date":"2020-11-12T11:00:00","date_gmt":"2020-11-12T09:00:00","guid":{"rendered":"https:\/\/examples.javacodegeeks.com\/?p=97056"},"modified":"2022-07-08T15:37:00","modified_gmt":"2022-07-08T12:37:00","slug":"sql-create-table-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/","title":{"rendered":"SQL Create Table Example"},"content":{"rendered":"<p>This article focuses on the functionality and usage of the SQL Create Table command.<\/p>\n<p>A Relational Database Management System stores data in form of relations. A relation comprises tuples and attributes. In layman terms, relation means a table comprising of rows and columns. A tuple is a row, whereas an attribute is a column.<\/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=B6eUqJHygDc\"><img decoding=\"async\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Create-Table-Example-1024x576.jpg\" alt=\"\" class=\"wp-image-113874\" width=\"512\" height=\"288\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Create-Table-Example-1024x576.jpg 1024w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Create-Table-Example-300x169.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Create-Table-Example-768x432.jpg 768w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/SQL-Create-Table-Example.jpg 1280w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><figcaption>CREATE TABLE SQL Tutorial &#8211; video<\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\">1. Pre-requisites<\/h2>\n<p>You can implement the example of this article in two ways:<\/p>\n<ol class=\"wp-block-list\">\n<li>By installing <a href=\"https:\/\/www.w3schools.com\/sql\/sql_syntax.asp\">SQL<\/a> in your local machine. <\/li>\n<li>On any online SQL compiler. <\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\">2. About Create Table Command in SQL<\/h2>\n<p><code>SQL Create Table<\/code> command is used to create a new table in the database.  You can also create a new table from a pre-existing table. Note that to create a table, you need to have an existing database. <\/p>\n<h2 class=\"wp-block-heading\" id=\"h-3-sql-create-table-syntax\">3. SQL Create Table Syntax <\/h2>\n<p>Now, let us look at the syntax for the Create Table command. <\/p>\n<pre class=\"wp-block-preformatted brush:sql\">CREATE TABLE tableName (\ncolumnName1 datatype1,\ncolumnName2 datatype2,\ncolumnName3 datatype3);<\/pre>\n<h2 class=\"wp-block-heading\">4. SQL Create Table Example<\/h2>\n<ol class=\"wp-block-list\">\n<li>First of all, create a database. Let us create a database named example using the <strong>Create Database<\/strong> command.<\/li>\n<\/ol>\n<pre class=\"wp-block-preformatted brush:sql\">Create Database example;<\/pre>\n<p>Then you have to use the database created above to create a table.<\/p>\n<pre class=\"wp-block-preformatted brush:sql\">Use example;<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"397\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg1-1024x397.jpg\" alt=\"SQL Create Table - Create database\" class=\"wp-image-97062\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg1-1024x397.jpg 1024w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg1-300x116.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg1-768x298.jpg 768w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg1.jpg 1106w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>SQL Create database and use database<\/figcaption><\/figure>\n<\/div>\n<p>2. With that, you can now create a table using the <strong>Create table<\/strong> command. Let us say &#8211; we are creating a table named student data. The table has 3 columns. The columns are <strong>studentName<\/strong>, <strong>studentId<\/strong>, and <strong>studentAge<\/strong> where the first column is of type varchar, the others are <strong>integers<\/strong>. <\/p>\n<pre class=\"brush:sql\">CREATE TABLE studentData( studentName varchar(20), studentId number, studentAge number);\n<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"237\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg2-1024x237.jpg\" alt=\"SQL Create Table -  Create table &amp; describe\" class=\"wp-image-97063\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg2-1024x237.jpg 1024w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg2-300x69.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg2-768x178.jpg 768w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/11\/jcg2.jpg 1085w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>SQL Create table &amp; describe table command<\/figcaption><\/figure>\n<\/div>\n<p>The describe command is used to check the structure of the table that you created using <code>SQL Create table<\/code> command. <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-5-primary-key\">5. Primary Key<\/h2>\n<p>A primary key is a column whose data can be used to uniquely identify each data record. In this step, I will insert four records into the <strong>StudentData<\/strong> table and define the <strong>studentId<\/strong> column as the primary key.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Insert statement<\/em><\/span><\/p>\n<pre class=\"wp-block-preformatted brush:sql\">insert studentData(studentName ,  studentId , studentAge ) values('Mary Zheng', 1, 50);\ninsert studentData(studentName ,  studentId , studentAge ) values('Tom He', 2, 56);\ninsert studentData(studentName ,  studentId , studentAge ) values('Tina  Sheng', 3, 16);\ninsert studentData(studentName ,  studentId , studentAge ) values('John Cheng', 4, 25);<\/pre>\n<p><span style=\"text-decoration: underline\"><em>primary key<\/em><\/span><\/p>\n<pre class=\"wp-block-preformatted brush\">alter table studentData add primary key (studentId )<\/pre>\n<p><span style=\"text-decoration: underline\"><em>alter table output<\/em><\/span><\/p>\n<pre class=\"wp-block-preformatted brush:plain\">mysql&gt; alter table studentData add primary key (studentId );\nQuery OK, 0 rows affected (0.09 sec)\nRecords: 0  Duplicates: 0  Warnings: 0\n\nmysql&gt;<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/insert.jpg\"><img decoding=\"async\" width=\"799\" height=\"500\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/insert.jpg\" alt=\"\" class=\"wp-image-104924\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/insert.jpg 799w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/insert-300x188.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/insert-768x481.jpg 768w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/a><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-6-foreign-key\">6. Foreign Key<\/h2>\n<p>A foreign key is a column which links to a primary key in another table. Primary and foreign keys are the keys to link data among the tables. In this example, I will create two tables and link the data with primary and foreign keys.<\/p>\n<p><span style=\"text-decoration: underline\"><em>create courseData<\/em><\/span><\/p>\n<pre class=\"wp-block-preformatted brush:sql\">--create courseData\nCREATE TABLE courseData( courseName varchar(20), courseId INT,  PRIMARY KEY (courseId ));\n\ninsert into courseData(courseName , courseId ) values('Math', 1);\ninsert into courseData(courseName , courseId ) values('English', 2);<\/pre>\n<p><span style=\"text-decoration: underline\"><em>create student_course and link with foreign keys<\/em><\/span><\/p>\n<pre class=\"wp-block-preformatted brush:sql\">--create student_course table\nCREATE TABLE student_course(\nid INT NOT NULL AUTO_INCREMENT, courseId INT,studentId INT, \nPRIMARY KEY (id),\nFOREIGN KEY (courseId) REFERENCES courseData(courseId),\nFOREIGN KEY ( studentId) REFERENCES studentData( studentId));\n\n--insert the data\ninsert into student_course(courseId,studentId) values(1,1);\ninsert into student_course(courseId,studentId) values(2,1);\ninsert into student_course(courseId,studentId) values(1,2);\ninsert into student_course(courseId,studentId) values(2,3);\ninsert into student_course(courseId,studentId) values(1,4);\ninsert into student_course(courseId,studentId) values(2,2);\n<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/foreignkey.jpg\"><img decoding=\"async\" width=\"791\" height=\"299\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/foreignkey.jpg\" alt=\"\" class=\"wp-image-104923\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/foreignkey.jpg 791w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/foreignkey-300x113.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/foreignkey-768x290.jpg 768w\" sizes=\"(max-width: 791px) 100vw, 791px\" \/><\/a><figcaption>Create table with Foreign keys<\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-7-select-data-from-joined-tables\">7. Select Data from Joined Tables<\/h2>\n<p>In this step, I will select the data from joined tables based on the primary and foreign keys.<\/p>\n<p><span style=\"text-decoration: underline\"><em>select with join<\/em><\/span><\/p>\n<pre class=\"wp-block-preformatted brush:sql\">select * \nfrom student_course sc, studentData s, courseData c\nwhere sc.courseId = c.courseId\nand sc.studentId = s.studentId;<\/pre>\n<p><span style=\"text-decoration: underline\"><em>select result<\/em><\/span><\/p>\n<pre class=\"wp-block-preformatted brush:plain\">mysql&gt; select *\n    -&gt; from student_course sc, studentData s, courseData c\n    -&gt; where sc.courseId = c.courseId\n    -&gt; and sc.studentId = s.studentId;\n+----+----------+-----------+-------------+-----------+------------+------------+----------+\n| id | courseId | studentId | studentName | studentId | studentAge | courseName | courseId |\n+----+----------+-----------+-------------+-----------+------------+------------+----------+\n|  1 |        1 |         1 | Mary Zheng  |         1 |         50 | Math       |        1 |\n|  3 |        1 |         2 | Tom He      |         2 |         56 | Math       |        1 |\n|  5 |        1 |         4 | John Cheng  |         4 |         25 | Math       |        1 |\n|  2 |        2 |         1 | Mary Zheng  |         1 |         50 | English    |        2 |\n|  4 |        2 |         3 | Tina  Sheng |         3 |         16 | English    |        2 |\n|  6 |        2 |         2 | Tom He      |         2 |         56 | English    |        2 |\n+----+----------+-----------+-------------+-----------+------------+------------+----------+\n6 rows in set (0.01 sec)\n\nmysql&gt;<\/pre>\n<h2 class=\"wp-block-heading\">8. Summary<\/h2>\n<p>This article discusses the <code>SQL Create Table<\/code> command&#8217;s functionality and usage through the example. <code>SQL Create Table<\/code> command is one of the most fundamental commands in SQL. It also touches upon the relational database terminologies &#8211; relations, tuples, attributes, primary, foreign key, insert, and select statements.<\/p>\n<h2 class=\"wp-block-heading\">9. Download the source code<\/h2>\n<p>You should download the source code to implement the functionality of <code>SQL Create Table<\/code> command. <\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/09\/SQL-create.zip\"><strong>SQL Create Table Example<\/strong><\/a><\/div>\n<p><strong>Last updated on Feb. 24th, 2022<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article focuses on the functionality and usage of the SQL Create Table command. A Relational Database Management System stores data in form of relations. A relation comprises tuples and attributes. In layman terms, relation means a table comprising of rows and columns. A tuple is a row, whereas an attribute is a column. You &hellip;<\/p>\n","protected":false},"author":234,"featured_media":1204,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[],"class_list":["post-97056","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 Create Table Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"SQL Create Table command is used to create a new table in the database. Note that to create a table, you need to have an existing database.\" \/>\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-create-table-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Create Table Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"SQL Create Table command is used to create a new table in the database. Note that to create a table, you need to have an existing database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/\" \/>\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=\"2020-11-12T09:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-08T12:37:00+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=\"Simran Koul\" \/>\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=\"Simran Koul\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/\"},\"author\":{\"name\":\"Simran Koul\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5f017b27433db0a02e2ea1cedd4ec94c\"},\"headline\":\"SQL Create Table Example\",\"datePublished\":\"2020-11-12T09:00:00+00:00\",\"dateModified\":\"2022-07-08T12:37:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/\"},\"wordCount\":484,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#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-create-table-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/\",\"name\":\"SQL Create Table Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"datePublished\":\"2020-11-12T09:00:00+00:00\",\"dateModified\":\"2022-07-08T12:37:00+00:00\",\"description\":\"SQL Create Table command is used to create a new table in the database. Note that to create a table, you need to have an existing database.\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#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-create-table-example\/#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 Create Table Example\"}]},{\"@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\/5f017b27433db0a02e2ea1cedd4ec94c\",\"name\":\"Simran Koul\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/02\/Capture-1-96x96.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/02\/Capture-1-96x96.png\",\"caption\":\"Simran Koul\"},\"description\":\"Simran has graduated as a Bachelor of Engineering in Computer Science from Chitkara University. She has undergone a 6-months long comprehensive industrial training at the reputed Centre for Development of Advanced Computing (C-DAC), where she worked on a project including the likes of Java, JSP, Servlets while the UI-UX through the pioneering HTML, CSS and JS. Her inquisitive nature and the seed of curiosity keeps her on the toes to find material to write about. Along with her interests in Software Development, she is an ardent reader and always ready-to-write writer.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/simran-koul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Create Table Example - Java Code Geeks","description":"SQL Create Table command is used to create a new table in the database. Note that to create a table, you need to have an existing database.","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-create-table-example\/","og_locale":"en_US","og_type":"article","og_title":"SQL Create Table Example - Java Code Geeks","og_description":"SQL Create Table command is used to create a new table in the database. Note that to create a table, you need to have an existing database.","og_url":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2020-11-12T09:00:00+00:00","article_modified_time":"2022-07-08T12:37:00+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":"Simran Koul","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Simran Koul","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/"},"author":{"name":"Simran Koul","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5f017b27433db0a02e2ea1cedd4ec94c"},"headline":"SQL Create Table Example","datePublished":"2020-11-12T09:00:00+00:00","dateModified":"2022-07-08T12:37:00+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/"},"wordCount":484,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#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-create-table-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/","url":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/","name":"SQL Create Table Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","datePublished":"2020-11-12T09:00:00+00:00","dateModified":"2022-07-08T12:37:00+00:00","description":"SQL Create Table command is used to create a new table in the database. Note that to create a table, you need to have an existing database.","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/sql-create-table-example\/#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-create-table-example\/#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 Create Table Example"}]},{"@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\/5f017b27433db0a02e2ea1cedd4ec94c","name":"Simran Koul","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/02\/Capture-1-96x96.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/02\/Capture-1-96x96.png","caption":"Simran Koul"},"description":"Simran has graduated as a Bachelor of Engineering in Computer Science from Chitkara University. She has undergone a 6-months long comprehensive industrial training at the reputed Centre for Development of Advanced Computing (C-DAC), where she worked on a project including the likes of Java, JSP, Servlets while the UI-UX through the pioneering HTML, CSS and JS. Her inquisitive nature and the seed of curiosity keeps her on the toes to find material to write about. Along with her interests in Software Development, she is an ardent reader and always ready-to-write writer.","url":"https:\/\/examples.javacodegeeks.com\/author\/simran-koul\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/97056","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\/234"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=97056"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/97056\/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=97056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=97056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=97056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}