10_Types.pdf - CITS1402 Relational Database Management...

This preview shows page 1 - 5 out of 16 pages.

The preview shows page 3 - 5 out of 16 pages.
CITS1402Relational Database Management SystemsVideo 10 — TypesGordon RoyleDepartment of Mathematics & Statistics
TypesWhen a table is created withCREATE TABLEthe database designerhas to specify thenameandtypeof each column.The type indicates (to SQL) whatkind of datawill be stored inthat column — numbers, strings, boolean values etc.This information can be used to assist SQL in various ways:IEfficient allocation of disk/memory when storing a tableIImproved data integrity by ensuring that values at least havethe right formIEnabling certain types ofpolymorphism
A unit codeConsider a field for storing aunit code, such as"CITS1402".At UWA, unit codes are standardised and always consist ofexactly8 characters.In SQL, the correctdeclarationfor this field would beCREATE TABLEUnit(unitCodeCHAR(8));The system can then store this column with no wasted space.
A unit nameThenameof a unit does not have a standard length:Relational Database Management SystemsNetwork Science

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 16 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
One
Professor
N/A
Tags
Type theory

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture