DBMS ER Model
DBMS ER Model
DBMS ER Model
Employee
Foreign Key
Derived attribute
15
B
C
The minimum and maximum values of this connectivity is called the cardinality of the
relationship
A unary relationship is represented as a diamond which connects one entity to itself as a
loop.
•The relationship above means, some instances of employee manage other instances of
Employee
A relationship between two entity types
• Note:
1. Generalization uses bottom-up approach where two or more lower level
entities combine together to form a higher level new entity.
2. The new generalized entity can further combine together with lower
level entity to create a further higher level generalized entity.
• Relational Algebra
• Relational algebra is a procedural query language, which takes
instances of relations as input and yields instances of relations
as output. It uses operators to perform queries.
• We can also specify column name using a . dot operator, with the
tuple variable to only get a certain attribute(column) in result.
• if we want to get data for students with age greater than 17,
then, we can write it as,T.age > 17, where T is our tuple
variable.
• Syntax: { c1, c2, c3, ..., cn | F(c1, c2, c3, ... ,cn)}
• where, c1, c2... etc represents domain of attributes(columns)
and F defines the formula including the condition for fetching
the data.
• For example,
• {< name, age > | ∈ Student ∧ age > 17}
• Again, the above query will return the names and ages of the
students in the table Student who are older than 17.
Basics of SQL
• https://www.geeksforgeeks.org/structured-
query-language/?ref=lbp
• https://www.w3schools.com/sql/sql_intro.asp