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
What are the equivalent terms in files for table, columns, row and data types?
File Field Record Data type
26
What relational operation grabs a subset of rows of a table?
SELECT
27
What relational operation eliminates one or more columns of a table?
Project
28
What relational operation lists all combinations of rows of two tables?
PRODUCT
29
What relational operation combines two tables by comparing related columns?
JOIN
30
What relational operation selects all rows of two tables?
UNION
31
What relational operation selects rows common to two tables?
INTERSECT
32
What relational operation selects rows that appear in one table but not another
DIFFERENCE
33
What relational operation changes a table name?
RENAME
34
What relational operation computes functions over multiple table rows, such as sun and count
AGGREGATE
35
Relational operations are collectively called what and are the theoretical foundations of the SQL language?
Relational algebra
36
Blank are logical constraints that ensure data is valid
Rules
37
Blank are part of the relational model and govern data in every relational database
Relational rules
38
All tables have a blank column, or group, in which values cannot repeat
Unique primary key
39
Relational databases require blank in that different columns of the same table have different names
Unique column names
40
Relational databases require blank in that no two rows have identical values in all columns
No duplicate rows
41
Blank are based on business policy and specific to a particular database
Business rules
42
Relational rules are implemented as what
SQL constraints
43
Relational rules are enforced by what
The database system
44
Blank are discovered during database design and are often implemented with SQL constraints
Business rules
45
Blank is a high-level computer language for storing, manipulating, and retrieving data
SQL
46
Blank support most important elements of sql standard, however, most don’t support the entire standard
Relational databases
47
A blank uses sql to insert, retrieve, update, and delete data from the tables
Database user
48
A blank uses sql to create a database and the database tables
Designer
49
A blank is a complex command composed of one or more clauses
SQL statement
50
A blank groups sql keywords with table names and conditions
Clause
51
Good prep rice is to write sql statements like what
Each clause on a separate line
52
Name the three clauses in a select statement
SELECT FROM WHERE
53
Sql statements end with a what
Semicolon
54
Clauses that end with a semicolon in sql are called what
Statement
55
In sql blank are case sensitive
Column names and table names
56
In sql blank are not case sensitive
Sql keywords
57
In sql blank are explicit values that are string, numeric, or binary
Literals
58
In sql strings must be surrounded by a single or double what?
Quote
59
Blank are represented with x ‘0’ where the 0 is any hex value
Binary values
60
In sql blank are words with special meanings
Keywords
61
In sql blank are objects from the database like tables, columns, etc
Identifiers
62
In sql blank are statements intended only for humans and ignored by the database when parsing an sql statement
Comments
63
What do you use for a single line comment on sql
- -
64
What do you use for a multiline comment in sql
/*
65
All databases recognize what for string literals while only some recognize what
Single quotes Double quotes
66
The sql language is divided into five subcategories. Name them
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)
67
Blank is a subcategory of sql that defines the structure of the database
Data Definition Language (DDL)
68
Blank is a subcategory of sql that retrieves data from the database
Data Query Language (DQL)
69
Blank is a subcategory of sql that manipulates data stirred in a database
Data Manipulation Language (DML)
70
Blank is a subcategory of sql that controls database user access
Data Control Language (DCL)
71
Blank is a subcategory of sql that manages database transactions
Data Transaction Language (DTL)
72
Blank creates, alters, and drops tables
DDL
73
Blank selects data from a table
DQL
74
Blank inserts, updates, and deletes data in a table
DML
75
Blank grants and revokes permissions to and from users
DCL
76
Blank commits data to a database, rolls back data from a database, and creates save points
DTL
77
A blank is a series of sql statements that is executed repeatedly
Automated script
78
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
Automated script
79
A blank is a single executing copy of a database system
Database system instance
80
Personally computers usually just run how many instances of a database system
One
81
Shared computers usually run how many instances of a database system
Many
82
Name the two sql commands that help database admins, users, and designers manage the database on an instance
CREATE DATABASE DROP DATABASE
83
What is the correct syntax for creating a database
CREATE DATABASE DatabaseName
84
What is the correct syntax for deleting a database and all tables in the database
DROP DATABASE DatabaseName;
85
The what is automatically installed in MySQL database system and used for system admin
MySQL database
86
Blank statements provide information about databases
SHOW
87
What sql command shows all the database system instances
SHOW DATABASES;
88
What is the sql syntax to list all tables in the default database
SHOW TABLES;
89
What is the sql syntax for listing all columns in a particular table of the default database
SHOW COLUMNS FROM TableName;
90
How do you obtain the create table statement for a table in the default database
SHOW CREATE TABLE TableName;
91
All data is a relational database is structured in blank
Tables
92
A blank has a name, a fixed sequence of columns, and a varying set of rows
Table
93
A blank has a name and data type
Column
94
A blank is an unnamed sequence of values that corresponds and belongs to the column’s data type
Row
95
A blank is a single column of a single row
Cell
96
A table must have at least one what, but any number of what?
Column Rows
97
A table without rows is called a what
Empty table
98
Tables must obey what?
Relational rules
99
A cell must not contain what?
Multiple values
100
Blank are allowed in different tables, but not the same table
Duplicate column names
101
No blank can have identical values in all columns
Two rows
102
Rows are not what?
Ordered
103
The organization of rows on a storage device must never what?
Affect query results
104
Name the four relational rules governing tables
Exactly one value per cell No duplicate column names No duplicate rows No row order
105
Blank allows database admins to improve query performance by changing the organization of data on storage devices without affecting no query results
Data independence
106
Blank tables allows tables with duplicate rows
Temporary
107
What sql statement creates a new table by specifying the table name, column names, and column data types? Give the syntax
CREATE TABLE TableName ColumnName DataType;
108
Give the syntax for deleting a table and all of the columns in it
DROP TABLE TableName;
109
Name the syntax for adding a column into an existing table
ALTER TABLE TableName ADD ColumnName DataType;
110
Name the syntax for modifying an existing column in a table
ALTER TABLE TableName CHANGE CurrentColumnName NewColumnName NewDataType;
111
Name the syntax for deleting an existing column in a table
ALTER TABLE TableName DROP ColumnName;
112
Name the way to change a column’s data type
ALTER TABLE TableName CHANGE ColumnName ColumnName NewDataType;
113
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
Transpose
114
A blank is a named set of values from which column values are drawn.
Data type
115
Name the seven general data types
1) integer 2) decimal 3) character 4) date 5) binary 6) spatial 7) document
116
Blank data types represent positive and negative integers
Integer
117
Blank data types represent numbers with fractional values
Decimal
118
Blank data types represent textual characters
Character
119
Blank data types represent day and time or both
Date
120
Blank data types store data exactly as the data appears in memory or computer files, but for bit
Binary
121
Blank data types contain textual data in a structured format like XML or JSON
Document
122
A blank data type stores data as an exact copy of memory?
Binary
123
All relational databases support what four data types?
Integer, decimal, date and time, and character
124
Most databases allow integer and decimals to be what
Signed or unsigned
125
A signed number may be what
Negative
126
A blank cannot be negative
An unsigned number
127
Data types vary in what
Storage requirements
128
Blank data types use in or two bytes per character
Character
129
Blank data types use a fixed number of bytes per number
Integer
130
Blank data types store larger numbers than the blank version of the same number
Unsigned , signed
131
To minimize table size, the data type with the blank should be used
Smallest storage requirements
132
What data type has a storage size of 1 byte?
TINYINT
133
What is the TINYINT range for a SiGNeD
-128 - 127
134
What is the range for TINYINT UNSIGNED
0 - 255
135
What integer data type has 2 bytes of storage.
SMALLINT
136
What is the number range for SMALLINT signed?
-32768 to 32767
137
What is the number range for SMALLINT unsigned?
0 to 65535
138
What integer data type uses 3 bytes of storage?
MEDIUMINT
139
What is the number range for MEDIUMINT signed?
-8388608 to 8388607
140
What is the number range for MEDIUMINT unsigned?
0 to 16 million
141
What integer data type uses 4 bytes of storage?
INT or INTEGER
142
What is the number range for INTEGER signed?
-2 billion to 2 billion
143
What is the number range for INTEGER unsigned?
0 to 4294967295
144
What integer data type uses 8 bytes of storage?
BIGINT
145
What is the number range for BIGINT signed?
-2 to the 63ed power to 2 to the 63rd power - 1
146
What is the number range for BIGINT unsigned?
0 to 2 to the 64th power - 1
147
What does the m and d stand for in DECIMAL(M,D)?
M is number of significant digits D is number of digits after decimal
148
What decimal data type uses 4 bytes of storage?
FLOAT
149
What is the approximate range of FLOAT?
-3.4 E+38 to 3.4 E+ 38
150
What decimal data type uses 8 bytes of storage?
DOUBLE
151
What is the approximate range of DOUBLE?
-1.8 e+308 to 1.8 E + 308
152
What day and time data type uses 3 bytes of storage and is formatted YYYY-MM-DD?
DATE
153
What day and time data type uses 3 bytes of storage and has a format of hh:mm:ss?
TIME
154
What day and time data type uses 5 bytes of storage and is formatted yyyy-mm-dd hh:mm:ss?
DATETIME
155
What character data type uses a byte per character?
CHAR(N)
156
What type of string does a CHAR(N) hold?
Fixed-length
157
In CHAR(N), what is the length range of N?
0 <= N <= 255
158
What character data type uses the length of the characters + one byte of storage?
VARCHAR(N)
159
A VARCHAR(N) has a what type of string?
Variable length
160
What is the number range for VARCHAR(N)?
0<=N<=65535
161
What character data type has a storage requirement of the length of the characters + 2 bytes?
TEXT
162
TEXT is what kind of string?
Variable-length
163
TEXT has a maximum length of how many characters?
65535
164
If you want to store a yes or no in sql how do you do it?
TINYINT with 1 = yes and 0= no
165
A blank is a symbol that computes from one or more other values called operands
Operator
166
Blank operators compute numeric values from numeric operands
Arithmetic
167
Blank operators compute logical values TRUE or FALSE. Operands can be numeric, character, and other data types
Comparison
168
Lank operators compute logical values from logical operands
Logical
169
A blank operator has one operand
Unary
170
A blank operator has two operands
Binary
171
Most operands are what?
Binary
172
The logical operator what is unary?
NOT
173
The arithmetic operator “-“ is either what?
Unary or binary
174
Operators may return what when either operands is what
NULL
175
What is the operator sign for adding two numeric values?
+
176
What is the operator sign for reversing the sign of a number and is Unary?
-
177
What is the operator sign for subtracting one numeric value from another and is binary?
-
178
What is the numeric operator sign for multiplies two numbers?
*
179
What is the numeric operator sign for divides one number by another and returns the remainder?
% modulus
180
What is the numeric operator for divides one from another?
/
181
What is to r numeric operator for raises a number to the power of another number?
^
182
What comparison operator sign compares two values for equality?
=
183
What is the comparison operator that compares one value to be less than or equal to another or grater than or equal to another?
<= >=
184
What’s re the comparison operators for less than and greater than?
< >
185
What are the two comparison operators that compares two values for inequality?
!= <>
186
What is the operator that returns true when both values are true?
AND
187
What is the operator that returns false when at least one is false?
OR
188
What is the operator that reverses a logical value?
NOT
189
A blank is a string of operators, operands, and parentheses that evaluates into a single value
Expression
190
In an expression, blank may be a column names or fixed values.
Operands
191
The value of an expression may be any blank
Data type
192
A blank expression may consist of a single column name or fixed value
Simple
193
When an expression is evaluated, blank are replaced with column values for a specific row.
Column names
194
The blank of operator may affect the value of an expression
Order
195
Operators of the same precedence are not evaluated blank
Left to right
196
Regardless of operator precedence, expression enclosed in what are evaluated first
Parentheses
197
In the order of operations, what operator has first precedence
- (Unary)
198
In order of operations what operator has second precedence
^
199
In order of operations, what operators have third precedence
* and % and /
200
In order of operation, what operators have fourth precedence
+ and -(binary)
201
In order of operations what operators have fifth precedence
= and != and <> and <= and >=
202
In order of operations what operator has sixth precedence
NOT
203
In order of operations what operator has seventh precedence
AND
204
In order of operation what operator has eighth precedence
OR
205
The blank statement selects rows from a table
SELECT
206
The select statement has two clauses name them
SELECT clause FROM clause
207
In a SELECT clause the select clause specifies what , separated by commas that determine what values are returned for each row
One or more expressions
208
In a select statement , the blank specifies the table from which rows are selected
FROM clause
209
In many select queries each expression in the select clause is a simple blank
Column name
210
To select all columns, the expressions can be replaced with what?
A single asterisk *
211
Give the syntax for a simple select statement
SELECT ColumnName FROM TableName;
212
The select statement returns a set of rows called the what?
Result table
213
In a select statement some tables may contain thousands or millions of rows, how can you limit the results?
With a LIMIT clause
214
Give the syntax for a select clause with a limit
SELECT * FROM TableName LIMIT 100;
215
A SELECT statement has an optional blank clause that specifies a condition for selecting rows
WHERE
216
In a where clause, a row is selected when the condition is blank for the row
True
217
In a where clause a row is omitted when blank
The expression is false or null
218
Give the syntax for a SELECT statement with a where clause
SELECT Expression1 FROM TableName WHERE Condition;
219
Blank is a special value that represents either unknown or inapplicable data
Null
220
NULL is not the same as blank for numeric data types or what for character data types
Zero Blanks
221
By default columns may contain blank values
Null
222
The blank prevents a column from having a null value.
NOT NULL constraint
223
NOT NULL constraints follow the column name and data type in a blank
CREATE TABLE statement
224
Give the syntax for using a not null constraint
CREATE TABLE TableName ColumnName DataType NOT NULL;
225
When arithmetic or comparison operators have one or more null operands, the result is blank
NULL
226
Since blank return null when either operand is null, blank cannot be used to select null values
Comparison operators
227
If you need to select null values, use what two operators.
IS NULL IS NOT NULL
228
In traditional mathematical logic, expressions are always true or false. When null is present, a logical expression may be what?
True, false, or null
229
In a logical expression, bill indicates the value is what?
Uncertain
230
If x is true and y is null, what is the result of x and y and x or y
Null True
231
If x is null and y is true what is the value of x and y and x or y
Null True
232
If x is false and y is null what is the value of x and y and x or y
False Null
233
If x is null and y is false what is the value of xand y and x or y?
False Null
234
If x is null and y is null, what is the value of x and y and x or y
Null Null
235
If x is null, what is the value of not x
Null
236
In MySQL, query results returning true and false are displayed how
0 = false 1= true
237
Using blank will not select a null value
NOT NULL
238
A blank adds rows to a table in sql
INSERT statement
239
The blank clause names the table and clauses where data is to be added.
INSERT INTO
240
In an insert statement, the blank clause specifies column values to be added
VALUES
241
The values clause may list any number of rows in blank to insert multiple rows
Parentheses
242
Give the syntax for an insert statement
INSERT [INTO] TableName (ColumnName) VALUES (Value1);
243
In an insert statement column names may be omitted as long as blank
The VALUES clause lists all column values in the same order as the table’s columns
244
Columns may be omitted from an INSERT statement. When omitted, a column is assigned what value
Null
245
When creating a table, the blank keyword after ColumnName and DataType will hold a default value to insert rather than null
DEFAULT
246
What is the syntax for inserting a default date value?
CREATE TABLE TableName ColumnName DATE DEFAULT ‘2000-01-01’;
247
The blank statement modifies existing rows in a table
UPDATE
248
The update statement uses what clause to specify the new column values
SET
249
In an update statement, the blank clause specifies which rows are updated
WHERE
250
Give the syntax for an update statement
UPDATE TableName SET ColumnName = Value WHERE Condition;
251
The blank statement deletes existing rows in a table
DELETE
252
The blank keyword in a delete statement is followed by the table name where rows are to be deleted
FROM
253
The blank clause in a delete statement specifies which rows should be deleted
WHERE
254
Give the syntax for a delete statement
DELETE FROM TableName WHERE Condition;
255
What happens in a delete statement if you exclude the WHERE clause
All rows in the table are deleted
256
The blank statement deletes all rows from a table and is nearly identical to the DELETE statement with no where clause
TRUNCATE
257
Give the syntax for a truncate statement
TRUNCATE TABLE TableName;
258
The blank statement selects data from one table called the source and inserts data into another table, called the target
MERGE
259
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
Primary keys
260
A blank is a column, or group of columns, used to identify a row
Primary key
261
In a table diagram what precedes the primary key
A solid circle
262
Often primary keys are used in what clause to select a specific row?
WHERE
263
The primary key is specified in SQL when the table is what?
Created
264
Primary keys must be what two things
Unique Not Null
265
A simple primary key consists of what
A single column
266
A composite primary key consists of what
Multiple columns
267
In a CREATE TABLE statement, how are composite primary keys denoted?
With parentheses
268
Composite primary keys must be what
Unique Not null Minimal
269
Composite values of a primary key, when blank, must be unique
Grouped together
270
No column of a composite primary key can contain a what
Null value
271
All primary key columns are necessary for what. When any column is removed, this no longer exists
Uniqueness
272
Blank in a CREaTe TAbLE statement names the table’s primary key
Primary key constraint
273
The primary key constraint ensures that the primary key is always blank and blank
Unique and non-null
274
A blank column is a numeric column that is assigned to increase by one when a new row is inserted
Auto-increment
275
Name the two ways to name a primary key in a create table statement
Inserting PRIMARY KEY after the data type and column name Listing PRIMARY KEY (ColumnName) at the end of the query
276
AUTO_INCREMENT follows the column’s blank in a CREATE TABLE statement
Data type
277
Blank primary keys are often implemented as auto-increment columns
Integer
278
In MySQL, auto_increment may be applied not to blank
Primary key columns
279
Database users occasionally make the following two mistakes when inserting primary keys
1) inserting values for auto-increment primary keys 2) omitting values for primary keys that are not auto-increment
280
When inserting rows that have an auto_increment don’t do what?
Include the auto-incremented value
281
A blank is a column or group of columns that refer to primary key.
Foreign key
282
The blank of the foreign and primary keys must be the same, but the blank must be different
Data type Names
283
What denotes a foreign key in a table diagram?
Open circle
284
Foreign keys may be blank and blank
Repeated and null
285
Foreign keys obey a relational rule called blank
Referential integrity
286
Referential integrity requires foreign key values must either be blank or blank
Null Match some value of the primary key
287
Multiple foreign keys may refer to the same blank
Primary key
288
A foreign key may refer to a primary key in the blank
Same table
289
A foreign key that refers to a composite primary key must blank
Also be composite
290
All columns of a composite foreign key must either be blank or blank
Null Match the corresponding primary key columns
291
A blank is added to the CREATE TABLE statement with the FOREIGN KEY and REFERENCE keywords
Foreign key constraint
292
When a foreign key constraint is specified, the database blank insert, update, and delete statements that violate referential integrity
Rejects
293
Name the syntax for creating a foreign key constraint
CREATE TABLE TableName ColumnName DataType PRIMARY KEY ColumnName2 DataType FOREIGN KEY (ColumnName) REFERENCES TableName(PrimaryKeyColumn)
294
In the CREATE TABLE statement, the order of blanks and columns is not significant.
Constraints
295
A blank is a simple or composite foreign key in which all columns are NULL
Fully NULL foreign key
296
In a relational database, foreign keys must obey what at all times?
Referential integrity
297
Occasionally, blank or blank result in referential integrity violations that must be corrected before data is stored in the database
Data entry errors Incomplete data
298
Referential integrity can be violated in what four ways
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
What two moves never violate referential integrity?
Primary key insert Foreign key deletes
300
Databases automatically correct referential violations automatically with one of what four actions?
RESTRICT SET NULL SET DEFAULT CASCADE
301
Blank rejects an insert, update, or delete that violates referential integrity
RESTRICT
302
Blank sets invalid foreign keys to null
SET NULL
303
Blank sets invalid foreign keys to the foreign key default value
SET DEFAULT
304
Blank propagates primary key changes to foreign keys
CASCADE
305
Blank behaves differently for primary key updates and deletes
CASCADE
306
In CASCADe, if a primary key is deleted, rows containing matching foreign keys are blank
Deleted
307
In CASCADE, if a primary key is updated, matching foreign keys are blank
Updated to the same value
308
Blank, blank and blank apply to primary key updates and deletes, and foreign key insert and update
RESTRICT, SET NULL, SET DEFAULT
309
Blank applies to primary key update and delete only
CASCADE
310
In MySQL, foreign key updates and inserts are supported by which action?
RESTRICT
311
For primary key updates and deletes, MySQL supports what?
All four actions
312
Referential integrity actions are specified in optional what and what clauses of the foreign key constraints
ON UPDATE and ON DELETE
313
ON UPDATE and ON DELETE are followed by either what, what, what or what?
RESTRICT SET NULL SET DEFAULT CASCADE
314
She several foreign keys refer to the same primary key, blank actions can be specified
Different actions
315
Blank is applied when the ON UPDATE or ON DELETE clause is omitted
RESTRICT
316
Blank cannot be used when a foreign key is not allowed NULL values
SET NULL
317
Blank is not supported in some MySQL configurations
SET DEFAULT
318
A blank is a rule that governs allowable values in a database
Constraint
319
Constraints are based on blank and blank and implemented with special keywords in a CREATE TABLE statement
Relational rules Business rules
320
The database automatically blanks inserts, updates and deletes that violate a constraint
Rejects
321
A blank appears after the column name and data type in a CREATE TABLE statement
Column constraint
322
Blank govern values in a single column, like NOT NULL
Column constraints
323
A blank appears in a separate clause of a CREATE TABLE statement and governs values in one or more columns, ex foreign keys
Table constraint
324
Some constraint types can be classified as either blank or blank, ex primary key
Column or table constraints
325
A primary key constraint on a composite column must be defined as a blank
Table constraint
326
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
Default constraint
327
Blank ensures that my values in a column or group of columns is not repeated.
Unique constraint
328
When applied to one column the unique constraint can be blank, when applied to a group of columns, the uniques constraint is a blank.
Either in the column declaration or a separate clause A table constraint and must appear in a separate clause
329
The unique constraint can be applied to blank but is unnecessary
Primary key columns
330
MySQL creates a blank for each unique constraint
Index
331
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.
Check constraint
332
When the CHECK constraint is one one column, then the CHECK may appear either blank or blank
In the column declaration Separate clause
333
When the check expression involves multiple columns, check is a blank and must be blank
Table constraint A separate clause
334
Table constraints may be blank using the optional CONSTRAINT keyword followed by the constraint name and declaration
Named
335
Most column constraint cannot be blank.
Named
336
Name the constraint that can be named in a column declaration
CHECK
337
Give the syntax for naming a constraint (that declaration only)
CONSTRAINT ConstraintName ConstraintDeclaration;
338
The MySQL statement blank returns the CReatE TAbLE statement for the table. It shows all constraints, constraintname clauses, but no default constraint names
SHOW CREATE TABLE TableName;
339
What does this query do- SELECT Column_name, Constraint_name FROM Information_schema.key_column_usage WHERE Table_Name = ‘TableName’;
Displays all names of constraints on TableName including default names
340
Constraints are added and dropped with the blank followed by a blank clause.
ALTER TABLE TableName ADD,DROP, or CHANGE
341
Blank such as NOT NULL and DEFAULT are added or dropped with a blank
Unnamed constraints CHANGE clause
342
What is the syntax for changing an unnamed constraint
CHANGE CurrentColumnName NewColumnName NewDataType (Constraint Declaration)
343
Blank are added with an ADD clause
Named constraints
344
What is the syntax for adding a constraint
ADD [CONSTRAINT ConstraintName] ConstraintDeclaration;
345
Adding a constraint always blanks when the data already in the table violates the constraint
Fails
346
Named constraints are deleted with a blank
DROP clause
347
Give the syntax for deleting a constraint (2)
DROP [CONSTRAINT ConstraintName] ConstraintDeclaration Or DROP ConstraintDeclaration [ConstraintName]
348
Blank fails when a foreign key constraint refers to the table’s primary key
Dropping a table
349
Before dropping a table that a foreign key references, either the blank or blank must be droppiled
Foreign key constraint Foreign key table