Mysql/CheatSheet: Difference between revisions

From Wiki
No edit summary
No edit summary
Line 27: Line 27:
</pre>
</pre>
</blockquote>
</blockquote>
== Tables ==
* list
<blockquote>
<pre>
SHOW TABLES;
</pre>
</blockquote>
* create
<blockquote>
<pre>
CREATE TABLE [IF NOT EXISTS] table_name(
  column_list
);
</pre>
</blockquote>
*
<blockquote>
<pre>
</pre>
</blockquote>





Revision as of 14:07, 10 June 2020

Databases

  • Create
CREATE DATABASE [IF NOT EXISTS] database_name;
  • Use
USE database_name;
  • Delete
DROP DATABASE [IF EXISTS] database_name;
  • List all
SHOW DATABASE;


Tables

  • list
SHOW TABLES;
  • create
CREATE TABLE [IF NOT EXISTS] table_name(
  column_list
);



other