Database Introduction Database Concepts
A database is a repository of data that is organized, stored, and managed according to a structure that is built on a computer's storage device.
Database: The warehouse where the data is stored.
Database classification
Network Database
Network database refers to the introduction of database technology into computer network system, with the help of network technology will be stored in the database of a large amount of information in a timely manner, while the computer network with the help of mature database technology on the network of various data management, and realize the user and the network of the database for real-time Dynamic Data interaction.
Hierarchical database
The hierarchical model is essentially a directed ordered tree with root nodes (in mathematics the ' tree ' is defined as a non-return connected graph)
relational database
relational database, which is based on the relational model, is used to deal with the data in the database by means of mathematical concepts and methods such as set algebra.
Another way to differentiate a database: based on storage media
Storage media is divided into two types: disk and memory
Relational database: stored on disk
Non-relational database: stored in memory
relational database
Basic concepts
relational database, which is based on the relational model, is used to deal with the data in the database by means of mathematical concepts and methods such as set algebra. The relationship model consists of three parts: relational data structure, relational operation set, and relationship integrity constraint.
Relational data structure: refers to how the data is stored in a form of a two-dimensional table.
Relational operations collection: How to correlate and manage the corresponding stored data, SQL directives.
Relationship integrity constraints: There is a corresponding correlation within the data, and there is a corresponding correlation between the data and the data.
In-table constraints: Corresponding specific columns can only be placed corresponding data (can not be placed in random)
Inter-table constraints: The nature of the entities are related to the corresponding relationship (foreign key)
Typical relational database
Oracle, DB2, Microsoft SQL Server, Microsoft Access, MySQL, SQLite
Small relational database: Microsoft access,sqlite
Medium-sized relational database: Microsoft SQL server,mysql (open source free)
Large-scale relational database: ORACLE,DB2
MySQL is currently a company with Oracle and belongs to Oracle.
SQL Introduction
SQL Basic Introduction
Structured Query Language (structured Query Language), abbreviated to SQL, is a special purpose programming language, a database query and programming language for accessing data and querying, updating, and managing relational database systems, as well as the extension of database script files.
SQL is designed specifically for relational databases.
SQL category
1. Data Query Language (dql:data query Language):
Its statement, also known as a "data retrieval statement," is used to obtain data from a table to determine how the data is given in the application. Reserved word Select is the most common verb used by DQL (and all SQL), and other dql commonly used reserved words are where,order by,group by and having. These dql reserved words are often used in conjunction with other types of SQL statements.
Specifically for querying data, representing statements as select/show.
2. Data operation language (Dml:data manipulation Language):
Its statements include verb insert,update and delete. They are used to add, modify, and delete rows in a table, respectively. Also known as the action query language.
Specifically for writing data: The delegate command is insert, UPDATE, and delete.
3. Transaction processing Language (TPL):
Its statement ensures that all rows of the table affected by the DML statement are updated in a timely manner. The TPL statements include Begin,transaction,commit and rollback. (Not all relational databases provide transaction-safe handling)
Dedicated to transaction security: Transaction
4. Data Control Language (DCL):
Its statements are licensed through grant and revoke to determine access to database objects for individual users and groups of users. Some Robms use GRANT and revoke to control access to the forms ' columns.
Specifically for Rights Management: delegate directives for Grant and revoke
5. Data definition Language (DDL):
Its statements include verb creat and drop. Create a new table or delete a table (creat table or drop tables) in the database, add an index to the table, and so on. The DDL includes many reserved words related to people getting data from the database directory. It is also part of the action query.
Specifically for structural management: Represents the command Create and drop (alter)
MySQL database (i) Introduction to SQL