Document directory
-
- Q: Is the database the same as the database management system?
- Q: historical database procedures?
- Q: What are common data models?
- Q: What applications does the database have?
- Q: Can I only query relational databases?
- TIPS: data storage unit
- Functions provided by DBMS:
- Features of the file system:
- Q: Are the following two links the same?
- Q: Can attributes customize data types?
- Q: What are common relational databases?
- Q: How does Java access and operate DBMS?
- Q: What is nosql?
Q: Is the database the same as the database management system?
A: The Database Management System is a software used to manage databases. The database is a collection of data;
Q: historical database procedures?
A: The projects that have the greatest impact on databases include the IBM System R project and the Berkeley University INGRES project;
(1) The first commercial DBMS emerged at the end of 1960s;
Early models were not relational models, but hierarchical and mesh models, and these models were not similar to SQL advanced query languages;
(2) Ted codd proposed a relational database in 1970;
(3) An Object-Oriented model is also proposed after the relational model;
Q: What are common data models?
Answer: relational data model, semi-structured data model, object-oriented model, hierarchical model (based on tree), and mesh model (based on graph );
Both the hierarchical model and the mesh model are early models. If you want to query, You Need To directly operate on the underlying data, so the query efficiency is low;
The relational model does not need to care about the underlying storage format of data, and can be quickly queried through SQL;
Q: What applications does the database have?
A: We are dealing with databases all the time, such as (1) Banking (2) Aerospace (3) Various websites (4) enterprise management;
Q: Can I only query relational databases?
A: Yes;
TIPS: data storage unit
Because the GB Data is no longer normal now, we need to know the data capacity units after GB;
TB --> Pb --> EB --> ZB --> YB --> dB --> NB;
Functions provided by DBMS:
(1) OwningDDL(Data Definition Language), able to create a database and define a mode;
(2) have a query language orDML(Data operation language) provides the ability to query and update data;
(3) YesStore large amounts of dataAnd persistent (the database can be stored for a long time. For example, if a piece of data is inserted, the data will be stored all the time );
(4) acid
A atomicity: the transaction is either executed or not executed;
C consistency: for example, for bank transfers, consistency is required;
I isolation: when multiple users access the database at the same time, it seems that only one user can access the database;
D Persistence: the stored data will not be lost;
The database system originated from the file system;
Features of the file system:
(1) ability to store large amounts of data;
(2) durability cannot be guaranteed (data may be lost without backup );
(3) data cannot be accessed effectively and there is no special query language;
(4) Isolation and atomicity cannot be guaranteed (if multiple users modify the same file at the same time, only one user's changes can be retained );
Database System Architecture
We can see that there are two types of operations on DBMS:
(1) DBA is responsible for the database model;
(2) DBMS users query and change database records;
When a user inputs and submits a query statement, the query compiler converts the statement into a query plan and submits it to the execution engine;
Query Processor
Query Compiler: Convert query statementsQuery plan;
Execution engine: executes the query plan;
Transactions
Generally, the database uses the automatic commit mode by default, that is, each statement is a transaction. If you cancel this mode, you need to handle concurrency control issues;
Concurrency Control Scheduler: Manages atomicity, independence, and consistency;
Log: Management persistence. Each database operation is recorded on the log and the log is stored on the disk;
Storage Management
Buffer Manager: manages the storage of memory (buffer;
The buffer zone is managed by the buffer manager;
Storage Manager: Manages disk data storage;
The buffer manager sends a request to the storage manager to put some data on the disk into the memory;
Q: Are the following two links the same?
A: Yes, because the order of attributes and the order of tuples in a relational table do not matter. Therefore, the preceding two expressions indicate different forms of the link, but are the same link;
Q: Can attributes customize data types?
A: No, because the relational data model explicitly specifies that the attribute type is the basic data type;
Q: What are common relational databases?
A: MySQL, DB2, Oracle, SQLite, and Ms server;
Q: How does Java access and operate DBMS?
A: Each DBMS provides a corresponding drive, and Java provides two methods to access the database:
(1) ODBC-JDBC bridge;
(2) JDBC;
Q: What is nosql?
A: Not only SQL;
Generally, for Web applications, databases are deployed on the server, and the server is generally divided into three layers:
(1) Web servers, such as Tomcat, receive user requests; (2) Application Servers: Execute business logic, such as Dao; (3) database servers: Query and update databases;
SQL Environment: DBMS installed on a computer;
Mode: Organizes a set of tables, views, and assertions;
Directory: A set of modes;
Cluster: A set of all accessible directories; create schema [mode name] [create table statement] [Create view statement] [Create trigger statement] [Create asserted statement] Set schema [mode name] // set the current mode create catalog [directory Name] // create directory set catalog [directory name] // set the current directory if you want to locate a table, we need "directory name. mode name. the table name "can be determined, but it can be ignored if the referenced table name is in the current directory and current mode; In MySQL, the database and mode are the same. For example, if you enter show schemas in MySQL, the same result as show databases is returned; the effects of create schema sh1 and create database SH2 are the same; the concept of catalog does not exist in MySQL; nor does the syntax of create Catalog; SQL Server: database server; SQL client: application server;