Introduction to SQL Database
Parts that should be mastered:
- 1. The basic concept of database
- 2. Basic concepts of the database model
- 3. The basic concept of entity relationship model
- 4. Basic Concepts and Properties of Relational Models
- 5. Database Optimization Theory
- 6. Master the creation of a database model
A: The basic concept of database:
A database (DB) is a warehouse for storing data. The data is stored in the computer for a long time and is associated with each other with less redundancy and can be shared by users.
Database Management System: (DBMS) An effective organization that effectively manages and controls the database.
Data model:
1. Concept
Data models are simulations and abstractions of concrete things in the world
For example, a map and an airplane are specific model objects.
2. Three types
1. Conceptual Models: Knowledge that Describes Real Things
2. Logical model: what to do
For example, student information should include name, class number, etc.
3 . Physical model: how to do operations such as linking a database with vs to extract data with code.
3. Database Design
Three generics: columns cannot be split, unique identification, reference primary key
Relational storage:
1 to 1: An object A corresponds to an object and an object B corresponds to an object A. The relationship can be stored in the A or B object.
1 -to-many: 1 object A corresponds to multiple objects, and one object B corresponds to one object A
Many-to-many: One object a corresponds to n objects b, and one object b corresponds to m objects and is stored in the same relationship table.