Answer these Check for Understanding questions as you work through the assignments.
- What is HTML? HTML is a markup language. This means that it turns content and data into something visual. It describes the structure of a webpage.
- What is an HTML element? A string of text that tells the program what piece of content it needs to display
- What is an HTML attribute? They provide additional information about an element. Defined inside the element's start tag.
- What is the difference between a class and an id? When would you use one vs. the other? A class can be used by multiple elements in html code while an id can only be used by 1.
- What HTML would you write to create a form for a new dog with a "name" and an "age"?
<!DOCTYPE html>
<html>
<body>
<h2>Dog Form</h2>
<form action="/action_page.php">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name" value="Sprinkles"><br>
<label for="age">Age:</label><br>
<input type="text" id="age" name="age" value="4"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>- 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. A div is used to create a block element. - Explain what each of the following HTML tags do and when you would use them:
<h1>,<h2>, etc.- headers
<p>- pargraphs for a lot of text
<body>- everything inside the main section of a webpage
<a>and thehrefattribute- This tag defines a link that needs to be accessed
<img>and thesrcattribute- This tag fetches an image that can be displayed
<div>- This is a block element that wraps text in a block.
<section>- This tag splits different components of your webpage into multiple sections.
<ul>,<ol>, and<li>- These are used to write out lists like bullet points or 1, 2, 3 ordered list
<form>- Used to create submittable forms where users input data
<input>- This tag is used to receive an input from a user
- What is CSS? CSS defines the style of a webpage. You can use multiple styles for the same html code
- What is a CSS selector? How do you use the ID selector? The class selector?
A selector selects the html element you want to style.
.classselector {...,#idselector {... - What are the three ways to include CSS in your HTML documents? What are the pros and cons of each? First: External CSS (pros: all styling is in one place, cons: if html needs specific style, you cant define it with a given html element) Second: Internal CSS (pros: if html needs specific styling, you can use this, cons: cant be used for multiple html documents.) Third: Inline CSS (pros: An inline style may be used to apply a unique style for a single element, cons: can only be used on 1 element)
- What is the Box Model? Describe each component of the Box Model. The box model is a structure for boxes or rectangles in css. The 4 components are content, padding, border and margin. The padding is the spacing between the content and the border. The margin is the spacing between the border and everything outside it.
-
What is a database? A database is just a collection of data that you can read and write from. It does not have any function besides storage
-
What is SQL? SQL is a language to interact with a database
-
What is SQLite3? SQLite3 is an interactive CLI that developers use to help them with SQL, similar to pry or irb
-
What is a Table? Data of rows and columns
-
What is a primary key? The id of a row of the table being read from
-
What is a foreign key? The id of a row of a table outside of the one being read from
-
Explain what each of the following SQL commands do:
- insert
- inserts a row of data into a tabke
- select
- reads data from a table
- where
- paramater for reading data
- order by
- another parameter for reading data
- inner join
- returns rows based on criteria from multiple tables
- How can you limit which columns you select from a table?
limit INT; - How can you limit which rows you select from a table?
SELECT column FROM table WHERE boolean - How can you give a selected column a different name in your output?
SELECT column AS new_name FROM table - How can you sort your output from a SQL statement?
SELECT * FROM table ORDER BY argument - What is joining? When do you need to join?
joining is when you are relating data from seperate tables based on a certain column. You need to do this if you need to calculate something that requires data from multiple tables - What is an aggregate function?
a function that performs a calculation on a set of values - List three aggregate functions and what they do.
sum: adds up values
count: counts how many rows meet a condition
avg: returns average of a collection of values
-
What does the
groupstatement do? -
How does the
groupstatement relate to aggregates?
- https://github.com/jacksonvaldez/task_manager
- https://github.com/jacksonvaldez/static_challenges
- Define CRUD. Create, Retrieve, Update, Delete. These are methods to interact with a database
- Define MVC. MVC is a very broad structure of a typical web framework. (Model, View, Controller).
- What three files would you need to create/modify for a Rails application to respond to a
GETrequest to/tasks, assuming you have aTaskmodel.app/controllers/tasks_controller.rbapp/views/tasks/action_name.html.erbapp/models/task.rbconfig/routes.rb - What are params? Where do they come from? params is information that comes with a request. A good anology: the information the waitress wrote down on their notepad for your sandwich order is the params.
- Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task? different routes are needed to execute different actions of CRUD