Top Banner
Review of Databases, Server-side Scripting
23

Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Review of Databases, Server-side Scripting

Page 2: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Databases

• Database• Database Modeling• Relational Data Model• Object oriented Database• Entity Relationship Diagrams• SQL

Page 3: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Database

• Database is a collection of Information. It refers to a collection of data that is managed by a DBMS.

A DBMS is expected to..• Allow users to create new Databases

and specify its schema.• Gives user ability to query and

manipulate data.

Page 4: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Database contd…

• Supports storage of large volume of data, keeping it secure from accidents and unauthorized use.

• Control access to data from many users at once, taking care to see that the data is not corrupted.

Page 5: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

DBMS Architecture

“Query”Processor

StorageManager

DataMetadata

TransactionManager

Schema Modifications

Queries Modifications

Page 6: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Database Modeling

• The process begins with analysis of what information the database must hold and the relationship among components of that information.

• The Database schema is specified in one of the several languages or notations suitable for expressing designs.

• After due consideration, the design is committed to a form that can be input to the DMBS.

Page 7: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Relational Data Model

• Today’s database implementations are almost always based on Relational model.

• It has a single data-modeling concept called the relation, a two-dimension table in which data is arranged.

• This model supports a very high level programming language called Structured Query Language, SQL.

Page 8: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

ExampleStudent # StudentName Address

1 Jane Jones First Address

2 Brian Brown Second Address

3 Clara Clarke Third Address

Student

StudiesStudent # Course #

1 C1

2 T2

3 T2

CourseCourse# CourseName#

C1 Computing

T2 Technology

Page 9: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Example contd…

To query: "What course does Student 2 work in?" • go to STUDIES and look up Student 2 and return

Course# (i.e. T2) • go to COURSE and look up T2 and return Theology

"Name all students doing Theology" • go to COURSE and find Course# (i.e. T2) • go to STUDIES look up T2 and return all Student#s • go to STUDENT and find each Student# and return each

StudentName

Page 10: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Relational Database of a Cat

Hammer the world flat by normalization

Page 11: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Object Oriented Database

• When database capabilities are integrated with object-oriented programming language capabilities, the result is an object-oriented database management system (ODBMS).

• An ODBMS makes database objects appear as programming language objects in one or more object-oriented programming languages.

• An ODBMS extends the language with transparently persistent data, concurrency control, data recovery, associative queries, and other database capabilities.

• Object-oriented databases are designed to work well with object-oriented programming languages

Page 12: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Example

Page 13: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Example contd…

To query: "What course does Student 2 work in?" • search Students index for pointer to Student 2 • follow CoursePointer to T2 and return CourseName

(Theology)

"Name all students doing Theology" • search Course Index and find Course# (i.e. T2) • follow Student Pointers, looking up each Student#

This process is called navigation, note that it relies heavily on pointers

and that a large proportion of pointers must be persistent

Page 14: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Oo-database of a Cat

Page 15: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Entity Relationship Diagram

StudentStudentNo(PK)StudentNameAddress

StudiesStudentNo(FK)CourseNo(FK)

CourseCourseNo(PK)CourseName

Page 16: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

SQL

• The Structured Query Language (SQL) comprises one of the fundamental building blocks of modern database architecture. 

• SQL defines the methods used to create and manipulate relational databases on all major platforms. 

Page 17: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

SQL contd…

SQL commands can be divided into two main sub languages. 

• The Data Definition Language (DDL) contains the commands used to create and destroy databases and database objects. 

• The Data Manipulation Language to insert, retrieve and modify the data contained within it. 

Page 18: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Server-side Scripting

• Need• ASP• Coldfusion• Perl• PHP

Page 19: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

NEED

• The Website creation will need access to databases and the ability to respond to user input.

• It also must be dynamic, scalable, and robust.

• Old standbys XSSI and static files just aren't sufficient to meet this requirements.

Page 20: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

ASP• Active server pages can be written in

VBScript, an easy-to-learn scripting language that uses a syntax similar to VB.

• With the extensive integration capabilities of Microsoft's .NET Framework, powerful ASP pages with expanded libraries can be created.

• IIS is required to run ASP. IIS is not extensively stable.

• A number of applications require third party software, which may not be free.

Page 21: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Coldfusion

• Simple, easy-to-learn, tag-based Syntax.

• Its native language, CFML (ColdFusion Markup Language) uses fewer but more powerful commands.

• Primitive, passable language.• Works on variety of platforms.

Page 22: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

PHP

• OPEN SOURCE• Syntax borrowed from C, JAVA etc,

hence a quick learning curve.• Dynamic graphics generation, IMAP,

SNMP, LDAP, XML .• PHP can interface with Sybase, Oracle,

Informix, Solid, Postgres, and even MSSQL.

• Runs on all possible web-servers.

Page 23: Review of Databases, Server-side Scripting. Databases Database Database Modeling Relational Data Model Object oriented Database Entity Relationship Diagrams.

Demonstration

A web interface for students to enroll in courses online in PHP and Coldfusion using MYSQL backend.

http://utopia.csis.pace.edu/cs615/demo

http://utopia.csis.pace.edu/cs615/demo/cfm