34 Database
1. View Database Commands
2. Use a database
3. See which library is currently in
4. See which tables are in the current database
5. querying data in a table
6. Build Library: Create database testbase;
7. Build tables: CREATE TABLE user (id int not null);
CREATE table with Name user_wangjing, field Id,date1,date2, etc.
New table name, meaning int 11 bits in parentheses, cannot be empty
8. Insert data: INSERT INTO user values (1);
9. to view information for a table:
10. Delete a table
11. Delete Library: drop database testbase;
12. New User:
Create user ' student11 ' @ '% ' identified by ' gloryroad ';
FLUSH privileges;
% indicates that all IPs can be logged in, ' student11 ' @ ' 10.60.89.% ' means that only the IP of this field can be logged in
13. Change Password:
UPDATE USER SET password=password (' 12345622xw1 ') WHERE user= ' GG1 ';
FLUSH privileges;
14. Create users and Modify permissions for users
Grant all privileges the Test.user to [e-mail protected] "%" identified by "Gloryroad"; # Let the user have permission to manipulate any database
Flush privileges;
15. build table, insert value
ENGINE=INNODB Storage database with InnoDB engine, if you want to use foreign keys, transactions and other functions, you need to InnoDB engine
16. to view the fields and properties of a table: show columns from book_wangjing;
17. View index: Show index from book_wangjing;
18. View 2 data, the first two from the beginning do not look, print then the back of the
19. See article 2 of 3
20. query table data and OR:
21. an alias to a field in a table
22. sorting fields in a table
SELECT * from book where Book_author like '% teacher ';
To calculate the number of data bars in a table:
Calculate Average:
"Python" Database Exercise-1