Linux server admin, MySQL/TSQL database admin, Python programmer, Linux gaming enthusiast and a forever GM.

  • 0 Posts
  • 12 Comments
Joined 2 years ago
cake
Cake day: June 8th, 2023

help-circle



  • It’s necessary to split it out into different tables if you have a one-to-many relationship. Let’s say you have a list of driver licenses the person has had over the years, for example. Then you’d need the second table. So something like this:

    SSN_Table

    ID | SSN | Other info

    Driver_License_Table

    ID | SSN_ID | Issue_Date | Expiry_Date | Other_Info

    Then you could do something like pull up a person’s latest driver’s license, or list all the ones they had, or pull up the SSN associated with that license.


  • Theoretically, yeah, that’s one solution. The more reasonable thing to do would be to use the foreign key though. So, for example:

    SSN_Table

    ID | SSN | Other info

    Other_Table

    ID | SSN_ID | Other info

    When you want to connect them to have both sets of info, it’d be the following:

    SELECT * FROM SSN_Table JOIN Other_Table ON SSN_Table.ID = Other_Table.SSN_ID

    EDIT: Oh, just to clear up any confusion, the SSN_ID in this simple example is not the SSN itself. To access that in this example query, it’d by SSN_Table.SSN








  • I violently disagree with your whole worldview and wish to engage you in rigorous debate over a topic neither of us has any ability to actually change in real life.

    Here is the rebuttal and deconstruction of everything that you believe:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin elit diam, cursus quis nibh sed, iaculis laoreet dolor. Nulla justo leo, feugiat et venenatis a, gravida ac leo. Etiam et erat vitae urna interdum varius laoreet ut sapien. Donec rutrum lobortis tellus, tempor accumsan ipsum facilisis non. Pellentesque vitae venenatis arcu, in viverra lacus. Donec eu pellentesque nunc, quis faucibus neque. Nam nec ex dignissim, convallis libero vitae, iaculis velit. Aenean id ornare neque. Mauris neque eros, congue nec porta nec, scelerisque fermentum diam. Praesent nec tortor non metus vulputate accumsan.

    Pellentesque placerat luctus ligula eu aliquam. Donec auctor pretium ex, sit amet consectetur lectus placerat in. Mauris vel enim neque. Proin vulputate sed quam nec imperdiet. Nulla cursus libero quis elit volutpat, quis sagittis mauris consequat. Pellentesque ornare suscipit ligula, nec consectetur eros porttitor sed. Suspendisse quis convallis turpis. Proin faucibus scelerisque lacinia. Nam ornare lorem a suscipit pulvinar. Donec vulputate justo lorem, sed lobortis lorem dictum eu. Sed non maximus neque. Vivamus fringilla eleifend lectus, et faucibus felis dictum vitae. Donec at ex scelerisque, facilisis purus eget, sagittis ex. In est arcu, tristique quis suscipit a, tincidunt non risus. Cras rhoncus posuere tempus.

    Fusce eget ligula eget nulla rhoncus aliquam. Fusce diam elit, auctor a turpis id, ullamcorper accumsan risus. Aliquam sed enim nisi. Nulla dictum congue eros, ac blandit risus vehicula quis. Maecenas laoreet, est et aliquam elementum, nibh erat elementum ipsum, at rutrum enim dui at velit. Sed ut sem quis erat condimentum aliquet nec ac quam. Quisque consequat volutpat odio a venenatis. Proin mollis leo non leo maximus, nec mattis quam lacinia.

    In hac habitasse platea dictumst. Aliquam erat volutpat. Donec ut ipsum quis lectus laoreet pharetra ut a tortor. Ut nec lacus et est tincidunt lobortis vel et augue. Donec tincidunt ex non felis dapibus elementum. Sed eget eros id est pellentesque auctor vitae quis ante. Curabitur pellentesque tellus et risus hendrerit, eu porttitor dui lobortis. Cras auctor luctus blandit.

    Cras fringilla nec sem ac feugiat. Vivamus venenatis orci non erat condimentum blandit. Suspendisse lorem erat, rhoncus ut purus eu, elementum tincidunt nunc. Vivamus lacinia dignissim dolor, egestas finibus sapien placerat eget. Aliquam nec diam eu erat finibus malesuada eu sed felis. Maecenas id ultricies lorem. Suspendisse neque mi, sollicitudin et nisi faucibus, mollis faucibus ipsum. Quisque aliquet fringilla mauris. Nam rutrum ut magna id vulputate. Quisque nec pharetra orci. Vestibulum semper ac velit ut viverra. Praesent tortor neque, feugiat sit amet tincidunt nec, mollis id eros. Nam sed ultricies dolor