Skip to content

Instantly share code, notes, and snippets.

@EVanGorkom
Forked from mikedao/b2_intermission_work.md
Last active August 19, 2023 18:58
Show Gist options
  • Save EVanGorkom/3ad6d1be2d0af7adac4f1cfc46191cfa to your computer and use it in GitHub Desktop.
Save EVanGorkom/3ad6d1be2d0af7adac4f1cfc46191cfa 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 Markup Language

  2. What is an HTML element?

    An element in HTML is what you use to declare sections and elements of your code. It helps tell the computer how to display your code. ex.

  3. What is an HTML attribute?

    An HTML attribute is what we use to provide more information about a given section or element of our code. It can help us pinpoint our changes that we want to see in our CSS code.

  4. What is the difference between a class and an id? When would you use one vs. the other?

    A class is typically used in more reoccuring elements of the code whereas an id is usually saved for single use. Several heading sizes may have the same class to modify them. A single section of bold text might have an id to help differentiate if from the rest of the paragraph.

  5. What HTML would you write to create a form for a new dog with a "name" and an "age"?

    for name I would use and for age I would use or maybe even use range if I wanted to limit it more.

  6. What are semantic tags? When would you use them over a div?

    Semantic tags are typically convey the purpose of the content that they contain. Div is used to help you create layout and style within your code. Semantic tags are more typically used to improve code readability.

  7. Explain what each of the following HTML tags do and when you would use them:

  • <h1>, <h2>, etc. => headers of varying sizes. The larger the number the smaller the header.
  • <p> => signifies the start of a paragraph of text
  • <body> => a non-semantic tag that tells the coder where the bulk of the website's content will be
  • <a> and the href attribute => <a> is an element that tells us that there will be a link. <href> is the attribute that is set equal to the link itself.
  • <img> and the src attribute => <img> is an element that tells us there will be an image. src is the arribute that is set equal to the location of the photo for rendering.
  • <div> => is used to denote and separate portions of the webpage for styling and layout purposes
  • <section> => it is a an element used to group "sections" of the code together based on likeness and theme.
  • <ul>, <ol>, and <li> => ul and ol stand for 'unordered list' and 'ordered list' respectively. li is the element/elements that is/are indented within the ul or ol.
  • <form> => refers to a form element in which you can create inputs for users to fill out and eventually sumbit for data.
  • <input> => is the element used to take data inputs from a user and can have many different types of inputs.

CSS

  1. What is CSS?

    Cascading Styling Sheets

  2. What is a CSS selector? How do you use the ID selector? The class selector?

    It is how CSS works with HTML code. The selector specifies what to look at and format for within the HTML code.

  3. What are the three ways to include CSS in your HTML documents? What are the pros and cons of each?

    Inline CSS: pros- quick and dirty // cons- dirty and can be hard to maintain if used to much.

    Internal CSS: pros- quick and topical // cons- it's not as thorough as external. You would have to set it up for each element or section you wanted to edit.

    External CSS: pros- can work throughout the html doc to find all elements that apply to it's scope // cons- takes longer

  4. What is the Box Model? Describe each component of the Box Model.

    • Content: It's what goes into everything else. Our human in the car.
    • Padding: It's what goes directly around the content. Our carseat.
    • Border: It's what goes around the content and padding. This is our car.
    • Margin: It's the space inbetween other elements on the field. This is the distance between other cars.

SQL

Jumpstart Lab Tutorial

  1. What is a database?
  • "Databases are at the core of almost every web application. They are our means of storing, fetching, calculating, and sorting data."
  1. What is SQL?
  • Structured Query Language
  1. What is SQLite3?
  • SQLite3 is a relational database management system that works directly within applications and is usually used for local storage and lighter data management.
  1. What is a Table?
  • A form of organizing data into rows and columns.
  1. What is a primary key?
  • A primary key is a column within a table that uniquely identifies each record or row in that table
  1. What is a foreign key?
  • A foregin key is a column or set of them that establishes a link between data in two tables, referencing the primary key of another table to create a relationship between the two.
  1. Explain what each of the following SQL commands do:
  • insert => this inserts data into the rows of the table
  • select => this retrieves data from one or more tables based on what you ask it to retrieve
  • where => this filters and retrieves specific rows from a table based on your specific conditions
  • order by => this sorts the retrieved data from a table in order based on the specified columns
  • inner join => this command combines data from two or more tables based on a matching condition, and then returns only the rows where the condition is met in both.

PG Exercises

  1. How can you limit which columns you select from a table?
  • use the select statement followed by the column names you want to retrieve, separated by commas.
  1. How can you limit which rows you select from a table?
  • use the where clause in your select statement and specify the conditions that the rows must meet.
  1. How can you give a selected column a different name in your output?
  • use the as keyword followed by the desired name after the column you're selecting.
  1. How can you sort your output from a SQL statement?
  • use the order by clause followed by the column name(s) you want to sort by
  1. What is joining? When do you need to join?
  • Joining in SQL combines data from two or more tables based on related columns
  1. What is an aggregate function?
  • An aggregate function in SQL performs a calculation on a set of values and returns a single value. It's used to summarize and analyze data in a table.
  1. List three aggregate functions and what they do.
  • SUM(): Calculates the sum of values in a numeric column.
  • AVG(): Calculates the average of values in a numeric column.
  • COUNT(): Counts the number of rows in a table or the number of non-null values in a specific column.
  1. What does the group statement do?
  • The group by statement is used to group rows that have the same values in specified columns into summary rows. It's often used with aggregate functions to calculate values for each group
  1. How does the group statement relate to aggregates?
  • It's used in conjunction with aggregate functions.

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: https://github.com/EVanGorkom/static_challenges

  1. Define CRUD.
  • Create
  • Read
  • Update
  • 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.
  • A view file, a controller file, and a routes file
  1. What are params? Where do they come from?
  • "Params" are the data sent with an HTTP request to a server, providing additional information. In a Rails application, the params hash is used to access and handle these parameters within controller actions.
  1. Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task?
  • Two separate routes for creating and editing tasks follow the RESTful design principles and correspond to different HTTP methods (POST for creation, PUT/PATCH for editing), ensuring clear separation of concerns and adhering to HTTP semantics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment