![]()
What does this return? Now run the same command with an id that is not in the database. In the Rails Console, run Task.find() where is the id of a Task in your database.Did it change? Is this what you expected? In the Rails Console, run task.update(description: "go buy food").What is the difference between new and create? Now what id do you see for the Task object? Do you see it stored in the Tasks table in Postico? If not try to refresh your table. Do you see your new Task? In the Rails Console, run task.save. What id do you see stored in the new Task object? Now open up the Tasks table in Postico. In the Rails Console, run task = Task.new(title: "Grocery Shopping", description: "need to eat").What SQL query do you see in the Rails Console after running this command? What does the create method do? Do you see your new Task? If not, try to refresh your table. In the Rails Console, run Task.create(title: "Laundry", description: "Clean the clothes").How does this compare to the SQL command you saw in the Rails Console? Is this what you would expect? What type of object is returned from this method call? What SQL query do you see in the Rails Console after running this command? Now run _sql. Now run tasks = Task.all in your Rails console. In TaskManager, open up the Rails console by running rails c from the command line (make sure that you navigate to your TaskManager repo first).First, open Postico and double check that you have deleted any tasks you made during the Postico Activity.Find all Tasks where the description contains the string “shop”.Retrieve all tasks sorted by title in reverse alphabetical order.If you complete the activity and answer the follow up questions, try to execute the following SQL queries: What is SQL? How does it relate to the DB?.How would you describe your task_manager_development database’s schema.How does a DB relate to web applications?.Compare and contrast a database with a collection of CSV files.Retrieve all Tasks with a title of “Laundry”.Open your task_manager_development database.You should be able to leave the other fields as default (other than “Nickname” - this is just an easier way to find this database after connecting to it). #POSTICO SINGLE SQL FILE FOR MULTIPLE DATABASES INSTALL#If not, download Postico and install it.Īfter launching Postico, be sure you can connect to your TaskManager database by filling in the “Database” field with task_manager_development. #POSTICO SINGLE SQL FILE FOR MULTIPLE DATABASES MOD#You should have installed Postico as part of the mod 2 intermission work. Use built in ActiveRecord methods to CRUD resources in the Rails Console.Describe what an ORM is and how it relates to the database.Define key database vocabulary including “table”, “column”, “row”, “primary key”, and “schema”.Describe what a database is and how it relates to web applications. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |