Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use studydb;
- CREATE TABLE buyer
- (
- buyer_id int primary key auto_increment,
- buyer_name varchar(20) not null
- );
- CREATE TABLE product
- (
- product_id int primary key auto_increment,
- product_name varchar(20) not null
- );
- CREATE TABLE orders
- (
- order_id int primary key auto_increment,
- buyer_id int not null,
- product_id int not null,
- qty int not null
- );
- alter table orders
- add foreign key (buyer_id)
- references buyer (buyer_id);
- alter table orders
- add foreign key (product_id)
- references product (product_id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement