<aside>
💡 Database - collection of inter-related data that models some aspects of the real world
</aside>
1. Database Management System
<aside>
💡 Problems of flat files
- Data integrity
- Implementation
- Durability
</aside>
<aside>
💡 Database Management System, DBMS
Software that allows applications to store and analyze information in a database.
A general-purpose DBMS is designed to allow the definition, creation, querying, update, and administration of databases.
Allowing programmers to focus on business problem
</aside>
- Data Model → a collection of concepts for describing the data in a database.
- e.g. Relational, KV, Graph, …
- Schema → a description of a particular collection of data, using a given data model.
2. Relational Model
- Structure: The definition of the database's relations and their contents.
- Integrity: Ensure the database's contents satisfy constraints.
- Manipulation: Programming interface for accessing and modifying a database's contents.
2.1 Concepts
- A relation is an unordered set that contain the relationship of attributes that represent entities.
- A tuple is a set of attribute values (also known as its domain) in the relation.
- Values are (normally) atomic/scalar.
- The special value NULL is a member of every domain.
- A relation's primary key uniquely identifies a single tuple.
- Some DBMSs automatically create an internal primary key if a table does not define one.
- A foreign key specifies that an attribute from one relation has to map to a tuple in another relation.
3. Data Manipulation Language, DML