Skip to content

Instantly share code, notes, and snippets.

@James-E-White
Forked from mikedao/b2_intermission_work.md
Last active October 7, 2022 21:01
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 James-E-White/03e720bd13fdc034bd20b011c888d41f to your computer and use it in GitHub Desktop.
Save James-E-White/03e720bd13fdc034bd20b011c888d41f 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? Elements - An HTML element is defined by a start tag, some content, and an end tag: Tells the webpage how to display the content.

  3. What is an HTML attribute? Providing additional information from elements

  4. What is the difference between a class and an id? When would you use one vs. the other? The class attribute is often used to point to a class name in a style sheet. It can also be used by a JavaScript to access and manipulate elements with the specific class name. Like in ruby class City than def initialize it gives it attributes that wiuld carry over for each class of city. ID only one element can have an id. The id attribute is used to point to a specific style declaration in a style sheet. A class name can be used by multiple HTML elements, while an id name must only be used by one HTML element within the page: You would want to use class if there ever is a need to edit

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

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

    element defines a division or a section in an HTML document.

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

  • <h1>, <h2>, etc. Headers in order of importance h1 being the first h6 the last. changes size of font.
  • <p> new paragraph
  • <body>Body of the whole html doc
  • <a> and the href attribute the and href are for adding URL's
  • <img> and the src attribute image and the src-Specifies the path to the image
  • <div> -element defines a division or a section in an HTML document.
  • <section>
  • <ul>, <ol>, and <li> unorderd list, ordered list and list information. Determine if you need lists or not.
  • <form>
  • <input>

CSS

  1. What is CSS? Cascading style sheet-With CSS, you can control the color, font, the size of text, the spacing between elements, how elements are positioned and laid out, what background images or background colors are to be used, different displays for different devices and screen sizes, and much more!
  2. What is a CSS selector?The selector points to the HTML element you want to style. Simple selectors (select elements based on name, id, class) Combinator selectors (select elements based on a specific relationship between them) Pseudo-class selectors (select elements based on a certain state) Pseudo-elements selectors (select and style a part of an element) Attribute selectors (select elements based on an attribute or attribute value) How do you use the ID selector?- The id selector uses the id attribute of an HTML element to select a specific element. The id of an element is unique within a page, so the id selector is used to select one unique element! To select an element with a specific id, write a hash (#) character, followed by the id of the element. The class selector?-The class selector selects HTML elements with a specific class attribute. To select elements with a specific class, write a period (.) character, followed by the class name.
  3. What are the three ways to include CSS in your HTML documents? 1.Inline - by using the style attribute inside HTML elements 2.Internal - by using a <style> element in the section 3. External - by using a element to link to an external CSS file What are the pros and cons of each?Inline changes the elements referenced adn can easily be changed. Internal can do the whole body of work. External access to different resources but lack stability. no control over them.
  4. What is the Box Model? Describe each component of the Box Model. In CSS, the term "box model" is used when talking about design and layout.

The CSS box model is essentially a box that wraps around every HTML element. Content - The content of the box, where text and images appear Padding - Clears an area around the content. The padding is transparent Border - A border that goes around the padding and content Margin - Clears an area outside the border. The margin is transparent

SQL

Jumpstart Lab Tutorial

  1. What is a database? a storage for data that isn't normally visible
  2. What is SQL?Structured Query Language is how we interact with most databases.
  3. What is SQLite3?SQLite: Great for experiments and local development, never use in production
  4. What is a Table?data structure for organizing the data
  5. What is a primary key?A primary key is a column or group of columns used to identify the uniqueness of rows in a table. Each table has one and only one primary key.
  6. What is a foreign key? is a field (or collection of fields) in one table, that refers to the PRIMARY KEY in another table.
  7. Explain what each of the following SQL commands do:
  • insert add a colum
  • select We use the SELECT command to find rows in the table. Specifically, here we said SELECT * which means "find all the data/columns". Then FROM fruits means to look in the table named fruits.
  • where The WHERE limits the returned rows to only those with the specified attribute matching.
  • order by Be default data will be output in the order it was inserted, but you can’t count on that. If order matters to you, you need to add an ORDER BY clause:
  • inner join In effect, a JOIN is like creating a new table composed of two of more other tables. The data is aligned/connected based on the ON criteria.

PG Exercises

  1. How can you limit which columns you select from a table? using the select and from
  2. How can you limit which rows you select from a table? using slect and desingating which row of information you want
  3. How can you give a selected column a different name in your output?
  4. How can you sort your output from a SQL statement? using different features ie..max
  5. What is joining? When do you need to join?The most commonly used kind of join is the INNER JOIN. What this does is combine two tables based on a join expression -
  6. What is an aggregate function?The basic idea of an aggregate function is that it takes in a column of data, performs some function upon it, and outputs a scalar (single) value. There are a bunch more aggregation functions, including MAX, MIN, SUM, and AVG. These all do pretty much what you'd expect from their names :-).
  7. List three aggregate functions and what they do. The MIN() function is an example of a Scalar Aggregate i.e returns one value. 2.vice versus Max()3.GetDate() is a scalar function and returns one value.
  8. What does the group statement do?What this does is batch the data together into groups, and run the aggregation function separately for each group. When you specify a GROUP BY, the database produces an aggregated value for each distinct value in the supplied columns.
  9. How does the group statement relate to aggregates?The word group is sometimes confused with the word aggregate. An aggregate is a collection of people who happen to be at the same place at the same time but who have no other connection to one another. Example: The people gathered in a restaurant on a particular evening are an example of an aggregate, not a group.

Rails Tutorial: Task Manager

Copy and Paste the link to your Task Manager repo here: https://github.com/James-E-White/task_manager Copy and Paste the link to your Static Challenge here: https://github.com/James-E-White/static_challenges

  1. Define CRUD. Create read update and delete/destroy
  2. Define MVC.Model View and Controller. Model is data the controller retrieves and the user than Views
  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/ The index you are calling tasks on and the controller for the method.
  4. What are params? Where do they come from? It’s a method that returns an ActionController::Parameters object, in practice it behaves a lot like a hash. params are the information you have given.
  5. Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task?One to create and the second to edit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment