joebock/Courses/557/EN_lab

Download Report

Transcript joebock/Courses/557/EN_lab

Announcements
• Progress Reports (mini design document) due Tuesday
Dec 4 in class. It will be graded and count to the final
grade of the project.
• Homework 3 due next Friday
• Next week advanced topics: Chapters 15, 17-19, 28-29
• Textbook lab files at
~joebock/Courses/557/EN_lab
• Data for populating databases is in there.
Notational Note
S
1
Cardinality Ratio Notation
REL
(0,N)
S
N
T
Participation Notation
(0,1)
REL
“Each entity of S can be
related to any number of
entities of T. An entity of T
can be related to 1 (or zero)
entities of S.”
T
“Each entity is S participates
in the relation either zero of
one times”
Possible ERD for Epidemiological Database
ID
name
b_date
sex
patient
HLA
HLA_A
HLA_B
drugs
(0,N)
severity
infection
(1,1)
isolate
Gene
sequence
HLA_C
Test result
(0,N)
date
(0,M)
Reactivity
test
Progress Report (design document)
• All Progress Reports Should Contain:
–
–
–
–
Names of all group members
Project title
A one paragraph overview of the project
Schema diagram of database (follow book
conventions for key and foreign key constraints). If
you must, this can be hand drawn, but why not use
software (eg, xfig, adobe illustrator, or visio. Also
powerpoint works just fine for a project of this scale)?
LAMP Projects
• For each webpage list:
–
–
–
–
–
–
Relative URL
Title of page
One sentence description of the page
Inputs (eg, GET parameters)
HTML Overview
English descriptions of SQL statements
Example
Title: Roster for <team>
URL: /roster.php
Description: Display roster of players for a single team
Inputs: teamID - the ID of the team whose roster is to be shown
HTML overview: the primary content of the page is a table
containing first name, last name, position and # of games played
for each player on team. First and last name are links to
stats.php. Include navigation links at top of page
SQL statements:
1) select statement on teams table to retrieve full name of tea
2) Select statement on event and player tables to retrieve info on all
players that played for that team.
Example 2
Title: Season Statistics for <player name>
URL: /stats.php
Description: Display the season statistics for a single player
Inputs: playerID: the ID of the player whose statistics are to be
displayed
HTML overview: display statistics info. The only links are navigations
back to the main page
SQL statements:
1) select statement to retrieve name and position of player. Name is
used in page title.
2) Select statement to retrieve stats (either pitching or hitting)
Tips for LAMP projects
• Write code to authenticate w/ the DB once
– Without persistence, you’ll need to use authenticate
with the DB each time a page is requested, but you
should use the same code to do this.
– You may want to code up a DB object
• See require() or include() PHP commands
• Write functions for re-used HTML elements
Menu Projects
• For each menu, list
– All menu options
– Brief description of what option does including English
description of SQL statements