DATA TYPES, DATABASES Gergely ZAJZON Dr. Med..

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

1 A B C
AP STUDY SESSION 2.
1
Chapter 1: The Database Environment
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Processes and Operating Systems
Copyright © 2013 Elsevier Inc. All rights reserved.
Relational Database and Data Modeling
David Burdett May 11, 2004 Package Binding for WS CDL.
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
Process a Customer Chapter 2. Process a Customer 2-2 Objectives Understand what defines a Customer Learn how to check for an existing Customer Learn how.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
CALENDAR.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
1 Advanced Tools for Account Searches and Portfolios Dawn Gamache Cindy Bylander.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
The 5S numbers game..
Photo Slideshow Instructions (delete before presenting or this page will show when slideshow loops) 1.Set PowerPoint to work in Outline. View/Normal click.
Welcome. © 2008 ADP, Inc. 2 Overview A Look at the Web Site Question and Answer Session Agenda.
Break Time Remaining 10:00.
The basics for simulations
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
Red Tag Date 13/12/11 5S.
Information Systems Today: Managing in the Digital World
Database Performance Tuning and Query Optimization
PP Test Review Sections 6-1 to 6-6
Chapter 7 Working with Databases and MySQL
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Database Normalization
Chapter 6 Data Design.
Access Tables 1. Creating a Table Design View Define each field and its properties Data Sheet View Essentially spreadsheet Enter fields You must go to.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 24.1 Test-Driving the Ticket Information Application.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
GIS Lecture 8 Spatial Data Processing.
Mobility Tool Fremtidens afrapportering 2013 – Erasmus Mobilitet / IP 2014 – Erasmus+ aktioner.
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
Artificial Intelligence
Before Between After.
Subtraction: Adding UP
: 3 00.
5 minutes.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Types of selection structures
Speak Up for Safety Dr. Susan Strauss Harassment & Bullying Consultant November 9, 2012.
Chapter 12: Designing Databases
Chapter 12 Working with Forms Principles of Web Design, 4 th Edition.
Essential Cell Biology
Converting a Fraction to %
Clock will move after 1 minute
PSSA Preparation.
14 Databases Foundations of Computer Science ã Cengage Learning.
Chapter 13 Web Page Design Studio
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
Copyright Tim Morris/St Stephen's School
1.step PMIT start + initial project data input Concept Concept.
1 Dr. Scott Schaefer Least Squares Curves, Rational Representations, Splines and Continuity.
Presentation transcript:

DATA TYPES, DATABASES Gergely ZAJZON Dr. Med.

DATABASE Simply: structured collection of data

DATABASE Simply: structured collection of data

DATABASE Simply: structured collection of data Storage: a collection of tables connecting to each other

DATABASE In computer science, a database is a structured collection of records or data that is stored in a computer system so that a computer program or person using a query language can consult it to answer queries. The records retrieved in answer to queries are information that can be used to make decisions.

DATA Data is visualised form of some kind of knowledge. Representative property of somebody or something. From IT perspective: data is coded information, stored in a computer as a signal sequence. Has to be stored in a structured and processable form

DATA - examples PATIENT DATA: - name - birth date - address - „TAJ” – patient code Phone book: - name - address - phone number

INFORMATION The Sesame Street character Cookie Monster describes information as "news or facts about something." Measure unit of information: bit: value can be 1 or 0 (true / false). Information is the result of processing, gathering, manipulating and organizing data in a way that adds to the knowledge of the receiver..

INFORMATION Why do we create databases? Storing and searching of data Retrieval of new informations from stored data collections

DATA TYPES Basic property of data fields Defines: a set of values structure of data allowable operations on those values Makes it possible, that in one column of a table only same type of data can be stored.

BASIC DATA TYPES Can not be divided to further separete parts

COUNTABLE DATA TYPE CLASSESS NUMERIC Byte 0-255 8 bit Shortint (-128)-127 Integer (-32768)-32767 16 bit LOGICAL 1 or 0 1 bit CHARACTER Any characters 1 byte (8 bit)

REAL DATA TYPE CLASSESS Numeric real data types (-2,9*10-39)-(1,7*1038) 48 bit Single (-1,5*10-45)-(3,4*1038) 32 bit Double (-5*10-324)-(1,7*10308) 64 bit Extended (-3,4*10-4932)-(1,1*104932) 80 bit Comp -2-63 + 1..263-1

