Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MariaDB [order_entry]> create table products(
- -> prod_id varchar(10) not null primary key,
- -> vend_id char(4) not null,
- -> prod_name varchar(25) not null,
- -> prod_price int not null,
- -> prod_desc varchar(255) null);
- Query OK, 0 rows affected (0.103 sec)
- MariaDB [order_entry]> create table orders(
- -> order_num int not null,
- -> order_date date not null,
- -> cust_id char(5) not null,
- -> primary key(order_num));
- Query OK, 0 rows affected (0.161 sec)
- MariaDB [order_entry]> create table productnotes(
- -> note_id char(3) not null,
- -> prod_id varchar(10) not null,
- -> note_date date not null,
- -> note_text varchar(200) null,
- -> primary key (note_id),
- -> foreign key (prod_id) references products (prod_id));
- Query OK, 0 rows affected (0.108 sec)
- MariaDB [order_entry]> create table orderitems(
- -> order_num int not null,
- -> order_item int not null,
- -> prod_id varchar(10) not null,
- -> quantity int not null,
- -> primary key (order_num, order_item));
- Query OK, 0 rows affected (0.126 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement