Database Concepts
Database System Concepts
- Data: Information stored in a structured form.
- Database: A structured collection of data stored electronically.
- Database Management System (DBMS): A software system used to manage databases and allows users to interact with data.
- Database Model: The way data is logically structured and represented such as relational, NoSQL, etc.
- Queries: A way to retrieve or manipulate data using languages like SQL.
Data Schema
A data schema defines the structure and organization of data within a database.
- Entity: A definable thing.
- Attribute: A property or characteristic of an entity.
- Relationship: How entities are associated with each other.
- Relation: A relation is a table with columns and rows.
- Tuple: A tuple is a row of a relation.
- Cardinality: The cardinality of a relation is the number of tuples it contains.
Characteristics of a Relation
- Rows contain data about an entity.
- Columns contain data about attributes of the entity.
- Cells of the table hold a single value.
- All entries in a column are of the same kind.
- Each column has a unique name.
- The order of the columns is unimportant.
- The order of the rows is unimportant.
- No two rows may be identical.
Entity Relationship (ER) Diagram
An ER diagram is a type of flowchart, illustrating how entities related to each other within a system.
Shapes
- Rectangles represent entity sets.
- Diamonds represent relationship sets.
- Lines link attributes to entity sets and entity sets to relationship sets.
- Ellipses represent attributes
- Double ellipses represent multivalued attributes.
- Dashed ellipses denote derived attributes.
- Underline indicates primary key attributes
Example:
flowchart TD
customer["Customer"]
id(["ID"])
name(["Name"])
street(["Street"])
city(["City"])
customer---id
customer---name
customer---street
customer---city
loan["Loan"]
number(["Number"])
amount(["Amount"])
loan---number
loan---amount
borrower{"Borrower"}
customer---borrower---loan
Last updated on