Skip to content

Instantly share code, notes, and snippets.

@ElliotOlbright
Forked from mikedao/b2_intermission_work.md
Last active June 29, 2021 18:50
Show Gist options
  • Save ElliotOlbright/7227bdc3d17fd21b29d724e29d5c66f3 to your computer and use it in GitHub Desktop.
Save ElliotOlbright/7227bdc3d17fd21b29d724e29d5c66f3 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?
  • Hyper Text Markdown Language
  • Standard markup language for web pages
  • decribes structure of web page
  • displays content on webpage
  1. What is an HTML element?
  • An element is a peice of HtML. Elements are used to define and display text, images or any "element" on a HTML doc.
  1. What is an HTML attribute
  • All HTML element can have attributes
  • Attributes are defined in the beginning of the HTML tag
  • Provide additional information about the element
  1. What is the difference between a class and an id? When would you use one vs. the other?
  2. What HTML would you write to create a form for a new dog with a "name" and an "age"?
  3. What are semantic tags? When would you use them over a div?
  4. Explain what each of the following HTML tags do and when you would use them:
  • <h1>, <h2>, etc.
  • these decribe a heading and defines the size of the heading.

    is the largest heading

  • <p>
  • This describes a paragraph in the webpage
  • <body>
  • defines the documents body. Hewre is where headings,paragraphs, links, images etc.
  • <a> and the href attribute
  • links are defined using the <a--, the destination or link is defined using the href
  • <img> and the src attribute
  • img is the tag for an image while the source path of the image is defined using src="image_source"
  • <div>
  • defines a section in a document
  • <section>
  • defines a section with a group
  • <ul>, <ol>, and <li>
  • ul is an unordered list
  • ol is an ordered list
  • li defines a list item
  • <form>
  • Defines an HTML form for user input
  • <input>
  • defines an input control

CSS

  1. What is CSS?
  • Cascading Style Sheets
  • formats the layout of a page
  • control color, font, position of elements etc.
  1. What is a CSS selector? How do you use the ID selector? The class selector?
  • a pattern or patterns used to select the elements you want to be styled
  • you can set a selector to an ID and call the ID for each element
  • similar to ID but calls all elements in the class defined
  1. What are the three ways to include CSS in your HTML documents? What are the pros and cons of each?
  • inline in attribute inside HTML element
    • pro: customizable
    • con: must repeat in every new line
  • internal in a <style> element in the section
    • pro: once set, everything follows
    • con: must change if a different effect is desired
  • external in an external CSS file
    • pro: easy to manipulate
    • con: dont lose that file!
  1. What is the Box Model? Describe each component of the Box Model.
  • a model of the HTML setup
    • includes:
      1. Content - The content of the box, where text and images appear
      2. Padding - Clears an area around the content. The padding is transparent
      3. Border - A border that goes around the padding and content
      4. Margin - Clears an area outside the border. The margin is transparent

SQL

Jumpstart Lab Tutorial

  1. What is a database?
  2. What is SQL?
  • Structured Query language
  • create, modify and delete tables
  • SQL is a programming language
  1. What is SQLite3?
  • A "lite" version of SQL
  • good for experiementing but not used in actual production.
  1. What is a Table?
  • a way to hold and display information that has different attributes such as an ID, name and quantity
  1. What is a primary key?

  2. What is a foreign key?

  3. Explain what each of the following SQL commands do:

  • insert
  • inserts data into a table
  • select
  • finds data from a table
  • where
  • defines the type or characteritic of the data to be selected from the table
  • order by
  • will sort the table and the data within by given characterisic
  • inner join
  • joins two different tables together to create a new table with the specified attributes of each table

PG Exercises

  1. How can you limit which columns you select from a table?
  • specify the column in which you are trying to retreive information
  • select (name of column),(name of compared column) from (directory)
  1. How can you limit which rows you select from a table?
  • specify the criteria of which rows you want to retrieve
  • select * from (directory) where (name of column) (criteria eg. cost > o)
  1. How can you give a selected column a different name in your output?
  1. How can you sort your output from a SQL statement?
  • you can use the order by method and describe the criteria that meets the sort
  1. What is joining? When do you need to join?
  • use the union method
  • neccesary when finding and comparing data from different tables or trying to combine data from different tables
  1. What is an aggregate function?
  • gives us the ability to retreive a single row of information
  • such as the max value or most revent date etc.
  1. List three aggregate functions and what they do.
  • max: give the highest value in the table
  • latest: give the most recent item
  • sum: give sum of all tables
  1. What does the group statement do?
  • groups rows that have the values into a summary row
  1. How does the group statement relate to aggregates?
  • it returns a single row like an aggregate

Rails Tutorial: Task Manager

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

  1. Define CRUD.
  • create recieve update and delete
  1. Define MVC.
  • model view Controller
  1. 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.rb
  • views/tasks/index.html.erb
  • controllers/task_controller.rb
  1. What are params? Where do they come from?
  • parameters of user input. The come from and users inpuit into a text field
  1. Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task?
  • One route is to create and the other is to overide and recreate for editing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment