Skip to content

Instantly share code, notes, and snippets.

@croixk
Forked from mikedao/b2_intermission_work.md
Last active November 27, 2021 16:33
Show Gist options
  • Select an option

  • Save croixk/d8c217a2460b28880951d3c9e5a76592 to your computer and use it in GitHub Desktop.

Select an option

Save croixk/d8c217a2460b28880951d3c9e5a76592 to your computer and use it in GitHub Desktop.
B2 Intermission Work Submission

B2 Intermission Work

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

HTML

  1. What is HTML? - HTML is the standard markup language for web pages (hyper text markup language)
  2. What is an HTML element? - labels a piece, such as a heading, paragraph, link, etc.
  3. What is an HTML attribute? - provides additional information about element. Comes in the form of a name/value pair
  4. What is the difference between a class and an id? When would you use one vs. the other? - a class is useds to specifiy a class for an HTML element - this allows you to keep styling similar between different elements. An id is unique, and can only apply to one element at most. An id specifies a unique id for an HTML element - classes can describe multiple elements, so the usage is different.
  5. What HTML would you write to create a form for a new dog with a "name" and an "age"? - you would use the input element
  6. What are semantic tags? When would you use them over a div? - semantic tags are used to describe meaning to both the browser and the developer. A div is used as a generic container, but doesn't provide information on actual meaning.
  7. Explain what each of the following HTML tags do and when you would use them:
  • <h1>, <h2>, etc. - these are header tags, for headers of different sizes
  • <p> - this establishes a paragraph
  • <body>- defines document's body - contains all visible contents
  • <a> and the href attribute - this definies a hyperlink - the 'href' is the link's destination
  • <img> and the src attribute - embeds an image in the html page - the src is the path to the image
  • <div>- define division or section in html
  • <section> - used to group together related elements - means that contents relate to a signle theme
  • <ul>, <ol>, and <li> - you use
      for an unordered list, ol for an ordered list, and li for a list item in an ordered list.
    • <form> - container for input
    • <input>- defines a type for input

    CSS

    1. What is CSS? - CSS is a language used to style an HTML document (cascading style sheets) - saves the work of styling in html
    2. What is a CSS selector? How do you use the ID selector? The class selector? - the selector points to the html element that you want to style. The ID selector uses the id attribute of an HTML element to select a specific element. The class selector selects html elements with a specific class attribute.
    3. What are the three ways to include CSS in your HTML documents? What are the pros and cons of each? The three ways are external CSS, internal CSS, and inline CSS. An external style sheet allows the entire website to be changed with just one file. An internal style sheet can be used if a single html page has a unique style. Inline style can be used for single elements. All three can also be combined, with a cascading order of priority - inline is highest priority, then external and internal style sheets, then browser default.
    4. What is the Box Model? Describe each component of the Box Model. - the box model is a box that wraps around each HTML element. From inside to out, this goes content, padding, border, margin

    SQL

    Jumpstart Lab Tutorial

    1. What is a database? - a means of storing, fetching, calculating, and sorting data
    2. What is SQL? - SQL stand for structured query language - how we interact with most databases
    3. What is SQLite3? - SQLite3 is a database engine
    4. What is a Table? - a table is used to store data
    5. What is a primary key? - column or group of columns used to identiy a row uniquely in a table
    6. What is a foreign key? - column or group of columns in a table that refernce the primary keys of another table
    7. Explain what each of the following SQL commands do:
    • insert - allows you to insert row
    • select - use this to find rows in the table
    • where - limit returned rows to those with matching attributes
    • order by - this allows you to order data in a different order than it started in
    • inner join - allows you to combine different tables

    PG Exercises

    1. How can you limit which columns you select from a table? - can use select * from - the desired columns come after the 'select'
    2. How can you limit which rows you select from a table? - you can use 'where', with a conditional
    3. How can you give a selected column a different name in your output? - you can use alter table.
    4. How can you sort your output from a SQL statement? - you can use order by
    5. What is joining? When do you need to join? - joining allows you to combine two or more tables in a database - this is necessary if you want to be able to use both simultaneously
    6. What is an aggregate function? - an aggregate function performs a calculation on a set of values, and returns a single value
    7. List three aggregate functions and what they do. count - counts the number of items. sum - produces a sum per each value specified. group by - allows you to batch the data into groups, and run the function for each group
    8. What does the group statement do? - allows you to avoid redundancy/compute aggregates for rows that have identical data
    9. How does the group statement relate to aggregates? - the group function allows you to use aggregates for collections of data that share a value

    Rails Tutorial: Task Manager

    Copy and Paste the link to your Task Manager repo here: https://github.com/croixk/croix_task_manager **Copy and Paste the link to your Static Challenge here:**https://github.com/croixk/static_challenges

    1. Define CRUD. CRUD stands for create, read, update, delete - this refers to the four functions for a persistent storage application.
    2. Define MVC - MVC stands for model, view, controller - this is a model for developing modern user interfaces.
    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. - you need to create or modify the index, title, and description.
    4. What are params? Where do they come from? - Ruby can generate a params object that can be used and manipulated inside of the application
    5. Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task? - we have two routes each since these are different elements of the CRUD model - these require different routes within our program.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment