Creating databases for web applications

Slides:



Advertisements
Similar presentations
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Advertisements

Describing Process Specifications and Structured Decisions Systems Analysis and Design, 7e Kendall & Kendall 9 © 2008 Pearson Prentice Hall.
Chapter 4 Enterprise Modeling.
INFO 425 Week 31 INFO 425 Design Problem I Week 3 – SDS Improvements Glenn Booker.
Chapter 4.
Analyzing Systems Using Data Dictionaries Systems Analysis and Design, 7e Kendall & Kendall 8 © 2008 Pearson Prentice Hall.
SYSTEM ANALYSIS & DESIGN (DCT 2013)
Systems Analysis and Design 9th Edition
NMED 3850 A Advanced Online Design February 25, 2010 V. Mahadevan.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Further Data Modelling …and the effect of time. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis –Further.
1004INT Information Systems Week 10 Databases as Business Tools.
WELL-DESIGNED DATABASES Process faster Easy to develop and maintain Easy to read and write code.
Eyad Alshareef 1 Creating Custom Forms Part A. 2Eyad Alshareef Data Block and Custom Forms Data block form Data block form Based on data blocks that are.
Chapter 4.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Systems Analysis I Data Flow Diagrams
Database Constraints. Database constraints are restrictions on the contents of the database or on database operations Database constraints provide a way.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Database Systems Lecture 5 Natasha Alechina
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
System Analysis Overview Document functional requirements by creating models Two concepts help identify functional requirements in the traditional approach.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Creating Databases SELECT. UPDATE. Demonstrate projects. Classwork / Homework: Prepare to choose teams & projects.
Project Implementation for COSC 5050 Distributed Database Applications Lab2.
Systems Analysis and Design in a Changing World, Fifth Edition
C H A P T E R 4 Designing Database E-Commerce Hassanin M. Al-Barhamtoshy
Creating databases for web applications SQL. Systems design. ER diagrams. Data flow diagrams. Storyboards. Homework: Plan database and applications for.
Phase 2: Systems Analysis
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Section 11 : Normalisation
Creating Databases for Web applications Introductions & overview Administration Moodle HW: Sign on, register for course, introduce yourself on Moodle.
Your Name Here See Page Notes for Info about Hyperlinks.
Creating Databases for Web Applications Library diagrams Continue with diagrams for video clip archive and for (Flash) grid design. General and specific.
PHP meets MySQL.
2/6/01D-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Using PARTS to Illustrate Requirements Concepts.
ClientPoint ™ Data Entry Workflow. ClientPoint “The filing cabinet!” Search for existing clients, or add clients.
Creating Databases More SQL. Design. Original Project Assignment Homework: Post proposal. Continue with planning.
1 OPOL Training (OrderPro Online) Prepared by Christina Van Metre Independent Educational Consultant CTO, Business Development Team © Training Version.
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
Lecturer: Gareth Jones. How does a relational database organise data? What are the principles of a database management system? What are the principal.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Analyzing Systems Using Data Dictionaries Systems Analysis and Design, 8e Kendall.
Relational Database. Database Management System (DBMS)
Database Beginnings. Scenario so far In our scenario we have people registering for training sessions. –The data about the training sessions was placed.
Entity-Relationship (ER) Modelling ER modelling - Identify entities - Identify relationships - Construct ER diagram - Collect attributes for entities &
Next Back A-1 Management Information Systems for the Information Age Second Canadian Edition Copyright 2004 The McGraw-Hill Companies, Inc. All rights.
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.
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
Creating databases for web applications Library. New example: student database. Homework: Complete class example. Catch up on source postings. Do creation.
Create Databases for Web Applications Database normalization. Classwork/Homework: determine teams for basic projects explain and enhance assignment.
UML’s StateChart FSM, EFSM in UML Concurrent states Tool support.
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Systems Analysis and Design 8th Edition
Creating Databases for Web Applications 3-Tier. Design vs Function vs Content. More SQL. More php. Homework: work on final projects.
For more course tutorials visit CIS 336 All iLabs Week 1 to Week 7 Devry University CIS 336: All iLabs Week 1 to Week 7: Devry University.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S.
Confirm teams. Review of diagrams. SELECT problems.
Database Development Lifecycle
Creating Databases Local storage. join & split
Creating databases for web applications
Creating Databases SELECT. UPDATE. Demonstrate projects. Do not track.
Accounting System Design
Accounting System Design
Databases and Information Management
COMP 208/214/215/216 – Lecture 7 Documenting Design.
Grocery Store Outline csc242 – web programming.
Presentation transcript:

