Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 843 Bytes

SQL_CheatSheet.md

File metadata and controls

39 lines (22 loc) · 843 Bytes

MariaDB:

#Create user with password
	create user "username" identified by "password";

#Display users
	select * from mysql.user;

#List available databases
	show databases;

#Create database
	create database "database name";

#Change to specified database
	use "database name";

#List available tables
	show tables;

#List field names and settings etc
	describe "table name";

#List all contents of the selected table
	select * from "table name";

#Insert contents into table
	insert into "table name" ( , , , , ) values ( , , , , );
		Tip: The table rows will need to be added after the table name and then the values you would like to insert after values.

#Update specified row by specifying id of row
	update "table name" set "column name" = "data in row", where "column name" = "data in row"