1. Using the salila Database

[root@DBAMAXWELL ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.7.37 MySQL Community Server (GPL)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE sakila
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| sakila     |
+------------+
1 row in set (0.00 sec)

mysql> SHOW TABLES;
+----------------------------+
| Tables_in_sakila           |
+----------------------------+
| actor                      |
| actor_info                 |
| address                    |
| category                   |
| city                       |
| country                    |
| customer                   |
| customer_list              |
| film                       |
| film_actor                 |
| film_category              |
| film_list                  |
| film_text                  |
| inventory                  |
| language                   |
| nicer_but_slower_film_list |
| payment                    |
| rental                     |
| sales_by_film_category     |
| sales_by_store             |
| staff                      |
| staff_list                 |
| store                      |
+----------------------------+
23 rows in set (0.00 sec)

mysql> 

 

2. The SELECT Statement and Basic Querying Techniques

  • Single-Table SELECTs

  • Choosing Columns

  • Selecting Rows with the WHERE Clause

 

 

 

  • Combining conditions with AND,OR,NOT, and XOR

 

 

  • The ORDER BY Clause

  • The LIMIT Clause

 

  • Joining Two Tables

  • The INSERT Statement
  1. INSERT Basics

  • Alternative Syntaxes

  •  The DELETE Statement
  • Using WHERE,ORDER BY,and LIMIT

  •  Removing All Rows with TRUNCATE

  •  The UPDATE Statement

  •  Using WHERE,ORDER BY,and LIMIT

    

  •  Exploring Databases and Tables with SHOW and mysqlshow

 

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