- [[学习任务]]
  - DONE 背产开
    - DONE 下载课件
    - LATER 写思维导图
      :LOGBOOK:
      CLOCK: [2023-06-01 Thu 17:00:59]--[2023-06-01 Thu 17:01:01] => 00:00:02
      :END:
  - LATER 看数据库 {{renderer :todomaster}}
    id:: 647bf024-fa40-4786-9770-e16da8b57f0f
    - DONE 课件
      :LOGBOOK:
      CLOCK: [2023-06-01 Thu 17:01:28]--[2023-06-01 Thu 17:01:30] => 00:00:02
      CLOCK: [2023-06-01 Thu 17:01:41]--[2023-06-01 Thu 17:38:19] => 00:36:38
      :END:
      - DONE Transactions
      - DONE Distributed DMBSs
      - DONE XML
      - DONE Data Mining
      - DONE NoSQL
    - LATER Theory
      :LOGBOOK:
      CLOCK: [2023-06-04 Sun 16:27:23]--[2023-06-04 Sun 16:54:55] => 00:27:32
      :END:
      - LATER Block 1
        - DONE DBMS
          - Relational Database: A database that organizes data into tables with rows and columns, maintaining relationships between tables using keys.
          - Table: A collection of related data organized into rows (also called records) and columns (also called fields).
          - Row/Record: A single set of data in a table, representing a specific instance or entity.
          - Column/Field: A specific attribute or data element within a table.
          - Primary Key: A unique identifier for each row/record in a table. It ensures the integrity and uniqueness of the data.
          - Foreign Key: A field in one table that refers to the primary key in another table, establishing a relationship between the two tables.
          - Relationship: The connection between tables based on common data values, such as primary and foreign keys.
          - Normalization: The process of organizing and structuring a database design to eliminate redundancy and improve data integrity.
          - Index: A data structure that improves the retrieval speed of data from a database table by creating a quick reference to the location of the data.
          - Query: A request for data or information from a database, usually written using Structured Query Language (SQL).
          - SQL (Structured Query Language): A programming language used to manage and manipulate relational databases. It allows you to create, modify, and retrieve data from databases.
          - CRUD Operations: An acronym for Create, Read, Update, and Delete operations, which are the basic operations used to manage data in a database.
          - ACID (Atomicity, Consistency, Isolation, Durability): A set of properties that guarantee the reliability and integrity of database transactions.
          - Data Integrity: The accuracy, consistency, and reliability of data stored in a database.
          - Database Schema: The structure or blueprint of a database, defining the tables, fields, relationships, and constraints.
          - Database Management System (DBMS): Software that provides an interface to interact with databases, managing their creation, modification, and retrieval.
        - LATER Forming queries
          - DONE Review relational algebra https://www.geeksforgeeks.org/introduction-of-relational-algebra-in-dbms/
          - LATER review lab2
          - LATER SQL join
      - LATER Block 2
        - LATER designing ER diagram
      - DONE Block 3
        collapsed:: true
        - DONE DB transaction management
          - DONE ACID (Atomicity, Consistency, Isolation, Durability): A set of properties that guarantee the reliability and integrity of database transactions.
            - Atomicity: The property that ensures a transaction is treated as a single, indivisible unit of work. It either executes all its operations successfully or rolls back to the initial state if any operation fails.
            - Consistency: The property that ensures a transaction transforms the database from one consistent state to another consistent state. It maintains data integrity and adheres to defined business rules.
            - Isolation: The property that ensures concurrent transactions do not interfere with each other. Each transaction operates in isolation until it completes, preventing interference or conflicts.
            - Durability: The property that ensures committed changes made by a transaction are permanently saved and will survive any subsequent system failures or crashes.
          - DONE Concurrency control
            - DONE Meaning of serialisability.
            - DONE How locking can ensure serialisability.
              - Locking achieves serializability by using locks to control access to
                shared resources (e.g., database objects like tables or rows) and
                prevent conflicts between concurrent transactions.
            - DONE 2PL
              - In the 2PL protocol, transactions acquire and release locks on database
                objects (e.g., tables, rows) in two distinct phases: the growing phase
                and the shrinking phase.
            - DONE Deadlock and how it can be resolved.
              - A deadlock is a situation in which two or more transactions are unable
                to proceed because each is waiting for a resource held by the other,
                resulting in a circular dependency and a system halt. It is a form of
                resource contention that can occur in concurrent systems, including
                database management systems.
            - DONE How timestamping can ensure serialisability.
              - By using transaction timestamps and enforcing the read and write
                validation checks, concurrency control mechanisms can ensure that
                transactions are executed in a way that maintains data consistency and
                serializability.
          - DONE Recovery Control
            - DONE Some causes of database failure.
              - System crashes, resulting in loss of main memory.
              - Power failures
              - Disk crashes, resulting in loss of parts of secondary storage.
              - Application software errors.
              - Natural physical disasters.
              - User mistakes.
              - Sabotage.
            - DONE Purpose of transaction log file.
              - Contains information about all updates to
                database:
                - Transaction records.
                - Checkpoint records.
                - Often used for other purposes (for example, auditing).
              - For autiding
            - DONE Purpose of checkpointing.
              - When failure occurs, redo all transactions that
                committed since the checkpoint and undo all
                transactions active at time of crash.
        - DONE Normalization
          background-color:: yellow
          - DONE Functional dependencies [g4g](https://www.geeksforgeeks.org/types-of-functional-dependencies-in-dbms/)
            - In a relational database management, functional dependency is a concept
              that specifies the relationship between two sets of attributes where one
              attribute determines the value of another attribute. It is denoted as **X → Y**, where the attribute set on the left side of the arrow, **X** is called **Determinant** , and **Y** is called the **Dependent**.
          - DONE BCNF vs. 3NF
            :LOGBOOK:
            CLOCK: [2023-06-01 Thu 17:38:55]--[2023-06-01 Thu 17:38:56] => 00:00:01
            :END:
          - DONE kinds of NF [tutorial](https://www.geeksforgeeks.org/normal-forms-in-dbms/)
            - First Normal Form (1NF): This is the most basic level of
              normalization. In 1NF, each table cell should contain _only a single value, and each column should have a unique name_. The first normal form helps to eliminate duplicate data and simplify queries.
            - Second Normal Form (2NF): 2NF eliminates redundant data by requiring that each _non-key attribute_ be dependent on the primary key. This means that _each column should be directly related to the primary key_, and not to other
              columns.
            - Third Normal Form (3NF): 3NF builds on 2NF by requiring
              that _all non-key attributes are independent of each other._ This means that each column should be directly related to the primary key, and not to any other columns in the same table.
            - Boyce-Codd Normal Form (BCNF): BCNF is a stricter form of 3NF that ensures that each determinant in a table is a candidate key. In other words, BCNF ensures that _each non-key attribute is dependent only on the candidate key._
            - Fourth Normal Form (4NF): 4NF is a further refinement of BCNF that ensures that _a table does not contain any multi-valued dependencies._
            - Fifth Normal Form (5NF): 5NF is the highest level of normalization and involves decomposing a table into smaller tables to _remove data redundancy and improve data integrity._
      - LATER Block 4
        - DONE Distributed DBMS
          - DONE client server arch
            - Computers (client) connected over wired or wireless local area network (LAN)
            - The database itself and the DBMS are stored on a central device called the database server, which is also connected to the network.
          - Distributed Database
            - A logically interrelated collection of shared data (and a description of this data), physically spread over a computer network.
          - Distributed DBMS
            - Software system that permits the management of the distributed database and makes the distribution transparent to users.
          - the key issues
            - Fragmentation
            - Allocation
            - Replication
          - importance and different types of fragmentation
            - Horizontal
            - Vertical
            - Mixed
          - different types of transparency
            - Distribution Transparency: The database feels as a single, logical entity
            - Transaction Transparency: Ensures that all distributed transactions maintain distributed database’s integrity and consistency.
            - Performance Transparency: must perform as if it were a centralized DBMS.
          - advantages and disadvantages of distributed databases
        - LATER XML
          - XML definition and basic concepts
            - eXtensible Markup Language
            - A meta-language (i.e. a language for describing other languages) that
              enables designers to create their own customised tags to provide
              functionality not available with HTML.
          - Relational model versus XML 
              - SQL
                - is a special-purpose programming language
                - You can: manage data in a relational databases. 
            - XML
                - is a markup specification language
                - You can: design ways of describing information (text or data), usually for storage, transmission, or processing by a program (you can use it in combination with a programming language).
                - It says nothing about what you should do with the data (although your choice of element names may hint at what they are for).
          - Well-formed XML, Valid XML
          - DTD, XSD
        - LATER Data Mining
        - LATER NoSQL
      - LATER Terms in: [chatGPT](https://chat.openai.com/c/db2ea8df-3bd0-4404-98ae-266afdd8fec1)
    - LATER Exercises
      - LATER past year exercise 1
      - LATER past year exercise 2
      - LATER past year exercise 3
  - Exercises
