CREATE TABLE PET(
ID NUMBER,
NAME VARCHAR2(50);
TYPENAME VARCHAR(20);
HEALTH NUMBER,
LOVE NUMBER,
BIRTHDAY DATE,
OWNER_ID NUMBER,
STORE_ID NUMBER
);
CREATE SEQUENCE SEQ_NAME
STATR WITH 1
INCREMENT BY 1
NOMAXVALUE
CACHE 10;
select to_char(BIRTHDAY,'mm-dd-yyyy')from pet;
insert into pet(ID,NAME,TYPENAME,LOVE,BITHDAY,OWNER_ID,STORE_ID)
values(651,'小花','狗狗',90,89,to_date('2015-02-14','yyyy-mm-dd'),361,985);
insert into pet(ID,NAME,TYPENAME,LOVE,BITHDAY,OWNER_ID,STORE_ID)
values(652,'贝贝','喵咪',100,95,to_date('2015-05-05','yyyy-mm-dd'),362,211);
insert into pet(ID,NAME,TYPENAME,LOVE,BITHDAY,OWNER_ID,STORE_ID)
values(653,'小环','企鹅',98,100,to_date('2015-08-08','yyyy-mm-dd'),363,212);
insert into pet(ID,NAME,TYPENAME,LOVE,BITHDAY,OWNER_ID,STORE_ID)
values(654,'麦克','鹦鹉',100,100,to_date('2015-09-09','yyyy-mm-dd'),364,213);
insert into pet(ID,NAME,TYPENAME,LOVE,BITHDAY,OWNER_ID,STORE_ID)
values(655,'爱丽丝','仓鼠',100,95,to_date('2015-10-01','yyyy-mm-dd'),365,214);
insert into pet(ID,NAME,TYPENAME,LOVE,BITHDAY,OWNER_ID,STORE_ID)
values(656,'旺财','狗狗',100,85,to_date('2015-11-11','yyyy-mm-dd'),366,215);
insert into pet(ID,NAME,TYPENAME,LOVE,BITHDAY,OWNER_ID,STORE_ID)
values(657,'小白','蛇',100,75,to_date('201512-12','yyyy-mm-dd'),367,216);
SELECT * FROM PET;
DELETE PET;
create table Petowner(
ID NUMBER,
NAME VARCHAR2(50),
PASSWORD VARCHAR2(50),
MONEY NUMBER(10,2)
);
insert into Petowner(ID,NAME,PASSWORD,MONEY)
values(361,'小红','6661',150);
insert into Petowner(ID,NAME,PASSWORD,MONEY)
values(362,'前前','6662',200);
insert into Petowner(ID,NAME,PASSWORD,MONEY)
values(363,'小静','6663',80);
insert into Petowner(ID,NAME,PASSWORD,MONEY)
values(364,'菲菲','6664',163);
insert into Petowner(ID,NAME,PASSWORD,MONEY)
values(365,'夏雨','6665',45);
select * from Petowner;
delete Petowner;
create table Petstore(
ID NUMBER,
NAME VARCHAR2(50),
PASSWORD VARCHAR2(50),
MONEY NUMBER(10,2)
);
insert into Petstore(ID,NAME,PASSWORD,MONEY)
values(001,'安徽第一宠物店','1101',4300);
insert into Petstore (ID,NAME,PASSWORD,BALANCE)
values(002,'北京西苑','1102',5507);
insert into Petstore(ID,NAME,PASSWORD,BALANCE)
values(003,'重庆观音桥','1103',8954);
SELECT * FROM PETSTORE;
DELETE PETSTORE;
create table Account(
ID NUMBER,
DEAL_TYPE NUMBER,
PET_ID NUMBER,
SELLER_ID,
BUYER_ID,NUMBER,
PRICE NUMBER,
DEAL_TIME DATE
);