Integrity → a set of rules, guidelines Consistency → correctness and presence of correct data, adherence to rules Accuracy → degree of correctness Reliability → all inclusive
To avoid: Redundancy → repetition of data Inconsistency → opposite of consistency Provoked by human error or bug/failure
ACID
Atomicity → each transaction is considered as one unit with a beginning/end Consistency → Presence of correct data that adheres to rules Isolation → Each transaction does not interfere with others Durability → Operations must be permanent
Query: Commands used to explain to the DBMS how we want to manipulate a DB (create, read, update, delete)
What we need to know
- What is a data? A piece of fact related to an object. When it’s processed and acquire a meaning, it becomes information
- What is a database? Systematic collection of data
- Characteristics:
- Reliability
- Accuracy
- Normalization
- Scalability
- Acid properties:
- Atomicity
- Consistency
- Integrity
- Durability
- Database system → Database admin = centralized control
- Characteristics:
- What is a relational DB? A systematic collection of data organized in tables
- Structure: tables
- Rows → Records
- Columns → Attributes (fields)
- Relation
- Connection between tables
- Primary key → Set of fields that identify uniquely each record of the table
- Foreign key → A field in a daughter table refers back to the primary key in the mother table
- Types of relation
- One to many → Relation between two tables when one attribute contains more instances of the other attribute
- Many to many → Relation in a joint table that unites two other tables
- One to one → One record in one table corresponds to one record in another table
- Structure: tables
- What is DBMS? Collection of programs to access a database to manipulate data (CRUD)
- SQL what is it? Standard language for dealing with relational DB
- Query → Set of instructions used to explain to the DBMS what specific CRUD operation we want to execute
- Past: declarative, non procedural
- Now: hybrid
- 2 types:
- Interactive → Immediate result, query on the spot, used by app devs
- Preprogrammed → embedded in an app and written in another language, result not immediate but processed in the app