Creating a database table is as simple as this.

Source: Internet
Author: User

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:

    1. 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:

    1. CREATE TABLE test01_01(
    2. Name nvarchar(+),
    3. 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.

    1. 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

    1. 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

    1. 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.

    1. Delete from m_table where name= ' Zhangsan ';

Creating a database table is as simple as this.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.