Creating databases for web applications New example: last lecture Systems design. ER diagrams. Data flow diagrams. Storyboards. Homework: Plan database and applications for a library: produce ERD and DFD

Added example Students: name, gpa, department Go to last lecture for code http://newmedia.purchase.edu/~Jeanine/db/studentexample/showstudents.php http://newmedia.purchase.edu/~Jeanine/db/studentexample/showdepartments.php http://newmedia.purchase.edu/~Jeanine/db/studentexample/enterstudent.html

System analysis and design Tools for planning communication with clients (specific diagrams may not always be shown, but used to support discussion) communication with builders Attempt to focus on function before implementation logical design versus physical design non-tech meaning of term Historically, a problem with computer work has been the rush to implementation, independent of understanding of desired function.

Models Information model = Entity relationship diagrams Ask yourself: what is the critical information? What are the relationships (what fields in one table point to other records?) Process model = data flow What are the (main) processes? Who initiates these processes? What data stores are used and/or changed? Story board What are the Web pages—the interfaces to the user (client/player/employee)? What is the flow from one Web page to another? There are other modeling schemes, for example, object oriented modeling.

ER models Done before creating the tables as part of planning and after creating the tables, as documentation Logical/analysis level (what is in examples here) just defines fields and relationships. Physical/Design/Implementation level: data types and also estimates on number of records. I'm trying to use all the terms typically used.

Entity-relationship Entity = the things (products, people, places, business concepts) attributes = fields = properties Relationships = connections between things, as represented by a field in one table (attribute of an entity) pointing to an entity.

Primary keys and foreign keys A field (attribute) that uniquely defines a record in a table can be its primary key. sometimes generated automatically by dbms In another table, the way to refer to this record would be by using the primary key value. This is called a foreign key in that other table.

Entity Relationship diagrams Blocks represent the records in the table. Typically, they list all the fields. Lines between the blocks represent relationships. The marks on the lines indicate the numbers, e.g., one to many, one to one. They also indicate what a minimum would be. 0 means that an entity in one table may not be referenced in the other at all.

