Lesson 1: Introduction to MySQL

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/68

encourage image

There's no tags or description

Looks like no tags are added yet.

69 Terms

1
New cards

They are commands/languages used to communicate with a DBMS and perform operations on data.

What are database languages used for in a DBMS?

2
New cards

Create, Read, Update, Delete.

What does CRUD stand for?

3
New cards

Data Definition, Data Manipulation, Data Control, Transaction Control

What are the four types of database languages?

4
New cards

To define and modify database structure and metadata.

What is the main purpose of DDL?

5
New cards

DDL

If you need to create, modify, or delete a table or index, which language would you use?

6
New cards

They are auto-committed, meaning the changes are saved permanently.

According to the material, what happens to DDL changes?

7
New cards

To access and modify data in pre-existing schema objects.

What is the main purpose of DML?

8
New cards

To define and modify database structure and metadata.

What operations are associated with DML?

9
New cards

DDL.

If you need to create, modify, or delete a table or index, which language would you use?

10
New cards

They are auto-committed, meaning the changes are saved permanently.

According to the material, what happens to DDL changes?

11
New cards

To access and modify data in pre-existing schema objects.

What is the main purpose of DML?

12
New cards

Inserting, deleting, updating, and retrieving data.

What operations are associated with DML?

13
New cards

The DML instructions that deal with data retrieval.

What is DQL according to the material?

14
New cards

According to the material, can DML changes be reversed? Why?

Yes. They are not automatically committed, so the changes can be reversed.

15
New cards

What is the main purpose of DCL?

To manage user access and permissions.

16
New cards

GRANT and REVOKE.

What two actions can DCL use to control access?

17
New cards

DCL.

If you need to control whether a user can access or modify database data, which language is relevant?

18
New cards

A group of related tasks treated by the DBMS as one execution unit.

What is a transaction?

19
New cards

To manage transactions.

What is the main purpose of TCL?

20
New cards

COMMIT and ROLLBACK.

What are the two key TCL actions mentioned in the material?

21
New cards

DML manipulates data; TCL controls the effects of those changes through transactions.

DML manipulates data; TCL controls the effects of those changes through transactions.

22
New cards

DDL = Structure, DML = Data, DCL = Access, TCL = Transactions.

What is the easiest way to distinguish DDL, DML, DCL, and TCL?

23
New cards

A name used for a database object, such as a database, table, column, alias, or index.

What is a database identifier?

24
New cards

Database names must be unique.

What naming rule applies to database names?

25
New cards

Within a table

Where must column and index names be unique?

26
New cards

Enclose the name in quotation marks, according to the material.

What should you do if an identifier is a reserved MySQL word?

27
New cards

They are not permitted unless the name is enclosed in quotation marks.

What happens if a name contains embedded spaces or special characters?

28
New cards

No. They are treated as different names.

On a case-sensitive server, are CUSTOMER and Customer the same name?

29
New cards

What kind of value a column can store.

What does a MySQL data type tell you?

30
New cards

A name and a data type.

What two things must every database column have?

31
New cards

String, Numeric, and Date and Time.

What are the three main MySQL data type categories in the material?

32
New cards

CHAR is fixed-length; VARCHAR is variable-length.

What is the difference between CHAR and VARCHAR?

33
New cards

CHAR.

If a column stores text with a fixed length, which type would you choose?

34
New cards

VARCHAR.

If a column stores text with a variable length, which type would you choose?

35
New cards

BINARY stores fixed-length binary strings; VARBINARY stores variable-length binary strings.

What is the difference between BINARY and VARBINARY?

36
New cards

Binary Large Objects (binary data).

What is a BLOB used for?

37
New cards

ENUM allows one value from a list; SET allows zero or more values from a list.

What is the difference between ENUM and SET?

38
New cards

ENUM

If a column should allow only one option from a predefined list, which type would you use?

39
New cards

If a column should allow multiple options from a predefined list, which type would you use?

SET

40
New cards

0 is false; nonzero values are true.

What does BOOL mean in the material?

41
New cards

BOOLEAN is equal to BOOL according to the material.

What is the relationship between BOOL and BOOLEAN?

42
New cards

INTEGER is equal to INT

What is the relationship between INT and INTEGER?

43
New cards

INT stores integers; DECIMAL stores exact fixed-point numbers

What is the difference between INT and DECIMAL?

44
New cards

size = total digits; d = digits after the decimal point.

What do size and d mean in DECIMAL(size,d)?

45
New cards

10 total digits, with 2 digits after the decimal point.

What does DECIMAL(10,2) mean?

46
New cards

DECIMAL.

If you need an exact decimal value, such as a monetary amount, which numeric type from the notes is appropriate?

47
New cards

It prevents negative values.

What does UNSIGNED do to a numeric column?

48
New cards

It automatically also adds the UNSIGNED attribute.

What does ZEROFILL do?

49
New cards

Whether MySQL uses FLOAT or DOUBLE.

What does the p value determine in FLOAT(p)?

50
New cards

Whether MySQL uses FLOAT or DOUBLE.

What does the p value determine in FLOAT(p)?

51
New cards

In FLOAT(p), what happens when p is 0–24?

The resulting type is FLOAT.

52
New cards

In FLOAT(p), what happens when p is 25–53?

The resulting type is DOUBLE.

53
New cards

DATE.

Which data type should you use for a value containing only a date?

54
New cards

TIME

Which data type should you use for a value containing only a time?

55
New cards

DATETIME.

Which data type stores both a date and time?

56
New cards

TIMESTAMP

Which data type represents a timestamp and can use automatic current-time initialization/updating?

57
New cards

YEAR

Which data type stores a four-digit year?

58
New cards

YYYY-MM-DD

What is the format of DATE?

59
New cards

hh:mm:ss

What is the format of TIME?

60
New cards

1901–2155 and 0000.

What is the allowed YEAR range stated in the material?

61
New cards

DATE = date; TIME = time; DATETIME = date + time; YEAR = year.

What is the key difference between DATE, TIME, DATETIME, and YEAR?

62
New cards

DDL.

If you need to create a table, which database language category should you think of first?

63
New cards

DML.

If you need to insert or update a student's information, which language should you think of?

64
New cards

DCL.

If you need to give a user permission to access database data, which language should you think of?

65
New cards

TCL.

If you need to commit or roll back changes made by DML, which language should you think of?

66
New cards

VARCHAR.

If a field stores a student's first name and its length can vary, which data type would you choose?

67
New cards

BOOL/BOOLEAN.

If a field stores whether something is true or false, which data type would you choose?

68
New cards

DECIMAL.

If a field stores an exact decimal value, which data type would you choose?

69
New cards

DATE

If a field stores a student's birthdate, which data type would you choose?