160 likes | 320 Views
Organizing Data. Chapter 3. Revision: page 105 -118. Back ground: File System. File Contents: Customer- and Agent Files. File System. Points to take notice of:. Duplication of data leads to anomalies :
E N D
Organizing Data Chapter 3 Revision: page 105 -118
Points to take notice of: • Duplication of data leads to anomalies: • Changing information in the Customer file and NOT in the Agent file (Islands of data) leads to inconsistency that impact on the integrity of the data. • Programmers interact DIRECTLY with the file, according to the STRUCTURE of the file. • If the file organization changes, so must the software!
How do a DB solve these problems: File: DB: Introduces the DBMS: Data is stored in ONLY one File The DBMS introduces data independence: The programmer do NOT need to know about data structures. The DBMS interact with the files • Duplication of data • Changes to software programs
Creation of a DB: • Create the LOGICAL view • Know the tables/entities, • Identify the attributes/field names, • Identify a PK for EACH table • Identify the relationship between entities.
Creation of a DB: • Logical view:
Implementation: • Create DB, using datadefinition language • Create Tables: • Attributes with Data TYPES: • Numerical, Text, Currency, Date, Logical
Populate: • Insert the values • Draw the Relationship • Answer queries: • Selection • Project • Join • QBE versus SQL
Relationships: • 1 : 1 • 1 : M • M : N
Exam: • Scope: • Section A: Build a database, and answer queries 40 marks • Will be marked in the Lab • Section B: Multiple Choice Questions • Chapters 1, 2, 3: Between 60 and 80 questions