MySQL creates a simple score management system

Source: Internet
Author: User

The operation process uses the laboratory building .

The first is to create a database Studentsystem, using the statement is: Create DATABASE Studentsystem; View the command to create a good database or show databases; To create a table in the created database Studentsystem, first connect to the database, using the statement use < database name >, where use Studentsystem ( no semicolon) is used.

The statement format for creating a new table in the database is:

Name of the CREATE TABLE table (column name a data type (data length), column name B data type (data length)); To create the following table:

The statement is: CREATE TABLE student (CID int), CNAME char (+), gender char (20));

Insert data into a table you can use the statement: INSERT into student (Cid,cname,gender) VALUES ("Tom", ' Male ') or insert into student values (' Tom ', ' male '); If you want to insert multiple lines at once, you can write:

INSERT into student values (' Tom ', ' Male '), ("", ' Rose ', ' Famale '), that is, omit the column names, and the values between each row are separated by commas, and end with a semicolon.

If you want to see the data in the table, you can use the statement: SELECT * from student;

MySQL creates a simple score management system

Related Article

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.