Help Needed In MYSQL Normalization
Hey guys, need your help here. How best can i Normaliza the sql query on my last question
1 Answer
i have great idea, why not separate this complex table to many tables
such as we will make just one main table mysql StructureCREATE TABLE `litorder` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `address` varchar(50) NOT NULL, `xdate` date NOT NULL, `ref` varchar(20) NOT NULL, `totalNaira` double(20,0) NOT NULL, `totalDollar` int(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE `amount` ( `id` int(11) NOT NULL AUTO_INCREMENT, `litorder_id` int(11) NOT NULL, `amount` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE `code` ( `id` int(10) NOT NULL AUTO_INCREMENT, `litorder_id` int(10) NOT NULL, `code` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE `price` ( `id` int(11) NOT NULL AUTO_INCREMENT, `litorder_id` int(11) NOT NULL, `price` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE `product` ( `id` int(11) NOT NULL AUTO_INCREMENT, `litorder_id` int(11) NOT NULL, `varchar` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE `quantity` ( `id` int(11) NOT NULL AUTO_INCREMENT, `litorder_id` int(11) NOT NULL, `quantity` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Posted: MacOS 1 of 1 people found this answer helpful. Did you? Yes No |
© Advanced Web Core. All rights reserved