DATA TYPE Choosing the correct data type: Helps making your database more structured Eg.: a field containing birth dates should be DATE type. Helps validating your data: Eg.: DATE field can not contain a date like 31. february 2008. You can not enter a text into an INTEGER field

Data Types Binary Boolean Character Numeric Temporal Database specific binary objects Pictures, digital signatures, etc. Boolean True/False values Character Fixed width or variable size Numeric Integer, Real (floating decimal point), Money Temporal Time, Date, Timestamp

SPREADSHEET <-> DATABASE Spreadsheet (EXCEL table): structured. - search - order - filter Software: Eg.: MS-Excel

SPREADSHEET <-> DATABASE „Excel database”: table with special layout: Rows of the table are connected with eachoter, containing the properties of one selected object. Columns: containing the same kind of property for each object. The table has a header in the first row.

SPREADSHEET <-> DATABASE TAJ Name Address Birth date.: Phone number: 123456789 Iv Béla Bp. 1014 Palota utca 1 1235.12.20. 06-1-2020030 234567890 Könyves Kálmán IV. kerület Mély utca 3 1308.Jan.1 +36-20-1234567 345678901 Harmadik András Székesfehérvár 8000 Fő út 4. 1290-04-01 (30) 1234567 456789012 Dobzse László Bp. 1031 Kis utca 3 1492.Március 2 2345678 012345678 Kalapos József Bp. 1220 Nagy utca 1 30/04/1835 06201234321

SPREADSHEET <-> DATABASE Disadvantages of Spreadsheet The same data set can only be modified by one user at the same time Storage of data is not safe enough Structure of data and connections are not defined

SPREADSHEET <-> DATABASE Disadvantages of Spreadsheet Logical limit: can not use multiple tables easiliy, as connections between tables can not be defined

SPREADSHEET <-> DATABASE Name Postal code City Address Doctor Off_PC Office_city Off_address Office_phone Balla Béla 2080 Érd Fő u. 3. Dr. House 1191 Budapest Kék u. 3. 405-2039 Kis Péter 1022 Kis u. 2. Dr. Green 1221 Fa u. 5. 373-8022 Nagy Irén 1134 Új u. 4. 303-1048 Pók Géza 2560 Diósd Tár u. 9. Dr. Kovac 2205 Zár u. 10. 323-581 INDIRECT PROPERTY => REDUNDANCY, MISTAKES IN DATA INPUT

DATABASE Data collection organized on the basis of a data model. Contains: data Structure of data Connection rule descriptions

DATA MODEL A logical structure, defining the layou of the stored data. Contains no data values. Only properties of data, structure and possible connections

DATA MODEL CONCEPTUAL DATA MODEL: Analysis of the informations and connections between them. Independent from software tools PHYSICAL DATA MODEL: Structured used in the database:definition of tables, data types, connection Software dependent

CONCEPTUAL DATA MODEL MOZIK FILMEK PK MOZI_ID PK FILM_ID M N MOZINEV FILMCIM MOZICIM HOSSZ MOZITEL NYELV MOZIWEB RENDEZO

PHYSICAL DATA MODEL MOZI__FILM FILMEK MOZIK PK MOZIFILM_ID N PK MOZI_FK PK MOZI_ID N 1 FILMCIM 1 MOZINEV FILM_FK HOSSZ MOZICIM VETITES NYELV MOZITEL RENDEZO MOZIWEB

Parts of a database Attributes (fields) Records Table Database An attribute or field is a component of a record that describes something about an item. Records A record is the representation of an individual item. Table A collection of records Database A collection of tables and rules for accessing the tables

Parts of a database Record Tables Attribute/Field Records become “rows” Attributes/fields become “columns” Rules determine the relationship between the tables and tie the data together to form a database

Referential Integrity Rules to preserve relationships Prevents orphan records Cannot add records on many sides Cannot delete from one side Cascade update Cascade delete

NORMAL FORMS The normal forms (abbrev. NF) of relational database theory provide criteria for determining a table's degree of vulnerability to logical inconsistencies and anomalies. The higher the normal form applicable to a table, the less vulnerable it is to such inconsistencies and anomalies. Each table has a "highest normal form" (HNF): by definition, a table always meets the requirements of its HNF and of all normal forms lower than its HNF; also by definition, a table fails to meet the requirements of any normal form higher than its HNF. The normal forms are applicable to individual tables; to say that an entire database is in normal form n is to say that all of its tables are in normal form n.

Normalizing Dependencies between data are identified Redundant data is minimized Reduces chances of data errors Reduces disk space The data model is flexible and easier to maintain

First Normal Form Contacts Eliminate repeating columns in each table Create a separate table for each set of related data Identify each set of related data with a primary key Contacts Id Name Company Address Phone ZipCode 1 Joe ABC 123 5532 12345 2234 3211 2 Jane XYZ 456 3421 14454 3 Chris PDQ 789 2341 14423 6655 Benefits: Now we can have infinite phone numbers or company addresses for each contact. Drawback: Now we have to type in everything over and over again. This leads to inconsistency, redundancy and wasting space. Thus, the second normal form…

Second Normal Form People Id Name Company Address Zip 1 Joe ABC 123 12345 2 Jane XYZ 456 14454 3 Chris PDQ 789 14423 Create separate tables for sets of values that apply to multiple records Relate these tables with a “foreign key”. PhoneNumbers PhoneID Id Phone 1 5532 2 2234 3 3211 4 3421 5 2341 6 6655

Third Normal Form Eliminate fields that do not depend on the primary key. People Id Name AddressID 1 Joe 2 Jane 3 Chris PhoneNumbers PhoneID Id Phone 1 5532 2 2234 3 3211 4 3421 5 2341 6 6655 Address AddressID Company Zip 1 ABC 123 12345 2 XYZ 456 14454 3 PDQ 789 14423 Is this enough? Codd thought so… What about “many to many”?

Kinds of Relationships “One to One” One row of a table matches exactly to another One person, one id number, one address “One to Many” One row of a table matches many of another One person, many phone numbers “Many to Many” One row may match many of another or many rows match one row of another

TAJ Név Irsz Város Cím Háziorvos Rend_irsz Rend_város Rend_cím RendMh_tel 123456789 Balla Béla 2080 Érd Fő u. 3. Dr. Ház 1191 Budapest Kék u. 3. 405-2039 123456790 Kis Péter 1022 Kis u. 2. Dr. Zöld 1221 Fa u. 5. 373-8022 123456791 Nagy Irén 1134 Új u. 4. 303-1048 123456792 Pók Géza 2560 Diósd Tár u. 9. Dr. Kovács 2205 Zár u. 10. 323-5819 Háziorvos Rend_irsz Rend_város Rend_cím RendMh_tel Dr. Ház 1191 Budapest Kék u. 3. 405-2039 Dr. Zöld 1221 Fa u. 5. 373-8022 303-1048 TAJ Név Irsz Város Cím Háziorvos 123456789 Balla Béla 2080 Érd Fő u. 3. Dr. Ház 123456790 Kis Péter 1022 Budapest Kis u. 2. Dr. Zöld 123456791 Nagy Irén 1134 Új u. 4. 123456792 Pók Géza 2560 Diósd Tár u. 9. Dr. Kovács

BETEGEK PK TAJ NEV IRSZ VAROS CIM HAZIORVOS REND IRSZ REND VAROS REND_CIM RENDMH_TEL BETEGEK ORVOSOK PK TAJ PK PECSÉT M N NEV ORVOS IRSZ IRSZ VAROS VAROS CIM CIM TEL

DATA MANAGEMENT LANGUAGE SQL = Structured Query Language DDL – Data Definition (CREATE) DML – Data Manipulation (INSERT, UPDATE, DELETE) QL – Query Language (SELECT)

TABLE TYPES Main (core) tables Subtables Linking tables (association table) Dictionary tables (look-up table, value list)

DATABASE SERVER A database server is a computer program that provides database services to other computer programs or computers, as defined by the client-server model. The term may also refer to a computer dedicated to running such a program. Database management systems frequently provide database server functionality, and some DBMS's (e.g., MySQL) rely exclusively on the client-server model for database access. Database Master servers are central and main locations of data while Database Slave servers are synchronized backups of the master acting as proxies.

DATABASE SERVER Special DBMS software user interface is not an important aim Allows multi-user change access Controll of user rights Backup of stored data Transaction management

DATABASE SERVERS Oracle MS-SQL My-SQL PostgreSQL

Gergely Zajzon Dr. Med. E-mail: zajzon.gergely@zazacom.hu Web: http://www.gyogyszerugy.hu Telefon: +36-20-9604294