MySQL Flashcards

1
Q

List all database names

A

show databases;

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

login to remote DB engine (given user = admin and remote = somedbinstance.com)

A

mysql -h somedbinstance.com -u admin -p

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

add a new database with the name somedb

A

create database somedb

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

delete a database named somedb

A

drop database somedb

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

When referencing database names, MySQL is case sensitive. (True or False)

A

True

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

SQL commands are case sensitive. (True or False)

A

False

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

display name of current database

A

select database()

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

switch to another database that has the name somedb

A

use somedb

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

What are the 3 types of data

A

Numeric, String, and Date

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

What is the type and range of INT variables?

A

Numeric
-2.147483647 billion to +2.147483647 billion

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

List columns and metadata in a table called sometbl

A

desc sometbl

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

List table in current database

A

show tables

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

Delete a table from current database

A

drop

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