Deck 3: An Introduction to SQL

Full screen (f)
exit full mode
Question
In MySQL, you can display the data vertically rather than horizontally.
Use Space or
up arrow
down arrow
to flip the card.
Question
When adding rows to character columns, make sure you enclose the values in double quotation marks.
Question
In SQL, you use the NOT NULL clause in a CREATE TABLE command to indicate columns that cannot contain null values.
Question
To create a table, type the word TABLE followed by the name of the table to be created and then by the names and data types of the columns that will comprise the table.
Question
To run the command(s)in a script file in MySQL, type SOURCE followed by the filename.
Question
To edit an SQL command, type EDIT at the mysql prompt..
Question
The shortcut command to quit MySQL is \q.
Question
If you added a row that should not be in a table, use a REMOVE command to remove it.
Question
To enter a null value into a table, you use a special format of the NULL command.
Question
Table names cannot contain spaces.
Question
This text uses MySQL version 5.0.
Question
The MySQL Reference Manual provides more detailed help.
Question
MySQL uses the term current database to refer to the database to which all subsequent commands pertain.
Question
MySQL does not require a password.
Question
SQL was developed as the data manipulation language for IBM's prototype relational model DBMS, System R.
Question
In SQL, there are special rules that specify that a particular word must begin in a particular position on the line.
Question
Dropping a table also deletes any data that you entered into the table.
Question
When you enter a new row into a table or modify an existing row, the values for one or more columns can be unknown or unavailable.
Question
In MySQL, you type the command at the mysql> prompt and press the Run key at the end of each line.
Question
In general, SQL is case-sensitive.
Question
SQL was developed in the mid-____.

A)1960s
B)1970s
C)1980s
D)1990s
Question
In MySQL, table names cannot exceed ____ characters.

A)12
B)14
C)16
D)18
Question
You indicate the end of a command by typing a(n)____.

A)column
B)comma
C)semicolon
D)period
Question
Script files must be saved in the default folder for the DBMS.
Question
To list all the columns in a table, use the LIST COLUMNS command.
Question
The USE command is executed at the start of every session to activate the database.
Question
The CREATE DATABASE command is executed only once for a database.
Question
The data type DECIMAL(5,2)represents a number with three places to the left and two places to the right of the decimal.
Question
If the CREATE TABLE command is executed more than once for the same table, MySQL overwrites the table with the newest data description.
Question
In MySQL, to delete the previous character, you need to press the ____ key(s).

A)Ctrl + A
B)Ctrl + E
C)Backspace
D)Delete
Question
To display all the rows and columns in a table, type the word SELECT, followed by a(n)____, followed by the word FROM and then the name of the table containing the data you want to view.

A)single quote
B)asterisk
C)double quote
D)slash
Question
In MySQL, you type commands at the mysql> ____.

A)worksheet
B)window
C)prompt
D)screen
Question
Which of the following commands changes the value in a column?

A)UPDATE
B)CHANGE
C)REPLACE
D)ADD
Question
The data type indicates the type of data that a column can contain as well as the maximum number of characters or digits that the column can store.
Question
In MySQL,the date, November 12, 2007 would be stored as '11-12-2007'.
Question
What is the original name of SQL?

A)SEQUEL
B)MYSEQUEL
C)DBase
D)MySQL
Question
Which of the following is a valid name for a table?

A)TBL_1
B)2_TBL
C)TBL 3
D)4 tbl
Question
In MySQL, to move to the beginning of the current line, you need to press the ____ key(s).

A)CTRL + A
B)Left arrow
C)Backspace
D)CTRL + E
Question
In MySQL, the data type STRING(n)stores a character string n characters long.
Question
BRANCH&BOOK is a valid name for a table in MySQL.
Question
The ____ command defines a table's structure by listing its columns, data types, and column lengths.

A)NEW TABLE
B)DEFINE TABLE
C)CREATE TABLE
D)ADD TABLE
Question
You use the ____________________ command to describe the layout of a table.
Question
____ is an example of a text editor.

A)NotePad
B)Paint
C)Microsoft Word
D)Outlook
Question
In MySQL, dates have the form ____.

A)DD-MM-YY
B)MM-DD-YY
C)YYYY-MM-DD
D)DD-MM-YYYY
Question
You can delete the entire table using the ____________________ TABLE command.
Question
In MySQL, you use the ____________________ command to change the database to the one you want to use.
Question
The ____ data type is used to store integers.

A)INTEGER
B)NUMERAL
C)NUMBER
D)INT
Question
For any column whose data type is CHAR, values must be enclosed in ____.

A)double quotation marks
B)parentheses
C)single quotation marks
D)square brackets
Question
The simplest way to obtain help in MySQL is to type ____ at the mysql> prompt.

