|See overview for INET 3350: Ruby, Rails, and Web Development|
|See syllabus for tentative schedule|
Learning to create web applications integrates three major skills:
A framework such as Ruby on Rails is designed to make all of these things easier; but to learn web development, it helps to have some knowledge of items 2 and 3 (we’ll teach you item 1). In past experience, students can do well if they already have some knowledge of either HTML/HTTP, SQL, or both. Students who take a course like this with nothing at all for both items may struggle; students with deficits in both areas will have to listen strenuously and be an active learner: Such students may need to use external resources to understand the coverage of Ruby on Rails.
Here are some questions that will help you assess your knowledge of HTML/HTTP and SQL.
For both sections, knowing the answer isn’t as important as feeling that the questions aren’t unexpected or unusual: consider yourself passing if most of the questions and answers make sense and feel obvious.
The answers are here: answers
What does the “H” in HTML and HTTP stand for?
What is this, and what is it for?
<form> Address1 <input name="address[address1]" /> Address2 <input name="address[address2]" /> City <input name="address[city]" /> State <input name="address[state]" /> Zip <input name="address[zip]" /> <input type="submit" /> </form>
When a web pages displays with no errors (i.e., when an HTTP response is returned with no errors), what HTTP status code is returned?
In an HTML form, what is the default HTTP method that is used to send data back to the server? Hint: Not GET
(A bit of a trick question) Do you think the following HTML is valid? What are some of the things you’d want to think about regarding a page’s validity?
<!DOCTYPE HTML> <html> <head> <title>Example<title> </head> <body> Hi there! </body> </html>
What does this do?
create table addresses ( id integer primary key, address1 varchar, address2 varchar, state varchar, city varchar, zip varchar );
What would happen if we inserted two rows into addresses with the same value for id?
Suppose an application was searching for all addresses with zipcode ‘02138’, but it seemed to be slow. What would you do?
George defines his database with the following commands:
drop table if exists addresses; create table addresses ( id integer primary key, address1 varchar, address2 varchar, state varchar, city varchar, zip varchar ); drop table if exists subscribers; create table subscribers ( id integer primary key, first_name varchar, last_name varchar, address_id integer ); insert into addresses (id, address1, address2, state, city, zip) values (1, '1 Broadway', '', 'Cambridge', 'MA', '02138'); insert into subscribers (id, first_name, last_name, address_id) values (1, 'John', 'Norman', 1); insert into subscribers (id, first_name, last_name, address_id) values (2, 'Ali', 'Khan', null);
Then he executes the following query:
select last_name, city from subscribers left join addresses on addresses.id = subscribers.address_id;
Here are two options A and B for the result. What does he get, and why does it matter?
last_name | city -----------+------ Norman | MA (1 row)
last_name | city -----------+------ Norman | MA Khan | (2 rows)
George has designed an application where there are two tables,
addresses. He added a foreign key to
address_id. By this means, each
subscriber can have a single address. He recently found out that some subscribers have
two or more addresses. How should he change his schema?