• Rubanski@lemm.ee
    link
    fedilink
    arrow-up
    8
    ·
    4 hours ago

    Ok genuine question, what is the difference between a SQL database and a simple Excel spreadsheet?

    • lefixxx@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      1 hour ago

      The excel file contains the data. It’s equivalent to the database.

      The excel program is how you interact with the data. SQL is how you interact with databases.

      Doesn’t matter how the data is structured inside the database. You can ask in the SQL language and you will receive an SQL answer.

    • frezik@midwest.social
      link
      fedilink
      arrow-up
      4
      ·
      3 hours ago

      A whole lot. Too much to cover in one post in any kind of detail.

      A modern relational database management system (RDBMS) is a highly optimized beast. How it accesses storage is very carefully considered. It has a whole mini language for defining relations between data. There are tools for debugging specific queries to make them faster. They index data with tradeoffs between read and write speeds. There are sophisticated locking mechanisms so multiple users can read and write at the same time. They have transactions where many alterations can be packed up together and written efficiently at once. Those transactional alterations are atomic, meaning there are guarantees that all of them happen or none of them happen. The entire thing is based on set theory, and it has survived attacks by many other pretenders to the throne for decades.

      And if you’re using Oracle, you can get all that while paying a highly optimized pricing model set up by the best financial advisors Larry Ellison can find to maximize value extraction from your company.

      • captainlezbian@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 hour ago

        And alternatively, for excel once you leave the realm of a single person entering data for a single project over time sizes you start entering the “why does this take 10 minutes to open” territory

    • iii@mander.xyz
      link
      fedilink
      English
      arrow-up
      11
      ·
      edit-2
      3 hours ago

      In the context of this tweet most important differences are:

      SQL is a language for querying databases.

      Most common used databases are relational databases. With relational databases you can setup, well, relations and constraints.

      Imagine you have 2 tables (2 excel sheets) one with people, and one with home ownership. You can set the following constraint: (1) each person shows up only once in the people table. And the following relation: (2) every home owner must refer to an existing person in people table.

      When modifying the table contents, the system checks if no constraints or relations are violated.

      Excel, just like a badly designed relational databse, would, for example, have no problem with duplicate people, or home ownership referring to non-existant people.

    • sexual_tomato@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      2
      ·
      2 hours ago

      Storage data structures. Database tables are designed for fast read/write. Excel is designed for fast simultaneous parallel computation.

      To get a sense of what this looks like, you can read more about their data structures; Databases typically store data in what’s called a “B Tree” and spreadsheets typically store as a format that can be easily converted into a “Directed Acyclic Graph” (although Excel lets you turn off the “acyclic” part if you allow circular references).

      Although, with Excel specifically, there’s probably not much difference since it has some database functionality now.

    • mossberg590@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      4 hours ago

      SQL is a language used to manage and interact with most relational databases so it is used often to describe relational databases. There are many tables in a relational database, each is very much like an excel tab. The excel spreadsheet can have many tabs relating to each other. So kinda similar. However a relational database is better defined, more functions and forced relationships, and most important space efficenct. Excel takes probably 100-1000 times more space, and that is best case.