department of computer science james madison university
TRANSCRIPT
![Page 1: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/1.jpg)
Learning Relational Algebra by Snapping Blocks
Jason Gorman, Sebastian Gsell, Chris Mayfield
Department of Computer ScienceJames Madison University
SIGCSE 2014
![Page 2: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/2.jpg)
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
![Page 3: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/3.jpg)
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
![Page 4: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/4.jpg)
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
![Page 5: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/5.jpg)
PROBLEM
How do we make theory more hands-on?
![Page 6: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/6.jpg)
Tools of the trade
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 6 of 13
![Page 7: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/7.jpg)
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
![Page 8: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/8.jpg)
MAIN IDEA
Block environment for manipulating data!
![Page 9: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/9.jpg)
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
![Page 10: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/10.jpg)
A quick tour of Bags
http://bags.cs.jmu.edu/
SIGCSE 2014 Learning Relational Algebra by Snapping Blocks 10 of 13
![Page 11: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/11.jpg)
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
![Page 12: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/12.jpg)
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
![Page 13: Department of Computer Science James Madison University](https://reader033.vdocument.in/reader033/viewer/2022042702/62655399f9f1e439bd5e03f4/html5/thumbnails/13.jpg)
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