I have three tables user table
CREATE TABLE IF NOT EXISTS `user` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(25) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8_unicode_ci;
item table
CREATE TABLE IF NOT EXISTS `item` (
`item_id` int(11) NOT NULL AUTO_INCREMENT,
`item` varchar(20) NOT NULL,
`price` int(3) DEFAULT NULL,
`likes` int(4) DEFAULT NULL,
PRIMARY KEY (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8_unicode_ci;
order table
CREATE TABLE IF NOT EXISTS `order` (
`user_id` int(11) DEFAULT NULL,
`order_no` varchar(50) DEFAULT NULL,
`item1` varchar(5) DEFAULT NULL,
`item2` varchar(5) DEFAULT NULL,
`item3` varchar(5) DEFAULT NULL,
`item4` varchar(5) DEFAULT NULL,
`item5` varchar(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8_unicode_ci;
I store item_id
in item1
or item2
so on column in order table. i give only 5 items can be select by user but they can increase quantity of any item like any user order two quantity of item1
how do i store this on database .
and any suggestion for improvement in tables .