SQL Basics (i)

Source: Internet
Author: User
1. How the data is stored (table property Operations)
1.1 questions to consider before building a table

A. Table name

B. table contains data type (CHAR (fixed-length character), VARCHAR (indefinite long character), number (numeric), date (date and time), BLOB (large data set), straight string, custom type)

C. Fields that make up the primary key

D. length of each field

E. Which fields can be null

1.2 CREATE TABLE Statement

Basic syntax:

CREATE TABLE table_name (field1 data_type [NOT NULL],  field2 data_type [NOT NULL],  field3 data_type [NOT NULL ],  field4 data_type [NOT NULL]);
1.3 ALTER TABLE Command

Basic syntax:

ALTER TABLE table_name [modify] [column column_name] [data_type] [NULL not null][restrict|cascade][drop] [constraint cons Traint_name][add]  [column] clumn definition

A. Adding attributes

SQL Basics (i)

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.