Relational Databases Flashcards

1
Q

A blank is a conceptual framework for database systems.

A

Database model

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

A database model has what three parts:

A

Data structures
Operations on data structures
Rules that govern valid data

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

Blank present how data is organized

A

Data structures

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

Blank manipulate data structures

A

Operations

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

Blank govern valid data

A

Rules

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

The relational model is a database model based on a blank table structure

A

Tabular

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

The relational model was published in 1970 by who of what company.

A

E. F. Codd of IBM

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

When was relational model released in commercial products?

A

1980

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

What database models were dominant in the 1960s and 70s

A

Hierarchical and network databases

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

Since computers were relatively slow and memory was limited, hierarchical and network databases were optimized for what at the expense of simplicity and flexibility?

A

Performance

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

Relational databases were originally designed for what data?

A

Transactional

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

What type of primary data structure does the hierarchical database model have?

A

Tree

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

What type of primary data structure does a network database model use?

A

Linked list

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

What type of primary data structure does the object database model have?

A

Class

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

What type of primary data structure does the graph database model use?

A

Vertex and edge

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

What type of primary data structure does the document database model use?

A

XML or JSON

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

Relational data structures are based on what theory?

A

Set theory

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

A blank is an unordered collection of elements in braces

A

Set

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

A blank is an ordered collection of elements enclosed in parentheses.

A

Tuple

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

A blank has a name, a fixed tuple of columns and a varying set of rows

A

Table

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

A blank has a name and data type.

A

Column

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

A blank is an unnamed tuple of values that corresponds to a column and belongs to the column’s data type

A

Row

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

A blank is a named set of values from which columns are drawn

A

Data type

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

What are the equivalent terms in mathematics for table, column, row and data type.

A

Relation
Attribute
Tuple
Domain

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

What are the equivalent terms in files for table, columns, row and data types?

A

File
Field
Record
Data type

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

What relational operation grabs a subset of rows of a table?

A

SELECT

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

What relational operation eliminates one or more columns of a table?

A

Project

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

What relational operation lists all combinations of rows of two tables?

A

PRODUCT

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

What relational operation combines two tables by comparing related columns?

A

JOIN

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

What relational operation selects all rows of two tables?

A

UNION

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

What relational operation selects rows common to two tables?

A

INTERSECT

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

What relational operation selects rows that appear in one table but not another

A

DIFFERENCE

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

What relational operation changes a table name?

A

RENAME

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

What relational operation computes functions over multiple table rows, such as sun and count

A

AGGREGATE

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

Relational operations are collectively called what and are the theoretical foundations of the SQL language?

A

Relational algebra

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

Blank are logical constraints that ensure data is valid

A

Rules

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

Blank are part of the relational model and govern data in every relational database

A

Relational rules

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

All tables have a blank column, or group, in which values cannot repeat

A

Unique primary key

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

Relational databases require blank in that different columns of the same table have different names

A

Unique column names

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

Relational databases require blank in that no two rows have identical values in all columns

A

No duplicate rows

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

Blank are based on business policy and specific to a particular database

A

Business rules

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

Relational rules are implemented as what

A

SQL constraints

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

Relational rules are enforced by what

A

The database system

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

Blank are discovered during database design and are often implemented with SQL constraints

A

Business rules

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

Blank is a high-level computer language for storing, manipulating, and retrieving data

A

SQL

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

Blank support most important elements of sql standard, however, most don’t support the entire standard

A

Relational databases

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

A blank uses sql to insert, retrieve, update, and delete data from the tables

A

Database user

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

A blank uses sql to create a database and the database tables

A

Designer

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

A blank is a complex command composed of one or more clauses

A

SQL statement

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

A blank groups sql keywords with table names and conditions

A

Clause

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

Good prep rice is to write sql statements like what

A

Each clause on a separate line

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

Name the three clauses in a select statement

A

SELECT
FROM
WHERE

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

