DBMS Data Models Flashcards

1
Q

What is a key

A

A key is a attribute used to uniquely identify rows/tupples

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

Whats a candidate key?

A

A candidate key is used to uniquely differ between some tupples which are coincidently matching.
In short they are never equal and hence can be used to uniquely Identify
A candidate key is a minimal super key, or a super key with no redundant attributes.

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

Whats a primary key?!

A

A primary key can be assumed a mixture of candidate key and a condition that it can never be null.(Unique+ Not Null)
A primary key may have one or more attributes.

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

Whats a Foreign Key!?

A

It is an attribute or set of attributes, that references to primary key of same table or another table

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

Whats needed for a foreign key to work!?

A

There must be atleast one same column in both the table ( the main one and the foreign one)

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

Whats Reference Table and Referencing Table?

A

The table containing Foreign Key is called Referencing Table

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

Explain Relational Model

A

Relational Model
* Relational Model is the most widely used model.
* In this model, the data is maintained in the form of a two-dimensional tables called Relation.
* All the information is stored in the form of rows and columns where columns represents attributes and
row represents records or tuples.

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

Whats integrity Constraints

A

Integrity Constraints
 Integrity constraints are a set of rules. It is used to maintain the quality of information.
 Integrity constraints ensure that the data insertion, updating, and other processes have to be
performed in such a way that data integrity is not affected.
Thus, integrity constraint is used to guard against accidental damage to the database.

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

Whats Check Constraint

A

Check
 This constraint defines a business rule on a column. All the rows in that column must satisfy this rule.
 Limits the data values of variables to a specific set, range, or list of values.

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

Define entity

A

An entity is a person, a place or an object that is distinguishable from other objects based on
the values of the attributes it possess.

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

Define Relation Schema

A

A relation schema represents name of the relation with its attributes.
e.g.; STUDENT (ROLL_NO, NAME, branch, semester, SPI) is relation schema for STUDENT.
* If a schema has more than 1 relation, it is called Relational Schema.

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

Define Relation Instance:

A

Relation Instance: The set of tuples of a relation at a particular instance of time is called as relation instance.
It can change whenever there is insertion, deletion or updation in the database.

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

Define Degree

A

Degree: The number of columns or attributes in the relation is known as degree of the
relation.

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

Define Cardinality

A

Cardinality: The number of rows or tuples in a relation is known as cardinality.

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

Relation Key

A

Relation key: Every row has one or multiple attributes, that can uniquely identify the row in the relation, which is called relation key or primary key.

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

how does integrity constraints guard data against accidental damage

A

Integrity constraints are a set of rules .
} They are used to ensure accuracy and consistency of the data in a relational database.
} Integrity constraints ensure that the data insertion, updation, and deletion made to the
database by authorized users do not result in a loss of data consistency.
} Thus, integrity constraint is used to guard against accidental damage to the database.

17
Q

Whats Key contraint

A

No two tuples in a relation have same value for all attributes. To ensure that we choose key constraint.

18
Q

Whats Key constraint

A

No two tuples in a relation have same value for all attributes. To ensure that we choose key constraint.

19
Q

Whats Referential integrity Constraint

A

A referential integrity constraint is specified between two tables.
Ê referential integrity constraint is enforced when a foreign key references the primary key of a table.
Ê In the referential integrity constraints, if a foreign key column in table 1 refers to the primary key column of
table 2, then every value of the foreign key column in table 1 must be null or be available in primary key column of table 2.

20
Q

Explain the Rules for converting ER model to database schema

A

Rule1: For Strong entities with only Simple Attributes.
Each attribute turns into a column in the table

Rule2: For Strong entities with composite Attributes
} A strong entity set with any number of composite attributes will require only one table in relational model.
} While conversion, simple attributes of the composite attributes are taken into account and not the composite attribute itself.

Rule 3: For Strong Entities with Multi-valued Attributes:
} For each multivalued attribute A, create a new table.
} Add the primary key column into multi-value
attribute’s table.
} If the multivalued attribute is composite, we include its simple components.

Rule 4:For Binary Relationship With Weak Entity Set
Weak entity set always appears in association with identifying relationship with total
participation constraint.

20
Q

Explain the Rules for converting ER model to database schema

A

Rule1: For Strong entities with only Simple Attributes.
Each attribute turns into a column in the table

Rule2: For Strong entities with composite Attributes
} A strong entity set with any number of composite attributes will require only one table in relational model.
} While conversion, simple attributes of the composite attributes are taken into account and not the composite attribute itself.

Rule 3: For Strong Entities with Multi-valued Attributes:
} For each multivalued attribute A, create a new table.
} Add the primary key column into multi-value
attribute’s table.
} If the multivalued attribute is composite, we include its simple components.

Rule 4:For Binary Relationship With Weak Entity Set
Weak entity set always appears in association with identifying relationship with total
participation constraint.