4 of 5
added 8 characters in body
Tulains Córdova
  • 39.4k
  • 13
  • 98
  • 155

In layman's words:

These are things that SQL is made to do and, believe it or not, I've seen done in code:

  • joins - codewise it'd require complex array manipulation
  • filtering data (where) - codewise it'd require heavy inserting, deleting items in lists
  • selecting columns - codewise it'd require heavy list or array manipulation
  • aggregate functions - codewise it'd require arrays to hold values and complex switch cases
  • foreign key integrity - codewise it'd require queries prior to insert and assumes nobody will use the data outside app
  • primary key integrity - codewise it'd require queries prior to insert and assumes nobody will use the data outside app

Doing these things instead of relying in SQL or the RDBMS leads to writing tons of code with no added value, meaning more code to debug and maintain. And it dangerously assumes the database will only be accessed via the application.

Tulains Córdova
  • 39.4k
  • 13
  • 98
  • 155