Sql statements end with a what

A

Semicolon

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

Clauses that end with a semicolon in sql are called what

A

Statement

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

In sql blank are case sensitive

A

Column names and table names

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

In sql blank are not case sensitive

A

Sql keywords

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

In sql blank are explicit values that are string, numeric, or binary

A

Literals

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

In sql strings must be surrounded by a single or double what?

A

Quote

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

Blank are represented with x ‘0’ where the 0 is any hex value

A

Binary values

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

In sql blank are words with special meanings

A

Keywords

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

In sql blank are objects from the database like tables, columns, etc

A

Identifiers

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

In sql blank are statements intended only for humans and ignored by the database when parsing an sql statement

A

Comments

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

What do you use for a single line comment on sql

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

What do you use for a multiline comment in sql

A

/*

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

All databases recognize what for string literals while only some recognize what

A

Single quotes
Double quotes

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

The sql language is divided into five subcategories. Name them

A

1) data definition language(DDL)
2) data query language (DQL)
3) data manipulation language (DML)
4) data control language (DCL)
5) data transaction language (DTL)

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

Blank is a subcategory of sql that defines the structure of the database

A

Data Definition Language (DDL)

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

Blank is a subcategory of sql that retrieves data from the database

A

Data Query Language (DQL)

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

Blank is a subcategory of sql that manipulates data stirred in a database

A

Data Manipulation Language (DML)

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

Blank is a subcategory of sql that controls database user access

A

Data Control Language (DCL)

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

Blank is a subcategory of sql that manages database transactions

A

Data Transaction Language (DTL)

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

Blank creates, alters, and drops tables

A

DDL

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

Blank selects data from a table

A

DQL

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

Blank inserts, updates, and deletes data in a table

A

DML

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

Blank grants and revokes permissions to and from users

A

DCL

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

Blank commits data to a database, rolls back data from a database, and creates save points

A

DTL

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

A blank is a series of sql statements that is executed repeatedly

A

Automated script

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

Blank are prepared in advance and saved in a file or a database stored procedure. They are executed by a computer program or from the sql command line by invoking the name of the file or stored procedure

A

Automated script

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

A blank is a single executing copy of a database system

A

Database system instance

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

Personally computers usually just run how many instances of a database system

A

One

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

Shared computers usually run how many instances of a database system

A

Many

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

Name the two sql commands that help database admins, users, and designers manage the database on an instance

A

CREATE DATABASE
DROP DATABASE

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

What is the correct syntax for creating a database

A

CREATE DATABASE DatabaseName

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

What is the correct syntax for deleting a database and all tables in the database

A

DROP DATABASE DatabaseName;

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

The what is automatically installed in MySQL database system and used for system admin

A

MySQL database

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

Blank statements provide information about databases

A

SHOW

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

What sql command shows all the database system instances

A

SHOW DATABASES;

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

What is the sql syntax to list all tables in the default database

A

SHOW TABLES;

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

What is the sql syntax for listing all columns in a particular table of the default database

A

SHOW COLUMNS FROM TableName;

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

How do you obtain the create table statement for a table in the default database

A

SHOW CREATE TABLE TableName;

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

All data is a relational database is structured in blank

A

Tables

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

A blank has a name, a fixed sequence of columns, and a varying set of rows

A

Table

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

A blank has a name and data type

A

Column

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

A blank is an unnamed sequence of values that corresponds and belongs to the column’s data type

A

Row

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

A blank is a single column of a single row

A

Cell

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

A table must have at least one what, but any number of what?

A

Column
Rows

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

A table without rows is called a what

A

Empty table

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

Tables must obey what?

A

Relational rules

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

A cell must not contain what?

A

Multiple values

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

Blank are allowed in different tables, but not the same table

A

Duplicate column names

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

No blank can have identical values in all columns

A

Two rows

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

Rows are not what?

A

Ordered

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

The organization of rows on a storage device must never what?

A

Affect query results

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

Name the four relational rules governing tables

A

Exactly one value per cell
No duplicate column names
No duplicate rows
No row order

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

Blank allows database admins to improve query performance by changing the organization of data on storage devices without affecting no query results

A

Data independence

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

Blank tables allows tables with duplicate rows

A

Temporary

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

What sql statement creates a new table by specifying the table name, column names, and column data types? Give the syntax

A

CREATE TABLE TableName
ColumnName DataType;

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

Give the syntax for deleting a table and all of the columns in it

A

DROP TABLE TableName;

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

Name the syntax for adding a column into an existing table

A

ALTER TABLE TableName
ADD ColumnName DataType;

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

Name the syntax for modifying an existing column in a table

A

ALTER TABLE TableName
CHANGE CurrentColumnName NewColumnName NewDataType;

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

Name the syntax for deleting an existing column in a table

A

ALTER TABLE TableName
DROP ColumnName;

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

Name the way to change a column’s data type

A

ALTER TABLE TableName
CHANGE ColumnName ColumnName NewDataType;

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

Blank is an operation in a table in which rows become columns and columns become rows. It is an important operation in mathematics, but is commonly applied to tables

A

Transpose

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

A blank is a named set of values from which column values are drawn.

A

Data type

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

Name the seven general data types

A

1) integer
2) decimal
3) character
4) date
5) binary
6) spatial
7) document

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

Blank data types represent positive and negative integers

A

Integer

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

Blank data types represent numbers with fractional values

A

Decimal

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

Blank data types represent textual characters

A

Character

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

Blank data types represent day and time or both

A

Date

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

Blank data types store data exactly as the data appears in memory or computer files, but for bit

A

Binary

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

Blank data types contain textual data in a structured format like XML or JSON

A

Document

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

A blank data type stores data as an exact copy of memory?

A

Binary

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

All relational databases support what four data types?

A

Integer, decimal, date and time, and character

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

Most databases allow integer and decimals to be what

A

Signed or unsigned

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

A signed number may be what

A

Negative

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

A blank cannot be negative

A

An unsigned number

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

Data types vary in what

A

Storage requirements

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

Blank data types use in or two bytes per character

A

Character

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

Blank data types use a fixed number of bytes per number

A

Integer

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

Blank data types store larger numbers than the blank version of the same number

A

Unsigned , signed

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

To minimize table size, the data type with the blank should be used

A

Smallest storage requirements

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

What data type has a storage size of 1 byte?

A

TINYINT

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

What is the TINYINT range for a SiGNeD

A

-128 - 127

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

What is the range for TINYINT UNSIGNED

A

0 - 255

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

What integer data type has 2 bytes of storage.

A

SMALLINT

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

What is the number range for SMALLINT signed?

A

-32768 to 32767

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

What is the number range for SMALLINT unsigned?

A

0 to 65535

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

What integer data type uses 3 bytes of storage?

A

MEDIUMINT

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

What is the number range for MEDIUMINT signed?

A

-8388608 to 8388607

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

What is the number range for MEDIUMINT unsigned?

A

0 to 16 million

141
Q

What integer data type uses 4 bytes of storage?

A

INT or INTEGER

142
Q

What is the number range for INTEGER signed?

A

-2 billion to 2 billion

143
Q

What is the number range for INTEGER unsigned?

A

0 to 4294967295

144
Q

What integer data type uses 8 bytes of storage?

A

BIGINT

145
Q

What is the number range for BIGINT signed?

A

-2 to the 63ed power to 2 to the 63rd power - 1

146
Q

What is the number range for BIGINT unsigned?

A

0 to 2 to the 64th power - 1

147
Q

What does the m and d stand for in DECIMAL(M,D)?

A

M is number of significant digits
D is number of digits after decimal

148
Q

What decimal data type uses 4 bytes of storage?

A

FLOAT

149
Q

What is the approximate range of FLOAT?

A

-3.4 E+38 to 3.4 E+ 38

150
Q

What decimal data type uses 8 bytes of storage?

A

DOUBLE

151
Q

What is the approximate range of DOUBLE?

A

-1.8 e+308 to 1.8 E + 308

152
Q

What day and time data type uses 3 bytes of storage and is formatted YYYY-MM-DD?

A

DATE

153
Q

What day and time data type uses 3 bytes of storage and has a format of hh:mm:ss?

A

TIME

154
Q

What day and time data type uses 5 bytes of storage and is formatted yyyy-mm-dd hh:mm:ss?

A

DATETIME

155
Q

What character data type uses a byte per character?

A

CHAR(N)

156
Q

What type of string does a CHAR(N) hold?

A

Fixed-length

157
Q

In CHAR(N), what is the length range of N?

A

0 <= N <= 255

158
Q

What character data type uses the length of the characters + one byte of storage?

A

VARCHAR(N)

159
Q

A VARCHAR(N) has a what type of string?

A

Variable length

160
Q

What is the number range for VARCHAR(N)?

A

0<=N<=65535

161
Q

What character data type has a storage requirement of the length of the characters + 2 bytes?

A

TEXT

162
Q

TEXT is what kind of string?

A

Variable-length

163
Q

TEXT has a maximum length of how many characters?

A

65535

164
Q

If you want to store a yes or no in sql how do you do it?

A

TINYINT with 1 = yes and 0= no

165
Q

A blank is a symbol that computes from one or more other values called operands

A

Operator

166
Q

Blank operators compute numeric values from numeric operands

A

Arithmetic

167
Q

Blank operators compute logical values TRUE or FALSE. Operands can be numeric, character, and other data types

A

Comparison

168
Q

Lank operators compute logical values from logical operands

A

Logical

169
Q

A blank operator has one operand

A

Unary

170
Q

A blank operator has two operands

A

Binary

171
Q

Most operands are what?

A

Binary

172
Q

The logical operator what is unary?

A

NOT

173
Q

The arithmetic operator “-“ is either what?

A

Unary or binary

174
Q

Operators may return what when either operands is what

A

NULL

175
Q

What is the operator sign for adding two numeric values?

A

+

176
Q

What is the operator sign for reversing the sign of a number and is Unary?

A

-

177
Q

What is the operator sign for subtracting one numeric value from another and is binary?

A

-

178
Q

What is the numeric operator sign for multiplies two numbers?

A

*

179
Q

What is the numeric operator sign for divides one number by another and returns the remainder?

A

% modulus

180
Q

What is the numeric operator for divides one from another?

A

/

181
Q

What is to r numeric operator for raises a number to the power of another number?

A
182
Q

What comparison operator sign compares two values for equality?

A

=

183
Q

What is the comparison operator that compares one value to be less than or equal to another or grater than or equal to another?

A

<=
>=

184
Q

What’s re the comparison operators for less than and greater than?

A

<
>

185
Q

What are the two comparison operators that compares two values for inequality?

A

!=
<>

186
Q

What is the operator that returns true when both values are true?

A

AND

187
Q

What is the operator that returns false when at least one is false?

A

OR

188
Q

What is the operator that reverses a logical value?

A

NOT

189
Q

A blank is a string of operators, operands, and parentheses that evaluates into a single value

A

Expression

190
Q

In an expression, blank may be a column names or fixed values.

A

Operands

191
Q

The value of an expression may be any blank

A

Data type

192
Q

A blank expression may consist of a single column name or fixed value

A

Simple

193
Q

When an expression is evaluated, blank are replaced with column values for a specific row.

A

Column names

194
Q

The blank of operator may affect the value of an expression

A

Order

195
Q

Operators of the same precedence are not evaluated blank

A

Left to right

196
Q

Regardless of operator precedence, expression enclosed in what are evaluated first

A

Parentheses

197
Q

In the order of operations, what operator has first precedence

A
  • (Unary)
198
Q

In order of operations what operator has second precedence

A
199
Q

In order of operations, what operators have third precedence

A
  • and % and /
200
Q

In order of operation, what operators have fourth precedence

A

+ and -(binary)

201
Q

In order of operations what operators have fifth precedence

A

= and != and <> and <= and >=

202
Q

In order of operations what operator has sixth precedence

A

NOT

203
Q

In order of operations what operator has seventh precedence

A

AND

204
Q

In order of operation what operator has eighth precedence

A

OR

205
Q

The blank statement selects rows from a table

A

SELECT

206
Q

The select statement has two clauses name them

A

SELECT clause
FROM clause

207
Q

In a SELECT clause the select clause specifies what , separated by commas that determine what values are returned for each row

A

One or more expressions

208
Q

In a select statement , the blank specifies the table from which rows are selected

A

FROM clause

209
Q

In many select queries each expression in the select clause is a simple blank

A

Column name

210
Q

To select all columns, the expressions can be replaced with what?

A

A single asterisk *

211
Q

Give the syntax for a simple select statement

A

SELECT ColumnName
FROM TableName;

212
Q

The select statement returns a set of rows called the what?

A

Result table

213
Q

In a select statement some tables may contain thousands or millions of rows, how can you limit the results?

A

With a LIMIT clause

214
Q

Give the syntax for a select clause with a limit

A

SELECT *
FROM TableName
LIMIT 100;

215
Q

A SELECT statement has an optional blank clause that specifies a condition for selecting rows

A

WHERE

216
Q

In a where clause, a row is selected when the condition is blank for the row

A

True

217
Q

In a where clause a row is omitted when blank

A

The expression is false or null

218
Q

Give the syntax for a SELECT statement with a where clause

A

SELECT Expression1
FROM TableName
WHERE Condition;

219
Q

Blank is a special value that represents either unknown or inapplicable data

A

Null

220
Q

NULL is not the same as blank for numeric data types or what for character data types

A

Zero
Blanks

221
Q

By default columns may contain blank values

A

Null

222
Q

The blank prevents a column from having a null value.

A

NOT NULL constraint

223
Q

NOT NULL constraints follow the column name and data type in a blank

A

CREATE TABLE statement

224
Q

Give the syntax for using a not null constraint

A

CREATE TABLE TableName
ColumnName DataType NOT NULL;

225
Q

When arithmetic or comparison operators have one or more null operands, the result is blank

A

NULL

226
Q

Since blank return null when either operand is null, blank cannot be used to select null values

A

Comparison operators

227
Q

If you need to select null values, use what two operators.

A

IS NULL
IS NOT NULL

228
Q

In traditional mathematical logic, expressions are always true or false. When null is present, a logical expression may be what?

A

True, false, or null

229
Q

In a logical expression, bill indicates the value is what?

A

Uncertain

230
Q

If x is true and y is null, what is the result of x and y and x or y

A

Null
True

231
Q

If x is null and y is true what is the value of x and y and x or y

A

Null
True

232
Q

If x is false and y is null what is the value of x and y and x or y

A

False
Null

233
Q

If x is null and y is false what is the value of xand y and x or y?

A

False
Null

234
Q

If x is null and y is null, what is the value of x and y and x or y

A

Null
Null

235
Q

If x is null, what is the value of not x

A

Null

236
Q

In MySQL, query results returning true and false are displayed how

A

0 = false
1= true

237
Q

Using blank will not select a null value

A

NOT NULL

238
Q

A blank adds rows to a table in sql

A

INSERT statement

239
Q

The blank clause names the table and clauses where data is to be added.

A

INSERT INTO

240
Q

In an insert statement, the blank clause specifies column values to be added

A

VALUES

241
Q

The values clause may list any number of rows in blank to insert multiple rows

A

Parentheses

242
Q

Give the syntax for an insert statement

A

INSERT [INTO] TableName (ColumnName)
VALUES (Value1);

243
Q

In an insert statement column names may be omitted as long as blank

A

The VALUES clause lists all column values in the same order as the table’s columns

244
Q

Columns may be omitted from an INSERT statement. When omitted, a column is assigned what value

A

Null

245
Q

When creating a table, the blank keyword after ColumnName and DataType will hold a default value to insert rather than null

A

DEFAULT

246
Q

What is the syntax for inserting a default date value?

A

CREATE TABLE TableName
ColumnName DATE DEFAULT ‘2000-01-01’;

247
Q

The blank statement modifies existing rows in a table

A

UPDATE

248
Q

The update statement uses what clause to specify the new column values

A

SET

249
Q

In an update statement, the blank clause specifies which rows are updated

A

WHERE

250
Q

Give the syntax for an update statement

A

UPDATE TableName
SET ColumnName = Value
WHERE Condition;

251
Q

The blank statement deletes existing rows in a table

A

DELETE

252
Q

The blank keyword in a delete statement is followed by the table name where rows are to be deleted

A

FROM

253
Q

The blank clause in a delete statement specifies which rows should be deleted

A

WHERE

254
Q

Give the syntax for a delete statement

A

DELETE FROM TableName
WHERE Condition;

255
Q

What happens in a delete statement if you exclude the WHERE clause

A

All rows in the table are deleted

256
Q

The blank statement deletes all rows from a table and is nearly identical to the DELETE statement with no where clause

A

TRUNCATE

257
Q

Give the syntax for a truncate statement

A

TRUNCATE TABLE TableName;

258
Q

The blank statement selects data from one table called the source and inserts data into another table, called the target

A

MERGE

259
Q

In a MERGE statement, the blank of the source and target rows must match for the target to values to be updated by the source values

A

Primary keys

260
Q

A blank is a column, or group of columns, used to identify a row

A

Primary key

261
Q

In a table diagram what precedes the primary key

A

A solid circle

262
Q

Often primary keys are used in what clause to select a specific row?

A

WHERE

263
Q

The primary key is specified in SQL when the table is what?

A

Created

264
Q

Primary keys must be what two things

A

Unique
Not Null

265
Q

A simple primary key consists of what

A

A single column

266
Q

A composite primary key consists of what

A

Multiple columns

267
Q

In a CREATE TABLE statement, how are composite primary keys denoted?

A

With parentheses

268
Q

Composite primary keys must be what

A

Unique
Not null
Minimal

269
Q

Composite values of a primary key, when blank, must be unique

A

Grouped together

270
Q

No column of a composite primary key can contain a what

A

Null value

271
Q

All primary key columns are necessary for what. When any column is removed, this no longer exists

A

Uniqueness

272
Q

Blank in a CREaTe TAbLE statement names the table’s primary key

A

Primary key constraint

273
Q

The primary key constraint ensures that the primary key is always blank and blank

A

Unique and non-null

274
Q

A blank column is a numeric column that is assigned to increase by one when a new row is inserted

A

Auto-increment

275
Q

Name the two ways to name a primary key in a create table statement

A

Inserting PRIMARY KEY after the data type and column name
Listing PRIMARY KEY (ColumnName) at the end of the query

276
Q

AUTO_INCREMENT follows the column’s blank in a CREATE TABLE statement

A

Data type

277
Q

Blank primary keys are often implemented as auto-increment columns

A

Integer

278
Q

In MySQL, auto_increment may be applied not to blank

A

Primary key columns

279
Q

Database users occasionally make the following two mistakes when inserting primary keys

A

1) inserting values for auto-increment primary keys
2) omitting values for primary keys that are not auto-increment

280
Q

When inserting rows that have an auto_increment don’t do what?

A

Include the auto-incremented value

281
Q

A blank is a column or group of columns that refer to primary key.

A

Foreign key

282
Q

The blank of the foreign and primary keys must be the same, but the blank must be different

A

Data type
Names

283
Q

What denotes a foreign key in a table diagram?

A

Open circle

284
Q

Foreign keys may be blank and blank

A

Repeated and null

285
Q

Foreign keys obey a relational rule called blank

A

Referential integrity

286
Q

Referential integrity requires foreign key values must either be blank or blank

A

Null
Match some value of the primary key

287
Q

Multiple foreign keys may refer to the same blank

A

Primary key

288
Q

A foreign key may refer to a primary key in the blank

A

Same table

289
Q

A foreign key that refers to a composite primary key must blank

A

Also be composite

290
Q

All columns of a composite foreign key must either be blank or blank

A

Null
Match the corresponding primary key columns

291
Q

A blank is added to the CREATE TABLE statement with the FOREIGN KEY and REFERENCE keywords

A

Foreign key constraint

292
Q

When a foreign key constraint is specified, the database blank insert, update, and delete statements that violate referential integrity

A

Rejects

293
Q

Name the syntax for creating a foreign key constraint

A

CREATE TABLE TableName
ColumnName DataType PRIMARY KEY
ColumnName2 DataType
FOREIGN KEY (ColumnName) REFERENCES TableName(PrimaryKeyColumn)

294
Q

In the CREATE TABLE statement, the order of blanks and columns is not significant.

A

Constraints

295
Q

A blank is a simple or composite foreign key in which all columns are NULL

A

Fully NULL foreign key

296
Q

In a relational database, foreign keys must obey what at all times?

A

Referential integrity

297
Q

Occasionally, blank or blank result in referential integrity violations that must be corrected before data is stored in the database

A

Data entry errors
Incomplete data

298
Q

Referential integrity can be violated in what four ways

A

1) A primary key is updated
2) a foreign key is updated
3) a row containing a primary key is deleted
4) a row containing a foreign key is inserted

299
Q

What two moves never violate referential integrity?

A

Primary key insert
Foreign key deletes

300
Q

Databases automatically correct referential violations automatically with one of what four actions?

A

RESTRICT
SET NULL
SET DEFAULT
CASCADE

301
Q

Blank rejects an insert, update, or delete that violates referential integrity

A

RESTRICT

302
Q

Blank sets invalid foreign keys to null

A

SET NULL

303
Q

Blank sets invalid foreign keys to the foreign key default value

A

SET DEFAULT

304
Q

Blank propagates primary key changes to foreign keys

A

CASCADE

305
Q

Blank behaves differently for primary key updates and deletes

A

CASCADE

306
Q

In CASCADe, if a primary key is deleted, rows containing matching foreign keys are blank

A

Deleted

307
Q

In CASCADE, if a primary key is updated, matching foreign keys are blank

A

Updated to the same value

308
Q

Blank, blank and blank apply to primary key updates and deletes, and foreign key insert and update

A

RESTRICT, SET NULL, SET DEFAULT

309
Q

Blank applies to primary key update and delete only

A

CASCADE

310
Q

In MySQL, foreign key updates and inserts are supported by which action?

A

RESTRICT

311
Q

For primary key updates and deletes, MySQL supports what?

A

All four actions

312
Q

Referential integrity actions are specified in optional what and what clauses of the foreign key constraints

A

ON UPDATE and ON DELETE

313
Q

ON UPDATE and ON DELETE are followed by either what, what, what or what?

A

RESTRICT
SET NULL
SET DEFAULT
CASCADE

314
Q

She several foreign keys refer to the same primary key, blank actions can be specified

A

Different actions

315
Q

Blank is applied when the ON UPDATE or ON DELETE clause is omitted

A

RESTRICT

316
Q

Blank cannot be used when a foreign key is not allowed NULL values

A

SET NULL

317
Q

Blank is not supported in some MySQL configurations

A

SET DEFAULT

318
Q

A blank is a rule that governs allowable values in a database

A

Constraint

319
Q

Constraints are based on blank and blank and implemented with special keywords in a CREATE TABLE statement

A

Relational rules
Business rules

320
Q

The database automatically blanks inserts, updates and deletes that violate a constraint

A

Rejects

321
Q

A blank appears after the column name and data type in a CREATE TABLE statement

A

Column constraint

322
Q

Blank govern values in a single column, like NOT NULL

A

Column constraints

323
Q

A blank appears in a separate clause of a CREATE TABLE statement and governs values in one or more columns, ex foreign keys

A

Table constraint

324
Q

Some constraint types can be classified as either blank or blank, ex primary key

A

Column or table constraints

325
Q

A primary key constraint on a composite column must be defined as a blank

A

Table constraint

326
Q

Blank constraint does not actually limit allowable values on a column. Instead, it specifies a values that is inserted and is not always considered a constraint

A

Default constraint

327
Q

Blank ensures that my values in a column or group of columns is not repeated.

A

Unique constraint

328
Q

When applied to one column the unique constraint can be blank, when applied to a group of columns, the uniques constraint is a blank.

A

Either in the column declaration or a separate clause

A table constraint and must appear in a separate clause

329
Q

The unique constraint can be applied to blank but is unnecessary

A

Primary key columns

330
Q

MySQL creates a blank for each unique constraint

A

Index

331
Q

The blank specifies an expression on one or more columns of a table. The constraint is violated when the expression is false and satisfied when the expression is true or null.

A

Check constraint

332
Q

When the CHECK constraint is one one column, then the CHECK may appear either blank or blank

A

In the column declaration
Separate clause

333
Q

When the check expression involves multiple columns, check is a blank and must be blank

A

Table constraint
A separate clause

334
Q

Table constraints may be blank using the optional CONSTRAINT keyword followed by the constraint name and declaration

A

Named

335
Q

Most column constraint cannot be blank.

A

Named

336
Q

Name the constraint that can be named in a column declaration

A

CHECK

337
Q

Give the syntax for naming a constraint (that declaration only)

A

CONSTRAINT ConstraintName ConstraintDeclaration;

338
Q

The MySQL statement blank returns the CReatE TAbLE statement for the table. It shows all constraints, constraintname clauses, but no default constraint names

A

SHOW CREATE TABLE TableName;

339
Q

What does this query do-
SELECT Column_name, Constraint_name
FROM Information_schema.key_column_usage
WHERE Table_Name = ‘TableName’;

A

Displays all names of constraints on TableName including default names

340
Q

Constraints are added and dropped with the blank followed by a blank clause.

A

ALTER TABLE TableName
ADD,DROP, or CHANGE

341
Q

Blank such as NOT NULL and DEFAULT are added or dropped with a blank

A

Unnamed constraints
CHANGE clause

342
Q

What is the syntax for changing an unnamed constraint

A

CHANGE CurrentColumnName NewColumnName NewDataType (Constraint Declaration)

343
Q

Blank are added with an ADD clause

A

Named constraints

344
Q

What is the syntax for adding a constraint

A

ADD [CONSTRAINT ConstraintName] ConstraintDeclaration;

345
Q

Adding a constraint always blanks when the data already in the table violates the constraint

A

Fails

346
Q

Named constraints are deleted with a blank

A

DROP clause

347
Q

Give the syntax for deleting a constraint (2)

A

DROP [CONSTRAINT ConstraintName] ConstraintDeclaration

Or DROP ConstraintDeclaration [ConstraintName]

348
Q

Blank fails when a foreign key constraint refers to the table’s primary key

A

Dropping a table

349
Q

Before dropping a table that a foreign key references, either the blank or blank must be droppiled

A

Foreign key constraint
Foreign key table