1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Make database more efficient [closed]

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 1, 2024 às 09:43.

  1. Stack

    Stack Membro Participativo

    This is a simplified surrogate problem for what I'm actually facing.

    Suppose I have a data on company employer-employee relationships. Let there be 3 employers A, B, C and they all share employees E1...E300, where E1...E300 are all the employee names. We only care about the employee names, there are no attributes associated with them.

    Let the arbitrary data fields be:

    • Location (String) (Employer and Employees work together at different locations across the USA)
    • risk_of_leaving (integer metric between 0 and 100) (Employer determines this score for employee)
    • employer_satisfaction_score (integer metric between 1 and 5) (Employer gives this score as a rating to the employee)

    An example table would be:

    Employer Employee Location risk_leaving satisfaction
    A E1 Boston 40 3
    A E2 Boston 20 2
    ... ... ... ... ...
    A E300 Boston 90 1
    B E1 Las Vegas 40 3
    B E2 New York 60 4
    ... ... ... ... ...
    B E300 New York 97 2
    C E1 Las Vegas 22 3
    C E2 Boston 42 3
    ... ... ... ... ...
    C E300 Boston 76 3

    My questions are:

    1. Is there an efficient way to store this in a database? If so, what is the best way?
    2. Is there anything I should do to optimize this further?

    I was thinking to just try a SQL database and make the Primary Key be the columns (Employer, Employee). I wanted to see if anyone knew a more efficient way or if there is anything to do to optimize this. Even if I have to use a different database structure (SQL vs. NoSQL).

    Continue reading...

Compartilhe esta Página