Skip to content

Instantly share code, notes, and snippets.

@AliciaWatt
Last active May 6, 2022 19:53
Show Gist options
  • Select an option

  • Save AliciaWatt/171a445f2548f927e3d8a673552efdba to your computer and use it in GitHub Desktop.

Select an option

Save AliciaWatt/171a445f2548f927e3d8a673552efdba to your computer and use it in GitHub Desktop.

B2 Intermission Work

Answer these Check for Understanding questions as you work through the assignments.

HTML

  1. What is HTML?
    • HTML is the mark up language used to create webpages. HTML alows browsers to understand how to display text.
  2. What is an HTML element?
    • An HTML element is the start tag, contents and end tag. Pretty much everything from the start tag to the end tag.
  3. What is an HTML attribute?
    • HTML attributes modify HTML elements.
  4. What is the difference between a class and an id? When would you use one vs. the other?
    • class is denoted with "." and id is denoted with #. Class is used when you need to add attributes to multiple elements vs id is used to add attributes to a single element.
  5. What HTML would you write to create a form for a new dog with a "name" and an "age"?
    • the input element
  6. What are semantic tags? When would you use them over a div?
    • A semantic tag describes its self to the reader. Div just breaks the page into logical blocks.
  7. Explain what each of the following HTML tags do and when you would use them:
  • <h1>, <h2>, etc.
    • headers. when you need to write a header
  • <p>
    • paragraph. When you need to write a paragraph
  • <body>
    • is the body of the HTML page. It is what is displayed in the browser
  • <div>
    • div is a container for other HTML elements
  • <section>
    • breaks up the document into blocks
  • <ul>, <ol>, and <li>
    • lists. orderd and unordered lists
  • <form>
    • for user input. Can use different form elements for different types of inputs.
  • <input>
    • how you add attributes to user input

CSS

  1. What is CSS?
    • css is a code used to style HTML.
  2. What is a CSS selector? How do you use the ID selector? The class selector?
    • A CSS selector allows you to select what you want to style. ID selector is used by giving an element an ID and then calling that id with #id and then formatting. A class is the same thing but called a different way.
  3. What are the three ways to include CSS in your HTML documents? What are the pros and cons of each?
    • external, internal, inline. External is easy to use across multiple html pages. Harder to prototype. Internal is easier to prototype but not able to use it across multiple html pages. Inline is the same as internal.
  4. What is the Box Model? Describe each component of the Box Model.
    • The box model describes the concept of surrounding the HTML content with boxes that break the page up into logical components. The four boxes are Content, Padding, Border and Margins. The content is the actual content of the HTML page. Padding is the space inbetween the content and boarder. The boarder goes around the padding and content and the margin is the space inbetween the border and edge of the page.

SQL

Jumpstart Lab Tutorial

  1. What is a database?
    • a collection of data.
  2. What is SQL?
    • Standard Query Language is used to talk to and manipulate data bases.
  3. What is SQLite3?
    • Not really sure of the significance of the difference but SQLite3 does not have a server where as SQL does?
  4. What is a Table?
    • collection of data
  5. What is a primary key?
    • how you identify data or values within a table
  6. What is a foreign key?
    • a forign key is how you link table together.
  7. Explain what each of the following SQL commands do:
  • insert
    • allows you at to add data to a table
  • select
    • select the data from a certain table
  • where
    • gives you a place to write a condition
  • order by
    • orders by the data in either ASC or DSC order
  • inner join
    • add data from two tables together

PG Exercises

  1. How can you limit which columns you select from a table?
    • use limit
  2. How can you limit which rows you select from a table?
    • use limit
  3. How can you give a selected column a different name in your output?
    • select column as name
  4. How can you sort your output from a SQL statement?
    • sort by(asc|dsc)
  5. What is joining? When do you need to join?
    • joining is when you combine two tables that share one common column. You can use either inner join or outer join.
  6. What is an aggregate function?
    • values of multiple rows are grouped together
  7. List three aggregate functions and what they do.
    • sum, count, avg
  8. What does the group statement do?
    • groups by a condition you pass it
  9. How does the group statement relate to aggregates?
    • adds things together

Rails Tutorial: Task Manager

Copy and Paste the link to your Task Manager repo here: Copy and Paste the link to your Static Challenge here:

  1. Define CRUD.
    • the basics of how an app works. first create, then read, then update, then delete.
  2. Define MVC.
    • MVC is the basis of how a computer works with the data a user provides it.
  3. What three files would you need to create/modify for a Rails application to respond to a GET request to /tasks, assuming you have a Task model.
    • routes, views, task controller
  4. What are params? Where do they come from?
    • params are the hash values you get from the user input.
  5. Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task?
    • those are two different actions. One creates a task from the blank template while the the takes an existing hash and modifies it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment