The Digital Research Initiative
The University of North Carolina at Chapel Hill

What Will Be Covered

  • Changing Use of the Web

  • Static Versus Dynamic Web Pages

  • What is a Database?

  • What is SQL?

  • What is CGI?

  • How Do These Things Fit Together?

  • Examples

Changing Use of the Web

  • The Web was a once basically a digital library of static "Web pages." (mainly before late 1997)
    • Web pages are HTML documents, basically online brochures.
    • The Web was (mainly) only a place to find information.
    • Killer Feature: Hyperlinks fascinated people most.

  • Now the Web is also an ultra-convenient place of commerce. (1998 onward)
    • New uses include shopping, banking, travel-planning, house hunting, and much more.

What is a Static Web Page?

  • A static Web page is a plain HTML file that is stored on a Web server.

  • When a user visits a static Web page, the HTML file is essentially copied from the server to the client computer.
    • No processing is done to the page by the server, the file is sent as-is.
    • The file is sent in exactly the same manner and form for all users/clients that request it.

  • The "effort" of the page is completed by the client computer, which has to interpret/render the Web page.

What is a Dynamic Web Page?

  • A dynamic Web page is a set of HTML which is generated by a Web server based on input from the user.

  • When a user visits a dynamic Web page, input is sent (often without the user's knowledge) from the user's computer to the Web server, and a program is run on the Web server which outputs/sends HTML to the user's computer.
    • Processing is done by the server.
    • Every user may get a different set of HTML/different output from the same URL; there are multiple possible outputs.

  • The "effort" of the page is mostly completed by the Web server computer, although the same "effort" of the static pages is required of the client computer to interpret/render.

What is a Database?

  • A database is a program that stores information and allows users to interact with this information.

  • Users can view and search information.

  • Users can also add, remove, and change information.

  • Database suites usually have two parts -- the "daemon" program that runs constantly and is the "container of information" and the "client" program which runs by user request and is the user's agent in interacting with the database.

  • Popular database programs include Oracle, Microsoft Access, MySQL and PostgresSQL.

How Do Databases Work?

  • Most modern databases hold data in "table form," such as:
      SCHOOL TUITION_COST
      UNC-Chapel Hill $1,500 per semester
      Duke University $35,000 per semester
      NC State University $1,500 and six hogs per semester

  • Users could view or update data in any combination possible, or add information.

  • Most databases have multiple tables, each with many columns, and they can be used in any combination.

  • For example, UNC's database will have a table for classes, another table for students, and another table for grades and all of these tables work together to generate a report card.

What is SQL?

  • Simple Query Language is an english-based computer language for interacting with a database.

  • SQL allows easy searches:
      select NAME from UNC_STUDENTS where HOMETOWN='Greensboro, NC";
      Displays names of students from Greenboro.

  • SQL allows easy additions, updates, and deletions:
      insert into UNC_STUDENTS (NAME,SSN,HOMETOWN) values ('John Doe','123-45-6789','Jamestown, NC');
      update UNC_STUDENTS set NAME='Bob Smith' where SSN='987-65-4321';
      delete from UNC_STUDENTS where HOMETOWN='Archdale, NC';

  • Most popular database programs use SQL to allow user interaction, with very little deviation in SQL syntax among database programs.

What is CGI?

  • Common Gateway Interface is a part of the Hypertext Transfer Protocol (HTTP) that allows input to come from a Web client to a program residing on a Web server.

  • A CGI program is run when the client requests the URL of the prgoram.

  • CGI programs accept the input sent from a web browser/client and utilize this data to generate HTML output (which is sent back to the web browser/client).

  • CGI programs can be written in any programming language, so long as that language is supported by the web server that will be running them.
    • Common languages used for CGI programs include Perl, ASP, and Java

  • CGI programs produce dynamic Web pages.

How Do These Things Fit Together?

  • CGI programs can call on small client programs to interact with databases.

  • The user/client sends input to the CGI program, which interacts with the database based on the user/client input. The CGI programs works with its database client to either pull data from the database or insert data, and then sends HTML output to the browser/client.

  • This HTML output can include information from the database, status messages, or personalized information.

Examples of CGI Programs and Databases Working Together

  • Yahoo!
      Users search Yahoo!'s database of Web Sites with a CGI program.
  • UNC Student Central
      UNC Students can register for classes or view their grades
  • Travelocity
      Users can search through travel opportunities and make reservations -- works across several companies' databases.
  • Buy.Com, Amazon.Com, and other online stores
      Users can search through items, view item information, and order items

This site made by
eric
This site was created especially for students of the UNC School of Journalism's
JOMC 050 Class, and anyone else who may be interested.
For more information, please contactdaikat@email.unc.edu