{"id":3157,"date":"2016-11-04T18:05:54","date_gmt":"2016-11-04T22:05:54","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=3157"},"modified":"2017-12-12T15:40:40","modified_gmt":"2017-12-12T20:40:40","slug":"mysql-101-basics","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/","title":{"rendered":"MySQL 101 &#8211; The basics"},"content":{"rendered":"<h1>MySQL 101 &#8211; The basics<\/h1>\n<p>MySQL is one of the most widely used relational database management systems (RDBMS). MySQL is used to manage databases in a wide variety of applications including the integrated web solution known as LAMP (Linux Apache MySQL Perl\/PHP\/Python). Database management is accomplished in MySQL using Structured Query Language (SQL). Because it scales well, MySQL works for projects of almost any size and complexity. Strong security features and the abundance of tools to control it make MySQL attractive to users who want to protect their data and still have easy access to and easy use of it. <\/p>\n<h2>Tutorial<\/h2>\n<p>This guide has been created to serve as a reference for most basic commands in SQL. Below, we have used a random test database to show you the basic principles of operating MySQL directly from the Command Line Interface (CLI). If you master the commands below, you will be well on your way to understanding how to effectively manage a database using MySQL. <\/p>\n<p><strong>Connecting to MySQL<\/strong><\/p>\n<p>To get started, establish an active SSH session on your server. We will connect using the root user of our MySQL instance for convenience. To follow along, you will need to know your MySQL root password to initiate your session.<\/p>\n<p><code>mysql -u root -p<\/code><\/p>\n<p><code class=\"gris\">Password:<br \/>\n<\/br><br \/>\nWelcome to the MySQL monitor.  Commands end with ; or \\g.<br \/>\nYour MySQL connection id is 5975<br \/>\nServer version: 5.1.73 Source distribution<br \/>\n<\/br><br \/>\nCopyright (c) 2000, 2013, Oracle and\/or its affiliates. All rights reserved.<br \/>\nOracle is a registered trademark of Oracle Corporation and\/or its<br \/>\naffiliates. Other names may be trademarks of their respective<br \/>\nowners.<br \/>\n<\/br><br \/>\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.<br \/>\n<\/br><br \/>\nmysql><\/code><\/p>\n<p>The appearance of the mysql> prompt after you enter the command to initiate the session indicates you are connected to the MySQL instance on your server and can execute commands.<\/p>\n<p><strong>View databases<\/strong><\/p>\n<p>Our first command is SHOW DATABASES. When you enter this command, a list of all the active databases on this MySQL instance will print to the screen.<\/p>\n<p><code>mysql> show databases;<\/code><br \/>\n<code class=\"gris\">+--------------------+<br \/>\n| Database           |<br \/>\n+--------------------+<br \/>\n| information_schema |<br \/>\n| mysql              |<br \/>\n| radius             |<br \/>\n+--------------------+<br \/>\n3 rows in set (0.02 sec)<\/code><\/p>\n<p><strong>Create a database<\/strong><\/p>\n<p>To use MySQL for your own projects you will need your own databases. Whether you want to start from scratch, or import a schema or data from an existing database you will need first to create the databases you want to use in this instance of MySQL. Go ahead and create the database &#8220;mynewdb&#8221; with the following command:<\/p>\n<p><code>mysql> create database mynewdb;<\/code><br \/>\n<code class=\"gris\">Query OK, 1 row affected (0.00 sec)<\/code><\/p>\n<p>Your database &#8220;mynewdb&#8221; is now ready to use. Now, you can create tables in it or import the contents of an existing database or schema.<\/p>\n<p><strong>Use a database<\/strong><\/p>\n<p>The USE command will enable you to select a specific database to work on. For instance, you may use mynewdb by entering<\/p>\n<p><code>[root@server ~]# mysql -u root -p mynewdb < radius.sql<\/code><br \/>\n<code class=\"gris\">Enter password:<\/code><\/p>\n<p><strong>Populating a database<\/strong><\/p>\n<p>You have two basic options for populating mynewdb: Manually create tables and insert data into those tables or import the contents of an existing database or schema structure into mynewdb. Because importing is more straightforward, we will start there.<\/p>\n<p><strong>Import data<\/strong><\/p>\n<p>To import data from an existing database, you must execute the command outside of MySQL, directly in the SSH command line. MySQL database backups are text files that are typically created with the .sql file extension name so that they may be easily identified as database backups. For our example, we'll import the contents of the radius.sql file into the mynewdb database.<\/p>\n<p><code>mysql> use radius<\/code><br \/>\n<code class=\"gris\">Reading table information for completion of table and column names<br \/>\nYou can turn off this feature to get a quicker startup with -A<br \/>\nDatabase changed<\/code><\/p>\n<p>The IMPORT command populated mynewdb by creating a copy of all of the tables and records that were found in the original database. MySQL accomplished this duplication by running every SQL command that had been run to populate the original database.<\/p>\n<p><strong>Delete a database<\/strong><\/p>\n<p>When a database has reached the end of its useful life deleting it is quite a straightforward process. Simply do as we show below to remove a database from your MySQL instance.<\/p>\n<p><code>mysql> drop database mynewdb;<\/code><br \/>\n<code class=\"gris\">Query OK, 35 rows affected (0.05 sec)<\/code><\/p>\n<p>Be careful with this command. Once a database is deleted the data in it cannot be recovered from within MySQL. Of course, if you have retained a backup you can always create a new database and import the contents of the old one.<\/p>\n<p><strong>Create a table<\/strong><\/p>\n<p>MySQL databases are built using tables. The creation a MySQL table is a complex task. Tables are so customizable that they really need to be designed to meet your specific needs or the needs of your application. To keep this guide brief we'll show you how we created a specific table we'll be using in our further examples below. <\/p>\n<p>One of the tables in our sample database was created like so:<\/p>\n<p><code>mysql> CREATE TABLE `radgroupreply`<\/code><code class=\"gris\"> (<br \/>\n  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,<br \/>\n  `groupname` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',<br \/>\n  `attribute` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',<br \/>\n  `op` char(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '=',<br \/>\n  `value` varchar(253) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',<br \/>\n  PRIMARY KEY (`id`),<br \/>\n  KEY `groupname` (`groupname`(32))<br \/>\n) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;<br \/>\nQuery OK, 0 rows affected (0.06 sec)<\/code><\/p>\n<p><strong>Show tables within the database<\/strong><\/p>\n<p>Tables are associated with the database in which they are created. To see a list of all the tables in the database with which you are working use the SHOW TABLES command:<\/p>\n<p><code>mysql> show tables;<\/code><br \/>\n<code class=\"gris\">+------------------------+<br \/>\n| Tables_in_radius       |<br \/>\n+------------------------+<br \/>\n| batch_history          |<br \/>\n| billing_history        |<br \/>\n| billing_merchant       |<br \/>\n| billing_paypal         |<br \/>\n| billing_plans          |<br \/>\n| billing_plans_profiles |<br \/>\n| billing_rates          |<br \/>\n| cui                    |<br \/>\n| dictionary             |<br \/>\n| hotspots               |<br \/>\n| invoice                |<br \/>\n| invoice_items          |<br \/>\n| invoice_status         |<br \/>\n| invoice_type           |<br \/>\n| nas                    |<br \/>\n| node                   |<br \/>\n| operators              |<br \/>\n| operators_acl          |<br \/>\n| operators_acl_files    |<br \/>\n| payment                |<br \/>\n| payment_type           |<br \/>\n| proxys                 |<br \/>\n| radacct                |<br \/>\n| radcheck               |<br \/>\n| radgroupcheck          |<br \/>\n| radgroupreply          |<br \/>\n| radhuntgroup           |<br \/>\n| radippool              |<br \/>\n| radpostauth            |<br \/>\n| radreply               |<br \/>\n| radusergroup           |<br \/>\n| realms                 |<br \/>\n| userbillinfo           |<br \/>\n| userinfo               |<br \/>\n| wimax                  |<br \/>\n+------------------------+<br \/>\n35 rows in set (0.01 sec)<\/code><\/p>\n<p>If you are following along with our guide here, you should see the newly created table in your list.<\/p>\n<p><strong>Delete a table<\/strong><\/p>\n<p>Occasionally, you realize you don\u2019t need a table anymore. Simply follow the command below to eliminate the unwanted table.<\/p>\n<p><code>mysql> drop table radgroupreply;<\/code><br \/>\n<code class=\"gris\">Query OK, 0 rows affected (0.01 sec)<\/code><\/p>\n<p>As with the delete database command, you should use this command with caution as it is not easy to recover from the mistake of using it when you don\u2019t mean to do so. <\/p>\n<p><strong>Show the structure of a table<\/strong><\/p>\n<p>During the lifetime of your database, you will likely want to add (INSERT) or modify (UPDATE) fields. To use both the INSERT and UPDATE commands effectively you need to know what is already in the database. To list the existing columns, rows, and all their associated parameters use the DESCRIBE command:<\/p>\n<p><code>mysql> desc wimax;<\/code><br \/>\n<code class=\"gris\">+----------+--------------+------+-----+-------------------+-----------------------------+<br \/>\n| Field    | Type         | Null | Key | Default           | Extra                       |<br \/>\n+----------+--------------+------+-----+-------------------+-----------------------------+<br \/>\n| id       | int(11)      | NO   | PRI | NULL              | auto_increment              |<br \/>\n| username | varchar(64)  | NO   | MUL |                   |                             |<br \/>\n| authdate | timestamp    | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |<br \/>\n| spi      | varchar(16)  | NO   | MUL |                   |                             |<br \/>\n| mipkey   | varchar(400) | NO   |     |                   |                             |<br \/>\n| lifetime | int(12)      | YES  |     | NULL              |                             |<br \/>\n+----------+--------------+------+-----+-------------------+-----------------------------+<br \/>\n6 rows in set (0.00 sec)<\/code><\/p>\n<p><strong>Select rows from a table<\/strong><\/p>\n<p>Use the SELECT command to view a particular portion of your data in a table (or all of it). This command is highly customizable. We'll show you a few variants below.<\/p>\n<p><strong>Select everything<\/strong><\/p>\n<p>If you wish to generate a list of everything from the table enter the following.<\/p>\n<p><code>mysql> SELECT * FROM radgroupreply;<\/code><br \/>\n<code class=\"gris\">+----+-----------+-----------------------+----+-------+<br \/>\n| id | groupname | attribute             | op | value |<br \/>\n+----+-----------+-----------------------+----+-------+<br \/>\n|  1 | default   | Acct-Interim-Interval | := | 15    |<br \/>\n|  2 | test1     | This is a test        | =  | 5     |<br \/>\n|  3 | test2     | This is a second test | =  | 29    |<br \/>\n|  4 | test3     | This is a third test  | =  | 12    |<br \/>\n+----+-----------+-----------------------+----+-------+<\/code><\/p>\n<p><strong>Select everything where groupname is default<\/strong><\/p>\n<p>Groupname is the title of a column or field in our table. Use of the command<\/p>\n<p><code>mysql> SELECT * FROM radgroupreply WHERE groupname=\"default\";<\/code><br \/>\n<code class=\"gris\">+----+-----------+-----------------------+----+-------+<br \/>\n| id | groupname | attribute             | op | value |<br \/>\n+----+-----------+-----------------------+----+-------+<br \/>\n|  1 | default   | Acct-Interim-Interval | := | 15    |<br \/>\n+----+-----------+-----------------------+----+-------+<br \/>\n1 row in set (0.00 sec)<\/code><\/p>\n<p>will return the whole row where the value of the entry in the column groupname matches the \"default\" value.<\/p>\n<p><strong>Select everything where value is smaller or equal to 15<\/strong><\/p>\n<p>The following will return the whole row where the value field is populated with a value less than or equal to 15 (<=). \n\n\n<code>mysql> SELECT * FROM radgroupreply WHERE value<=15;<\/code><\/p>\n<p><code class=\"gris\">+----+-----------+-----------------------+----+-------+<br \/>\n| id | groupname | attribute             | op | value |<br \/>\n+----+-----------+-----------------------+----+-------+<br \/>\n|  1 | default   | Acct-Interim-Interval | := | 15    |<br \/>\n|  2 | test1     | This is a test        | =  | 5     |<br \/>\n|  4 | test3     | This is a third test  | =  | 12    |<br \/>\n+----+-----------+-----------------------+----+-------+<br \/>\n3 rows in set (0.00 sec)<\/code><\/p>\n<p>You may construct similar commands with other operators such as <, >, <=, >= and =.<\/p>\n<p><strong>Select the data from only 1 field for all rows<\/strong><\/p>\n<p>In this example, we will select only one field from the table in question.<\/p>\n<p><code>mysql> SELECT value FROM radgroupreply;<\/code><br \/>\n<code class=\"gris\">+-------+<br \/>\n| value |<br \/>\n+-------+<br \/>\n| 15    |<br \/>\n| 5     |<br \/>\n| 29    |<br \/>\n| 12    |<br \/>\n+-------+<br \/>\n4 rows in set (0.00 sec)<\/code><\/p>\n<p>The data is displayed in a single column rather than being formatted like the whole table.<\/p>\n<p><strong>Select the data from only multiple fields for all rows<\/strong><\/p>\n<p>Here we will select multiple fields from the table in question. You'll see that the data is displayed in two columns.<\/p>\n<p><code>mysql> SELECT groupname,value FROM radgroupreply;<\/code><br \/>\n<code class=\"gris\">+-----------+-------+<br \/>\n| groupname | value |<br \/>\n+-----------+-------+<br \/>\n| default   | 15    |<br \/>\n| test1     | 5     |<br \/>\n| test2     | 29    |<br \/>\n| test3     | 12    |<br \/>\n+-----------+-------+<br \/>\n4 rows in set (0.00 sec)<\/code><\/p>\n<p>Following the pattern established above, you can select the data from as many or as few of the fields in a table as you wish.<\/p>\n<p><strong>INSERT Rows in a Table<\/strong><\/p>\n<p>The INSERT command enables you to insert rows into a specific table. Inserts can be performed in a few different manners. The method you choose will depend on the mechanics of your code. We will show you two common methods to give you a general sense for how it is done.<\/p>\n<p><strong>First insert method<\/strong><\/p>\n<p>Our first example of how to use INSERT is based on our previous examples of how to use SELECT. This command creates a row consistent with the same table format used above:<\/p>\n<p><code>mysql> INSERT INTO radgroupreply<\/code><code class=\"gris\"> (groupname, attribute, op, value) VALUES ('my group is the best', 'this attribute rocks', '=', '12');<br \/>\nQuery OK, 1 row affected (0.00 sec)<\/code><\/p>\n<p>To check that the row has been inserted, we can perform a select on radgroupreply. The command and results should appear as follows:<\/p>\n<p><code>mysql> SELECT * FROM radgroupreply;<\/code><br \/>\n<code class=\"gris\">+----+----------------------+-----------------------+----+-------+<br \/>\n| id | groupname            | attribute             | op | value |<br \/>\n+----+----------------------+-----------------------+----+-------+<br \/>\n|  1 | default              | Acct-Interim-Interval | := | 15    |<br \/>\n|  2 | test1                | This is a test        | =  | 5     |<br \/>\n|  3 | test2                | This is a second test | =  | 29    |<br \/>\n|  4 | test3                | This is a third test  | =  | 12    |<br \/>\n|  5 | my group is the best | this attribute rocks  | =  | 12    |<br \/>\n+----+----------------------+-----------------------+----+-------+<br \/>\n5 rows in set (0.00 sec)<\/code><br \/>\n\u2003<br \/>\n<strong>Second insert method<\/strong><\/p>\n<p>A new method of inserting data into MySQL tables has gained popularity recently. This method achieves the same thing as the first but the formatting of the query is quite a bit different, as you can see below:<\/p>\n<p><code>mysql> INSERT INTO radgroupreply SET groupname='This other group rocks', attribute='Second type of insert method', op='+', value='11';<\/code><br \/>\n<code class=\"gris\">Query OK, 1 row affected (0.00 sec)<\/code><\/p>\n<p>As with the previous INSERT method, to confirm the insertion worked properly, perform a select on radgroupreply as follows:<\/p>\n<p><code>mysql> select * from radgroupreply;<\/code><br \/>\n<code class=\"gris\">+----+------------------------+------------------------------+----+-------+<br \/>\n| id | groupname              | attribute                    | op | value |<br \/>\n+----+------------------------+------------------------------+----+-------+<br \/>\n|  1 | default                | Acct-Interim-Interval        | := | 15    |<br \/>\n|  2 | test1                  | This is a test               | =  | 5     |<br \/>\n|  3 | test2                  | This is a second test        | =  | 29    |<br \/>\n|  4 | test3                  | This is a third test         | =  | 12    |<br \/>\n|  5 | my group is the best   | this attribute rocks         | =  | 12    |<br \/>\n|  6 | This other group rocks | Second type of insert method | +  | 11    |<br \/>\n+----+------------------------+------------------------------+----+-------+<br \/>\n6 rows in set (0.01 sec)<\/code><\/p>\n<p>and confirm the new row is now in the table.<\/p>\n<p><strong>The UPDATE Command to Update Rows \/ Fields in a Table<\/strong><\/p>\n<p>Using UPDATE you can change the contents of existing rows in a table. This command is quite versatile and will become handy in any SQL project you work on. We'll show you a couple of basic examples of how to use the UPDATE command to get you started.<\/p>\n<p><strong>Update a single value from a row<\/strong><\/p>\n<p>The smallest change you can make to a table is to update a single value from a specific row. To change just one value you need a unique identifier for the row you wish to change. Every row in a given table has a unique row id that is recorded in the id column. To make sure you update the right row use the WHERE statement combined with the desired value from the id column as in the example below.<\/p>\n<p><code>mysql> UPDATE radgroupreply SET value='9' WHERE groupname='test1';<\/code><br \/>\n<code class=\"gris\">Query OK, 1 row affected (0.00 sec)<br \/>\nRows matched: 1  Changed: 1  Warnings: 0<\/code><\/p>\n<p>Our example should have changed the value for the groupname \u201ctest 1\u201d to \u201c9\u201d. We can confirm that change using the following SELECT command:<\/p>\n<p><code>mysql> SELECT value FROM radgroupreply WHERE groupname=\"test1\";<\/code><br \/>\n<code class=\"gris\">+-------+<br \/>\n| value |<br \/>\n+-------+<br \/>\n| 9     |<br \/>\n+-------+<br \/>\n1 row in set (0.01 sec)<\/code><\/p>\n<p><strong>Update multiple values in multiple rows<\/strong><\/p>\n<p>You can also update multiple rows at the same time. We have provided a simple example of such an UPDATE command in which we change the value fields to \u201c0\u201d for all the rows in which the value of the op field is \u201c=\".<\/p>\n<p><code>mysql> UPDATE radgroupreply SET value=\"0\" WHERE op=\"=\";<\/code><br \/>\n<code class=\"gris\">Query OK, 4 rows affected (0.00 sec)<br \/>\nRows matched: 4  Changed: 4  Warnings: 0<\/code><\/p>\n<p>Again, we will use the SELECT command to check whether the desired changes occurred. Given that several rows were affected, it will be easier to figure out if the changes have been made if we print the whole table like so.<\/p>\n<p><code>mysql> SELECT * FROM radgroupreply; <\/code><br \/>\n<code class=\"gris\">+----+------------------------+------------------------------+----+-------+<br \/>\n| id | groupname              | attribute                    | op | value |<br \/>\n+----+------------------------+------------------------------+----+-------+<br \/>\n|  1 | default                | Acct-Interim-Interval        | := | 15    |<br \/>\n|  2 | test1                  | This is a test               | =  | 0     |<br \/>\n|  3 | test2                  | This is a second test        | =  | 0     |<br \/>\n|  4 | test3                  | This is a third test         | =  | 0     |<br \/>\n|  5 | my group is the best   | this attribute rocks         | =  | 0     |<br \/>\n|  6 | This other group rocks | Second type of insert method | +  | 11    |<br \/>\n+----+------------------------+------------------------------+----+-------+<br \/>\n6 rows in set (0.00 sec)<\/code><\/p>\n<p>The results of this latest SELECT should show that the value fields have been updated to \"0\" for all rows where the op field was \"=\".<\/p>\n<p><strong>DELETE rows in a table<\/strong><\/p>\n<p>There are times when you need to delete data from your tables. Such deletions can be done one at a time or in bulk. <\/p>\n<p><strong>Deleting a single row<\/strong><\/p>\n<p>The safest way to delete a specific single row is to specify that row in your DELETE command based on the id column. The following command is an example of this approach:<\/p>\n<p><code>mysql> DELETE FROM radgroupreply WHERE id=\"6\";<\/code><br \/>\n<code class=\"gris\">Query OK, 1 row affected (0.00 sec)<\/code><\/p>\n<p>If you print the full table, using the command below, you should see that the row with id value \u201c6\u201d is no longer present in the table.<\/p>\n<p><code>mysql> SELECT * FROM radgroupreply;<\/code><br \/>\n<code class=\"gris\">+----+----------------------+-----------------------+----+-------+<br \/>\n| id | groupname            | attribute             | op | value |<br \/>\n+----+----------------------+-----------------------+----+-------+<br \/>\n|  1 | default              | Acct-Interim-Interval | := | 15    |<br \/>\n|  2 | test1                | This is a test        | =  | 0     |<br \/>\n|  3 | test2                | This is a second test | =  | 0     |<br \/>\n|  4 | test3                | This is a third test  | =  | 0     |<br \/>\n|  5 | my group is the best | this attribute rocks  | =  | 0     |<br \/>\n+----+----------------------+-----------------------+----+-------+<br \/>\n5 rows in set (0.00 sec)<\/code><\/p>\n<p><strong>Deleting a multiple rows<\/strong><\/p>\n<p>You will often need to remove multiple fields from a table for housekeeping reasons. MySQL tables can become quite large and it's often wise to clean them up for manageability and performance purposes.<\/p>\n<p>Below we'll show you how to delete multiple rows based on a common factor. For this example, we'll delete ALL the rows for which the amount in the value column is below 15. Given the data in our table, that should mean that all rows other than the first row will be deleted when you enter this command:<\/p>\n<p><code>mysql> DELETE FROM radgroupreply WHERE value<\"15\";<\/code><br \/>\n<code class=\"gris\">Query OK, 4 rows affected (0.00 sec)<\/code><\/p>\n<p>With the following SELECT command, we can confirm that all rows have been deleted other than the one where the value column indicates a value of 15 or above.<\/p>\n<p><code>mysql> SELECT * FROM radgroupreply; <\/code><br \/>\n<code class=\"gris\">+----+-----------+-----------------------+----+-------+<br \/>\n| id | groupname | attribute             | op | value |<br \/>\n+----+-----------+-----------------------+----+-------+<br \/>\n|  1 | default   | Acct-Interim-Interval | := | 15    |<br \/>\n+----+-----------+-----------------------+----+-------+<br \/>\n1 row in set (0.00 sec)<\/code><\/p>\n<h2>Conclusion<\/h2>\n<p>Now you know all the basic commands needed to administer MySQL data. There are myriad variations on the above commands that will afford you greater and greater control over the behavior and content of MySQL databases. The best way to learn these variations and the efficiency that comes of using them is to take what you have learned in this tutorial and play with it. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>MySQL 101 &#8211; The basics MySQL is one of the most widely used relational database management systems (RDBMS). MySQL is used to manage databases in a wide variety of applications including the integrated web solution known as LAMP (Linux Apache MySQL Perl\/PHP\/Python). Database management is accomplished in MySQL using Structured Query Language (SQL). Because it<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-3157","post","type-post","status-publish","format-standard","hentry","category-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MySQL 101 - The basics - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will show you the basics of MySQL, a widely used relational database management systems. Read now &amp; Learn most basic commands in 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:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL 101 - The basics - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you the basics of MySQL, a widely used relational database management systems. Read now &amp; Learn most basic commands in SQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-04T22:05:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-12T20:40:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"963\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/\",\"name\":\"MySQL 101 - The basics - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"datePublished\":\"2016-11-04T22:05:54+00:00\",\"dateModified\":\"2017-12-12T20:40:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will show you the basics of MySQL, a widely used relational database management systems. Read now & Learn most basic commands in SQL.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL 101 &#8211; The basics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL 101 - The basics - Globo.Tech","description":"This tutorial will show you the basics of MySQL, a widely used relational database management systems. Read now & Learn most basic commands in 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:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/","og_locale":"en_US","og_type":"article","og_title":"MySQL 101 - The basics - Globo.Tech","og_description":"This tutorial will show you the basics of MySQL, a widely used relational database management systems. Read now & Learn most basic commands in SQL.","og_url":"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/","og_site_name":"Globo.Tech","article_published_time":"2016-11-04T22:05:54+00:00","article_modified_time":"2017-12-12T20:40:40+00:00","og_image":[{"width":1920,"height":963,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/","url":"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/","name":"MySQL 101 - The basics - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-11-04T22:05:54+00:00","dateModified":"2017-12-12T20:40:40+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will show you the basics of MySQL, a widely used relational database management systems. Read now & Learn most basic commands in SQL.","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/mysql-101-basics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"MySQL 101 &#8211; The basics"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/3157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=3157"}],"version-history":[{"count":5,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/3157\/revisions"}],"predecessor-version":[{"id":3978,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/3157\/revisions\/3978"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=3157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=3157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=3157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}