SHARE
TWEET

Untitled

a guest Sep 17th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MariaDB [order_entry]> create table products(
  2.     ->      prod_id varchar(10) not null primary key,
  3.     ->     vend_id char(4) not null,
  4.     ->      prod_name varchar(25) not null,
  5.     ->     prod_price int not null,
  6.     ->      prod_desc varchar(255) null);
  7. Query OK, 0 rows affected (0.103 sec)
  8.  
  9. MariaDB [order_entry]> create table orders(
  10.     ->      order_num int not null,
  11.     ->      order_date date not null,
  12.     ->      cust_id char(5) not null,
  13.     ->      primary key(order_num));
  14. Query OK, 0 rows affected (0.161 sec)
  15.  
  16. MariaDB [order_entry]> create table productnotes(
  17.     ->      note_id char(3) not null,
  18.     ->      prod_id varchar(10) not null,
  19.     ->      note_date date not null,
  20.     ->      note_text varchar(200) null,
  21.     ->      primary key (note_id),
  22.     ->      foreign key (prod_id) references products (prod_id));
  23. Query OK, 0 rows affected (0.108 sec)
  24.  
  25. MariaDB [order_entry]>  create table orderitems(
  26.     ->      order_num int not null,
  27.     ->      order_item int not null,
  28.     ->     prod_id varchar(10) not null,
  29.     ->      quantity int not null,
  30.     ->     primary key (order_num, order_item));
  31. Query OK, 0 rows affected (0.126 sec)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top