Management of Oracle Tables

Source: Internet
Author: User

Character type

Char fixed length, Max 2000 characters

char (10) ' xiaoming ', followed by 6 characters will be wasted, suitable for defining fixed-length and frequently queried fields, such as ID number, high efficiency

VARCHAR2 variable length, max 4000 characters

VARCHAR2 (10) ' Xiaoming ' behind 6 character space will be saved

Clob character type large object, Max 4G

Digital type

NUMBER-10 's 38-time-square-38-square

Number (5,2) represents 5 significant digits, with two decimal places -999.99~999.99

Number (5) represents a 5-bit integer

Date type

Date contains the day of the month and seconds

Image

blobs can hold sounds and pictures

Build table

Create TableStudent (--Table nameId Number(4),--School NumberNamevarchar2( -),--nameSexChar(2),--SexBirthday date,--BirthdaySal Number(7,2)--Scholarships)
SELECT  from WHERE PARAMETER = ' Nls_characterset '; If Value=al32utf8  a Chinese character takes 3 bytes, you have to set char (3)

Query table structure

DESC student;

Add Field

Alter Table Add (ClassID number (2));

Modify the length of a field

Delete a field

Alter Table Drop column sal;

Modify Table Name

 to Stu;

Add data

INSERT into student values (' 01 ', ' Zhang San ', ' Male ', ' November-November-82 ', 10000.98);

Management of Oracle Tables

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.