Presentation on theme: "AS ICT Post Exam Study Database Design. Relational databases are complex file structures combined with software that manages the update, retrieval and."— Presentation transcript:
Relational 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 display – Use of a report interface for printing data output – Use 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) Relational Databases
RDBMS Concepts 12341234 12341234 24312431 Table 1Table 2 Primary Key fields (shown in bold) Secondary Key field Records Data fieldsPrimary keys uniquely identify individual records in tables. Primary keys are usually positioned as the first field in a record Secondary keys identify primary keys in other tables, thus showing that a relationship exists between records in different tables
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.
Entity Relationship Diagrams ERDs show the relationship between entities Student Subject Teacher Classroom Calendar (date/time) Note The 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). 11 0 0
ACTIVITY Analyse all the data displayed on the sample invoice and from this identify: – All entities and their respective attributes – When you have done this sketch an ERD to show the relationships between the entities you have defined