Creating Databases for Web applications

Slides:



Advertisements
Similar presentations
Introduction to Structured Query Language (SQL)
Advertisements

Introduction to Structured Query Language (SQL)
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Module 3: Table Selection
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
Creating Databases for Web Applications Work session Open Source versus Proprietary important topics HW: finish* projects. Look at final quiz guide. Final.
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)
Other formats for data Linked lists, Hash tables, JSON, Big Data, Hadoop & MapReduce. REST. Parallel processing exercise Homework: Plans for group sorting.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
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.
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 SQL. XML. Linked Lists. NoSQL. Homework: Keep working on projects. Post constructive feedback on other projects.
Creating Databases for Web Applications 3-Tier. Design vs Function vs Content. More SQL. More php. Homework: work on final projects.
Grouping Robin Burke ECT 360. Outline Extra credit Numbering, revisited Grouping: Sibling difference method Uniquifying in XPath Grouping: Muenchian method.
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 Database Programming with Python Gary Stewart
Understanding Core Database Concepts Lesson 1. Objectives.
Web Database Programming Using PHP
JavaScript, Sixth Edition
Confirm teams. Review of diagrams. SELECT problems.
Query Methods Simple SQL Statements Start ….
Tables & Relationships
CSE 103 Day 20 Jo is out today; I’m Carl
Module 11: File Structure
CS320 Web and Internet Programming SQL and MySQL
Creating Databases Local storage. join & split
CHAPTER 7 DATABASE ACCESS THROUGH WEB
Chapter 2: Relational Model
Indices.
Information Systems Today: Managing in the Digital World
Web Database Programming Using PHP
Creating databases for web applications
Entity-Relationship Model
Relational Databases.
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Application with Cross-Platform GUI
Introduction to Database Systems
SQL: Advanced Options, Updates and Views Lecturer: Dr Pavle Mogin
NOSQL databases and Big Data Storage Systems
Microsoft Access 2003 Illustrated Complete
Database Management  .
Database Processing with XML
Databases.
Relational Algebra Chapter 4, Part A
Introduction to Ms-Access Submitted By- Navjot Kaur Mahi
Databases and Information Management
ORACLE SQL Developer & SQLPLUS Statements
Chapter 8 Working with Databases and MySQL
CS4222 Principles of Database System
Developing a Model-View-Controller Component for Joomla Part 3
Semi-Structured data (XML Data MODEL)
Data Model.
CMPT 354: Database System I
Databases and Information Management
INFO/CSE 100, Spring 2006 Fluency in Information Technology
Flat Files & Relational Databases
Database Applications
Advanced Database Concepts: Reports & Views
Relational Database Design
CS3220 Web and Internet Programming SQL and MySQL
Addressing confidentiality issue in third party xml publication
CS3220 Web and Internet Programming SQL and MySQL
Databases and Information Management
Databases This topic looks at the basic concept of a database, the key features and benefits of a Database Management System (DBMS) and the basic theory.
Understanding Core Database Concepts
Presentation transcript:

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

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 <book isbn="978-1-4302-4032-7"> <type value="nonfiction"> <subtype value="computing"/> <level value="professional"/> </type> <title>HTML5 and JavaScript Projects</title> <publisher> <pname>Apress</pname> <website>www.apress.com</website> </publisher> </book> 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?

Example 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 1 -1 Anne 3 2 Jeanine 4 -1 David -1 5 Daniel 7 6 Tom 9 8 Aviva -1 -1 Annika -1 -1 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 r_id id for Esther id for Jeanine mother r_id id for Esther id for Anne mother ….

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

NoSQL Alternatives to SQL MongoDB http://www.mongodb.org/display/DOCS/SQL+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 ExtractValue(xml_text,'/person[@id="3"]/firstname') 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','<age>30</age>') WHERE row_id=10 These can be used in direct MySQL coding including coding to be saved as STORED PROCEDURE.

SQL injection What if dtext was 50 then 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.