23
Review of Databases, Server-side Scripting

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

  • View
    242

  • Download
    0

Embed Size (px)

Citation preview

Review of Databases, Server-side Scripting

Databases

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

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.

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.

DBMS Architecture

“Query”Processor

StorageManager

DataMetadata

TransactionManager

Schema Modifications

Queries Modifications

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.

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.

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

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

Relational Database of a Cat

Hammer the world flat by normalization

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

Example

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

Oo-database of a Cat

Entity Relationship Diagram

StudentStudentNo(PK)StudentNameAddress

StudiesStudentNo(FK)CourseNo(FK)

CourseCourseNo(PK)CourseName

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. 

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. 

Server-side Scripting

• Need• ASP• Coldfusion• Perl• PHP

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.

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.

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.

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.

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