Creating Databases for Web applications SQL. XML. Linked Lists. NoSQL. Homework: Keep working on projects. Post constructive feedback on other projects.

Slides:



Advertisements
Similar presentations
What is a Database By: Cristian Dubon.
Advertisements

Keys, Referential Integrity and PHP One to Many on the Web.
Chapter 12 Information Systems Chapter Goals Define the role of general information systems Explain how spreadsheets are organized Create spreadsheets.
Introduction to Structured Query Language (SQL)
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
Introduction to Structured Query Language (SQL)
Introduction to Structured Query Language (SQL)
Getting Started Chapter One DATABASE CONCEPTS, 7th Edition
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Concepts of Database Management Sixth Edition
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Creating Databases SELECT. UPDATE. Demonstrate projects. Classwork / Homework: Prepare to choose teams & projects.
Module 3: Table Selection
ASP.NET Programming with C# and SQL Server First Edition
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
Creating Databases for Web Applications Work session Open Source versus Proprietary important topics HW: finish* projects. Look at final quiz guide. Final.
Relational Database Concepts. Let’s start with a simple example of a database application Assume that you want to keep track of your clients’ names, addresses,
Creating databases for web applications SQL. Systems design. ER diagrams. Data flow diagrams. Storyboards. Homework: Plan database and applications for.
1 MySQL and phpMyAdmin. 2 Navigate to and log on (username: pmadmin)
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
Other formats for data Linked lists, Hash tables, JSON, Big Data, Hadoop & MapReduce. REST. Parallel processing exercise Homework: Plans for group sorting.
CHAPTER 8: MANAGING DATA RESOURCES. File Organization Terms Field: group of characters that represent something Record: group of related fields File:
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
CSC 405: Web Application And Engineering II7.1 Database Programming with SQL Aggregation and grouping with GROUP BY Aggregation and grouping with GROUP.
Chapter 6 1 © Prentice Hall, 2002 The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited) Project Identification and Selection Project Initiation.
Chapter 6 SQL: Data Manipulation (Advanced Commands) Pearson Education © 2009.
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
1 Design Issues in XML Databases Ref: Designing XML Databases by Mark Graves.
Dimu' Rumpak © 2009 by Prentice Hall 1 Getting Started Didimus Rumpak, M.Si. Database Concepts Chapter 1 1.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Creating Databases Local storage. join & split Classwork: show 1 table application. Share designs for oscars application. Adaptive select. Homework: [Catch.
Creating Databases for web applications [Complete presentations] More SQL Class time: discuss final projects. Do posting if you have not done it.
6.1 © 2010 by Prentice Hall 6 Chapter Foundations of Business Intelligence: Databases and Information Management.
The Digital Archive Database Tool Shih Lin Computing Center Academia Sinica.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Creating Web Documents catch-up JavaScript slide show tools redirection.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Aliya Farheen October 29,2015.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
Computing & Information Sciences Kansas State University Friday, 20 Oct 2006CIS 560: Database System Concepts Lecture 24 of 42 Friday, 20 October 2006.
Creating Databases for Web Applications 3-Tier. Design vs Function vs Content. More SQL. More php. Homework: work on final projects.
CPSC 203 Introduction to Computers T97 By Jie (Jeff) Gao.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
Grouping Robin Burke ECT 360. Outline Extra credit Numbering, revisited Grouping: Sibling difference method Uniquifying in XPath Grouping: Muenchian method.
Databases Flat Files & Relational Databases. Learning Objectives Describe flat files and databases. Explain the advantages that using a relational database.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 4: Intermediate.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Introduction to Business Information Systems by Mark Huber, Craig Piercy, Patrick McKeown, and James Norrie Tech Guide D: The Details of SQL, Data Modelling,
Lec-7. The IN Operator The IN operator allows you to specify multiple values in a WHERE clause. SQL IN Syntax SELECT column_name(s) FROM table_name WHERE.
Creating Databases for Web applications Making a table of table information. Reprise on database design. SQL. Classwork/Homework: Projects! Postings.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
Introduction to Database Programming with Python Gary Stewart
Creating Databases for Web applications
Confirm teams. Review of diagrams. SELECT problems.
Module 11: File Structure
Creating Databases Local storage. join & split
Chapter 2: Relational Model
Indices.
Entity-Relationship Model
Chapter 8 Working with Databases and MySQL
Flat Files & Relational Databases
Presentation transcript:

Creating Databases for Web applications SQL. XML. Linked Lists. NoSQL. Homework: Keep working on projects. Post constructive feedback on other projects.

SQL UNION Assume a database with table for full-time faculty and another table for part-time faculty. –Reasons not to do this: some overlap of fields. –Reasons to do this: most processing involves just one or the other. Why have optional fields? Why waste space? SQL UNION can be used when application calls for information from both tables.

SELECT UNION SELECT column_name(s) FROM table_name1 UNION SELECT column_name(s) FROM table_name2 SELECT fname, start_date FROM faculty WHERE start_date < 2005 UNION adjname, start_date FROM adjuncts WHERE start_date < 2005 –NOTE: the start_date expression may be wrong…

SELECT …. BETWEEN Can combine two tests using the BETWEEN operator SELECT department, COUNT(*) as c FROM students GROUP BY department HAVING c BETWEEN 5 AND 10 SELECT department, COUNT(*) as c FROM students GROUP BY department HAVING c >= 5 AND c<=10.