Example: trivia quiz Tables are Questions Players History (that is, a question was asked [of] a player on a specific date, with outcome correct or not correct Each item in History relates to a specific player and a specific question

Question databank table question_id Question Answer (answer pattern) Players table player_id Player name Score lastplayed date Question databank table question_id Question Answer (answer pattern) Value Category history table question_id player_id whenplayed correct ER diagram for quiz show. Note: the history table has relations with each of the other two tables. The primary key of the history table is the pair: question_id and player_id.

Course pre-req example In this design, each course has at most one pre-requisite course.

Course course title Division Pre-requisite simple version: only works if there are only 0 or 1 pre-requisites. However, a course can be a pre-requisite for zero or many courses.

Course pre-reqs, more complete Each course can have no, 1, or any number of pre-requisites. TWO TABLES! Courses Statements of pre-reqs

Statement of pre-requisites Course to be taken pre-required course (prior course) Course Course title Division Each statement of pre-requisites refers to exactly one course and exactly one 'pre-req'. A course can be in either position, zero, one or several times. Creating Web Documents is a pre-req for Creating Dynamic Web Docs & Creating DBs for Web Some courses may have pre-requisites of more than one course. The second example may not be true. In fact, Purchase registration does not monitor or enforce ANY pre-requisites! This could be even more complicated: pre-requisites may be satisfied by one of several courses….

clip tag table Video archive application has table of clips and tags similar to the pre-req tables. Demonstrate NOTE: I removed entries on 2 videos and then restored them with shorter names!

Data design Sometimes done by taking the artifacts (forms, reports, screens) and writing down all those fields into first draft of records These artifacts can be from the current system or the proposed materials for a new system Apply a technique called normalization to get well-defined entities and relationships. First step is making sure each record has fixed number of fields. For example, not indefinite number of pre-reqs Subsequent steps ensure that data is not repeated, so information only needs to be updated in one place Make customer data be in a customer file NOT in each transaction file EXTRA CREDIT opportunity for posting We may cover this later in course.

Process diagram Focus on Blocks Connections processes agents (this could be people in specific roles or 'the system' triggered by events, including a time condition) data stores: more general term than databases Connections Agent engaged with process Process using data store This approach can be modified to an event driven approach.

Player Questions DB Play game History DB Edit questions Player scores Data flow diagram (process diagram) for quiz show Player Questions DB Play game History DB Edit questions Player scores Data flow diagram (process diagram) for quiz show Editor

Story board more implementation based than the others Therefore, part of system build, not system design, or, perhaps, System Physical Design not Logical Design focus on the scripts and how the scripts call each other Story board is term from advertising, animation, ?

Include/Required file: opendbq Create quiz tables (php only) Input Questions (handles form input) Choose category Show scores Ask question Story board. Thicker Links with round bases represent handling of form. Names are readable versions of file names. Check answer Clear tables

Entities for store Initial design catalog of products orders one or more ordered items customer list Enhanced design Need 1 more table: call it ordered items Normalization would tell you you need a 4th entity for the ordered items distinct from the orders. Since I've done this many times before, I know to do this.

Customer list Customer ID first name last name Billing information ER diagram for on-line store Customer list Customer ID first name last name Billing information E-mail Password Product catalog Product id Product name Picture Cost Order list Order ID Customer ID Date Status Total Ordered items Order ID Product Quantity ER diagram for on-line store. The connectors, often called crow’s feet, indicate the cardinality, the possible numbers of the relationships: each ordered item relates to exactly 1 product and exactly one order. Each order is for exactly one customer. However, a customer can have zero or more orders. An order includes at least one ordered item (the 1 is indicated by the vertical line.)

Billing system (timed event) Data flow (process) diagram for on-line store. Catalog Browse/Order Customer Customer list Billing Current orders Ordered items Shipping Billing system (timed event) Data flow (process) diagram for on-line store. Note that this is the information/data flow, not the flow of goods. The orange indicates processes and associated agents NOT implemented in the example I will present. Note: this diagram does not distinguish between the (personal) shopping cart, which is a list of items, and the ordered items for all customers. Shipping clerk Note that this is the information/data flow, not the flow of goods. The shipping operation produces a physical product: the collection of ordered items, packed and set off for delivery.

Create tables (php only) Include/require: opendbo Storyboard of partial implementation: ordering Create tables (php only) Include/require: opendbo Input products Delete current customer cookie Order product Story board. Thicker Links with round bases represent handling of form. Names are readable versions of file names. makeorder Submit order Shopping cart Include/require: displaycartfunction

Video archive: main table $fields = "fileaddr varchar(15) NOT NULL,cliptitle varchar(50) NOT NULL,"; $fields = $fields . "clipdate varchar(10),clipgroup varchar(15), sequence int(6), PRIMARY KEY (fileaddr)"; NOTE: example of primary key NOT created by DBMS.

Video archive: tag table $fields = "fileaddr varchar(15) NOT NULL,tag varchar(20) NOT NULL";

ER for video clip archive Video clips File addr Clip title Clip group Sequence Tags File addr Tag

Grid Design example Designs generated in Flash application stored as variable length strings in database Alternative would be to store design elements, like the ordered items Application could use sign on procedure!

ER for design Members Member id Member name Member email Member password Designs Design id Member id Design name Design string

Song with features example Bare bones Song table and Feature table plus A song can have 0 or more features Intention is to provide way of detecting songs similar to a given song Complex SQL statement!

Song features feature id name description song id Name Description Year feature of song fisid fid

Song with features storyboard createtables.php deletefeaturesinsongs.php listallfeaturesinsongs.php addsong.html addsong.php opendbe.php (included in all php files) addfeature.html addfeature.php addfeaturestosong1.php addfeaturestosong2.php findothers1.php findothers2.php

Songs with features DFD Add songs Identify songs Admin Finder Song info Add feature Add features to song Edit info

Agents Of course in these toy applications such as the songs with features, there is just one agent (me!) but Important to plan what are roles of system builders versus system users Some social networking song sites do allow users to add songs, specify features, add features, etc.

Opportunity for improvement Functions mentioned but not implemented (in orange) Navigation could be better specifically, going back or 'coming out of' steps. Where to go Teams will review and enhance these projects and present whole thing to the class. Mike noted that problems with navigation.

Homework Design ER and DFD for a library. YOUR job is to define entities, relationships, agents, data stores, processes. Logical design, not physical design Note: a data store could be manual. Don't be concerned with that.