Web Programming Week 2 Old Dominion University Department of Computer Science CS 418/518 Fall 2010 Martin Klein 09/07/10.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

Monash University Week 7 Data Modelling Relational Database Theory IMS1907 Database Systems.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Overview Relational Databases and SQL Pertemuan 1 Matakuliah: T0413/Current Popular IT II Tahun: 2007.
ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.
A Guide to MySQL 7. 2 Objectives Understand, define, and drop views Recognize the benefits of using views Use a view to update data Grant and revoke users’
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
A Guide to SQL, Seventh Edition. Objectives Understand, create, and drop views Recognize the benefits of using views Grant and revoke user’s database.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
1 IT420: Database Management and Organization SQL: Structured Query Language 25 January 2006 Adina Crăiniceanu
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
Web Architecture Dr. Frank McCown Intro to Web Science Harding University This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike.
ASP.NET Programming with C# and SQL Server First Edition
CHAPTER 7 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Concepts and Terminology Introduction to Database.
Web Server Design Week 1 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 1/13/10.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Chapter 10 – Database Creation1 IT238: Data Modeling and Database Design Unit 6: Database Creation Instructor: Qing Yan, M.D., Ph.D.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Brian Alderman | MCT, CEO / Founder of MicroTechPoint Pete Harris | Microsoft Senior Content Publisher.
Database: SQL and MySQL
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
Web Client-Server Server Client Hypertext link TCP port 80.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network.
Object-Relational Modeling. What Is a Relational Data Model? Based on the concept of relations (tables of data) Relationships established by matching.
Unit 4 Object Relational Modeling. Key Concepts Object-Relational Modeling outcomes and process Relational data model Normalization Anomalies Functional.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
1 Seminar on Service Oriented Architecture Principles of REST.
DBSQL 5-1 Copyright © Genetic Computer School 2009 Chapter 5 Structured Query Language.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
CDNI Requirements (draft-lefaucheur-cdni-requirements-02) CDNI Working Group IETF 81 Quebec City, Canada July 28, 2011 Kent Leung Yiu.
Advanced Accounting Information Systems Day 10 answers Organizing and Manipulating Data September 16, 2009.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Database UpdatestMyn1 Database Updates SQL is a complete data manipulation language that can be used for modifying the data in the database as well as.
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
6-1 © Prentice Hall, 2007 Topic 6: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
8-1 © Prentice Hall, 2007 Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Databases Introduction - concepts. Concepts of Relational Databases.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
SQL Basics Review Reviewing what we’ve learned so far…….
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
Web Server Design Week 3 Old Dominion University Department of Computer Science CS 495/595 Spring 2006 Michael L. Nelson 1/23/06.
Getting started with Accurately Storing Data
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.
Web Programming Week 3 Old Dominion University
Chapter 4 Relational Databases
Databases and Information Management
Chapter 9 Designing Databases
WEB API.
Normalization Referential Integrity
Databases and Information Management
WebDAV Design Overview
Web Programming Week 3 Old Dominion University
CS1222 Using Relational Databases and SQL
Relational Database Design
CS1222 Using Relational Databases and SQL
Web Programming Week 3 Old Dominion University
CS1222 Using Relational Databases and SQL
Presentation transcript:

Web Programming Week 2 Old Dominion University Department of Computer Science CS 418/518 Fall 2010 Martin Klein 09/07/10

Defining the Web / HTTP HTTP was originally defined by Request for Comments (RFCs)1945, 2068, 2616 –and several others for defining URLs, URIs, etc. While RFC 2616 remains canonical for HTTP, we have a new document for the “Web” (URIs + protocols + formats), we have a slightly revisionist but ultimately useful unifying document: –The Architecture of the World Wide Web, Volume One.

How To Read RFCs (quoting from RFC 2119) The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC MUST This word, or the terms "REQUIRED" or "SHALL", mean that the definition is an absolute requirement of the specification. 2. MUST NOT This phrase, or the phrase "SHALL NOT", mean that the definition is an absolute prohibition of the specification. 3. SHOULD This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course. 4. SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label. 5. MAY This word, or the adjective "OPTIONAL", mean that an item is truly optional. One vendor may choose to include the item because a particular marketplace requires it or because the vendor feels that it enhances the product while another vendor may omit the same item. An implementation which does not include a particular option MUST be prepared to interoperate with another implementation which does include the option, though perhaps with reduced functionality. In the same vein an implementation which does include a particular option MUST be prepared to interoperate with another implementation which does not include the option (except, of course, for the feature the option provides.)

