Answer the question
In order to leave comments, you need to log in
In what structure to store data in the database?
There is a test project (tsrm system).
I do it for practice.
There is no understanding of how to store data.
Conditionally:
There is an object type "Lead", which has properties conditionally: "Name", "Contacts", "Address", "Responsible manager"
The "Lead" has "Deals" (there can be infinite): "Deal 1" , "Deal 2", etc.
I don’t understand how information is stored in the database, in what format, etc. (What literature, introductory article can I read to get an idea?)
Conventionally, my lead looks like this:
lead = {
id:"someID",
name: "someName",
phone: "898989898",
address: "420021, Kazan",
manager: "someManager",
deal: [
{firstDeal: "someInfo"},
{secondDeal: "someSecondDeal"}
],
}
Answer the question
In order to leave comments, you need to log in
So leads are one table, managers are a separate table, transactions are also a separate table.
managers are attached to leads by ID (in the lead table in the manager field - its ID)
in the deals table there is a lead field in which the lead ID. If the field has an identifier from another table, then the field name = 'tablename_id' to make it clear what that data is.
id in any table is the primary key .
You can also read about a foreign key - a handy feature - it won't let you delete a lead as long as there are deals that refer to it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question