--Create tablecreate table ADMIN ( gno VARCHAR2 (4) Not NULL, Gpassword VARCHAR2 (8) is not NULL, gname VARCHAR2 (9) Not NULL, Gphone VARCHAR2 (one));--ADD comments to the columns comment on column Admin.gno is ' administrator Comment on column Admin.gpassword is ' Administrator password '; Comment on column admin.gname is ' administrator name '; Comment on column admin. Gphone is ' admin phone ';--create/recreate primary, unique and FOREIGN KEY constraints ALTER TABLE ADMIN add constrain T Pk_gno primary key (GNO);
--Create tablecreate table Userz ( uno VARCHAR2 (4) Not NULL, uname VARCHAR2 (9) is not NULL, Upassword VARCHAR2 (8) NOT NULL, Uphone VARCHAR2 (one), usfje number (8,2) not NULL, udfje number (8,2) Not NULL, uzje number (8,2) is not NULL, udate DATE is not null);--ADD comments to the columns comment on CO Lumn Userz.uno is ' user number (primary key) '; Comment on column userz.uname is ' user name '; Comment on column Userz.upassword Is ' user password '; Comment on column userz.uphone is ' user phone '; Comment on column userz.usfje is ' water amount '; Comment on column use Rz.udfje is ' tariff amount '; Comment on column Userz.uzje is ' total amount of water and electricity '; Comment on column userz.udate is ' payment date ';-- Create/recreate Primary, unique and FOREIGN KEY constraints ALTER TABLE Userz add constraint Pk_uno primary key (UNO) ;
--Create tablecreate table water ( uno VARCHAR2 (4) Not NULL, wmonth CHAR (6) is not NULL, Wyl number ( 8,2) NOT NULL, usfje number (6,2) not null);--ADD comments to the columns comment on column Water.uno is ' user ID (primary key) '; Comment on column water.wmonth is ' month '; Comment on column water.wyl is ' water consumption '; Comment on column water.usfje
is ' Water charges (foreign key) ';--create/recreate primary, unique and FOREIGN KEY constraints ALTER TABLE water add constraint pk_ W_uno primary KEY (UNO);
--Create tablecreate table POWER ( uno VARCHAR2 (4) Not NULL, Pmonth CHAR (5) is not NULL, pyl number ( 8,2) NOT NULL, udfje number (8,2));--ADD comments to the columns comment on column Power.uno are ' user numbers (primary key) '; com ment on column power.pmonth is ' meter month '; Comment on column power.pyl is ' power consumption '; Comment on column power.udfje is ' Tariff Amount (foreign key) ';--create/recreate primary, unique and FOREIGN KEY constraints ALTER TABLE POWER add constraint Pk_p_uno PR Imary key (UNO);
Database 10.12 water fee management System related table design