Oracle的创建表和创建约束的Sql语法 1.创建表的语句 ---1.创建模拟的数据表 --- --1.1.创建学生表Student create table Student( StuId NUMBER NOT NULL, --学生ID StuName ) NOT NULL, --名称 Gender )NOT NULL, -- 性别 Age ) NOT NULL, -- 年龄 JoinDate DATE NULL, --入学时间 ClassId NUMBER NOT NULL, --班级ID
回顾MySQL创建表语句users(id整型/name字符串/birthday日期型,默认今天)drop table if exists users;create table if not exists users( id int(5) auto_increment primary key, name varchar(4) not null, birthday date default '2015-4-27'); 使用oracleSQL,创建用户表users(id整型/name字符串/birth
Oracle表操作 --主键,复合主键 create table example (id number primary key, name varchar2(20)); create table example1 (id number, name varchar2(20),primary key(id)); create table example2 (id number, name varchar2(20)); ALTER TABLE example2 ADD PRIMARY KEY (ID)
create table usertable( id int primary key, username ) not null, birthday date, sex ), address ) ); create table orders( id int primary key, user_id int not null, numberid ) not null, createtime date, note ), constraint fk_orders foreign key (user_id
/****** Object: StoredProcedure [dbo].[GET_TableScript_ORACLE] Script Date: 06/15/2012 13:07:16 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /*============================================================== 名称: GET_TableScript_ORACLE 功能: 生