A)helpmysql
B)\h
C)\ms
D)\a
Question
The ____ data type stores only the actual character string.

A)CHAR
B)VARCHAR
C)TEXT
D)STRING
Question
The correct data type for the BALANCE column in the CUSTOMER table is ____.

A)CHAR
B)INT
C)SMALLINT
D)DECIMAL
Question
When a script file contains more than one command, each command must end with a ____.

A)question mark
B)colon
C)period
D)semicolon
Question
SQL is Structured ____________________ Language.
Question
In MySQL, to move to the end of a line, you need to press the ____ key(s).

A)CTRL + A
B)Right arrow
C)CTRL + E
D)Tab
Question
To display data vertically rather than horizontally, replace the semicolon at the end of the command with ____.

A)\G
B)\V
C)%
D)#
Question
You can use a special value to represent situations in which an actual value is unknown, unavailable, or not applicable. This special value is called a(n)____________________ data value.
Question
The ____ command activates the default database.

A)ACTIVATE
B)USE
C)DEFAULT
D)CHANGE
Question
The ____________________ command adds rows to a table.
Question
In MySQL, the most recent command entered is stored in a special area of memory called the ____.

A)browser history
B)command history
C)session history
D)statement history
Question
The mysql prompt displays in the ____ Client window.

A)MySQL
B)DOS
C)Server
D)Command Line
Question
How can you correct errors in data?
Question
To view the data in a table, you use the ____________________ command.
Question
You can use the ____________________ command to update a value in a table.
Question
If the word ____________________ follows the word INT, a column is created for which MySQL will automatically generate a new sequence number each time a new row is added.
Question
What are the common restrictions placed on table and column names?
Question
To create a new database, execute the ____________________ command.
Question
To examine the structure of a table, use the ____________________ command.
Question
Should a user be allowed to enter null values for the primary key?
Question
Script files must have a ____________________ file name extension.
Question
To get more information about the union command, type ____________________ at the command prompt.
Question
To indicate columns that cannot contain null values, use the ____________________ clause in a CREATE TABLE statement.
Question
A file containing SQL commands is called a ____________________ file.
Question
To run a script file, type either SOURCE or ____________________ followed by the name of the file.
Question
To move up a line in the statement history, use the ____________________ key(s).
Question
If you need to delete a record, you can use the ____________________ command.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/75
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: An Introduction to SQL
1
In MySQL, you can display the data vertically rather than horizontally.
True
2
When adding rows to character columns, make sure you enclose the values in double quotation marks.
False
3
In SQL, you use the NOT NULL clause in a CREATE TABLE command to indicate columns that cannot contain null values.
True
4
To create a table, type the word TABLE followed by the name of the table to be created and then by the names and data types of the columns that will comprise the table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
5
To run the command(s)in a script file in MySQL, type SOURCE followed by the filename.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
6
To edit an SQL command, type EDIT at the mysql prompt..
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
7
The shortcut command to quit MySQL is \q.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
8
If you added a row that should not be in a table, use a REMOVE command to remove it.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
9
To enter a null value into a table, you use a special format of the NULL command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
10
Table names cannot contain spaces.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
11
This text uses MySQL version 5.0.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
12
The MySQL Reference Manual provides more detailed help.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
13
MySQL uses the term current database to refer to the database to which all subsequent commands pertain.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
14
MySQL does not require a password.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
15
SQL was developed as the data manipulation language for IBM's prototype relational model DBMS, System R.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
16
In SQL, there are special rules that specify that a particular word must begin in a particular position on the line.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
17
Dropping a table also deletes any data that you entered into the table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
18
When you enter a new row into a table or modify an existing row, the values for one or more columns can be unknown or unavailable.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
19
In MySQL, you type the command at the mysql> prompt and press the Run key at the end of each line.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
20
In general, SQL is case-sensitive.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
21
SQL was developed in the mid-____.

A)1960s
B)1970s
C)1980s
D)1990s
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
22
In MySQL, table names cannot exceed ____ characters.

A)12
B)14
C)16
D)18
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
23
You indicate the end of a command by typing a(n)____.

A)column
B)comma
C)semicolon
D)period
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
24
Script files must be saved in the default folder for the DBMS.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
25
To list all the columns in a table, use the LIST COLUMNS command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
26
The USE command is executed at the start of every session to activate the database.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
27
The CREATE DATABASE command is executed only once for a database.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
28
The data type DECIMAL(5,2)represents a number with three places to the left and two places to the right of the decimal.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
29
If the CREATE TABLE command is executed more than once for the same table, MySQL overwrites the table with the newest data description.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
30
In MySQL, to delete the previous character, you need to press the ____ key(s).

