Managing Information! Lecturer: N. Kyritsis, MBA, Ph.D. Candidate Athens University of Economics and Business!! e-mail: kyritsis@ist.edu.gr
Database Management
Database Definition Collection of relevant files that contain data reagarding people, locations, products.!! e.g. Phone Book, Customer list, Video Club Movies Catalogue, Enterprise Ordering details
Traditional Vs. Computer Based Databases VS
Database Advantages Space saving (e.g. files in cabinets & storages)! Time saving (Typing and double checking for errors)! Efficiency (ease of access to information)! Accuracy in data and information search! Low maintenance Costs! Reliability! Connectivity and Integration of different types of files
Database Management Systems (DBMS) A DataBase Management System- DBMS is a specialized software that is used to create, store, organise and access a database.! Examples of DBMS:! Personal Use: Microsoft Access, Filemaker! Professional Use: Oracle, Lotus, Microsoft SQL Server, MySQL
Database Elements Entities - Everyone that uses the database system (Users, Administrators etc)! Tables (e.g. Customers, Suppliers, Employees, Orders)! Forms (Database User Interface)! Reports
Database Tables Records! Primary & Foreign Keys! Fields! Data types! Table Relationships!! These are the basic structural elements of a Database System
Example of Customers Table ΚΩΔΙΚΟΣ ΠΕΛΑΤΗ ΕΠΩΝΥΜΟ ΟΝΟΜΑ ΔΙΕΥΘΥΝΣΗ E-MAIL ΕΔΡΑ 209 ΚΑΡΝΕΖΗΣ ΓΕΩΡΓΙΟΣ ΠΕΙΡΑΙΩΣ 200 george@mail.com ΑΘΗΝΑ 315 ΠΑΠΑΣΤΡΑΤΟΥ ΕΥΑΓΓΕΛΙΑ ΑΘΗΝΑΣ 100 papastratou@mail.com ΑΘΗΝΑ 109 ΞΕΝΟΥ ΙΩΑΝΝΗΣ ΚΥΠΡΟΥ 16 ksenou@mail.com ΘΕΣ/ΝΙΚΗ 201 ΖΑΦΕΙΡΙΟΥ ΑΝΝΑ ΠΑΤΗΣΙΩΝ 47 anna@mail.com ΠΑΤΡΑ 455 ΓΕΩΡΓΙΟΥ ΚΩΝ/ΝΟΣ ΣΠΟΡΑΔΩΝ 23 georgiou@mail.com ΑΘΗΝΑ 632 ΙΩΑΝΝΟΥ ΜΑΡΙΑ ΖΑΚΥΝΘΟΥ 42 maria@mail.com ΚΟΡΙΝΘΟΣ
Example of Products Table ΚΩΔΙΚΟΣ ΠΡΟΙΟΝΤΟΣ 200301 ΠΕΡΙΓΡΑΦΗ ΚΑΤΗΓΟΡΙΑ ΤΙΜΗ ΑΠΟΘΕΜΑ ΕΚΤΥΠΩΤΗΣ CANON ΜΟΝΑΔΑ ΜΕΤΡΗΣΗΣ ΕΚΤΥΠΩΤΕΣ 120,00 150 ΤΕΜΑΧΙΑ 200303 SCANNER HP ΣΑΡΩΤΕΣ 90,00 200 ΤΕΜΑΧΙΑ 200324 201789 LAPTOP TOSHIBA ΕΚΤΥΠΩΤΗΣ HP Η/Υ 540,00 30 ΤΕΜΑΧΙΑ ΕΚΤΥΠΩΤΕΣ 110,00 120 ΤΕΜΑΧΙΑ 200309 ΜΕΛΑΝΙΑ HP ΑΝΑΛΩΣΙΜΑ 23,00 1 ΚΟΥΤΙΑ 200311 ΜΑΡΚΑΔΟΡΟΙ ΓΡΑΦΙΚΗ ΥΛΗ 4,00 3 ΤΕΜΑΧΙΑ
Table Relationships ERD Diagram! Is a schematic representation that is used in relational databases in order to describe the relationship between two tables. Different types of relationships! One to one! One to Many! Many to Many
Table Relationships ΚΩΔΙΚΟΣ ΠΕΛΑΤΗ ΕΠΩΝΥΜΟ ΟΝΟΜΑ ΔΙΕΥΘΥΝΣΗ E-MAIL ΕΔΡΑ ΚΩΔΙΚΟΣ ΠΡΟΙΟΝΤΟΣ ΠΕΡΙΓΡΑΦΗ ΚΑΤΗΓΟΡΙΑ ΤΙΜΗ ΑΠΟΘΕΜΑ ΜΟΝΑΔΑ ΜΕΤΡΗΣΗΣ 209 ΚΑΡΝΕΖΗΣ ΓΕΩΡΓΙΟΣ ΠΕΙΡΑΙΩΣ 200 george@mail.com ΑΘΗΝΑ 200301 ΕΚΤΥΠΩΤΗΣ CANON ΕΚΤΥΠΩΤΕΣ 120,00 150 ΤΕΜΑΧΙΑ 315 ΠΑΠΑΣΤΡΑΤΟΥ ΕΥΑΓΓΕΛΙΑ ΑΘΗΝΑΣ 100 papastratou@mail.com ΑΘΗΝΑ 200303 SCANNER HP ΣΑΡΩΤΕΣ 90,00 200 ΤΕΜΑΧΙΑ 109 ΞΕΝΟΥ ΙΩΑΝΝΗΣ ΚΥΠΡΟΥ 16 ksenou@mail.com ΘΕΣ/ΝΙΚΗ 200324 LAPTOP TOSHIBA Η/Υ 540,00 30 ΤΕΜΑΧΙΑ 201 ΖΑΦΕΙΡΙΟΥ ΑΝΝΑ ΠΑΤΗΣΙΩΝ 47 anna@mail.com ΠΑΤΡΑ 201789 ΕΚΤΥΠΩΤΗΣ HP ΕΚΤΥΠΩΤΕΣ 110,00 120 ΤΕΜΑΧΙΑ 455 ΓΕΩΡΓΙΟΥ ΚΩΝ/ΝΟΣ ΣΠΟΡΑΔΩΝ 23 georgiou@mail.com ΑΘΗΝΑ 200309 ΜΕΛΑΝΙΑ HP ΑΝΑΛΩΣΙΜΑ 23,00 1 ΚΟΥΤΙΑ 632 ΙΩΑΝΝΟΥ ΜΑΡΙΑ ΖΑΚΥΝΘΟΥ 42 maria@mail.com ΚΟΡΙΝΘΟΣ 200311 ΜΑΡΚΑΔΟΡΟΙ ΓΡΑΦΙΚΗ ΥΛΗ 4,00 3 ΤΕΜΑΧΙΑ One to Many One to Many ΚΩΔΙΚΟΣ ΠΕΛΑΤΗ ΚΩΔΙΚΟΣ ΠΡΟΙΟΝΤΟΣ ΠΟΣΟΤΗΤΑ ΗΜΕΡΟΜΗΝΙΑ ΑΓΟΡΑΣ 209 200303 2 25/10/2012 209 200303 3 25/10/2012 201 200303 4 26/10/2012 201 200309 2 27/10/2012 201 200309 12 27/10/2012 632 200309 10 30/10/2012
Normalization of a Database Is the process of rationalising complicated groups of data in order to minimize duplicate and redundant data, relations of many-to-many type and achieve increased stability and flexibility of the database.! There are 3 Normalisation Forms.
Normalization Example ΚΩΔΙΚΟΣ ΠΕΛΑΤΗ ΕΠΩΝΥΜΟ ΟΝΟΜΑ ΔΙΕΥΘΥΝΣΗ E-MAIL ΚΩΔΙΚΟΣ ΕΔΡΑΣ 209 ΚΑΡΝΕΖΗΣ ΓΕΩΡΓΙΟΣ ΠΕΙΡΑΙΩΣ 200 george@mail.com 1 315 ΠΑΠΑΣΤΡΑΤΟΥ ΕΥΑΓΓΕΛΙΑ ΑΘΗΝΑΣ 100 papastratou@mail.com 1 109 ΞΕΝΟΥ ΙΩΑΝΝΗΣ ΚΥΠΡΟΥ 16 ksenou@mail.com 2 201 ΖΑΦΕΙΡΙΟΥ ΑΝΝΑ ΠΑΤΗΣΙΩΝ 47 anna@mail.com 3 One to Many 455 ΓΕΩΡΓΙΟΥ ΚΩΝ/ΝΟΣ ΣΠΟΡΑΔΩΝ 23 georgiou@mail.com 1 632 ΙΩΑΝΝΟΥ ΜΑΡΙΑ ΖΑΚΥΝΘΟΥ 42 maria@mail.com 4 ΚΩΔΙΚΟΣ ΕΔΡΑΣ ΕΔΡΑ We create a separate table that contains each city only once (avoid duplicates and errors) 1 ΑΘΗΝΑ 2 ΘΕΣ/ΝΙΚΗ 3 ΠΑΤΡΑ 4 ΚΟΡΙΝΘΟΣ
Referencial Integrity Relational DBMS try to enforce rules of data and referencial integrity in order to ensure that data loss is minimised and all the database tables remain intact.! Example:! Customer-Places Order- Delete Customer-What happens to his purchase history?
Queries Queries is the way through each user or developer can interact with the database system.! The means to ask anything related to the information he needs! The DBMS returns all the relevant results! A user can execute multiple queries at the same time in order to acquire all the information needed.! The DBMS results come in a coherent, grouped and easy to understand format.
DBMS Capabilities Data Definition! Data Dictionary! Queries - Reports! Structured Query Language (SQL)! Object Oriented Database Management Systems (OODBMS)
Object Oriented Database Management Systems (OODBMS) Databases that store and retrieve not only structured numbers and characters but also Designs, Images, Photographs, Sound and full motion Video.! Stores all data and procedures as objects that are easy to access at any time needed even simultaneously by many users.! OODBMS are very popular in the fields of Multimedia Management & Java Applications that are implemented in Website development.! Cons: They are slower in response than relational DB when dealing with heavy traffic.! Pros: They can store and manage more complex and different types of data that relational DBMS.! New Trend: Hybrid Systems Object Relational Database Management Systems