Getting Started with SQL statements

Source: Internet
Author: User

E1, Database

Creating a database: Create databases Student_teacher;

Delete databases: drop database student_teacher;

2. Table

Creating tables: Create table student;

Delete tables: drop table student;

Add a column: Alter table student add column name char;

3. View

Creating views: Create View Stu;

Delete view: Drop view Stu;

4. Simple table Data Operation statement

Select: SELECT * from student where no=091120109;

Inserting tuples: INSERT into student (No,num,sex,grade) values (1,091120109,male,98);

Delete tuple: Delete form student where Sex=male;

Update the value of the field property: Update student set Sex=female where Sex=male;

Fuzzy Lookup: SELECT * FROM student where num like "%911201%"; The% represents any 0 or more characters, and ' _ ' represents any single character.

Sort (desc is descending, ASC is ascending): Select *from student ORDER by Num [DESC];

Getting Started with SQL statements

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.