Database Review (Introduction)

Source: Internet
Author: User
Tags sql client

Q: Is the database the same as the database management system?

A: Database management system is a software, used to manage the database, database is a collection of data;

Q: What is the historical process of the database?

A: The project with the most impact on the database is IBM's system R Project, and the Ingres project at Berkeley University;

(1) in the late 1960s, the first commercial DBMS appeared;

The early model is not a relational model, but a hierarchical, mesh model, and these models do not have a SQL-like advanced query language;

(2) 1970 Ted Codd proposed a relational database;

(3) The object-oriented model is also proposed after the relational model.

Q: What are the common data models?

A: Relational data model, semi-structured data model, object-oriented model, hierarchical model (tree-based), network model (based on graph);

Both the hierarchical model and the mesh model are early models, and if you want to query, we need to manipulate the underlying data directly, so the query efficiency is low.

The relational model does not need to care about the underlying storage format of the data, and can be quickly queried by SQL;


Q: What are the applications of the database?

A: We are dealing with databases all the time, such as (1) bank (2) Aerospace (3) various websites (4) enterprise management;

Q: Can SQL only query relational databases?

Answer: Yes;

Small Knowledge Point: The unit of data storage

Because now the GB data is normal, so we need to know the data capacity unit after GB;

tb-->pb-->eb-->zb-->yb-->db-->nb;

Features provided by the DBMS:

(1) have DDL(data definition Language), be able to create database and define schema;

(2) have query language or DML(Data Manipulation language) to provide query and update data;

(3) can store a large amount of data , and persistence (the database can be stored for a long time, such as the insertion of a piece of data, this data will always be saved);

(4) ACID

A atomicity: The transaction is either executed or not executed;

C Consistency: such as bank transfer, need consistency;

I isolation: When multiple users access the database at the same time, it feels like only one user is accessing it;

D Persistence: No loss of stored data;

The database system originates from the file system;

Features of the file system:

(1) Ability to store large amounts of data;

(2) There is no guarantee of durability (data may be lost if not backed up);

(3) No valid access to data, no specific query language;

(4) There is no guarantee of isolation and atomicity (if multiple users modify the same file at the same time, only one user's changes can be kept);

system Architecture of the database

As you can see, there are generally two types of operations on the DBMS:
(1) DBA is responsible for the database model;

(2) DBMS user queries and changes database records;

When the user enters a query statement and commits, the query compiler turns the query statement into a query plan and gives it to the execution engine;

Query processor

Query compiler: Convert query statement to query plan ;

Execution Engine: Execute the query plan;

Transaction

In general, the database defaults to autocommit mode, that is, each statement is a transaction, if the mode is canceled, the problem of concurrency control needs to be handled;

Concurrency Control Scheduler: Management of atomicity and independence and consistency;

LOG: Manage persistence, each database operation is recorded on the log, the log is placed on disk;

Storage Management

Buffer Manager: Manages the storage of memory (buffers);

Buffers are managed by the buffer manager;

Memory Manager: Manages the data storage of the disk;

The buffer Manager makes a request to the memory manager to put a chunk of the disk's data into memory;

Q: Are the following two relationships the same?

A: Yes, because the order of the attributes in the relational table is different from the order of the tuple, so the above two represents the different manifestations of the relationship, but it is the same relationship;

Q: Can properties customize data types?

A: No, because the type of attribute explicitly specified in the relational data model is the basic data type;

Q: What are the common relational databases?

Answer: MySQL, DB2, Oracle, SQLite, MS Server;

Q: How does Java access the operating DBMS?

A: Each DBMS will provide the appropriate drive, and Java provides two ways to access the database:

(1) ODBC-JDBC Bridge;

(2) JDBC;

Q: What is NoSQL?

Answer: not only SQL;

Usually for Web applications, the database is placed on the server side, and the server side is generally divided into three-tier architectures:

(1) Web server: such as Tomcat, receiving user requests, (2) Application server: Executing business logic, such as DAO, (3) database server: Executing database query and update;
SQL Environment : DBMS installed on the computer;

schema : A collection of organizational tables, views, assertions, and so on; Catalog : A collection of patterns; cluster : A collection of all directories accessible;

Create schema [schema name] [CREATE TABLE statement] [CREATE VIEW statement] [CREATE TRIGGER statement] [creating assertion statement]
Set schema [mode name]//Set Current mode
Create catalog [directory name]//Creation directory set catalog [directory name]//Set current directory
If you want to locate a table, we need the "directory name. Name of the schema" to determine, but generally if the reference table name is in the current directory and the current schema, it can be ignored; In MySQL, the database and schema are the same, such as in MySQL: Show schemas, will return the same results as show databases, and create schema SH1 and create database SH2 the same effect There is no concept of catalog in MySQL, nor is there a syntax for create catalog; SQL Server: database server; SQL client: Application server;

Database Review (Introduction) (GO)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.