Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Learning Relational Algebra by Snapping Blocks
Jason Gorman, Sebastian Gsell, Chris Mayfield
Department of Computer ScienceJames Madison University
SIGCSE 2014
What is an algebra?
Mathematical system consisting of:
I Operands: variables or values from whichnew values can be constructed
I Operators: symbols denoting proceduresthat construct the new values
These building blocks form expressions
What are some examples from arithmetic?
I [(x + 7)/(y − 3)] + x
What are some examples from set theory?
I R − (S ∪ T )
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 2 of 13
Overview of relational algebra
Formal notation for specifying queries
I DBMS translates SQL into relational algebra
Operands:
I Relations
I Constants (finite relations)
Operators:
I Set operations (union, intersection, difference)
I Selection and projection (remove tuples/attributes)
I Cartesian product and join (combine tuples)
I Renaming (change schema / copy relation)
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 3 of 13
Combining operations to form queries
Linear notation:
πtitle,year
(σlength≥100(Movies) ∩ σstudioName=‘Fox ′(Movies)
)Expression tree:
πtitle,year
∩
σlength≥100
Movies
σstudioName=‘Fox ′
Movies
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 4 of 13
PROBLEM
How do we make theory more hands-on?
Tools of the trade
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 6 of 13
Block based environments
Advantages [Maloney et al. 2010]
I Simplify the programming environment
I Encourage self-directed learning
I Making program execution visual
I Eliminating syntax error messages
I Making variables/data more concrete
Programming focus
I Object-oriented design
I Interactive media
I Simulation and games
I Mobile development
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 7 of 13
MAIN IDEA
Block environment for manipulating data!
Standing on the shoulders of . . .
Features
I Free and open source (AGPL 3.0)
I Works in the browser (JavaScript)
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 9 of 13
A quick tour of Bags
http://bags.cs.jmu.edu/
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 10 of 13
Bags architecture
Bags (blocks, gui, results)
Snap (blocks, gui, threads)
Morphic (canvas, framework)
JavaScript (dom, runtime)
Implemented via change sets
I See the paper for details
I Special thanks to Snap!
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 11 of 13
Moving forward
Additional features
I Bring your own data
I Load/save projects
I From blocks to Greek
Teaching materials
I Exercises and activities
I Scavenger hunt projects
Educational research
I Bags in DB courses
I Bags in CS0 / K-12
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 12 of 13
Summary
Bags allows you to
I manipulate data sets interactively
I experiment with relational operators
I practice computational thinking
I visualize mathematical concepts
Invitation: Build your own Bags!
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 13 of 13