Rdbms:
1, the establishment of the database delete
2. Creation, deletion and modification of forms
3. Creation and deletion of indexes
4. Users and Permissions
5, the Data deletion and modification
6. Enquiry
DML: Data Manipulation language
INSERT REPLACE DELETE UPDATE
DDL: Data Definition language
CREATE DROP ALTER
DCL: Data Control Language
GRANT REVOKE
SELECT
Database management System:
Oracle Sybase Infomix
Mysql Enterprisedb
Dbms:
Data management Independence
Data read is completed efficiently
Ensure the integrity and security of your data
Centralized data management
Concurrent storage and failure recovery
Reduce application Development Time
Sql:ansi
Sql86 sql89 sql92 sql99
SQL command:
Profiler Plan Executor
Optimizer
How to access Files < —————— disk Recovery Manager
Cache transaction Manager
Disk space Manager —————— > Disk lock Manager
Format of package:
Package Manager-specific formats
Universal binary Format
Source
RPM Package: MySQL Mysql-server
Binary program: MySQL
-U Specify user name
-P Specify password
-H Specify Mysql-server
User name: [email protected] user and which host to allow the user, connect Mysql-server
If the client and server are on the same host, then the C/S communication protocol
Linux:socket/var/lib/mysql/mysql.sock
Windows:memory
Quit: Quit
Mysqld
tcp:3306 User:mysql Group:mysql
Installation Location:/var/lib/mysql/
MySQL initialization: Build the MySQL database and save the DBMS's meta-data information.
MySQL: Is the interactive client, two modes of operation.
Interactive mode
Batch processing mode
Interactive mode Command Category:
Client commands
Use database name//set default database
Server-side commands: You must use the statement terminator, which is the semicolon by default.
Relational database objects:
Table
Index
View
Constraints
Stored Procedures
Storage functions
Trigger
Cursor
User
Permissions
Transaction
Table: Rows, columns
Table: Entities
Row: Row
Column: Field column
Field name data type type decoration (constraint)
Character
CHAR (n)//maximum 256 characters
VARCHAR (n)//maximum 65,536 characters
BINARY (n)//Case-sensitive
VARBINARY (N)
Text (n)//Large Object
BLOB (n)//Case Large Object
Numerical
Exact values
Integral type
TINYINT
SMALLINT
Mediumint
Int
BIGINT
Modifier UNSIGNED
Not NULL
Decimal
DECIMAL
Approximate values
FLOAT
DOUBLE
Date Time
DATE
Time
Datetime
STAMP
Boolean
Built
Enum
SET
DCL:
SELECT
GRANT
GRANT pri1,pri2 .... On DATABASE. TABLE to ' [email protected] '
REVOKE
REVOKE pri1,pri2 .... On DATABASE. TABLE from ' [email protected] '
CREATE USER ' username ' @ ' host ' identified by ' password ';
DROP USER ' username ' @ ' host ';
Host:ip
Hostname
Network
Wildcard characters
_: Matches any single character
%: matches any character of any length
Ddl:
CREATE
CREATE DATABASE Dbase_name;
CREATE TABLES tbase_name (col1,col2 ...);
Alter
ALTER TABLE Tb_name
MODIFY
Change
ADD
DROP
DROP
DROP DATABASE Dbase_name;
DROP TABLE Tb_name;
Dml:
INSERT
INSERT into Tb_name (Col1,col2 ...) VALUE (",,), (',,);
UPDATE
UPDATE tb_name SET col1=value WHERE col2=value;
DELETE
DELETE from Tb_name WHERE
Choose
SELECT field from Tb_name WHERE
View the tables in the library: show TABLES from Db_name;
View the structure of the Biao: DESC tb_name;
View User authorization: Show GRANTS for ' username ' @ ' host '
Selection and projection
Select: Specify a field as the search code, a logical comparison, to filter the qualifying rows;
Select rows to specify filter criteria with where
Projection: Obscuring certain fields
Select columns
Rdbms-mysql Preliminary