---
title: "oracle基本语句"
author: "androider"
date: "2007-11-28T09:55:18Z"
tags: []
slug: "oracle"
draft: false
lastmod: "2007-11-28T09:55:18Z"
id: 144406
url: "https://androider.iteye.com/blog/144406"
---

一、基本建表语句

```
create table GROUPINFO
(
  ID             VARCHAR2(32) not null,
  GROUP_TYPE     VARCHAR2(20),
  GROUP_NAME     VARCHAR2(255) not null,
  MAINTAIN_LEVEL NUMBER,
  CUSTOMER_NAME  VARCHAR2(20),
  CUSTOMER_TEL   VARCHAR2(20)
)
tablespace EOMS_DB
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 128K
    minextents 1
    maxextents unlimited
  );

```

二、添加primary key


```
alter table GROUPINFO
  add primary key (ID)
  using index 
  tablespace EOMS_DB
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
```