Difference between revisions of "MariaDB/SQL/CREATE"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< MariaDB‎ | SQL
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
==Related==
+
{{fmt/title|"CREATE" SQL command}}
* <code>{{l/same|DROP}}</code> deletes existing users
+
==About==
==Example==
+
The <code>CREATE</code> command is how you create various different objects in a database.
* <syntaxhighlight inline lang=SQL>CREATE USER 'roundcube'@localhost IDENTIFIED BY 'yourPasswordHere!';</syntaxhighlight>
+
==Reference==
** '''Note''': <code>'roundcube@localhost'</code> is not the same user as <code>'roundcube'@localhost</code>. The latter creates user 'roundcube' with '@localhost' stored in another field, from what I can tell.
+
* [https://mariadb.com/kb/en/create/ MariaDB Knowledge Base]
** '''Note''': 'password' and "password" are not necessarily identical. At least once, I got an error with 'password' but "password" was fine. The password in question ended with a '^' character, so maybe that was escaping the end-quote-mark or something?
+
==Syntax==
 +
* <code>CREATE {{l/sub|DATABASE}}</code> (or <code>SCHEMA</code>)
 +
* <code>CREATE {{l/sub|TABLE}}</code>
 +
* <code>CREATE {{l/sub|VIEW}}</code> (create or replace)
 +
* <code>CREATE {{l/sub|CATALOG}}</code>
 +
* <code>CREATE {{l/sub|USER}}</code>
 +
* <code>CREATE {{l/sub|TRIGGER}}</code>
 +
* <code>CREATE {{l/sub|EVENT}}</code>
 +
* <code>CREATE {{l/sub|FUNCTION}}</code>
 +
* <code>CREATE {{l/sub|FUNCTION UDF}}</code> - user-defined function
 +
* <code>CREATE {{l/sub|INDEX}}</code>
 +
* <code>CREATE {{l/sub|PACKAGE}}</code>
 +
* <code>CREATE {{l/sub|PACKAGE BODY}}</code>
 +
* <code>CREATE {{l/sub|PROCEDURE}}</code>
 +
* <code>CREATE {{l/sub|ROLE}}</code>
 +
* <code>CREATE {{l/sub|SEQUENCE}}</code>
 +
* <code>CREATE {{l/sub|SERVER}}</code>

Latest revision as of 22:19, 18 February 2025

"CREATE" SQL command

About

The CREATE command is how you create various different objects in a database.

Reference

Syntax