Relational Database Modeling Flashcards

1
Q

Data Model

A
  • notion for describing data or information
    1. Structure of the data
  • data structures used to implement data in the computer are sometimes referred to as a physical data model, data models are somewhat higher level than data structures and are referred to as a conceptual model to emphasize the different in level
    2. Operations on the data: limited set of operations, or queries (retrieve information) and modifications (change the database)
    3. Constraints on the data: limitations on what the data can be (ex. day of the week is an int between 1 - 7)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Important Data models for database systems

A
  1. Relational model, including object-relational extensions
    - present in all commercial database management systems
  2. Semistructured-data model, including XML and related standards
    - added feature of most relational DBMS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Object-oriented features to relational models: Object-relational model

A
  1. Values can have structure rather than being elementary types such as integer or strings
  2. Relations can have associated methods
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Relational Model

A
  • relational model gives us a single way to represent data as a 2D table called a relation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Attributes

A
  • columns of a relations
  • appear at the tops of the columns
  • describes the meaning of entries in the column below
  • attributes in a relation schema are a set, not a list
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Schemas

A
  • name of the relation and the set of attributes for a relation is called the schema for that relation
    (ex. Movies(title, year, length, genre)
  • in a relational model, a database consists of one or more relations
  • the set of schemas for the relations of a database is called a relational database schema, or database schema
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Tuples

A
  • rows of a relation, other than the header row containing the attribute names are called tuples
  • tuple has one component for each attribute of the relation
    (ex. (Gone With the Wind, 1939, 231, drama) is a tuple)
  • must use the order in which the attributes were listed in the relation schema because the attributes are not present in a tuple
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Domains, or data type

A
  • relational model requires that each component of each tuple be atomic; must be some elementary type such as an integer or string
  • value cannot be a record structure, set, list, array or any other type that have its values broken into smaller components
  • for each attribute of a relation is a domain of a particular elementary type
  • components of any tuple of the relation must have a value that belongs to the domain of the corresponding column
    (ex Movies(title: string, year: integer, length: integer, genre: string)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Equivalent Representations of a Relation

A
  • relations are sets of tuples, not lists of tuples
  • order in which the tuples of a relation are presented is does not matter
  • we can reorder the attributes of the relation as we choose without changing the relation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Relation Instances

A
  • relationship about movies is not static and can change over time
  • set of tuples for a given relation is called an instance of that relation
  • a conventional database system maintains only one version of any relation, and this instance of the relation is called the current instance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly