130 likes | 145 Views
3 / 12. CHAPTER. Databases. MIS105 Lec13 Irfan Ahmed Ilyas. Lecture Objectives. Database Concepts Data Organization in databases Key Field Main activities in Database Maintenance Defining data Creating data Manipulating data Database Usage. Database Concepts.
E N D
3 / 12 CHAPTER Databases MIS105 Lec13 Irfan Ahmed Ilyas
Lecture Objectives • Database Concepts • Data Organization in databases • Key Field • Main activities in Database Maintenance • Defining data • Creating data • Manipulating data • Database Usage Prepared By: Irfan Ilyas
Database Concepts • A database is a structured collection of related data, stored in some medium for some specific purpose. • A database usually represents some real world environment, thus reflecting changes happening in that environment. • Examples: • Addresses/ telephone numbers stored in some indexed address book • Course related data saved on a computer disk using some software like Microsoft Excel, Microsoft Access etc. Prepared By: Irfan Ilyas
Cha.. Cha.. Field Field…… Record Data File :………. Data File ……….. Data Organization in Databases Character Character Character Field Record Data File A Database Prepared By: Irfan Ilyas
9 8 … 7 0 A L I Field: ID Field: Score Record for Rasheed Record for … File: Course File: Faculty Data Organization Example • In a University database Field: Name Record for Ali File: Student University Database Prepared By: Irfan Ilyas
A Database Example Prepared By: Irfan Ilyas
….Database Concepts • Key Field • Searching a particular record uniquely in a data file requires at least one field unique in value for all records • Example, in STUDENT file StudentNumber is such a field • Common example of key values (in daily life databases) • Social Security Number • Driver’s License • Student ID Numbers Prepared By: Irfan Ilyas
Electronic Databases • Databases on some electronic media like disks • Computer programs are needed to maintain/ use on disk databases • Three main activities for electronic database maintenance • Defining • Specifying the data types, data validation rules etc. for the data values • Creating • Storing the data values (as defined by the user) on some physical medium • Manipulating • Querying/ searching/ updating the data values • Checking the conformance with the defined data constraints (validation rules) Prepared By: Irfan Ilyas
Database Usage • Databases are mostly used as an integral part of related Information Systems Accounting Staff Registration Staff Accounting Information System Registration Information System A shared database in a University environment Prepared By: Irfan Ilyas
Database Implementation Approaches • Flat File Approach • Every data file is tried to be rich in all the relevant details • Every data file is used on a localized basis (e.g. one file for each department). • This makes every file independent of the other files in the database • Benefit: Data Reporting is easily done on each file independently • Disadvantage: Data inconsistencies may result due to data redundancies (duplications) Prepared By: Irfan Ilyas
A Flat File Database • A Student Grade Database • All the information needed is placed in one single data file • For example, a spreadsheet containing a single student grade file • No need to refer to any other file for data reporting • Redundant data values • In GRADE_REPORT: • Student’s personal information includes: • StudentNumber, StudentName, Class, Major • Whenever a grade record for a student is inserted in the file, his personal information is repeated. Prepared By: Irfan Ilyas
.. A Student Grade Database • Possible Data Updation Anomalies (abnormality) • When adding a grade for an already existing student, his personal information needs to be consistent with the existing ones (Insertion Anomaly) • If all grade records for a specific student are deleted, other details for that student will also be lost (Deletion Anomaly) • If any student’s number is modified, this needs a change in all other grade records of the same student (Modification Anomaly) Prepared By: Irfan Ilyas