 CREATE TABLE IF NOT EXISTS `users` (
 `user_id` varchar(100) NOT NULL PRIMARY KEY,
 `user_pw` varchar(100) NOT NULL,
 `user_name` varchar(100) NOT NULL,
 `user_email` varchar(100) NOT NULL,
 `user_credit` int(11) NOT NULL,
 `user_ip` varchar(20) NOT NULL
 );
 
 CREATE TABLE IF NOT EXISTS `items` (
 `item_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
 `item_name`    varchar(100)    NOT NULL,
 `item_data`    text            NOT NULL,
 `item_credit`  int(11)         NOT NULL,
 `item_writer`  varchar(100)    NOT NULL,
 `item_date`    text            NOT NULL,
 FOREIGN KEY (item_writer) REFERENCES users (user_id)) ;
 
 CREATE TABLE IF NOT EXISTS `deals`(
 `deal_id`      int(11)         NOT NULL AUTO_INCREMENT PRIMARY KEY,
 `item_id`      int(11)         NOT NULL,
 `item_writer`  varchar(100)    NOT NULL,
 `user_id`      varchar(100)    NOT NULL,
 `deal_date`    text            NOT NULL,
 FOREIGN KEY (user_id) REFERENCES users (user_id),
 FOREIGN KEY (item_id) REFERENCES items (item_id),
 FOREIGN KEY (item_writer) REFERENCES items (item_writer));
