Answers

See overview for INET 3350: Ruby, Rails, and Web Development
See syllabus for tentative schedule

HTML/HTTP

  1. HyperText.
  2. An HTML form defines a section of the document that allow the user to type in data that gets submitted to the server.
  3. 200.
  4. POST.
  5. It’s not valid, because the <title> element should be closed after the word Example with </title> (note the forward slash). The reason this is a bit of a trick question is because validity depends to some extent on the version of the browser. This particular example is HTML5, which will work in newer versions of Chrome, Safari, and Internet Explorer.

SQL/Relational databases

  1. It creates a table called addresses.
  2. The database would probably reject the insert because a primary key implies that there is a constraint whereby the value for the id column must be unique.
  3. Add an index.
  4. A left join means: Make sure that all rows “on the left” (i.e., from the subscribers table) are represented in the result. In this case, even though user 2 (Ali) doesn’t have an address, he should appear in the result set. Therefore, result (B) is correct. A “natural join” would provide the result in (A).
  5. He should introduce a “join table” hetween subscribers and addresses. Each row of the join table would have a row with two foreign keys, providing the ids for each subscriber/address combination.

Back to the questions