天天看點

資料庫oracle建表/insert/改表名稱

1,更改表名稱: alter table student rename column student to student_name;

2,在表中插入新的資料,使用文法insert: insert into stdent (ID, STUDENT, TEACHER_ID)values (6, 'xiaosun', '5');

3,修改字段名稱:   alter table teacher rename column student_name to teacher_name;

4,在表中增加一個字段:alter table STUDENT add (age varchar2(30) default 3 not null);表名是STUDENT 

5,建表語句:CREATE TABLE t_book (

  id  varchar(20) CONSTRAINT PK_DEPT PRIMARY KEY,

  bookName varchar(20) DEFAULT  '',

  price decimal(6,2) DEFAULT '',

  author varchar(20) DEFAULT '',

  bookTypeId varchar(20) DEFAULT '' 

)

6,SQL模糊查詢:SELECT * FROM t_s_type   WHERE typename LIKE '%中國%'