D
D
Dmitry Krapivin2016-05-16 08:15:59
PostgreSQL
Dmitry Krapivin, 2016-05-16 08:15:59

Problem when merging data from different sources. Which of the attributes to make the key in the database?

Good afternoon!
Description of the problem:
A system for large companies engaged in marketing and analysis of data
on
competitors client machines with the server are installed in different cities (representations).
attributes. For example:
Short name: Rul
Full name: LLC "NK Rul"
INN: 546456456
Form of incorporation: Limited Liability Company
Country: Russia
Address: Syktyvkar, st. Marka, 7
Activities: Sale and mining of precious metals
Parent company: OJSC "Rarus"
Subordinate companies: LLC "KHT", LLC "BRAK"
Owner: Sidorov IP
Analyst every day transmits information about the Central Office of Analysts.
The system is multi-server. Those. The database is not centralized. In order for information about objects and their structure to be identical, information about the structure is transmitted to the central office. Let's just say, to align the structure.
It is more logical to assume that the key attribute is "full name" or TIN. But there is one thing,
in the process of analysis firms (daughters) are identified, the data on which are not complete. For example:
"There was information about a certain company registered in the city of Bashma, owner Maikol. There is information that this company is associated with Ruzatana OJSC. Please consider and check"
Those. on one of the client machines, information about the object will be recorded without its name. And you will need to send this info.
Can you please tell me which attribute (or something "other") should be made key and why?
respectfully

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Rou1997, 2016-05-16
@Rou1997

or something different"

Create a separate id field and make it key.

K
Konstantin Malyarov, 2016-05-16
@Konstantin18ko

id_company (int) and that's it. Do not need anything else.

M
Michael, 2016-05-16
@zuzuzu

The guys correctly write about the ID. Since the completeness of the data is not defined for you, then the only permanent element of the record will be the additional field of the ID.

A
Alexander Kosarev, 2016-05-16
@jaxtr

The generated ID in this case will be the only correct solution, int / long or UUID - depending on the views / wishes. At one time I tried various identifiers like TIN, KPP, etc. to do with keys, but nothing good came of it - the usefulness of the data entered by the end user, as a rule, is not guaranteed, just like their reliability.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question