MySQL Test 2: Traditional Test Questions

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/71

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

72 Terms

1
New cards

MySQL data types can be divided into __ categories.

7

2
New cards

Which data type is intended for storing a string of one or more characters?

Character

3
New cards

The terms character, string, and __ are used interchangeably to describe the character data type.

text

4
New cards

At a basic level, you can divide numbers into two categories: integer and __ numbers

real

5
New cards

Which data type is intended for storing numbers used for mathematical calculations?

Numeric

6
New cards

Integers are numbers that __ a decimal point.

don't have

7
New cards

Real numbers are numbers that __ a decimal point.

have

8
New cards

Date and time data types are typically referred to as date/time or __ data types

temporal

9
New cards

Which of these three data type categories are most widely used?

Numeric, Character, Date and time

10
New cards

The binary data type is useful for storing which of the following?

encryption keys, smaller image, audio, and video files

11
New cards

The LOB data type is useful for storing which of the following?

video, large amounts of character data, images, and sound

12
New cards

Which data type is used for storing geographical values such as GPS data?

Spatial

13
New cards

The spatial data type is also referred to as __ types because they define points that represent any location in the world.

geometry

14
New cards

The two most common character data types supported by MySQL are CHAR and __

VARCHAR

15
New cards

Use the __ type to store fixed

length strings.

16
New cards

If two characters (such as NE) are stored in a CHAR(10) column, what will be stored in this column?

2 characters and 8 spaces

17
New cards

Use the __ data type to store variable

length strings.

18
New cards

If two characters (such as NE) are stored in a VARCHAR(10) column, what will be stored in this column?

2 characters and 1 byte to store string length

19
New cards

By default, MySQL 8.0 and later uses the utf8mb4 character set for the CHAR and VARCHAR types.

True

20
New cards

The utf8mb4 character set can use up to __ bytes to store each character.

4

21
New cards

The utf8mb4 character set uses __ byte(s) to store characters used in the English language.

1

22
New cards

The CHAR type in the utf8mb4 character set in MySQL must reserve __ bytes for each character.

4

23
New cards

You can typically save storage space by using the __ type.

VARCHAR

24
New cards

Although you typically store numeric values using a numeric type, sometimes the character type is a better choice for some numeric values.

True

25
New cards

Which of the following would typically be stored in a character column rather than a numeric column?

zip code, telephone number, SCC classroom numbers like N1, N10 and social security number

26
New cards

Although, you can use either single quotes or double quotes to specify a string, single quotes are more typically used.

True

27
New cards

Double quotes are used to specify a string when the string contains a(n)

single quote '

28
New cards

Integer types __ include a decimal point.

do not

29
New cards

Integer types can store __ numbers.

negative, positive

30
New cards

To specify the integer type, you can use either the keyword INTEGER or INT. Of these two keywords, it is more common practice to use which one?

INT

31
New cards

The number of digits a value has to the right of the decimal point is called its __ and the total number of digits is called its

scale, precision

32
New cards

Fixed

point numbers are numbers that have a fixed number of digits to the __ of the decimal point.

33
New cards

When you use the DECIMAL type, MySQL uses a __ number of bytes to store the value.

varying

34
New cards

What would the original value of 1.2 be stored as when DECIMAL(9,1) data type is specified?

1.2

35
New cards

A primary key is used to uniquely identify each __ in a table.

row

36
New cards

The vendor_name column is a good candidate for a primary key.

False

37
New cards

Which of the following operations would violate the referential integrity of the tables?

deleting a row from the primary key table

38
New cards

An index can speed performance when __.

joining data from tables, searching for rows based on a search condition

39
New cards

MySQL automatically creates indexes for primary and foreign keys in each table.

True

40
New cards

When should you create an index?

When the column is updated infrequently, When a column is frequently used in search conditions

41
New cards

To apply the __ normal form, you continue to divide the tables of the data structure into __ tables until all __ has been removed

fifth, smaller, redundancy

42
New cards

For a table to be in first normal form, its columns must contain repeating values.

False

43
New cards

A table in first normal form often has repeating values in its rows. This can be resolved by applying the second normal form.

True

44
New cards

The second normal form only applies to tables that have composite primary keys.

True

45
New cards

Second normal form helps __.

save storage space, reduce the chance of storing inconsistent data, make maintenance easier

46
New cards

When you create or open a model, the diagram for the model is displayed by default.

True

47
New cards

When you are done creating your model, you can create a MySQL database creation script from the diagram.

True

48
New cards

When dropping a database, if the specified database doesn't exist, the DROP DATABASE statement will generate an __. To prevent this, you can add the __ EXISTS keywords to the statement.

error, IF

49
New cards

In its simplest form, the CREATE TABLE statement consists of the name of the new table followed by the names and data types of its columns. Each column has one or more __ coded for it.

attributes

50
New cards

To indicate that each row in a column must contain a unique value, you can code the __ attribute.

UNIQUE

51
New cards

Identifies a column whose value is automatically incremented by MySQL when a new row is added.

AUTO_INCREMENT

52
New cards

Defining a foreign key constraint at the table

level allows you to do what?

53
New cards

By default, the columns in a view are given __

the same names as the columns in the base tables

54
New cards

If a view contains a calculated column, you should name that column just like you would do in other SELECT statements.

True

55
New cards

On the view's SELECT statement, you will need to __

rename columns from different tables that have the same name

56
New cards

The fourth and fifth examples in Figure 12

3 shows techniques for assigning names to columns. The book states that you will typically want to use the technique shown in the __

57
New cards

The example in part 2 of Figure 12

3 shows a view that uses __

58
New cards

Use nested views sparingly because they can make dependencies confusing and code difficult to maintain.

True

59
New cards

If you name the columns of a view in the __

CREATE VIEW clause, you have to name all of the columns

60
New cards

If you name the columns of a view in the __

SELECT clause, you can name just the columns you need to rename

61
New cards

It is usually easier to alter a view by using the __

CREATE OR REPLACE VIEW statement

62
New cards

The DROP VIEW statement __

permanently deletes the view

63
New cards

Can be called from an application that has access to the database.

Stored procedure

64
New cards

Is executed in response to an INSERT, UPDATE, or DELETE statement on specified table.

Trigger

65
New cards

Procedural code that controls the flow of execution.

Stored program

66
New cards

Is executed at a scheduled time.

Event

67
New cards

Can be called from a SQL statement.

Stored function

68
New cards

Examine Figure 13

  1. This script creates a stored procedure named __
69
New cards

The __

DELIMITER statement changes the delimiter from the default delimiter of the semicolon to two __

70
New cards

The code within the CREATE PROCEDURE statement is defined by a __ of code.

block

71
New cards

The code within the CREATE PROCEDURE statement begins with the __ keyword and ends with the __ keyword.

BEGIN, END

72
New cards

After the stored procedure has been __

created, this script uses the DELIMITER statement to change the delimiter back to the default delimiter of a __