An Introduction to "Database Review" database

Source: Internet
Author: User
Tags sql client
  Q: Is the database the same as the database management system?

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

Q: The historical process of the database.

A: The projects that have the biggest impact on the database are IBM's system R project and the Ingres Project at Berkeley;

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

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

(2) The 1970 Ted Codd presented 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 (based on tree), mesh model (based on graph);

Hierarchical model and network model are early models, if you want to query, the underlying data needs to be directly manipulated, so the query efficiency is low;

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


Q: What is the application of the database?

A: Now all the time we will deal with the database, such as (1) Banks (2) Aerospace (3) a variety of Web sites (4) business management;

Q: SQL can only query the relational database.

Answer: Yes;

Small Knowledge Points: Units of data storage

Because now GB data is no longer normal, so we need to understand GB after the data capacity units;

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

features provided by the DBMS:

(1) has the DDL(data definition Language), can create the database and defines the pattern;

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

(3) The ability to store large amounts of data , and durability (the database can be stored for a long time, such as as long as the insertion of a piece of data, this data will be kept);

(4) ACID

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

C Consistency: For example, bank transfer, need consistency;

I Isolation: Multiple users at the same time access to the database, such as only a user access to the feeling;

D Persistence: Storage data is not lost;

The database system originates from the file system;

characteristics of the file system:

(1) can store a large amount of data;

(2) cannot guarantee the persistence (if does not make the backup, may lose the data);

(3) Can not be effective access to data, there is no special query language;

(4) There is no guarantee of isolation and atomicity (if more than one user modifies the same file at the same time, only one user's change can be retained);

the system architecture of the database

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

(2) DBMS users query and change database records;

When the user enters a query statement and submits it, 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 into query plan ;

Execution Engine: Execute query plan;

Affairs

Generally speaking, the database defaults to autocommit mode, that is, each statement is a transaction, and if the pattern is canceled, the problem of concurrency control needs to be handled;

Concurrency control Scheduler: Managing atomicity and independence and consistency;

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

Storage Management

Buffer Manager: Storage of managed memory (buffer);

The buffer is managed by the buffer manager;

Memory Manager: Managing disk data storage;

The buffer Manager makes a request to the memory manager to put a piece of data from the disk into memory;

Q: The following two relationships are the same one.

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

Q: Can properties customize the data type?

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

Q: What are the common relational databases?

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

Q: Java How to access the Operation 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;

Typically, for Web applications, databases are placed on the server side, and the server side is generally divided into three-tier architecture: (1) Web server: such as Tomcat, receive user requests, (2) Application Server: Execute business logic, such as DAO; (3) database server: Execute database query and update;
SQL Environment : A DBMS installed on a computer;

patterns : A collection of organization tables, views, assertions, and directories : a collection of schemas; a cluster : A collection of all accessible directories;

Create schema [schema name] [creation Table statement] [CREATE VIEW statement] [CREATE TRIGGER statement] [Create assertion statement]
Set schema [schema 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 "directory name. Schema name. Table name" to determine, but generally if the reference table name in the current directory and the current mode, you can ignore; in MySQL, the database and schema are the same, such as in MySQL: Show schemas, will return and show Databases the same result as the CREATE schema SH1 and create database sh2 are the same; there is no concept of catalog in MySQL; SQL Server: Database server ; SQL client: Application server;

 

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.