• I am erhei, a tester who is going bald

  • Welcome to collect ⭐ message if there is an error please correct!

  • I collected some software test data, pay attention to my public number: programmer two black, free to get!

  • The most difficult time, that is, when we are not far from success!


Written in the book of the former

You probably know that databases are a very important technology. Engaged in software testing also need to use the database. Of course, the level of the database also directly determines our salary ceiling. So, I decided to systematically organize a set of MySQL articles. I hope I can help you while summarizing and combing. The following figure shows an overview of the MySQL series.

First, why to learn database

Most of our data is stored in Excel, or Python, data can be stored in lists, collections, dictionaries. Then they have many disadvantages, such as data is easy to lose; Search for a large amount of data is difficult. So, at this point we can use the database. A database is software designed to manage data. It has two advantages: (1) to achieve data persistence (2) data integrity and unified management, easy to query.

2. Related concepts of database

A Database is a container that holds a group of organized data.

2, DBMS Database Management System, also known as Database software (product), used to manage the data in DB. For example, MySQL, Oracle, DB2, and SqlServer. Most companies use MySQL because it is open source and free.

3, SQL Structured Query Language (Structure Query Language), used to communicate with DBMS, specifically for the establishment of the operation command set database. SQL advantages: ① Almost all DBMS support SQL language ② simple and easy to learn ③ can carry out very complex and advanced database operations.

Taking the library as an example, the collaboration among the three is shown as follows:

Three, the characteristics of database storage data

1. Put data into tables, and then tables into libraries; 2. A database can have multiple tables, and each table has a name to identify itself. Table names are unique; 3. Tables have features that define how data is stored in a table, similar to the Python “class” design; 4. A table consists of columns, also known as fields. All tables are made up of one or more columns, each of which is similar to “properties” in Python; 5. The data in a table is stored in rows, each row similar to “objects” in Python.

Four, table and library design specifications

1. Naming conventions

1) Database names must be alphabetic, numeric, and underscore (_), and must start with an alphabetic letter. All lowercase characters 3) Simple and clear name (the length cannot exceed 32 characters) 4) Field name should not use keywords (such as type and order) 5) Use as little storage space as possible to store the data of a field

2. Grammar norms

You are advised to end each command with a semicolon (;). 3. You can indent or wrap each command as required. 4

  • Single-line comment: # Comment text
  • Single line comment: — Comment text
  • Multi-line comments: /* Comments text */

3. Database three paradigms

2) Second normal form: there are primary keys, and non-primary key fields depend on the primary key (attributes depend entirely on the primary key). 3) Third normal Form: Tables cannot have redundant fields (non-primary key fields cannot depend on each other)

The three paradigms are the basic concepts of general database design, which can establish a database with less redundancy and reasonable structure. If there are special cases, of course, to special treatment, database design is the most important requirements and performance, requirements > performance > table structure. Therefore, we can not blindly pursue the paradigm to establish a database.

4, SQL language classification

1) Data Query Language (DQL) Select 2) Data Manipulate Language (DML): INSERT, update, and delete 3).DDL: Data definition languages CREATE, DROP, and ALTER 4) TCL: Transaction Control Language COMMIT, rollback

First introduction to MySQL

1. MySQL installation and introduction

MySQL can be installed locally or on a server. For example, we need to build a test library locally, or want to operate the database on the server through the client, it can be operated locally; If your development environment is on a cloud server, you can do it directly on the server. So, how does the client and server work together, as shown below:

  • Local (Windows or Mac) | cloud server (Linux)

  • Note: Navicat used by the client here, if you need to crack the version and install MySQL service documents, follow the public number: programmer erhei, add xiaosister wechat, can be obtained. I won’t go into details here.

2. Start and stop MySQL services

Net start mysql Stop mysql net stop mysql

  • Note: Open CMD window, be sure to use administrator identity!

3. MySQL service login and logout

Method 1: Login in a terminal window

#mysql [-h host name -p port number] -u user name -p password mysql -hlocalhost -uroot -pNote: Windows installation default password is empty.

Method 2: Log in to the client (Navicat)

MySQL > select * from ‘MySQL’

  • Show the databases; View all databases

  • Use the library. Opens the specified library

  • show tables ; Displays all tables in the library

  • Show tables from database name; Displays all tables in the specified library

  • Create table name (

  • Field name Field type,

  • Field Name Field type

  • ); Create a table

  • Desc table name; View the structure of the specified table

  • Select * from table_name; Displays all data in the table

View the server version

Method 1: Log in to the mysql server and select version(). Mysql –version or mysql –V is not logged in to mysql server

Well, today’s learning here, the biggest feeling is that no matter what language you learn, you must lay a good foundation, the later will be less detours. Consider performance while implementing functionality. This article is the first introduction to MySQL, and it is our first step to learn MySQL. Tomorrow we will continue to learn SQL DOL, DML, DDL, DCL. Come on!

Finally, in order to facilitate everyone’s learning, we specially prepared a 13G super practical dry goods learning resources, involving very comprehensive content.

Include software learning roadmap, video, and more than 50 days of class 16 assault on practical projects, more than 80 software testing with software, 37 test documentation, 70 software test related issues, 40 level testing experience article, thousands of test questions, sharing, and 2021 bible software testing interview, there are all kinds of selected software testing job resume, Hope to help you…

Pay attention to my public number: [programmer two black] can get this information!

If you don’t want to experience the feeling of giving up after a few days when you can’t find information and no one answers your questions, you can join our group: 785128166, where we can discuss and exchange information about various software tests and technical exchanges.

Recommended reading

Well paid programmers can’t escape being 35… How can we save ourselves when our abilities are out of sync with our age

Graduated from college and started selling… Unwilling to accept the status quo, the road to self-help testing

From crown to unemployment, finally choose software testing, looking back on the road, I was lucky!