MySQL Flashcards

SQL

1
Q

RDBMS?

A

MySQL FTW!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Start MySQL

A

mysql -h localhost -u root -p

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Create new database

A

CREATE DATABASE database_name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Change database

A

USE database_name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Create new table

A

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);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe a table

A

DESC newTable;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Insert data to a table

A

INSERT INTO myTable (field1, field2, field3) VALUES (‘val’, ‘v’, ‘1’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Selecting data

A

SELECT field1 FROM myTable WHERE field2 = ‘ammatasiri’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Arithmetic operators

A

AND, OR, <>, =, <, >

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Arithmetic selection

A

SELECT field1 FROM myTable WHERE field2 = ‘ammatasiri’ AND field3 = 2;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Like? No Facebook shit!

A

SELECT field1 FROM myTable WHERE field2 LIKE‘ammatahu%’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

I’ve got “%” but WTF is “_” ?

A

SELECT * FROM myTable WHERE field2 LIKE‘_utto’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Single quotes?

A

Fuck yeah! But not for INT, DEC numbers when selecting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

”*” is asterisk right?

A

It’s a “star” retard. ESS KIU EL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Between

A

SELECT * FROM myTable WHERE field5 BETWEEN 5 and 10;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Do you love SQL, MySQL?

A

Son of a bitch.

17
Q

How about something different?

A

Pr0n?

18
Q

Can I use something else instead of OR?

A

SELECT * FROM youStupidTable WHERE field1 IN (‘three’, ‘different’, ‘pigs’);

19
Q

w00t! Can I use NOT?

A

SELECT * FROM youStupidTable WHERE field1 NOT IN (‘stairway’, ‘to’, ‘heaven’);

20
Q

You mean, like everwhere?

A

Yes everywhere. NOT BETWEEN your crotch. NOT IN her pussy. NOT LIKE that bicth.

21
Q

How do you know all these?

A

Because I have a pirated PDF document of Oreilly’s Head First SQL.

22
Q

I can haz GUI?

A

phpMyAdmin, MySQL Workbench and blah blah blah! But command line is enough for learning.

23
Q

So that’s it?

A

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!