CIS275 - Chapter 2: Relational Databases Flashcards
A _____ is a conceptual framework for database software.
database model
The _____ is not optimized for big data.
relational model
Many non-relational databases have come to market since 2000, optimized for big data and are collectively called _____.
NoSQL databases
NoSQL stands for _____ and encompasses a variety of database models.
‘Not only SQL’
The _____ is a database model based on mathematical principles, with three parts:
A data structure that prescribes how data is organized.
Operations that manipulate data structures.
Rules that govern valid relational data.
relational model
A ___ is a collection of values, or elements, with no inherent order.
set
Sets are denoted with braces. Ex: {apple, banana, lemon} is the set containing three kinds of fruit. Since sets have no order, {apple, banana, lemon} is the same set as {lemon, banana, apple}.
A _____ is a named set of possible database values, such as integers, dictionary words, or logical values TRUE and FALSE.
domain
A _____ is a finite sequence of values, each drawn from a fixed domain.
tuple
Ex: (3, apple, TRUE) is a tuple drawn from domains (Integers, DictionaryWords, LogicalValues).
A _____ is a named set of tuples, all drawn from the same sequence of domains.
relation
Ex: The relation below is named Grocery and contains three tuples.
In the relational model, each tuple position is called an _____ and given a unique name.
attribute
Ex: In the Grocery relation, the first, second, and third positions might be named Quantity, FruitType, and OrganicCertification.
Domain, tuple, relation, and attribute =
Data type, row, table, and column
The relational model stipulates a set of operations on tables, collectively called _____.
relational algebra
Like the relational data structure, relational operations are based on set theory.
combines two tables with identical columns into one table.
Union
removes all rows of one table from another table.
Difference
eliminates one or more columns of a table.
Projection
selects a subset of rows of a table.
Selection
combines two tables with different columns into one table.
Join
lists all possible combinations of rows of two tables.
Product
_____, also known as integrity rules, are logical constraints that ensure data is valid and conforms to business policy.
Relational rules
_____ are relational rules that govern data in every relational database.
Structural rules
The relational model stipulates a number of structural rules, such as:
Unique primary key — all tables should have a column with no repeated values, called the primary key and used to identify individual rows.
Unique column names — different columns of the same table must have different names.
No duplicate rows — no two rows of the same table may be have identical values in all columns.
_____ are relational rules specific to a particular database and application.
Business rules
Example business rules include:
Unique column values — in a particular column, values may not be repeated.
No missing values — in a particular column, all rows must have known values.
Delete cascade — when a row is deleted, automatically delete all related rows.
A _____ is a collection of data organized as columns and rows.
table
A table must have at least one column and any number of rows. A table without rows is called an empty table.
A _____ is a set of values of the same type. Each column has a name, different from other column names in the table.
column
A ____ is a set of values, one for each column.
row
A ____ is a single column of a single row. In relational databases, each ____ contains exactly one value.
(same word in both fields)
cell
In addition to a name, each column has a_____, which defines the format of the values stored in each row.
data type
_____data types represent positive and negative integers. Several _____ data types exist, varying by the number of bytes allocated for each value.
(same word)
Integer
Common integer data types include INT, implemented as 4 bytes of storage, and SMALLINT, implemented as 2 bytes.
_____data types represent numbers with fractional values.
Decimal
Decimal data types vary by number of digits after the decimal point and maximum size. Common decimal data types include FLOAT and DECIMAL.
_____data types represent textual characters.
Character
Common character data types include CHAR, a fixed string of characters, and VARCHAR, a string of variable length up to a specified maximum size.
_____data types represent date, time, or both.
Time
Some time data types include a time zone or specify a time interval. Some time data types represent an interval rather than a point in time. Common time data types include DATE, TIME, DATETIME, and TIMESTAMP.
_____data types store data exactly as the data appears in memory or computer files, bit for bit.
Binary
The database manages binary data as a series of zeros and ones. Common binary data types include BLOB, BINARY, VARBINARY, and IMAGE.
_____data types store geometric information, such as lines, polygons, and map coordinates.
Spatial
Examples include POLYGON, POINT, and GEOMETRY. Spatial data types are relatively new and consequently vary greatly across database systems.
_____data types contain textual data in a structured format such as XML or JSON.
Document
Data types
Relational databases support many different data types. Most data types fall into one of the following categories:
Tables obey three rules:
- Tables are normalized — exactly one value exists in each cell.
- No duplicate column names — duplicate column names are not allowed in one table. However, the same column name can appear in different tables.
- No duplicate rows — no two rows may have identical values in all columns.
In addition to the three rules, relational databases obey the principle of _____, which states that rows and columns of a table have no inherent order.
data independence
Although values in rows and columns are stored sequentially on a storage device, such as a disk drive, the sequence is arbitrary and does not affect the results of a database query.
a special value that represents missing data.
Null value
NULL represents either ‘unknown’ or ‘inapplicable’.
NULL is not the same as zero for numeric data types or blanks for character data types.
a symbol that computes a value from one or more other values (called operands).
operator
Arithmetic operators, such as +, -, *, and /, compute numeric values from numeric operands.
Comparison operators, such as , and =, compute logical values TRUE or FALSE. Operands may be numeric, character, and other data types.
Logical operators, AND, OR, and NOT, compute logical values from logical operands.