TEXT   22
kichu
Guest on 16th March 2023 06:58:00 AM


  1. CREATE TABLE customer(c_id int primary key,
  2.     name varchar(20)
  3.     ,address varchar(100),
  4.      city varchar(20),
  5.      ph_no int);
  6.  
  7. create table product(p_id int primary key,
  8.      pname varchar(20),
  9.      price int default '0');
  10.  
  11. create table Invoice_master(inv_id int primary key,
  12.      cust_id int ,
  13.      inv_date date,
  14.      constraint fk foreign key(cust_id) references customer(c_id));
  15.  
  16. create table Invoice_item(invid int,pid int,quantity int,
  17. constraint fkh foreign key(invid) references Invoice_master(inv_id),
  18. constraint frk foreign key(pid) references product(p_id));

Raw Paste

Login or Register to edit or fork this paste. It's free.