3 Sep 2016 • eugene
Today, we take our computational thinking further by working with loops.
Maze: Loops - Code.org, Course 1, Stage 13
Help the angry bird use repeat blocks to get the pigs! See if you can finish each step with a green dot - given for successful completion.
As before, our mentors will throw names into a hat, and pair-up the students. One student drives and one navigates. After each step, the students switch roles and work through the same step with a different Chrome user. Then move on to the next step.
We continue working through the MySQL database Sushi cards, Beginner Databases.
As before, students work in pairs. One drives and one navigates. After each card, the students switch roles and work through the same card using their own database (via the USE
command we discussed in last week's dojo). Then move on to the next card.
Below are some MySQL commands that may come in handy as you work through the Sushi cards.
You want your own database? No problem. There are a couple of ways to do this. The simple / safe way to rename a database is to copy it. For example, let's say I want to change the database name from CoderDojo
to Spongebob
:
Shell
button on the XAMPP Control Panel to launch the shell.mysqldump -u root CoderDojo > dump.sql
.mysql -u root
.create database Spongebob;
.use Spongebob;
.source dump.sql
.To change a table name from oldname
to newname
we can use the following command:
ALTER TABLE oldname RENAME newname;
Unfortunately, renaming a column forces us to replace it with a new column. For example, if we accidently created the Cartoons
table with carton_name varchar(50)
, we would fix it by using the following alter command:
ALTER TABLE `Cartoons` CHANGE `carton_name` `cartoon_name` varchar(50);
Note how we had to specify all the details for the column we replaced.