Skip to content

Instantly share code, notes, and snippets.

@jlweave
Last active November 26, 2022 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlweave/880cf373ec74f363b6a5df5fcef9622b to your computer and use it in GitHub Desktop.
Save jlweave/880cf373ec74f363b6a5df5fcef9622b to your computer and use it in GitHub Desktop.
Mod 2 Intermission Work
# B2 Intermission Work
Answer these Check for Understanding questions as you work through the assignments.
## HTML
1. What is HTML?
a standard markup language for web pages
1. What is an HTML element?
everything from the start and end tag
1. What is an HTML attribute?
additional information, specified in start tag
1. What is the difference between a class and an id? When would you use one vs. the other?
class can have multiple were id can only have one. Id would be used for something like a header where class could be used for paragraphs
1. What HTML would you write to create a form for a new dog with a "name" and an "age"?
<dl>, <dt>, <dd>
1. What are semantic tags? When would you use them over a `div`?
semantic tags are easier to comperhend, automation
1. Explain what each of the following HTML tags do and when you would use them:
* `<h1>`, `<h2>`, etc. header
* `<p>` paragraph
* `<body>` defines doc body
* `<a>` and the `href` attribute links, actual path
* `<img>` and the `src` attribute images
* `<div>` a section in a doc
* `<section>` defines a section in doc, such as chapters, intros
* `<ul>`, `<ol>`, and `<li>` unordered, ordered, defines list items
* `<form>` collect user input
* `<input>` most user form element
## CSS
1. What is CSS?
cascading style sheets, describes how HTML is desplayed
1. What is a CSS selector? How do you use the ID selector? The class selector?
points to the HTML element you want to style
1. What are the three ways to include CSS in your HTML documents? What are the pros and cons of each?
internal - dont need to upload multiple files but can increase page size and load time, external - seperate docs mean cleaner structure and smaller in size but it my not render correctly until CSS is loaded, inline - quickly insert, quick fixes, don't need to create seperate docs but making rules to every element is time consuming and can lengthen download time.
1. What is the Box Model? Describe each component of the Box Model.
A box that wraps every HTML element. Contents is where text or images appear, padding is around contents and is transparent, boarder is around padding and is also transparent, and margin is also transparent around everything.
## SQL
### Jumpstart Lab Tutorial
1. What is a database?
storing, fetching, calculating and sorting data
1. What is SQL? s
tructed query lang. interacts with databases
1. What is SQLite3?
experiments and local dev, never use in production
1. What is a Table?
database objects that contain all the data in a database
1. What is a primary key?
constraint uniq identifies each record table
1. What is a foreign key?
refers to the primary key from another table
1. Explain what each of the following SQL commands do:
* insert new data inro database
* select specify what we want
* where use key arg to specify a column/row to match
* order by table contents in ascending(default) or descending order
* inner join select records that have matching values in both tables
### PG Exercises
1. How can you limit which columns you select from a table?
SELECT column_name
1. How can you limit which rows you select from a table?
SELECT row_number
1. How can you give a selected column a different name in your output?
unsure on this one
1. How can you sort your output from a SQL statement?
ORDER BY
1. What is joining? When do you need to join?
is used to combine rows from tow or more tables, based on related column between them
1. What is an aggregate function?
performs calculations on a set of values and returns a single value
1. List three aggregate functions and what they do.
COUNT - counts how many rows
SUM - adds up the numerical value
AVG - gives the average number
1. What does the `group` statement do?
group rows that have the same value into summary rows
1. How does the `group` statement relate to aggregates?
the GROUP BY statement is often used with aggregats to group the results by one or more columns
## Rails Tutorial: Task Manager
**Copy and Paste the link to your Task Manager repo here:**
https://github.com/jlweave/intermission_for_mod_two
**Copy and Paste the link to your Static Challenge here:**
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.
1. What are params? Where do they come from?
taken from the parameters that we received in a request and turns it into a params object that we can use and manipulate inside of our application
1. Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task?
@jlweave
Copy link
Author

jlweave commented Nov 26, 2022

Did not complete Static Challenge, wanted to spend more time on SQL and Active Record

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment