UNIT 2 Flashcards
What do you mean by relational model?
Represents the database a collection of relations.
Relation is a concept from set theory.
What do you mean by a flatfile?
Any files that are stored in the local database as opposed to the other complex files that are stored in structured databases.
The records present in flat files are generally stored in sequential order without any metadata.
What do you mean by a flatfile?
Any files that are stored in the local database as opposed to the other complex files that are stored in structured databases.
The records present in flat files are generally stored in sequential order without any metadata.
How does a flat file table organize its data?
Using a single table.
What are the problems with flat file database?
As the data is stored in a single table, there will be repeated data that might cause modification errors. (updated anomalies).
ERRORS: Might miss a record when you update the table.
Might miss a record when you delete details.
May not be able to insert new details without other details.
How do you solve the problem with the flat file database?
By using relational database instead of flat fie database. RD used multiple tables instead of a single one in order to avoid redundant data.
This process of converting flat file database to relational database is called as NORMALIZATION.
How does the relational database solve the problem?
Updates are less prone to errors.
Less storage is required as the data has to be stored only once now.
Informally describe what is present in the relational database?
Relation - set of values.
Row - tuples - has certain facts which describe the data elements in each row - entities/ relations.
Column - Column header - describes the data items present in that particular column.
Give the formal definition / words for the following:
table, row, column, set of values, table defn, populated table.
Relation
tuples
attribute
domain
schema
state of relation
What do you mean by a key? What do you mean by a surrogate key?
Value in a tuple/row that uniquely identifies the row in a table is called as a key.
Surrogate Key: Sometimes seq num and row_id’s are used as a key to uniquely identify a row in the table. This is called as surrogate key.
What do you mean by a schema?
Schema is the definition of a relation.
It is denoted by: R(A1,A2,…..AN).
R = Relation name
A1… AN = attribute name
Each of these attribute has a set of domain or set of valid values.
What do you mean by a tuple?
Tuple is an ordered set of values. Each value is derived from a domain.
Row present in a particular relation will be a set of tuples. (Customer relaiton - 4 tuple values )
Relation is a collection of such rows.
What do you mean by a domain?
It has a logical definition.
It has a datatype and a format defined for it.
Like date or phone numbers.
Attribute names which are used designates the role which is played by each domain in a particular relation.
What do you mean by relation state?
It is the subset of cartesian product of all domains of its attributes.
Each domain has all set of values that the particular attr can take.
What are the different characteristics of relation?
Ordering of tuples in Relation r(R).
Ordering of attributes in Relation schema R.
Values in the tuple.
How are all values considered in a tuple?
They are considered atomic or indivisible,
What do you mean by constraints? What are the different types of constraints?
Constraints determine which values are permissible and which values do not belong to the dataset.
Three types of constraints:
i) inherent / implicit - Based on the model itself.
ii) schema based / explicit - Based on the facilities provided by the model.
iii) application based / semantic - Beyond the expressive power of the model and enforced by the application programs.
What do you mean by a valid state?
It is a database state that satisfies all the constraints in the defined set of integrity constraints.
What are the main types of constraints?
Domain
Key
Integrity - entity integrity
Referential integrity
What does domain constraint specify?
Domain constraint specifies that within each tuple, the value present for each attribute must be an atomic value from the domain of that attribute. D(A).
Every value must be from the domain of that attribute.