Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAndrew Chalkley
Treehouse Guest TeacherDatabase Foundations Stage 7: SQL Calculating, Aggregating and Other Functions Launched
The latest stage of database foundations has been launched. It's called SQL Calculating, Aggregating and Other Functions.
SQL has various functions to perform arithmetic operations similar to what you would see in a spreadsheet application. Other functions help to group data together in more meaningful ways, while others help you do more complex filtering of your information.
Enjoy!
4 Answers
mahmoud saeed
14,071 PointsYesss! Ive already started. I have ran into a minor problem. I downloaded the add-on file for the database, but when I try to open it, I get an error that says it is not a workbench document.
Any suggestions?
Thanks!
Chase Lee
29,275 PointsYeah!
Richard Crawford-Wilson
6,094 PointsAndrew Chalkley , you know you're awesome right?
Andrew Chalkley
Treehouse Guest TeacherThanks Richard Crawford-Wilson! You are too!
Joss Daniels
59,875 PointsOn the videos I get NaN:NaN on the thing that usually shows the time of the video and I can't click through to certain parts of the videos?
Andrew Chalkley
Treehouse Guest TeacherIf it's still happening, send a screenshot to help@teamtreehouse.com and they'll help you out and look in to it.
Andrew Chalkley
Treehouse Guest TeacherAndrew Chalkley
Treehouse Guest TeacherCan you open it in Sublime or TextMate?
Does it start with...
Let me know.
Chase Lee
29,275 PointsChase Lee
29,275 PointsSame problem. Can't tell exactly but it look the same.
Andrew Chalkley
Treehouse Guest TeacherAndrew Chalkley
Treehouse Guest TeacherI just downloaded it and ran it. With no problems.
Do you have a specific error or a screenshot of your problem.
Chase Lee
29,275 PointsChase Lee
29,275 PointsHere it is.
Richard Crawford-Wilson
6,094 PointsRichard Crawford-Wilson
6,094 PointsIn your mysql workbench after opening the connection to your database (where you start queries) Do the following
File -> Open -> Open SQL Script. And then browse for the .sql file that was provided.
Additionally you can use the terminal to run the SQL script (which is better in my opinion for large scripts as it crashes the GUI less)
Using this command:
mysql -u root -p < path_to_script.sql
This will log you in as the root user, and ask for it's password, then it will execute the file you linked. Not sure if this works on windows, but should work on mac and linux just fine.
Richard Crawford-Wilson
6,094 PointsRichard Crawford-Wilson
6,094 PointsChase James You are opening a model file, Press Ctrl Shift O, or file -> open SQL script, NOT a model..
Chase Lee
29,275 PointsChase Lee
29,275 PointsWhen do I do that? The file stuff doesn't work here are my options.
Richard Crawford-Wilson
6,094 PointsRichard Crawford-Wilson
6,094 PointsChris James Double click on your localhost database to start querying. You want to be in the query editor, not in the main home page. Login to your database to the point where you would start writing SQL queries as you have done in past tutorials. You can then Open the SQL script in that screen.
Richard Crawford-Wilson
6,094 PointsRichard Crawford-Wilson
6,094 PointsEDIT: Meant to reference Chase James
Chase Lee
29,275 PointsChase Lee
29,275 PointsOkay. Tried it and worked. Thanks so much Richard Crawford-Wilson!