140 likes | 255 Views
DATA TYPES. FILE TABLE FIELD ITEM RECORD KEY FIELD / PRIMARY KEY SECONDARY KEY FOREIGN KEY. database. Sequential file – arranged according to the Primary Key Serial file – no particular order Difficult to find record Index to locate randomly stored records Direct access file.
E N D
FILE • TABLE • FIELD • ITEM • RECORD • KEY FIELD / PRIMARY KEY • SECONDARY KEY • FOREIGN KEY database
Sequential file – arranged according to the Primary Key • Serial file – no particular order • Difficult to find record • Index to locate randomly stored records • Direct access file Types of file
Updates / amendments of records • Addition of new records • Deletion of records FILE MAINTENANCE
Numeric • Integers (counting) • Real numbers (measurement, etc) • Date • Alphanumeric • Logical / Boolean • Currency Data typeSTo constrain the data to a certain kind of information and range of values
Human error • False information • Information entered incorrectly • Validation check – set rules / format to the data type Checking Data ENtry
Length check • Character check • Format check • Is it possible for data to still be incorrect even though it has passed all validation check above? • Data verification – input data twice and compare VALIDATION CHECKe.g. date
All data stored in only one single file • requires a lot of memory • reduces speed of accessing the data FLAT FILES
Task: Find the Class Teacher’s Phone Number for Student X • Step 1: Search the Students File until it gets the correct Student • Step 2: Get the Class Teacher’s Name • Step 3: Search the Teachers File until it gets the correct Teacher • Step 4: Get the Teacher’s Phone Number Consider a school database that contains a STUDENTS FILE & TEACHERS FILE
Consider a school database that contains a STUDENTS FILE • Normally, Primary Key = Student ID • But students normally don’t remember their ID! • So Search by their Name - Secondary Key SECONDARY KEY
Data are stored in Tables • When data in different Tables are connected together,they form Relational Tables RELATIONSHIPS
Recall • Primary Key / Key Field • Secondary Key • Foreign key • A field in one file that is also a key field in another file FOREIGN KEY
Analogue • Can be any value within a defined range • E.g. • height of a person • Pressure • Light intensity • Digital • Discrete patterns of 0s and 1s • Only 2 states of single bit data • E.g. • On / Off • True / False • Yes / No ANALOGUE & DIGITAL DATA
Use A-D Converter • Burglar alarm / room thermostat take sample every second • Convert music to digital data 128 000 samples per second (kbps) • Use D-A Converter • Control lights during a concert complex switching, etc ANALOGUE & DIGITAL DATA CONVERSION