SELECT … BETWEEN Assume table with fields that hold dates. SELECT * FROM orders WHERE orderdate BETWEEN '7/20/08' AND '8/05/08'; –Need to research date and date/time 'arithmetic'

Classwork Consider customers (cid, cname, zipcode), products (pid, pname, price), orders (oid,cid,date), orderedproducts (opid, oid, pid, quantity) example. Generate list of zipcodes with total number of orders. Generate list of product names, with total ordered for each zipcode Generate list of customers who had orders made in the summer of ?

Hints Decide on tables needed –Some fields in some tables, maybe even all the fields in some tables, may not be part of the result. They are needed to make up the JOINed table to obtain the results. –Generally, how tables are JOINed, the ON conditions is fixed Decide on WHERE conditions. These are conditions on individual records. Decide if any GROUP operations: any aggregations –NOTE: DISTINCT also does an aggregation Decide if any HAVING conditions: conditions on aggregated results Decide on any functions, e.g., COUNT(*)

XML Template for a structured form of data, namely tree: –nodes and child nodes –attributes –text content Note: some call this semi or partially structured –some elements may NOT have all attributes or child nodes Developers create and agree on structure Intended for use by different applications JavaScript, php, other languages have built-in methods. Human readable Not particularly compact, nor speedy in terms of processing. –A [long] text field is read in and interpreted. Generally, a copy of the XML file is generated and sent to be used by an application.

XML example HTML5 and JavaScript Projects Apress I made all this up. There probably exist more than one XML schema for books.

More… Many technologies/standards around XML, including ways to specify definitions, do queries, etc. Posting opportunity….

Question? What are uses for XML?

Class work Define XML for corporate 'family' tree –a company can have subsidiaries –decide on the information in attributes in element contents in child elements

Linked lists Example [You may have worked on this in Data Structures.] Multiple ways. This is one way. Information is parent and children Data contained in one big array of arrays Each component array is [name, index first child, index next sibling] Use -1 to indicate no child or no next sibling.

My family ignore in-laws…. one parent for each child 0 Esther Anne 3 2 2Jeanine David Daniel 7 6 5Tom 9 8 6Aviva Annika Note: other orders would be valid

Your family Leave out a parent and in-laws OR come up with alternative –One possibility is to include all half/step siblings or –Another possibility is to add fields for siblings from the father versus siblings from the mother –OR ???

Contrast with Relational Database Tables, records, fields with some fields indicating relationships, i.e., pointing to records using primary key as the foreign key Commercial products and open source products (MySQL) store data efficiently, perform operations quickly, provide many functions. DBMS also holds the data itself. One copy of information is maintained and accessed by the different applications.

Relational Database family Two tables People and relationships Relationships have fields for two people PLUS label for relationship. Allow multiple relationships.

My family: people table Esther Anne Jeanine Daniel Aviva David Tommy Debbie Annika Liam Grant Allison …

My family: relationships 1.r_id id for Esther id for Jeanine mother 2.r_id id for Esther id for Anne mother 3.….

Your family Write out at least 5 family members and at least 5 relationships…

NoSQL Alternatives to SQL MongoDB QL+to+Mongo+Mapping+Charthttp:// QL+to+Mongo+Mapping+Chart

Key-value pairs The data is a set of key-value pairs –The input values passed from a form to a php file –Associative array Options to set up map using Google Maps API They may or may not be unique, that is, a specific key may have more than one value

Parallel structures Recall simple states capitals quiz May have more than 2 arrays of corresponding data

So…. You may come into a situation with this question already resolved. Data exists in some form already OR your teacher says use this… OR you need to decide Parallel structures? Key-value? Does the tree structure suit the data? Or would tables be better? Is the place of the data important or sending copies around okay, even appropriate –read-only most of the time? ?

XML in a database A field in the table is suitable for XML data Can use a long text datatype called BLOB MySql stores and returns the text.

MySQL XML functions These use a special language called XPATH to indicate how to interpret the XML. EXTRACTVALUE –SELECT EXTRACTVALUE(fieldname,XPATH expression) FROM tablename SELECT as fname FROM my_table WHERE row_id=10 –The resultset reflects the results! UPDATEXML –UPDATEXML(fieldname,XPATH expression indicating replacement in places where there are matches, replacement text) UPDATE my_table SET xml_text = UpdateXML(xml_text,'//age',' 30 ') WHERE row_id=10 These can be used in direct MySQL coding including coding to be saved as STORED PROCEDURE.

SQL injection Technique by which malicious user enters input that can change result of SQL statement. Say a piece of text, dtext, is taken to be the id field for all records to be deleted from the database. The assumed usage is that it is just one id. –What if dtext was 50 then DROP FROM customers WHERE id=dtext would drop record with id 50 –What if dtext was 0 or true then DROP FROM customers where id=50 or TRUE would drop everything There are techniques to prevent these (such as input=number) but they can be more complicated.

Extra credit opportunities NOT just a link. Read and report on what you learn. expressions involving DATE, TIMESTAMP, etc. stored procedures in general MySql standalone coding XML in MySQL NoSQL or MongoDB Hadoop SQL injection Ajax Cloud computing ???

Homework Keep working on final projects. Post on topics mentioned (SQL injection, NoSQL, etc.) Post constructive feedback on other projects to their posting on Proposals forum.