Lesson 1: MySQL Basic Commands Flashcards

1
Q

Command to create a database.

A

CREATE DATABASE databaseName;

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

Command to create a table.

A

CREATE TABLE tableName (columnName dataType (length), ….);

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

Data Type for id.

A

INT

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

Datatype for name

A

VARCHAR

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

Data type for date

A

DATE

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

Data type for date and time

A

TIMESTAMP

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

Data type for decimal numbers

A

DECIMAL (whole, decimal)

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

Data type for images

A

BLOB

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

Command to schedule task

A

CREATE TRIGGER

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

Command to add a column to table

A

ALTER TABLE tableName ADD columnName dataType (length);

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

Command to change the table’s name.

A

ALTER TABLE oldTableName TO newTableName;

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

Command to change column’s name.

A

ALTER TABLE tableName CHANGE oldColName newColName dataType (length);

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

Command to remove a column.

A

ALTER TABLE tableName DROP COLUMN columnName;

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

Command to delete all data.

A

TRUNCATE TABLE tableName;

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

Command to delete structure and data of table.

A

DROP TABLE tableName;

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

Delete structure and data of database.

A

DROP DATABASE databaseName;