White Tour 19

database

I. Basic Concepts Database

1, the database DataBase, referred to as DB

2. The concept: What is a database? Storing data warehouse

3, the database features:

  • Persistent storage of data, the database is essentially a file system
  • Convenient data storage and management
  • The use of a unified database manipulation language -SQL language

4, common database management system (DataBase Management System: DBMS)

  • MySQL : the Oracle's free open-source database, small and medium, 6+ start charging
  • The Oracle : the Oracle's large database
  • DB2: IBM's large database
  • SQL Server: Microsoft's large database
  • SQLite: small mobile devices embedded database

Two. MySQL-related operations

2.1 Installation

See Fig.

2.2 Uninstall

1, completely remove the entire software in the control panel

2, delete the ProgramData directory of MySQL

2.3 Configuration

  • Startup and shutdown services

    • start up
      • In the cmd window or enter services.msc in the operation of open systems and services, manually click to open
      • Enter net start mysql in cmd
    • shut down
      • In cmd or type services.msc in the operation of open system service window, manually click Pause
      • Enter net stop mysql in cmd
  • Login: Type in cmd

    • mysql -u -p password account
    • mysql -u account -p, Enter, enter the password
    • Password mysql -h target ip -uroot -p goals
  • drop out:

    • exit

    • quit

    • Close the cmd window

III. Structure of the database

Database Project

Entity class table

Property fields

Object records

Four. SQL

The concept: SQL: Structured Query Language, Structured Query Language

Most relational data have the same SQL syntax, but there are a number of different database operation, this difference is called "dialects."

The general syntax:

1, SQL statement can be written in a single line or multiple lines, end with a semicolon

2, SQL keywords are not case sensitive, use uppercase generally recommended

3, SQL statements can be used in a number of spacing and indentation to improve readability

4, SQL syntax Three comments

a, single-line comment: - footnotes

b, single-line comment: # content annotation (MySQL dialect)

c, multi-line comments: / * comment * content /

Five. SQL classification

5.1 DDL Data Definition Language

For defining database objects: databases, tables, columns,

Keywords: create, alter, drop, etc.

5.2 DML Data Manipulation Language

For additions and deletions to the data table in the database

Keywords: insert, delete, update

5.3DQL data query language

For data query the database

关键字:select、on、where、order by、asc、desc、group by、limit、between and、and、or、in、like

5.4 DCL Data Control Language

For access and security levels defined in the database

Keywords: revoke, grant

Guess you like

Origin www.cnblogs.com/demonycw/p/11329498.html