Run MySQL database queries straight from your browser! Practice, test, and benchmark your SQL queries in this playground equipped with a running MySQL server hosted in Ubuntu operating system.
MySQL is an open-source RDBMS (relational database management system) maintained by Oracle. It allows users to interact with the databases, through SQL (Structured Query Language). It has more than 20 years of history. It was released on 23 May 1995. And it's one of the most popular RDBMS systems used by big tech companies like Google, NASA, Twitter, and more.
Google Trends MySQL vs PostgreSQL
In modern software development, it's often used as part of some tech stack, for example, LAMP (Linux, Apache, MySQL, and PHP). It’s lightweight and easy to use.
MySQL is supported by the most popular programming languages to date, like Python, PHP, and Go, to name a few. It also supports widely-used operating systems such as Linux, Windows, and macOS. MySQL is often used to power the back end of modern web applications, and to record transactions.
Create database
create database <database_name>
create database test_db;
Switch databases
use <database_name>
use test_db;
Create a new table
create table <table_name> (columns)
create table my_table (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
email VARCHAR(50)
)
Insert new entries to new table
INSERT INTO <table_name> (column1, column2, column3,...)
VALUES (value1, value2, value3,...)
INSERT INTO my_table (
first_name,
last_name,
) VALUES (
'John',
'Smith',
'jsmith@email.com'
);
Select all entries in a table
select * from <table_name>
select * from my_table;
Update an entry in a table
UPDATE <table_name> SET <column1>=<value>, <column2>=<value>.. WHERE <column>=<value>
UPDATE my_table SET email='johnsmith@newemail.com' WHERE id=1;
Delete an entry in a table
DELETE FROM <table_name> WHERE <column>=<value> LIMIT <int>;
DELETE FROM my_table WHERE id=1 LIMIT 1;