Wednesday, October 29, 2008

Codd's Rules for Relational Database Management

The following are the 12Codd's rules for Relational Database Management!

If the first 5 are satisfied then the system is considered as a DBMS, and if 6 or more rules are being followed by the system, then it is regarded as an RDBMS!

•The information rule
•The rule of guaranteed access
•The Systematic treatment of all null values
•The database description rule
•Comprehensive data sub language
•The view updating rule
•The insert and update rule
•The physical independence rule
•The logical independence rule
•The integrity independence rule
•The distribution rule
•The Nonsubversion rule

Sunday, October 12, 2008

XML file for creation of a database of cricket players

save this as a .xml file...

< ?xml version="1.0" encoding="ISO-8859-1"? >

< ?xml-stylesheet type="text/xsl" href="cricket.xsl"? >


< Team >
< player >
< name > Sachin Tendulkar < /name >
< age > 35 < /age >
< role > Allrounder < /role >
< country > india < /country >
< runs > 12075 < /runs >
< batavg > 45.26 < /batavg >
< wickets > 234 < /wickets >
< matches > 333 < /matches >
< innings > 300 < /innings >
< highscore > 186 < /highscore >
< bestbowling > 5/29 < /bestbowling >
< /player >

< player >
< name > Shahid Afridi < /name >
< age > 34 < /age >
< role > Batsman < /role >
< country > pakistan < /country >
< runs > 3752 < /runs >
< batavg > 40.26 < /batavg >
< wickets > 154 < /wickets >
< matches > 200 < /matches >
< innings > 173 < /innings >
< highscore > 107 < /highscore >
< bestbowling > 5/34 < /bestbowling >
< /player >

< player >
< name > Jacques Kallis < /name >
< age > 31 < /age >
< role > Allrounder < /role >
< country > South Africa < /country >
< runs > 5752 < /runs >
< batavg > 40.26 < /batavg >
< wickets > 89 < /wickets >
< matches > 186 < /matches >
< innings > 140 < /innings >
< highscore > 167 < /highscore >
< bestbowling > 5/45 < /bestbowling >
< /player >

< player >
< name > Ricky Ponting < /name >
< age > 36 < /age >
< role > Batsman < /role >
< country > australia < /country >
< runs > 9876 < /runs >
< batavg > 45.48 < /batavg >
< wickets > 1 < /wickets >
< matches > 325 < /matches >
< innings > 297 < /innings >
< highscore > 161 < /highscore >
< bestbowling > 1/36 < /bestbowling >
< /player >
< /Team >

XSL stylesheet for database of cricket players

save this as a .xsl file, & it will highligh the indian players in blue, Aussies in yellow & pakistan players in green & add few more colors to various attributes...

< ?xml version="1.0" encoding="ISO-8859-1"? >
< xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >




< xsl:template match="/" >
< html >
< body >
< h2 > List < /h2 >
< table border="1" >
< tr > < th > name < /th >
< th > age < /th >
< th > Matches < /th > < /tr >

< xsl:for-each select="Team/player" >

< xsl:choose > < xsl:when test= "country='india'" >
< tr >
< td style="color:blue" > < xsl:value-of select="name"/ > < /td >
< td style="color:red" > < xsl:value-of select="age"/ > < /td >
< xsl:value-of select="matches"/ > < /td > < /tr >
< /xsl :choose >


< xsl:choose > < xsl:when test= "country='australia'" >
< tr >
< td style="color:yellow" > < xsl:value-of select="name"/ > < /td >
< td style="color:red" > < xsl:value-of select="age"/ > < /td >
< td style="color:orange" > < xsl:value-of select="matches"/ > < /td > < /tr >
< /xsl:choose >


< xsl:choose > < xsl:when test= "country='pakistan'" >
< tr >
< td style="color:green" > < xsl:value-of select="name"/ > < /td >
< td style="color:red" > < xsl:value-of select="age"/ > < /td >
< td style="color:orange" > < xsl:value-of select="matches"/ > < /xsl:when > < /xsl:choose >



< /xsl:for-each >


< /table>
< /body >
< /html >
< /xsl:template >