Databases 2 In this course, we define an Information System as any software application dealing with persistent information (i.e. persistent data) in computer's memory.

Relational Data Model (Overview)

Primitively speaking, we can see an Information System as a combination of three main components:

Data Management Layer provides data structures and operations to be utilised by the application layer. Formally, a combination of data structures and data processing operations supported by the Data Management Layer is called a Data Model. We can speak about information systems based of a file management system, on a relational data model, on World-Wide Web, etc. In other words, information systems may be based on different data models. Relational Data Model allows to operate with a database as with collection of two-dimensional tables called relations.

Tuples (i.e. Data Objects) are related by means of so-called foreign key/primary key relationships.

A relational database schema may be seen as a definition of a number of relations (tables). Each relation is defined as a unique name with a list of domains which corresponds to columns of the relation. For example:

 Customer(C#,Cname,Ccity,Phone)  Product(P#,Pname,Price)  Transaction(C#,P#,Date,Qnt)

To insert (put) new tuples into a particular relation declared in a current data base schema;

 Step1: A user (an application programm) chooses a relation (say, Customer);  Step2: The user (programm) prepares a new tuple of the relation on the screen or in the computer's memory.  Step3: The DBMS put a new tuple into the relation (data base).

Relational Data Model automatically supports so-called Referential Integrity: "A foreign key can have only two possible values, either the relevant primary key value or Null-Value. No other values are permitted" The most popular relational query language is called SQL (Structured Query Language). The basic operation in SQL is called mapping, which transforms values from a database to user requirements. This operation is syntactically represented by the SQL block.

SQL blocks may be nested in order to implement more complex queries. Consider for example the following query: "Get names of such customers who bought the product CPU ". SQL blocks may operate with multiple relations to select data from such different relations. Consider for example the following query: "Get customer names, dates and numbers of product units for transactions dealing with the product number 1".

Application Layer implements purpose-oriented data processing algorithms and a particular user interface. There is no common solutions which are used for designing different information systems. For example, a project management system, electronic library, financial transaction system, computer-based training system, etc. require essentially different data processing algorithms and user interfaces. Internet-Based Information Systems

Internet is the largest world-wide computer network that exists today. It is in fact a network of networks that is estimated to connect several million computers and with over 100 million individual users around the world - and it is still growing rapidly

HyperText Transfer Protocol (HTTP) is an example of an Internet Data Service protocol. It is designed to support communication between clients and a hypermedia information server.

 Clients send requests for certain services to a server.  The server responds by sending back relevant data to the clients.

Some requests can also cause side effects in the information maintained by the server, such as addition or deletion of certain documents. HTTP basically defines the internal structure of supported requests and responses.

The World Wide Web (WWW) is a globally distributed collection of so-called WWW documents. These are in fact documents written in a mark-up language called a HyperText Mark-up Language (HTML). The pages residing on some particular host machine are made accessible over the net through HTTP. In other words, the WWW architecture is essentially that of multiple HTTP servers on the Internet serving WWW pages to HTML clients.

The Uniform Resource Locator (URL) is one of the most important Internet concepts. It may be viewed as a means of uniquely identifying resources on the net. In HTTP, URLs identify the data to be transmitted. HTML allows for URLs to be embedded in its pages. This is the basic linking mechanism in WWW: the embedded URLs typically point to other HTML pages.

Thus the World Wide Web (WWW) can be seen as a distributed collection of multi-media (HTML) documents interrelated by means of computer-navigable links. The fact that HTML is the WWW de facto standard for describing how information is structured and displayed underlines its importance to the web architecture. It allows different vendors to develop WWW browsers that, while running on different hardware and software platforms, still display web pages in approximately the same way. A mark-up code is simply an ASCII character sequence distinct from the text. Typically, text is bracketed by a start code and an end code, and the text thus enclosed is subject to the properties that the code describes. HTML mark-up codes are called HTML tags and are distinguished from text by adopting the following notation:

 a start tag is written as "< tag-X >" where tag-X is some reserved code identifier  the corresponding end tag is written as ""

Text bracketed by TAG-X Text bracketed by TAG-Y

Most queries currently made to WWW servers fetch static data stored in a portion of the file system associated with the server. The CGI interface provides a means for a client to request that an arbitrary program be executed by the server. The reason for running that program can be to produce side effects, such as updating a data base or sending e-mail to someone, but more often the program is run in order to return data directly to the client/user in the form of an HTML document generated by the program.

The CGI interface provides a very powerfull mechanism for bulding so-called Internet-Based Information systems.

It should be especially noted that CGI applications may communicate to a file system and other software packages installed on the server. For example, CGI scripts may provide an internet access (i.e. interface) to a big local database, expert system, etc.