Posts by Caio Lesnock • 11 points
4 posts
-
0
votes1
answer135
viewsA: COUNT and SUM with 3 tables
I managed to solve! I just needed to do a subquery inside JOIN: SELECT offices.id, offices.version, SUM(sub.quantity) as quantity, SUM(in_use) FROM offices JOIN ( SELECT office_keys.office_id,…
-
0
votes1
answer135
viewsQ: COUNT and SUM with 3 tables
I’m making an IT management system. I have 3 tables: Computers, offices, office_keys Example: offices ______________________________________ id | 1 version | Home & Business 2016 office_keys…
-
0
votes0
answers21
viewsQ: PHP Abstract Function with interface argument
I’m trying to create an abstract function by passing an interface as an argument: abstract class AbstractManagement { abstract public function handle(RequestInterface $request) :array; } But when I…
phpasked Caio Lesnock 11 -
1
votes0
answers33
viewsQ: What is the ideal model for creating classes involving the database?
I have a very strong question about what is the best way to create classes to "interact" with the database (in PHP, in this case). For example: I need very specific validations of each table to be…