Relational DB Model Flashcards

Functional relationship/dependency, Primary key, Foreign key, Required and Optional attributes, Attribute Domain, Composite and simple attributes, Single-values and multi-values attributes, Derived attributes, Strong and weak entities (existence dependent), Strong and weak relationships (PK)

1
Q

Data Definition Language (DDL)

A

commands responsible for creating, editing and deleting SQL
tables

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

DDL commands

A

used to define the structure, names, and types of
the data containers within a database

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

Data Modeling Steps

A
  1. Business Rules, Use cases
  2. Conceptual Model
  3. Logical Model
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are business rules?

A

brief, precise, and unambiguous description of a policy, procedure, or
principle within a specific organization/lab/research area

this helps define entities, attributes, and constraints which distinguishes characteristics of data viewed by company/users

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

What is functional dependency in DBMS?

A

describes the
relationship between attributes (columns) in a table

It shows that the value of one attribute determines the other.

So X → Y, where X is Determinant and Y is Dependent

EX: Student ID → Semester
This explains that a semester is dependent on a student ID which determines a specific semester.

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

Primary key

A

candidate key chosen
by the DB designer

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

candidate key

A

minimal superkey

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

superkey

A

set of attributes that
uniquely determine all other attributes
in that relation

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

foreign key

A

attribute whose values match the primary key values
in a related table

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

required attribute

A

attribute that MUST have a value

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

optional attribute

A

attribute that can be NULL

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

Attribute Domain

A

set of possible values for a given attribute

Examples:
- Domain for the GPA: [0.0, 4.0]
- Domain for the gender: {Male, Female}
- Domain for the gene start location: positive integer numbers.

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

Composite attribute

A

attribute
that can be further subdivided to yield additional attributes

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

Simple attribute

A

attribute that cannot be subdivided

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

Single-value attribute

A

only one valid
value can be assigned

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

multi-value attribute

A

logically have more than one value – this usually occurs
with 1:M and M:N relationships but also with spreadsheet data

17
Q

derived attribute

A

attribute that’s computed/calculated from other attributes

18
Q

strong relationship (existence dependent)

A

Pros: you cannot
have a child entity without a
parent entity

Cons: composite keys are less
efficient and less flexible than
simple primary keys

19
Q

weak relationship (existence dependent)

A

Pros: Simple primary keys are more
efficient and more flexible than
composite primary keys

Cons: it is
possible to have a child entity
without a parent entity

20
Q

strong entity (PK)

A

Identifying relationship, when the PK of the related entity contains a PK
component of the parent entity

21
Q

weak entity (PK)

A

Non-identifying relationship, does not use the PK of the parent entity as
part of its own PK, but only as a FK

22
Q

transitive/indirect FD

A

dependent is indirectly dependent on
determinant

If a → b & b → c, then according
to axiom of transitivity, a → c

Ex: If enrol_no → dept and dept → building_no, then Enrol_no → building_no

23
Q

Why use FD?

A

removes redundancy, thereby improving data quality, accuracy and errors. - this is time and cost effective

helps identify poor db design

24
Q

non-trivial FD

A

dependent is strictly not a subset of the
determinant

X → Y and Y is not a
subset of X

EXs: roll_no → name, {roll_no, name} → age

25
Q

trivial FD

A

dependent
is always a subset of the determinant

X → Y and Y is the subset of X

EXs: {roll_no, name} → name, roll_no → roll_no