This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph of the statement, and in the article page obvious location to the original link, blog address is http://www.cnblogs.com/jasonnode/. There are online exercises for each section of the website that you can try. For more courses, please refer to the website. Create a database
Let's start by creating a database of our own, as follows:
- Create DATABASE test;
As to what this sentence means, and what the fixed grammar, we introduce later.
Create a database table
Create a database, next we create a table, our data operations are for the table, for example:
- CREATE TABLE test01_01(
- Name nvarchar(+),
- Age int(5));
Add data
Now that you know the basic information about MySQL, let's get started with the practice.
Let's start with some simple examples and try MySQL, we'll add a piece of data to the database table, and the syntax for adding the data, we'll talk about it later, don't worry. First look at the example, write code to exercise a bit.
- Insert into m_table values(' Wangwu ',' + ',' Beijing ');
Querying data
We've added a piece of data to the previous section, so we're going to look at this data now.
Here we only do the simplest query data, will be in-depth explanation of the various query statements, today we are only talking about the basic
Okay, let's take a look at the following example
- Select * from m_table;
modifying data
Now that we can add and query the data, then we're going to change the data.
Modify the data we added last time, here the modification is just the content of the data
Take a look at the following example
- Update m_table Set name= ' Zhangsan ',age=ten where name= ' Wangwu ';
Delete data
So far, we have added, queried, and modified the data in the table, and then we don't need this data, so we can delete the data.
Deleting the data is also very simple, let's delete the previous data.
Take a look at the examples below and try to write your own code.
- Delete from m_table where name= ' Zhangsan ';
Creating a database table is as simple as this.