Presentation on theme: "Post Exam Study Database Design"— Presentation transcript:
1 Post Exam Study Database Design AS ICTPost Exam StudyDatabase Design
2 Relational DatabasesRelational databases are complex file structures combined with software that manages the update, retrieval and manipulation of data. For this reason they are often called Relational Database Management Systems (RDBMS).The management system allows data changes by a variety of means, for example:Use of a form interface for data input and displayUse of a report interface for printing data outputUse of SQL (Structured Query Language) for transferring data between third party application software and the relational database management system (RDBMS) software.NB SQL, originally developed by IBM in the 1970s, is now a de jure programming standard managed by ANSI (American National Standards Institute)Examples of popular relational database systems are:MS Access (bundled in with MS-Office: suitable for developing simple relational databases)Oracle (a fully functional true RDBMS used by many large organisations)MySQL (a fully functional true RDBMS developed by the Open Software Foundation – its main use is as a website server database)
3 RDBMS Concepts Table 1 Table 2 Records Data fields 3412342431RecordsData fieldsPrimary keys uniquely identify individual records in tables. Primary keys are usually positioned as the first field in a recordSecondary keys identify primary keys in other tables, thus showing that a relationship exists between records in different tablesSecondary Key fieldPrimary Key fields(shown in bold)
4 Relational Database Design The design of a successful database requires a detailed logical analysis of all the data required for a system to work.The data are named, typed and classified as data fields.Data fields are grouped into similar records which are stored in appropriate tables.How is this logical analysis done?Experienced systems analysts use a “top down” approach to this by first identifying objects of significance, such as customers and products in a sales based system or students, teachers and courses in a school or college based system.These objects may be physical, i.e. something you can touch such as products and people (e.g. customers, students, teachers) or something abstract (e.g. Businesses, courses and subjects).These objects are referred to as “entities” which are subsequently used to name tables in an RDBMS.When an “entity” has been defined, a list of its “attributes” can be derived.An attribute is useful information that you wish to record in the RDBMS, e.g. a person or business name, address and telephone number; a product name, price and VAT rate; a course subject name, teacher, classroom and lesson time and day.Attributes as used to define table field names in the RDBMS.When all entities and their required attributes have been defined an entity relationship diagram (ERD) may be drawn which shows the relationships between each table in the RDBMS.
5 Entity Relationship Diagrams ERDs show the relationship between entitiesNoteThe lines drawn between each entity have a 3 pronged end referred to as a “crows foot”.This is used to indicate that one or more occurrences of the entity is related to the connecting entity. Thus this diagram illustrates that a student must participates in one or more subjects (must is indicated by the number 1 near the student entity) and a classroom may (or may not) be used for teaching more than one subject (may is indicated by a 0 near the classroom entity).StudentTeacher11ClassroomSubjectCalendar(date/time)
6 ACTIVITYAnalyse all the data displayed on the sample invoice and from this identify:All entities and their respective attributesWhen you have done this sketch an ERD to show the relationships between the entities you have defined