

{"id":21851,"date":"2018-08-08T05:00:22","date_gmt":"2018-08-08T05:00:22","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=21851"},"modified":"2021-03-10T14:34:45","modified_gmt":"2021-03-10T09:04:45","slug":"sql-create-database","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/sql-create-database\/","title":{"rendered":"SQL Create Database | SQL Drop &amp; Select Database"},"content":{"rendered":"<p>SQL(Structured Query Language) is used for managing the relational DBMS. SQL provides us many functionalities using queries and commands like Create, Drop, and Select database query.<\/p>\n<p>We have various types of queries available to us. <strong>Create<\/strong> and <strong>Drop<\/strong> belong to the <strong>DDL(Data Definition Language)<\/strong> type of queries, and <strong>Select<\/strong> belongs to <strong>DML(Data Manipulation Language)<\/strong> type of queries.<\/p>\n<p>Create query helps us create a database, while drop deletes the data stored in the table, and Select query helps us get a glimpse of the data stored and provides a view with various applied conditions.<\/p>\n<h3>What is a Database?<\/h3>\n<p>We have large amounts of data being generated every day and to utilize the generated data, we need to store the data properly.<\/p>\n<p>We use databases to store the data being produced. In other words, we can say that a database is a collection of large amounts of data.<\/p>\n<p>A database is made up of many tables and data inserted into those tables.<\/p>\n<h3>Rules for creating a Database<\/h3>\n<p>While creating a database, we need to follow some rules:<\/p>\n<p>1. The database that we are creating should have a unique name so that it can be identified easily.<br \/>\n2. The name of the database can be 128 characters long, not more than that.<br \/>\n3. Our create query runs in the auto-commit mode.<\/p>\n<h3>Why do we need to Create, Drop, and Select Query?<\/h3>\n<p>Data is increasing day by day, and billions of new data are created and thus we need to have control to continuously capture the data in the database.<\/p>\n<p>With the SQL queries, we are able to do that.<\/p>\n<p>With the Create query, we create multiple tables that are then used to store the data and perform various studies on it.<\/p>\n<p>In today\u2019s time, almost all the major sectors use data for exploratory analysis to predict the growth of services being provided by them.<\/p>\n<p>Some of the significant examples being :<\/p>\n<ul>\n<li>Health Care Sector<\/li>\n<li>E-commerce Sector<\/li>\n<li>Financial Firms<\/li>\n<\/ul>\n<p>This dependency on data requires efficient management and handling of data being produced, and here, SQL queries come in handy.<\/p>\n<p>Similarly, we use Select query to get a glimpse of the data stored in our database, and Drop query is used to drop the data stored in the table with the specified conditions.<\/p>\n<h3>SQL Create Query<\/h3>\n<p>Create query comes under the DDL(Data Definition Language) in SQL.<\/p>\n<p>DDL queries help in defining the database structure or the database schema. It is also known as Data Storage and Definition Language.<\/p>\n<p>Create helps us define the implementation details of the schema which are hidden from the user and are accessible only to the database administrator.<\/p>\n<p>Create Query is used to create a table in the database.<\/p>\n<p><strong>Syntax of Create Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">CREATE Table tableName (\r\ncolumnName1 datatype,\r\ncolumnName2 datatype,\r\ncolumnName3 datatype,\r\ncolumnName4 datatype,\r\ncolumnName5 datatype,\r\n\u2026...\r\n);\r\n<\/pre>\n<p>Let us consider an example:<\/p>\n<p>Let us create a table called <strong>DataFlair_Employee,<\/strong> which holds the details of all the current employees working in DataFlair. The details must include :<\/p>\n<ul>\n<li>Name of the employee<\/li>\n<li>Post of the Employee<\/li>\n<li>Email of the Employee<\/li>\n<li>Age of the Employee<\/li>\n<li>Contact Number of the Employee<\/li>\n<\/ul>\n<p>Thus, we need to create five columns in our database, i.e. :<\/p>\n<ul>\n<li><strong>name_emp &#8211;<\/strong> Name of the employee<\/li>\n<li><strong>post_emp &#8211;<\/strong> Post of the Employee<\/li>\n<li><strong>email &#8211;<\/strong> Email of the Employee<\/li>\n<li><strong>age &#8211;<\/strong> Age of the Employee<\/li>\n<li><strong>co_num &#8211;<\/strong> Contact Number of the Employee<\/li>\n<\/ul>\n<p>Let us now write the query to create our table DataFlair_Employee, we have decided the column number and names in advance (stated in bold):<\/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\nco_num varchar(10)\r\n);\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-86801\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table.png\" alt=\"SQL Create table\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Create-table-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-86802\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table.png\" alt=\"View SQL created table\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-the-created-table-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p><strong>Populating the database :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Insert into DataFlair_Employee (name_emp , post_emp , email , age , co_num)\r\nValues ('Ram' ,  \"Intern\", 'ram@dataflair.com', 21 , '7415823691' ),\r\n('Shyam', \"Manager\", 'shyam@dataflair.com' , 25 , '7586941235'),\r\n('Ria', \"Analyst\" , 'ram@dataflair.com', 23 , '7415823691'),\r\n('Kavya', \"Senior Analyst\" , 'kavya@dataflair.com', 31 , '9874586321'),\r\n('Aman', \"Database Operator\",' rish@dataflair.com' , 26 , '9864752431') ;\r\n<\/pre>\n<p><strong>To view the created table :<\/strong><br \/>\nSelect * from DataFlair_Employee;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-86803\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data.png\" alt=\"view inserted data in SQL\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/view-inserted-data-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>This is how we create a table using the create statement.<\/p>\n<h3>SELECT Query in SQL<\/h3>\n<p>Select query comes under the DML (Data Manipulation Language) query of SQL.<\/p>\n<p>DML queries help us to manipulate and edit data stored in a database. Select query is used to take a peek into the data stored in the database and to get a glimpse of the type of data stored in the database.<\/p>\n<p>Select query is required to access the data stored in our database and is used to check data beforehand using any operation on the database for data cleaning and analysis.<\/p>\n<p><strong>Syntax of SELECT Query :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT * FROM tableName ;<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT column1 , column2 , \u2026.. FROM tableName ;\r\n<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT column1 , column2 , \u2026\u2026 FROM tableName WHERE condition;<\/pre>\n<p><strong>Example :<\/strong><br \/>\nLet us view the table DataFlair_Employee we created above.<\/p>\n<p><strong>1. First, let us view all the data stored in the table DataFlair_Employee.<\/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\/2018\/08\/select-query-to-view-all-data.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-86804\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data.png\" alt=\"select query to view all data\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-to-view-all-data-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p><strong>2. Query to view only a few units of data stored in the table.<\/strong><\/p>\n<p>We can restrict the number of rows we want to see in the data, i.e. we can restrict our output table using the LIMIT keyword.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT name_emp , age FROM DataFlair_Employee LIMIT 2 ;<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-86806\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit.png\" alt=\"select query with limit\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-limit-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>Here we get the two rows in our output as we have set the LIMIT to 2, and only the column\u2019s passed in the query are returned in the output.<\/p>\n<p><strong>3. Query to get data according to specified conditions<\/strong><\/p>\n<p>Consider we want the data of employees who are above the age of 22, then we can do so by the following query.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SELECT * FROM DataFlair_Employee Where age &gt; 22;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-86805\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition.png\" alt=\"select query with condition\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/select-query-with-condition-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>Here, we get the details of all the employees whose age is more than 22 years.<\/p>\n<h3>DROP Query in SQL<\/h3>\n<p>DROP query is used to delete the table on which the drop command is executed. It deletes the table definition and all its column definitions and restrictions.<\/p>\n<p><strong>Syntax:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">DROP TABLE tableName ;<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<p>Let us try deleting our existing table, i.e. DataFlair_Employee table. The query for the same will be as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Drop Table DataFlair_Employee;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-86807\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2.png\" alt=\"drop table in SQL\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2-1536x824.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2-720x386.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2-520x279.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/drop-table-2-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>We should be very careful when we drop a table because once a table is dropped, the table can\u2019t be recovered back.<\/p>\n<h3>Summary<\/h3>\n<p>We have seen how we can create a database using the Create query and view the database using the Select query, in multiple formats using the Limit and the Where clause.<\/p>\n<p>The Limit clause is used to view chunks of the database and where clause is used to get data according to the conditions provided by the user.<\/p>\n<p>At last, we see how to drop a table, but we should be very cautious when we drop a table as once this action is performed, we can\u2019t reverse it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL(Structured Query Language) is used for managing the relational DBMS. SQL provides us many functionalities using queries and commands like Create, Drop, and Select database query. We have various types of queries available to&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":86808,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[3061,13430,13526,13528,14103,14104,14107],"class_list":["post-21851","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql","tag-create-database-statement","tag-sql-create-database","tag-sql-select-database","tag-sql-select-dtabase","tag-syntax-of-sql-create-databsae","tag-syntax-of-sql-drop-database","tag-syntax-of-sqlselect-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Create Database | SQL Drop &amp; Select Database - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn about SQL Create database, SQL select database,SQL drop database with syntax and examples to explain the same.\" \/>\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-create-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Create Database | SQL Drop &amp; Select Database - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn about SQL Create database, SQL select database,SQL drop database with syntax and examples to explain the same.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/sql-create-database\/\" \/>\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=\"2018-08-08T05:00:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-10T09:04:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/SQL-Create-drop-select-database.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=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Create Database | SQL Drop &amp; Select Database - DataFlair","description":"Learn about SQL Create database, SQL select database,SQL drop database with syntax and examples to explain the same.","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-create-database\/","og_locale":"en_US","og_type":"article","og_title":"SQL Create Database | SQL Drop &amp; Select Database - DataFlair","og_description":"Learn about SQL Create database, SQL select database,SQL drop database with syntax and examples to explain the same.","og_url":"https:\/\/data-flair.training\/blogs\/sql-create-database\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-08-08T05:00:22+00:00","article_modified_time":"2021-03-10T09:04:45+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/SQL-Create-drop-select-database.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":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"SQL Create Database | SQL Drop &amp; Select Database","datePublished":"2018-08-08T05:00:22+00:00","dateModified":"2021-03-10T09:04:45+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/"},"wordCount":1002,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/SQL-Create-drop-select-database.jpg","keywords":["Create Database Statement","SQL create database","SQL select Database","SQL select Dtabase","syntax of sql create databsae","syntax of sql drop database","syntax of SQLselect database"],"articleSection":["SQL Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/sql-create-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/","url":"https:\/\/data-flair.training\/blogs\/sql-create-database\/","name":"SQL Create Database | SQL Drop &amp; Select Database - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/SQL-Create-drop-select-database.jpg","datePublished":"2018-08-08T05:00:22+00:00","dateModified":"2021-03-10T09:04:45+00:00","description":"Learn about SQL Create database, SQL select database,SQL drop database with syntax and examples to explain the same.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/sql-create-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/SQL-Create-drop-select-database.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/SQL-Create-drop-select-database.jpg","width":1200,"height":628,"caption":"SQL Create, drop & select database"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/sql-create-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Searching for Groups of Scala Regex","item":"https:\/\/data-flair.training\/blogs\/tag\/searching-for-groups-of-scala-regex\/"},{"@type":"ListItem","position":3,"name":"SQL Create Database | SQL Drop &amp; Select Database"}]},{"@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\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/21851","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\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=21851"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/21851\/revisions"}],"predecessor-version":[{"id":86809,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/21851\/revisions\/86809"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/86808"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=21851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=21851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=21851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}