becky becky -3 years ago 135
SQL Question

SQL front end forms

I am just starting to learn SQL, and this is probably a silly question, but what code is used for the front end, user friendly input to a database or table?

For example, when you fill in your contact information for a website that information obviously doesn't go off to someone who inputs it individually in to the table/database using SQL syntax, so how is the SQL tied to the individual form sections that are being filled in by the customer? Is it the responsibility of the database manager to create this link or of a web developer through something like HTML code?

Answer Source

This is a really open question, because there is a ton in the middle, but I guess this is the best way to summarize it:

In modern web development (not looking at you aspx or ASP.NET MVC 5 Razor templates) you would have a client-side application for web technologies client side generally lands in the area of HTMl5, CSS 3, JavaScript that is what creates the UI for the user.

Once the form is filled out there are generally two ways to submit the data 1 via a form attribute (you can read more about it in the link). This will have an attribute called method which defines the type of the HTTP protocol to send the data which you can read about the different type here and action which is the server endpoint. However there is a ton more information about it which is why it has its own books written that should be read about. The other method is via custom JavaScript using XMLHttpRequest.

This HTTP protocol would send the data to a server you have which is generally written in a massive amounts of languages, but the most generic are C#, Java, Node.js (JavaScript), and PHP. The server will listen to the request and do things such as validation and handle business logic. At which point once everything goes dandy and the data gets sanitized and processed for the database, the operation can take place.

The server will open up a connection to the desired RDBMS database (SQL Server, MySQL, PostgreSQL) or a NoSQL database like (MongoDB, CouchDB) at which point it will run SQL provided from the server or execute a procedure on the database with the sanitized data passed in.

Essentially a small workflow would be

  • The customer enters data into a form
  • The customer submits data, and it passes to the web server via an HTTP method (GET, POST, PUT, or DELETE)
  • The server receives an HTTP request and reads it. It does verification and based on the URL that was called to the server, it will execute specific SQL or a stored procedure for that action
    • Let's say the action is to add a new order, the server will send to the database a SQL command such as insert into order values (id, price, and date)

This is a really rough picture, but these are the beginning steps to any enterprise n-tier architecture in most of the cases. Hopefully there are enough keywords for you to google and research on your own that will help you along the way with better understanding.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download