Creating a database
CREATE DATABASE db_name;
Deleting a database
DROP DATABASE db_name;
Creating a table:
| require 'pg' | |
| db_conn = PG.connect(dbname: 'shopping_db') | |
| result = db_conn.exec(string_of_sql) | |
| entry_as_hash = result[0] # yield a hash of the first row. | |
| Explain what BDD/TDD is and its benefits. Compare it to "cowboy coding. | |
| Explain what 'yield' does when called in a method | |
| Draw an ERD for the following app using proper notation. A user can have zero or many blog posts, and each blog post can have zero or many comments. | |
| Explain what a database is and why you would use one as opposed to other persistent storage mechanisms | |
| Explain what a foreign key is and why you would use one | |
| Give examples of use cases for Ruby's `.each`, `.select`, and `.map` methods. | |
| Explain what a database 'constraint' is | |
| What is a document outline? | |
| Compare and contrast arrays and hashes and when you would use each | |
| Explain what "auto-incrementing primary key" means for a database table |
##WDI Project 1
The students' first projects are their opportunity to apply everything that they've learned in their first month of WDI. What they've covered:
The students work invididually on a project of their own design. We stress development process and code quality, and we have implementation guidelines for the students to follow, all of which you can find below.
Git Workflow Ripest Tomatoes.
git clone <the_ssh_url> in your dev directorycd into the rails project and create a new branch branch with git branch <yourname>git checkout <yourname>git checkout master and pull from origin.git checkout <yourname>git rebase master| Shortcut | Command |
|---|---|
command + shift + p |
open command pallette |
command + left arrow |
move cursor to the beginning of current line |
command + right arrow |
move cursor to the end of current line |
command + up arrow |
move cursor to the top line of the file |
command + down arrow |
move cursor to the last line of the file |
command + multiple mouseclicks |
create multiple cursors within file |
option + mousedrag |
create multiple cursors along mousepath |
One of the most helpful tools when first learning to code is articulating in plain English what a puzzling piece of code does for you. This is because the act of researching and expressing the code's purpose in your own words helps ingrain that purpose in your mind. That said, your homework tonight is to identify the commands you used today and in your prework and mindfully break them down.
You're all adults with 20+ years of experience as learners, and you know your learning patterns best. Your first homework assignment is to examine the entirety of your learning history to identify your perceived strengths and weaknesses as a student, so you can make the most of your experience in WDI.
git remote add <repo_name> <branch_name> <ssh_clone_url> where <branch_name> is typically master and <repo_name> is whatever you choose, though it's common to call it origin.git remote -v