Lecture 1, 2 and 3 Flashcards

(40 cards)

1
Q

Reasons for DBMS

A
  1. Data redundancy and inconsistency
    • Multiple file formats, duplication in different files
  2. Difficulty in accessing data
    • Need to write a new program to carry out each new task
  3. Data isolation
    • Multiple files and formats
  4. Integrity problems
    • Integrity constraints (e.g., account balance > 0) become “buried” in program code rather than being stated explicitly
    • Hard to add new constraints or change existing ones
  5. Atomicity of updates
    • Example: Transfer of funds from one account to another should either complete or not happen at all
    • Failures may leave data in an inconsistent state with partial updates carried out


6. Concurrent access by multiple users
• Needed for performance
• Example: Two people reading a balance (e.g., 100) and then withdrawing money (e.g., 50 each) at the same time
• Uncontrolled concurrent accesses can lead to inconsistencies

  1. Security problems
    • Hard to provide user access to some, but not all, data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

DBMS architecture:

A

Database (DB)

  • Collection of data with same structure
  • Including correlations and relationships
  • Common purpose
  • Shared by several users

DBMS

  • Collections of programs over DB
  • Define; i.e. specify data types, structure, organisation
  • Build & manipulate
  • Administrate

Applications / Users

  • Access for performing queries
  • android app etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Ultimate DBMS goal:

A

Separate data from application
- Provide an interface
- Allow system administrator to make modifications without having an impact
on the user
- Users can change their view of the data without having to worry about how it’s
stored

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

Three layers

A

Internal

  • Storage
  • Storing data
  • Software for constructing data
  • Efficient access methods (keys, indices etc)

Logical

  • Control
  • Optimization of queries
  • Resolving conflicting accesses (multiple users)
  • Guarantees constant availability

External

  • Dialog
  • communication with user
  • Access control
  • answer presentation
  • Analysis of user requests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Development process of DBMS:

A
  1. Planning
  2. Analysis
  3. Logical design
  4. Physical design
  5. Implementation
  6. Maintainance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Four different types of DBMS:

A
Traditional
- Text and numerical data
Multimedia DBMS
- Multimedia (movies, music etc)
Spatial DBM
- Geographic and geometric data
Data warehouses
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Waaruit bestaat een Entity-relationship-model

A

Entities

  • Instance: person, place, object, event, concept (often corresponds to row)
  • Type: collection of entities (often corresponds to table)

Relationship
- Instance: link between entities (corresponds to primary-foreign key
equivalence in related tables)
- Type: Category of a relationship (corresponds to links between entity types)

Attributes
- Properties or characteristics of an entity type or relationship type

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

Wat zijn business rules?

A
  • statements that define or constrain some aspect of the business
  • Derived from policies, procedures, events, functions
  • Assert business structure
  • Control or influence business behavior
  • Expressed in terms familiar to end users
  • Automated through DBMS software
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Wat maakt een goede business rule?

A
  • Declarative - what, not how
  • Precise, clear, agreed-upon meaning
  • Atomic - one statement
  • Consistent - internally and externally
  • Expressible - structured, natural language
  • Distinct - non-redundant
  • Business-oriented - understood by business people
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Wat is belangrijk bij data naming?

A
  • Related to business and not technical
  • Meaningful and self-documenting
  • Unique
  • Readable
  • Composed of words from an approved list
  • Repeatable
  • Written in standard syntax
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Wat is een entity type?

A

a collection of entities that share common properties or characteristics

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

Wat is een entitiy instance?

A
  • A single occurrence of an entity type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Voorwaarden van een entity

A

Should be:

  • object with many instances in db
  • object that is composed of multiple attributes
  • object that you’re trying to model

Should not be:

  • user of database
  • output of database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are strong and weak entities?

A

Strong

  • exist independently of other types of entities
  • has its own unique identifier
  • Identifier underlined with single line

Weak

  • dependents on a strong identity
  • without unique identifier
  • entity box and partial identifier have double lines
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an attribute?

A

Property or characteristic of an entity type or of a relationship type

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

Types of attributes

A
Required vs optinal
Derived vs Stored
Singlevalue vs Multivalue
Simple vs composite
Identifier
     Is a key = can be a single attribute or combination of 
                      attributes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

An identifier has to be:

A
  • Unique
  • Not be Null
  • Not change in value