A)Ctrl + A
B)Ctrl + E
C)Backspace
D)Delete
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
31
To display all the rows and columns in a table, type the word SELECT, followed by a(n)____, followed by the word FROM and then the name of the table containing the data you want to view.

A)single quote
B)asterisk
C)double quote
D)slash
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
32
In MySQL, you type commands at the mysql> ____.

A)worksheet
B)window
C)prompt
D)screen
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
33
Which of the following commands changes the value in a column?

A)UPDATE
B)CHANGE
C)REPLACE
D)ADD
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
34
The data type indicates the type of data that a column can contain as well as the maximum number of characters or digits that the column can store.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
35
In MySQL,the date, November 12, 2007 would be stored as '11-12-2007'.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
36
What is the original name of SQL?

A)SEQUEL
B)MYSEQUEL
C)DBase
D)MySQL
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following is a valid name for a table?

A)TBL_1
B)2_TBL
C)TBL 3
D)4 tbl
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
38
In MySQL, to move to the beginning of the current line, you need to press the ____ key(s).

A)CTRL + A
B)Left arrow
C)Backspace
D)CTRL + E
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
39
In MySQL, the data type STRING(n)stores a character string n characters long.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
40
BRANCH&BOOK is a valid name for a table in MySQL.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
41
The ____ command defines a table's structure by listing its columns, data types, and column lengths.

A)NEW TABLE
B)DEFINE TABLE
C)CREATE TABLE
D)ADD TABLE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
42
You use the ____________________ command to describe the layout of a table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
43
____ is an example of a text editor.

A)NotePad
B)Paint
C)Microsoft Word
D)Outlook
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
44
In MySQL, dates have the form ____.

A)DD-MM-YY
B)MM-DD-YY
C)YYYY-MM-DD
D)DD-MM-YYYY
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
45
You can delete the entire table using the ____________________ TABLE command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
46
In MySQL, you use the ____________________ command to change the database to the one you want to use.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
47
The ____ data type is used to store integers.

A)INTEGER
B)NUMERAL
C)NUMBER
D)INT
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
48
For any column whose data type is CHAR, values must be enclosed in ____.

A)double quotation marks
B)parentheses
C)single quotation marks
D)square brackets
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
49
The simplest way to obtain help in MySQL is to type ____ at the mysql> prompt.

A)helpmysql
B)\h
C)\ms
D)\a
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
50
The ____ data type stores only the actual character string.

A)CHAR
B)VARCHAR
C)TEXT
D)STRING
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
51
The correct data type for the BALANCE column in the CUSTOMER table is ____.

A)CHAR
B)INT
C)SMALLINT
D)DECIMAL
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
52
When a script file contains more than one command, each command must end with a ____.

A)question mark
B)colon
C)period
D)semicolon
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
53
SQL is Structured ____________________ Language.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
54
In MySQL, to move to the end of a line, you need to press the ____ key(s).

A)CTRL + A
B)Right arrow
C)CTRL + E
D)Tab
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
55
To display data vertically rather than horizontally, replace the semicolon at the end of the command with ____.

A)\G
B)\V
C)%
D)#
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
56
You can use a special value to represent situations in which an actual value is unknown, unavailable, or not applicable. This special value is called a(n)____________________ data value.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
57
The ____ command activates the default database.

A)ACTIVATE
B)USE
C)DEFAULT
D)CHANGE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
58
The ____________________ command adds rows to a table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
59
In MySQL, the most recent command entered is stored in a special area of memory called the ____.

A)browser history
B)command history
C)session history
D)statement history
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
60
The mysql prompt displays in the ____ Client window.

A)MySQL
B)DOS
C)Server
D)Command Line
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
61
How can you correct errors in data?
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
62
To view the data in a table, you use the ____________________ command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
63
You can use the ____________________ command to update a value in a table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
64
If the word ____________________ follows the word INT, a column is created for which MySQL will automatically generate a new sequence number each time a new row is added.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
65
What are the common restrictions placed on table and column names?
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
66
To create a new database, execute the ____________________ command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
67
To examine the structure of a table, use the ____________________ command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
68
Should a user be allowed to enter null values for the primary key?
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
69
Script files must have a ____________________ file name extension.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
70
To get more information about the union command, type ____________________ at the command prompt.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
71
To indicate columns that cannot contain null values, use the ____________________ clause in a CREATE TABLE statement.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
72
A file containing SQL commands is called a ____________________ file.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
73
To run a script file, type either SOURCE or ____________________ followed by the name of the file.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
74
To move up a line in the statement history, use the ____________________ key(s).
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
75
If you need to delete a record, you can use the ____________________ command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 75 flashcards in this deck.