Basic operations in MySQL (database creation, modification, deletion, data table creation, modification,

Source: Internet
Author: User
Starting today, I started a new field and started to learn SQL databases. Now, let's start with the basics ~~ Keep up with me. Today, let's talk about the basic database operations. In the DOS environment of MySQL, the following actions are completed: showdatabases; createdatabaseexample; showdatabases; showcharacterset; alterdatab

Starting today, I started a new field and started to learn SQL databases. Now, let's start with the basics ~~ Keep up with me. Today, let's talk about the basic database operations. In the DOS environment of MySQL, the following actions are completed: show databases; create database example; showdatabases; show character set; alter datab

Starting today, I started a new field and started to learn SQL databases. Now, let's start with the basics ~~ Catch up with the gods. Today, let's talk about basic database operations.

Database Operations

In the DOS environment of MySQL, perform the following actions:

show databases;create database example;showdatabases;show character set;alter databases example character set gbk;drop database example;show databases;

From the beginning of the first sentence to the explanation of the last sentence

1. Check the existing database

2. Create a database named example

3. display the existing database again

4. View All character sets

5. Change the character set of database example to gbk.

6. Delete the example Database

7. display the database


Data Table operations

Create database example; -- create example database use example; -- select create table student (id int, name varchar (20), score double ); -- create a data table named show tables; -- show that the existing data table alter table studentadd chinese double; -- add the chinese column alter table studentmodify name verchar (200) to the data table student ); -- alter table studentchange chinese math double; desc student; -- display the data table studentdrop table student; -- delete the data table studentshow tables;

All these are basic operations on databases and data tables. The experiment is clear ~~

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.