18
Q

Defining attributes:

A
  • State what it is and why it is important
  • Make it clear
  • Include aliases in documentation
  • State source of values
  • State whether it can change
  • Specify whether required or optional
  • State min and max number of occurrences allowed
  • Indicate relationships with other attributes
19
Q

Wat is an relationship instance?

A

ink between specific entity instances

20
Q

What are three types of relationship degrees?

A

Number of entity types that participate in the relationship
- Three types:
Unary
- entities of the same entity type related to each other
- employee is supervisor of another employee; in same table displayed
Binary
- entities of one type related to entities of another
Ternary
- entities of three different types involved in the same relationship
- e.g. product shipped by supplier to a warehouse

21
Q

three relationship cardinalities?

A
  • One-to-one
  • Each entity in the relationship will have exactly one related entity
  • One-to-many: An entity on one side can have many related entities on the other side, but an
    entity on the other side, will have a maximum of one related entity
  • many-to-many
  • entities on both side can have multiple related entities
22
Q

What are cardinalities contraints?

A
number of instances of one entity that can, or must be, associated with each instance
of another entity
Minimum cardinality
- If zero, then optional
- if one or more, than mandatory
Maximum cardinality
- the maximum number
23
Q

What is an associative entity?

A

one or more attributes on a relationship suggests that the relationship should perhaps instead be represented as an associative entity

24
Q

Four conditions for associative entities:

A
  1. all the relationships for the participating entities are “many” relationships
  2. The resulting associative entity has an independent meaning and (preferrably) can
    be identified with a single-attribute identifier (key)
  3. Associative entity has one or more attributes in addition to the identifier (must add
    something)
  4. Associative entity participates in one or more relationships independent of the entities
    related in the associated relationship
25
What is generalization?
- the process of defining a more general entity type from a set of specialized entity types - Bottom-up
26
What is specification?
- The process of defining one or more subtypes of the supertype and forming supertype/subtype relations - Top-down
27
Completeness constraints
- Indicates whether an instance of a supertype must also be a member of at least one subtype - Yes - total specialization rule (double line) - No - partial specialization rule (single line)
28
Disjointness constraints
- Whether an instance of a supertype can be a member of two or more subtypes - Disjoint rule: - an instance of the supertype can be only one of the subtypes - Overlap rule: - an instance of the supertype could be more than one of the subtypes
29
What are forgein keys?
Describe links between relations - Must be modeled during the creation of the table - Verification of referential integrity by RDBMS: - External keys always reference existing tuples
30
Referential integrity:
The RDBMS always verifies the value that is linked to, actually exists in the other table - E.g. if you delete a studentid, the entire row is then also deleted in the other linked table
31
Types of joins:
- Natural Join - Inner join - Inner join using () - Left | right | Full outer join
32
What is a natural join?
Joining condition is based on equality between values in the common columns - Attributes with the same name of associated tables will appear once only in the returned result
33
What is a Inner join:
- two or more tables combined into one | - INNER can be omitted (inner join = join)
34
What is a Left outer join:
Returns all matched rows, plus all unmatched rows from the table on the left of the join clause - Uses NULL values in fields of non-matching tuples
35
What is a Right outer join:
Returns all matched rows, plus all unmatched rows from the table on the right of the join clause - Uses NULL values in field of non-matching tuples
36
What is a Full outer join:
- Returns all matched and unmatched rows from both tables in the join clause - Uses NULL values in field of non-matching tuples
37
What zijn Indices / Indexes / Indexing structures:
Mechanisms to quickly locate data - Indexing can speed-up access to the desired attributes - ID, Postcode, Birth date, name, surname etc. - Index file usually contains records (index entries) of the form - Different types of indices e.g.: - Ordered indices: search keys are stored in sorted order - Hashed indices: search keys distributed uniformly across buckets using a hash function
38
What is a view
can be seen as virtual table - based on the result set of a SQL statement - attributes in a view are columns from one or more “real” tables in the database - Purpose: - Can be used instead of Select - To present data as if the data were coming from one single table
39
Functions
- subprograms - For data transformation - used in SELECT or WHERE - Two types of functions: - Built-in functions - User-defined functions
40
What is DDL, DML, DCL?
``` DDL - data definition language commands that define a database DML - data manipulation language commands that maintain and query a database DCL - data control language commands that control a database ```