Skip to content

Instantly share code, notes, and snippets.

@PhilipDeFraties
Last active August 15, 2020 17:32
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 PhilipDeFraties/74738e95c51be70fc27007ae8d5e12e8 to your computer and use it in GitHub Desktop.
Save PhilipDeFraties/74738e95c51be70fc27007ae8d5e12e8 to your computer and use it in GitHub Desktop.
Module 2 Intermission Work
B2 Intermission Work
Answer these Check for Understanding questions as you work through the assignments.
HTML
What is HTML?
HTML stands for Hyper Text Markup Language, HTML is the standard markup language for creating Web pages, HTML describes the structure of a Web page
What is an HTML element?
HTML elements tell the browser how to display the content, HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc. An HTML element is defined by a start tag, some content, and an end tag
What is an HTML attribute?
An attribute is an extra bit of information about elements that are contained within their start tags.
What is the difference between a class and an id? When would you use one vs. the other?
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
What HTML would you write to create a form for a new dog with a "name" and an "age"?
A class?
What are semantic tags? When would you use them over a div?
A semantic element clearly describes its meaning to both the browser and the developer.
Explain what each of the following HTML tags do and when you would use them:
<h1>, <h2>, etc.
Headings, numbers indicate relative size
<p>
Defines a paragraph
<body>
The <body> element defines the document's body.
<a> and the href attribute
The <a> tag defines a hyperlink. The href attribute specifies the URL of the page the link goes to.
<img> and the src attribute
The <img> tag is used to embed an image in an HTML page. The src attribute specifies the path to the image to be displayed.
<div>
The <div> tag defines a division or a section in an HTML document.
The <div> tag is used as a container for HTML elements - which is then styled with CSS or manipulated with JavaScript.
The <div> tag is easily styled by using the class or id attribute.
Any sort of content can be put inside the <div> tag!
<section>
The <section> tag also supports the Global Attributes in HTML.
The <section> tag also supports the Event Attributes in HTML.
The <section> tag defines a section in a document.
<ul>, <ol>, and <li>
The <ul> tag defines an unordered (bulleted) list.
Use the <ul> tag together with the <li> tag to create unordered lists.
For ordered lists, use the <ol> tag.
<form>
The <form> tag is used to create an HTML form for user input.
<input>
The <input> tag specifies an input field where the user can enter data.
The <input> element is the most important form element.
The <input> element can be displayed in several ways, depending on the type attribute.
CSS
What is CSS?
CSS stands for Cascading Style Sheets.
What is a CSS selector? How do you use the ID selector? The class selector?
A selector is a pattern to target specific elements from the HTML, the selector points to the HTML element you want to style.
What are the three ways to include CSS in your HTML documents? What are the pros and cons of each?
Inline: Included within an element modifying only that element.
Internal: Defines style for entire page.
External: Style sheet that can be shared by multiple pages.
What is the Box Model? Describe each component of the Box Model.
The model by which HTML layout can be thought of as, a series of boxes wrapped around each other designating areas for margins, borders, padding, and the actual content.
SQL
Jumpstart Lab Tutorial
What is a database?
A database is a means of storing, fetching, calculating, and sorting data
What is SQL?
Structured Query Language, the language that allows for interaction with databases.
What is SQLite3?
THe built-in version of SQLite on macs, a basic database engine useful for experimentation and local development.
What is a Table?
Organized data collection structured by user.
What is a primary key?
The key by which sets of info are cataloged within a table, can be auto-incrementing.
What is a foreign key?
An id that can connect a set of info on one table to a set of info on a different table.
Explain what each of the following SQL commands do:
insert
Adds a set of info to an existing table.
select
Returns info from a field or the field itself as per parameter.
where
Used as a limiting parameter for info accession.
order by
Allows the order in which info is returned to be altered via parameter.
inner join
Allows two tables to be connected.
PG Exercises
How can you limit which columns you select from a table?
select name, membercost from cd.facilities;
How can you limit which rows you select from a table?
select * from cd.facilities where membercost > 0;
How can you give a selected column a different name in your output?
Select from a table via specification and use the `update` function to change the value.
How can you sort your output from a SQL statement?
Sort by numerical or alphabetical values using the `order by` function.
What is joining? When do you need to join?
Joining is combining info from specific columns from multiple tables with shared id's.
What is an aggregate function?
Takes in a column of data, performs some function upon it, and outputs a scalar (single) value.
List three aggregate functions and what they do.
`count` - returns number of rows
`max` - returns largest value
`sum` - adds together everything in the slots column
What does the group statement do?
Batch the data together into groups.
How does the group statement relate to aggregates?
It runs the aggregation function separately for each group.
Rails Tutorial: Task Manager
Copy and Paste the link to your Task Manager repo here:
https://github.com/PhilipDeFraties/Task_Manager
Copy and Paste the link to your Static Challenge here:
https://github.com/PhilipDeFraties/static_challenges
Define CRUD.
Acronym for possible interactions between a user and a database. Create, Retrieve, Update, Delete.
Define MVC.
Acronym for model/architecture of interaction pattern between user and database. Model, View, Controller.
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.
app/controllers/tasks_controller.rb
app/models/task.rb
config/routes.rb
What are params? Where do they come from?
Params are objects that hold information, they are generated via GET request/posts
Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task?
I don't really understand why.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment