Tutor profile: Daniel P.
Subject: Web Development
What does the MVC model provide when doing full stack web development?
Conceptually, the MVC model (or Model, View, Controller) allows for separation of concerns. What this means is that each are of your code can do one thing and do it well. You don't have single files, classes, or sections of code trying to do all kinds of different actions, Instead, when a request comes in it hits your Controller layer, which is only in charge of making sure requests are directed to the correct place and responses are returned in the right format. From there, you will usually have a Service Class that deals interacts with your Model to return any relevant data to your Controller. Once the Controller has the data it needs, it calls up the View layer to determine how best to format that data to return to the client / user as a response. This MVC model makes perfect sense for running Server-Side rendered web applications, but how do you think it might change if you were using a front-end framework like React?
Subject: SQL Programming
How would I count the number of records in a table?
SQL has a number of "helper functions" that you can use to do analysis on tables from within the SELECT section of your query. Consider [[ SELECT * FROM table_name; ]]. This will return all rows and columns table_name. If you wanted to do analysis you could run the query [[ SELECT count(*) from table_name; ]] which would return a count of all records in the table. Interestingly enough, you could also get the same result by running [[ SELECT count(1) from table_name; ]] Why do you suppose that is?
needs and Daniel will reply soon.