MySQL Flashcards
SQL
RDBMS?
MySQL FTW!
Start MySQL
mysql -h localhost -u root -p
Create new database
CREATE DATABASE database_name;
Change database
USE database_name;
Create new table
CREATE TABLE newTable (field1 VARCHAR(30), field2 CHAR(1) NOT NULL, field3 INT NOT NULL DEFAULT 0, field4 DATE, field5 DEC (1,2), field6 BLOB);
Describe a table
DESC newTable;
Insert data to a table
INSERT INTO myTable (field1, field2, field3) VALUES (‘val’, ‘v’, ‘1’);
Selecting data
SELECT field1 FROM myTable WHERE field2 = ‘ammatasiri’;
Arithmetic operators
AND, OR, <>, =, <, >
Arithmetic selection
SELECT field1 FROM myTable WHERE field2 = ‘ammatasiri’ AND field3 = 2;
Like? No Facebook shit!
SELECT field1 FROM myTable WHERE field2 LIKE‘ammatahu%’;
I’ve got “%” but WTF is “_” ?
SELECT * FROM myTable WHERE field2 LIKE‘_utto’;
Single quotes?
Fuck yeah! But not for INT, DEC numbers when selecting
”*” is asterisk right?
It’s a “star” retard. ESS KIU EL.
Between
SELECT * FROM myTable WHERE field5 BETWEEN 5 and 10;
Do you love SQL, MySQL?
Son of a bitch.
How about something different?
Pr0n?

Can I use something else instead of OR?
SELECT * FROM youStupidTable WHERE field1 IN (‘three’, ‘different’, ‘pigs’);
w00t! Can I use NOT?
SELECT * FROM youStupidTable WHERE field1 NOT IN (‘stairway’, ‘to’, ‘heaven’);
You mean, like everwhere?
Yes everywhere. NOT BETWEEN your crotch. NOT IN her pussy. NOT LIKE that bicth.
How do you know all these?
Because I have a pirated PDF document of Oreilly’s Head First SQL.

I can haz GUI?
phpMyAdmin, MySQL Workbench and blah blah blah! But command line is enough for learning.
So that’s it?
This is just a premature ejaculation. There are more to learn on SQL. But I’m too lazy to use this website even. Correct if there are mistakes in flashcards. Kthaxbai!