-
-
RDBMS: Relational database relations system
-
More suitable for high-level requirements for data security and the relationship more complex data NoSQL
-
-
NoSQL: non-relational database relational system
-
Suitable for high performance data storage ,, is generally carried out with the RDBMS used for big data processing, distributed architecture better at
-
-
-
The type of database management system
-
RDBMS:
-
MySQL、oracle、msSQL(sql server)、PG
-
-
NoSQL: Not Only SQL
-
键-值(key-value):Redis、memcached
-
Document (document): Mongodb
-
-
-
What is a table?
-
Table: table
-
Table: table is the basic unit of the database, all data is organized in tabular form, the aim readability
-
A table comprising rows and columns
-
OK: referred to as data / record (data)
-
Column: is called a field (coolumn)
-
-
What attributes of each field should be included?
Field names, data types, their associated constraints.
-
-
-
Learning mysql mainly learn general sql statement, SQL statements, including add, delete, change, search, SQL statements, how classification
-
DQL (Data Query Language): query, select all statements are DQL
-
DML (Data Manipulation Language): insert, delete, update, data tables to add, delete, change.
-
DDL (Data Definition Language): create, drop, alter, table structure of add, delete, change
-
TCL (Transaction Control Language): commit to commit the transaction, rollback rolls back the transaction. (TCL T is the Transaction)
-
DCL (Data Control Language): grant authorization, revoke revoke permissions
-
-
Import Data
-
The first step: Sign mysql database management system
-
dos command window:
mysql -uroot -p111
-
-
Step Two: to see which database
show database; (this is not a sql statement, the mysql command)
-
Step 3: Create your own database (bjpowernode)
create database bjpowernode; (this is not a sql statement, the mysql command)
-
Step Four: Using data bjpowernode
use bjpowernode (this is not a sql statement, the mysql command)
-
Step five: Check the database which tables currently in use there?
sql show tables :( This is not a statement, the mysql command)
-
Step Six: initialization data
-
-
bjpowernode.sql, this file ends with sql, this file is called "sql script." What is the sql script it?
When a file extension is .sql. And a large number of documents written in sql statement, we become such a document is "sql script"
Note: Use direct source command can be executed sql script.
The amount of data sql scripts too much time, can not open, use the source command initialized.
-
Delete the database: drop database file name:
-
View table structure: dexc + table name:
-
View the data sheet: select * from File Name:
-
View other tables in the library
show tables from (library name)
-
View the table creation statement:
show create table emp:
-
In the database is not a null value, did not mean anything, is empty
Null is not a value can not be measured by an equal sign
You must use it is null or is not null
-
Exercises operation
Login: mysql -uroot -p111
Show Files: show the file name
Use file: use the file name:
View Table: show tables:
Join table: source + drag the file cmd
-
-
create database database name:
-
use the database name # create tables in the database, create a table when you must first select the database.
-
-
-
Query the database currently in use:
-
select database():
-
Version of the database query: select version ()
-
-
Terminate a statement:
If you want to terminate a statement is being prepared, you can type \ c.
-
Exit mysql
-