-sql study of five knowledge systems

Source: Internet
Author: User

1. Create a database

CREATE DATABASE test1;

2. Deleting a database

DROP DATABASE test1;

3. Create a table

CREATE TABLE tabname (userid BIGINT (one) not NULL PRIMARY KEY, username varchar, userpwd varchar, employee_id varchar (Employee_Name), the address varchar (20));

Create an existing table similar table

CREATE TABLE tabname2 as SELECT userid,username,userpwd,address from TabName;

4. Delete a table

DROP TABLE tabname2;

5. Add a column

ALTER TABLE tabname ADD Tel INT (11);

6. Modify a column

ALTER TABLE tabname MODIFY Tel VARCHAR (11);

7. A few simple SQL statements

Insert data: INSERT INTO TabName (Userid,username,userpwd,employee_id,employee_name,address,tel) VALUES (' 001 ', ' XL ', ' [email Protected] ', ' 1406081112 ', ' tester ', ' building 10th, No. 1388th Zhang Dong Road, Pudong, Shanghai ', ' 13612345678 ';

-sql study of five knowledge systems

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.