Objectives of SQL
SQL is a transform-oriented language with 2 major components:
A DDL for defining database structure.
A DML for retrieving and updating data.
Until SQL3, SQL did not contain flow of control commands. These had to
ISO standard defines five aggregate functions:
COUNT returns number of values in specified column.
SUM returns sum of values in specified column.
AVG returns average of values in specified column.
HTML documents consist of text with imbedded elements.
The elements are denoted by markup tags enclosed with < > .
Tags come in pairs. < indicates a starting tag and < / indicates an ending tag.
For example <p> </p>
Avg, max, min
<title> make a choice</title>
<link rel="stylesheet" type="text/css" href="base.css" />
<!- give visitor a list of options ->
<!- change labels as appropriate ->
<h1> Thank you for visiting th
Computing a Join
Procedure for generating results of a join are:
1. Form Cartesian product of the tables named in FROM clause.
2. If there is a WHERE clause, apply the search condition to each row of the product
table, retaining those row
Some Simple examples
Example of an alert box
<h2> Click on the image below to display an alert box</h2>
<a onclick="alert('meow');"><img src="one.jpg"/></a>
Example of an image roll-over
Quick Relationship Analysis
1. 1 X 1 Y and 1 Y 1 X then one to one relationship
Represent the relationship as One Table
2. 1 X 1 Y and 1Y * X or 1 X * Y and 1 Y 1 X
Then one to many relationship
Represent the relationship as Two Tables
Examine the 1 * par
For each of the following a)identify the type of relationship, b)sketch the appropriate tables structure and indicate PK
and FK attributes, c)identify tables if they are parent, child, or intersection.
1.One particular employee may work in many different