Using transact-SQL and simulation techniques to create virtual M&M'S
Robin M. Snyder · Journal of computing sciences in colleges · 2002
The M&M problem is an example of a nontrivial yet simple method for summarizing sampled data that are then used in making decisions. Previous work by the author used client-side JavaScript and Active Server Pages to create virtual M&M's. This paper moves the generation of the virtual M&M's to a SQL Server database server. In doing so, a number of interesting and practical problems in database design and implementation are explored. In particular, the use of the programming language Transact-SQL as used in SQL Server is used to create and test a database stored procedure to generate the requested M&M's and store them in a database table structure to be used by the requesting program. As such, the paper serves as a short introduction to database design as might be used in experimental data collection applications, programming in Transact-SQL and SQL as can be used with Query Analyzer, and in simulating discrete events.