Database 10.12 water fee management System related table design

Source: Internet
Author: User
Tags administrator password

--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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.