Z
Z
Zangar2016-09-12 18:26:37
MySQL
Zangar, 2016-09-12 18:26:37

How to do it right? Should I make a new table or put everything in the finished one?

There is a database with a list of clients. Two tables: the clients themselves and the table of applications.

CREATE TABLE IF NOT EXISTS `companies` (
  `numbr` int(11) NOT NULL,
  `compname` varchar(255) NOT NULL DEFAULT '',
  `phone_main` varchar(255) DEFAULT NULL,
  `phone_extra` varchar(255) DEFAULT NULL,
  `adress` varchar(255) DEFAULT NULL,
  `last_order` date DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `orders` (
  `num` int(11) NOT NULL,
  `orders` varchar(255) DEFAULT NULL,
  `date_exec` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

prntscr.com/ch5syy
prntscr.com/ch5ta6
prntscr.com/ch5tqw
Essence: You need to make an application form. Drop-down list with clients; then text input -- application; boolean status -- passed/failed.
How can you properly build a database?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
idShura, 2016-09-13
@idShura

Read about database normalization, at least understand the first three normal forms.
And why duplicate the question ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question