1 / 18

Creating Databases for Web Applications

Dive into creating databases, managing session variables, and understanding big data in web applications. Explore algorithms and net neutrality while tackling basic projects and assignments. Learn through hands-on homework and practical examples. Study the essentials like SQL SELECT, WHERE conditions, ON conditions, GROUP BY, and more. Harness the power of sessions for persistent data on web pages using PHP. Discover the world of big data and its impact on technology and society. Uncover data collection and analysis concepts with real-world examples.

fblair
Download Presentation

Creating Databases for Web Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Creating Databases for Web Applications Session variables Big Data. Algorithms. Net Neutrality. Decide on basic projects assignments. Homework: Start work on basic assignments. Read articles and find at least one other.

  2. SELECT • Study Course Announcement on Pop Quiz. • Read for the process of coming up with the answer…how many tables? What are conditions on individual records? These are the WHERE conditions. Assuming more than one table, what is (are) the ON condition(s) ? Is there any GROUPing (aka aggregation)? Are there condition(s) on the groups? Is there any ORDERing? • Study one or more of sources found by you and your class mates. • Review use of SELECT in examples. • Study examples even if you already picked the one you will enhance.

  3. Sessions • Way to have persistent information for just the session for multiple pages • Alternative is to send information via hidden inputs in form or directly composed query string. • Kept on server computer, not client computer. • In place of cookies (but does use a cookie or http header) • $_SESSION will be an associative array for key/value pairs. • REQUIREMENT that the session_start(); call be before anything is sent to the browser. • This includes any HTML outside (before) the php delimiter! • http://students.purchase.edu/jeanine.meyer/sessionTest.html

  4. Sessions demo • sessionTest.html • sessionTest1.php • sessionTest2.php • sessionEnd.php • Also demonstrates foreach construction for associative array. • NOTE: I know the elements in the sessions array and there are just 2, but this is a good way for situations with more and/or unknown key values.

  5. sessionTest.html <!DOCTYPE html><html><head> <title>Session demo </title></head> <body> <form action="sessionTest1.php"> Name: <input type=text name='cname'> <input type=submit value="SUBMIT"> </form> </body>

  6. sessionTest1.php <?php session_start(); print ("This is just a test for session variables. <br>"); $_SESSION['customer'] = $_GET['cname']; $_SESSION['visits'] = 1; print("Hello, " . $_SESSION['customer']); print(" <br> This is visit number " . $_SESSION['visits']); print("<br> <a href='sessionTest2.php'>GO TO NEXT PAGE </a>"); ?>

  7. sessionTest2.php <?php session_start(); print ("demonstrating session variables<br>"); print ("Hello, " . $_SESSION['customer'] ); $visits = $_SESSION['visits']; $visits = $visits + 1; print ("This is visit number $visits"); $_SESSION['visits'] = $visits; print ("<br> <a href='sessionTest2.php'>REPEAT </a> OR <br>"); print ("<a href='sessionTest.html'>START OVER </a> OR <br>"); print ("<a href='sessionEnd.php'>END SESSION</a>"); ?>

  8. sessionEnd.php <?php session_start(); print ("Session information was <br>"); if ($_SESSION!="") foreach ($_SESSION as $key=>$val) { print ("$key was $val <br>"); } session_unset(); session_destroy(); ?>

  9. Big Data • buzz term, mixed meanings • also Smart technology, Smarter Cities, etc… • Volume, velocity, variability • Format of data can be key-value pairs, parallel structures, XML, or tables • Also, sometimes used in reference to any use of data, aka analytics, represented by Nate Silver combining polls + regression analysis to predict voting in elections

  10. What is the data? • Data can be collected by an organization • This is the case with the main subject matter of this course: organization creates and manages data in standard (relational) database. • OR gathered from variety of sources, some sources may not be [that] well-defined or complete • "Everything is trying to tell you something" • But what? Correlation is not causation but it may not matter.

  11. Articles in popular press • NPR story: http://www.npr.org/2013/03/07/173176488/the-big-data-revolution-how-number-crunchers-can-predict-our-lives?ft=3&f=111787346&sc=nl&cc=es-20130310 • New York Times article: http://www.nytimes.com/2012/12/02/magazine/who-do-online-advertisers-think-you-are.html?pagewanted=all • "I am the product not the customer…"

  12. More • All Google data, but gathered uncontrolled process: • http://www.nytimes.com/2014/12/24/upshot/trending-holiday-gift-searches.html • About job hunting: http://www.pbs.org/newshour/making-sense/ask-headhunter-big-data-hr-means-big-problems-job-seekers/

  13. More • Book reviews: • Big Data http://online.wsj.com/article/SB10001424127887324178904578342234223307970.html#printMode • To Save Everything, Click Herehttp://tomslee.net/2013/03/evgeny-morozovs-to-save-everything-click-here.html • Government proposals: https://www.whitehouse.gov/the-press-office/2015/01/12/fact-sheet-safeguarding-american-consumers-families

  14. Algorithms … used for decision making • College acceptance • Jobs • Sentencing, parole • Populations to market to • For loans • Decisions on loans • What else?

  15. Basis of (for) Algorithms • May be data, "Big", otherwise • Training set • Sample • ? • Potential for problems in the data

  16. Responses • Weapons of Math Destruction by Cathy O'Neal • May be articles, blog • Response from ACM (computing professional society) • http://faculty.purchase.edu/jeanine.meyer/db/2017_usacm_statement_algorithms.pdf

  17. Net Neutrality • What does this mean? • For you, for companies, for potential for growth & innovation • What is status as of today?

  18. Classwork / Homework • Finalize teams • One team member makes posting confirming team members • Read articles cited or find your own, for example, recent article on use of Algorithms for decision making or Net Neutrality. • Report on moodle (Introductions, etc. forum) • Take an informed position

More Related