Examples from RFC Method Not Allowed The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource Forbidden The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated Request Timeout The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.

Reading the W3C Arch Principles –fundamental “rule” or “law” that is widely applicable Constraints –definitions imposed by the architects of the Web –“MUST”, “SHALL” Good Practice –things you should be doing, but they can’t / shouldn’t be defined as constraints –“SHOULD”, “RECOMMENDED”

Principle: Global Identifiers –Global naming leads to global network effects.

Good practice: Identify with URIs –To benefit from and increase the value of the World Wide Web, agents should provide URIs as identifiers for resources.

Constraint: URIs Identify a Single Resource –Assign distinct URIs to distinct resources.

Uniform Resource Identifiers URI URL URN RFC 3986 (2396) RFC 2141 RFC 1738

URI Schemes \ / \________________/\_________/ \__/ \___/ \_/ \_________/ \_________/ \__/ | | | | | | | | | | userinfo hostname port | | parameter query fragment | \_______________________________/ \_____________|____|____________/ scheme | | | | | authority |path| | | | | path interpretable as filename | ___________|____________ | / \ / \ | urn:example:animal:ferret:nose interpretable as extension taken from:

Important Web Architecture Concepts URIs Identify Represent Martin Klein -- Old Dominion University … Representations As defined by the Web Architecture

remember: URIs identify Resources Representations represent Resources When URIs are dereferenced, they return representations (i.e., a resource is never returned) taken from: Important Web Architecture Concepts (As defined by the Web Architecture)

W3C Web Architecture Resource URI Representation 2 Represents Representation 1 Represents Identifies Content Negotiation The tools we have to solve the interoperability problem are: Resource URI Representation slide from Herbert Van de Sompel

LAMP Chapters 3, 10 of textbook –more info: Quick review of relational databases –normalization –referential integrity Basic MySQL commands

“Graphic Novel” Super Heroes (from chapter 10) What if we need to add a super hero with more than 3 powers?

1st Normal Form Eliminate repeating columns Add primary key to table –Unique –Must not change Maintain “atomicity“ –Each cell is atomic, has only one item of data

1NF add primary key to tables eliminate repeating columns each attribute is atomic What if John Smith changes his name?

2nd Normal Form Honor 1st Normal Form Create separate tables for data duplicated across rows Be aware of relationships! –1:1 –1:m –m:n

2NF satisfy 1NF create separate tables for data duplicated across rows Are “city“ and “state“ directly related to the lairs?

3rd Normal Form Honor 1st & 2nd Normal Form Create separate tables for any transitive or partial dependencies

3NF satisfy 2NF create separate tables for any transitive or partial dependencies see note on p. 283 on why good/evil is not in a separate table

That’s About as Far As We’ll Go Other normal forms are possible (BCNF, 4NF, 5NF) –take a database class if you’re interested Referential integrity –a foreign key (“link”) into another table is no longer valid –“404 Errors” are bad in databases and should not happen how bad is a function of the data itself…

MySQL Hierarchy server=mln-web.cs.odu.edu database=tennisplayers table 1table 2 table 3 database=superheroes table 1table 2 table 3

Manipulating Tables & Databases CREATE - create new databases, tables ALTER - modify existing tables DELETE - erase data from tables DESCRIBE - show structure of tables INSERT INTO tablename VALUES - put data in table UPDATE - modify data in tables DROP - destroys table or database (values + structure) more:

Native MySQL Data Types Unlike Perl, PHP and other civilized languages, MySQL is big into data types: – types.htmlhttp://dev.mysql.com/doc/refman/5.0/en/data- types.html –many examples in chapter 3, 10

SQL Query Form SELECT [fieldnames] FROM [tablenames] WHERE [criteria] ORDER BY [fieldname to sort on] [DESC] LIMIT [offset, maxrows] more: look at chapters 3 and 10 for code examples