↑ Top
Kaai24
dev studios
| Sign in | DE EN

SQL Database and Querys


Everything with a $ is a variable and must be replaced with a real name.

Basics

show databases;
create $database;
use $database;
show tables;
create table $tablename(column1,column2);
drop $tablename;
drop $database;

To create a primary key use

ALTER TABLE `$tablename` ADD `id` INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (id);

More soon

(Edited 08-04-20)

Comments