Data Types COMP3017 Advanced Databases Dr Nicholas Gibbins - 2012-2013.

Slides:



Advertisements
Similar presentations
Limitations of the relational model 1. 2 Overview application areas for which the relational model is inadequate - reasons drawbacks of relational DBMSs.
Advertisements

Chapter 10: Designing Databases
Database Ed Milne. Theme An introduction to databases Using the Base component of LibreOffice LibreOffice.
IMPLEMENTATION OF INFORMATION RETRIEVAL SYSTEMS VIA RDBMS.
Technology Guide 3 Data and Database T3-1. IT for Management Prof. Efraim Turban T3-2 File Management Hierarchy of data for a computer-based file Record.
Web- and Multimedia-based Information Systems. Assessment Presentation Programming Assignment.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
WMES3103 : INFORMATION RETRIEVAL
Introduction to Structured Query Language (SQL)
Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Database Management: Getting Data Together Chapter 14.
Organizing Data & Information
ISD3 Chris Wallace Next 6 Weeks Extended Relational Model Object Orientation Matching systems 3 tier architecture Technology.
1 Data & Database Development. 2 Data File Bit Byte Field Record File Database Entity Attribute Key field Key file management concepts include:
Databases Week 7 LBSC 690 Information Technology.
Introduction to Databases Transparencies
CH 11 Multimedia IR: Models and Languages
Introduction to Structured Query Language (SQL)
The University of Akron Dept of Business Technology Computer Information Systems Database Management Approaches 2440: 180 Database Concepts Instructor:
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
HYPERTEXT MARKUP LANGUAGE (HTML)
Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
IST Databases and DBMSs Todd S. Bacastow January 2005.
Chapter 11 Databases.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Data at the Core of the Enterprise. Objectives  Define of database systems.  Introduce data modeling and SQL.  Discuss emerging requirements of database.
1 Advanced Computer Programming Databases. Overview What is a database? Database Basics Database Components Data Models Normalization Database Design.
© Paradigm Publishing Inc. 9-1 Chapter 9 Database and Information Management.
DAY 14: ACCESS CHAPTER 1 Tazin Afrin October 03,
3. Multimedia Systems Technology
Concepts and Terminology Introduction to Database.
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
The Data in a Relation To consider atomic data in relations; To consider data types in a relation; To consider missing data & NULLs in relations. Objectives.
MULTIMEDIA DATABASES -Define data -Define databases.
Object Persistence Design Chapter 13. Key Definitions Object persistence involves the selection of a storage format and optimization for performance.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
Term 2, 2011 Week 1. CONTENTS Problem-solving methodology Programming and scripting languages – Programming languages Programming languages – Scripting.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
ITGS Databases.
Relational Databases. Relational database  data stored in tables  must put data into the correct tables  define relationship between tables  primary.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Chap 14 Presentation Layer Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
©Silberschatz, Korth and Sudarshan1 Structured Query Language (SQL) Data Definition Language Domains Integrity Constraints.
1 CS 430 Database Theory Winter 2005 Lecture 10: Introduction to SQL.
Temporal Data Modeling
Where does time go ?. Applications abound Temporal database systems provide built-in support for recording and querying time-varying information Application.
What is GIS? “A powerful set of tools for collecting, storing, retrieving, transforming and displaying spatial data”
MULTIMEDIA DATA MODELS AND AUTHORING
CPT-S Advanced Databases 11 Yinghui Wu EME 49.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Data Types COMP3211 Advanced Databases Dr Nicholas Gibbins
OODBMS and ORDBMS. Background Object-oriented software, based on the principles of user-defined datatypes, along with inheritance and polymorphism, is.
Geog. 314 Working with tables.
COMP3211 Advanced Databases
Introduction Multimedia initial focus
Multidimensional Access Structures
Multimedia Database.
Datamining : Refers to extracting or mining knowledge from large amounts of data Applications : Market Analysis Fraud Detection Customer Retention Production.
Databases.
Tools for Memory: Database Management Systems
9/22/2018.
Spreadsheets, Modelling & Databases
Presentation transcript:

Data Types COMP3017 Advanced Databases Dr Nicholas Gibbins

Overview Data types and operations Modelling data Temporal data Spatial data Multimedia data

Data Types and Operations

Data Types Numeric Character Temporal Spatial Image Text Audio and Video

Operations on Data Comparison Arithmetic Fuzzy searches Retrieve all documents that contain a given word Find a picture that contains blue sky

Which operations are meaningful? Can you add two weights together? –2kg + 2kg = ? Can you multiply two weights? –2kg * 2kg = ? Can you add a weight to a quantity? –13 + 2kg = ? Can you multiply a weight by a quantity? –13 * 2 kg = ?

Which operations are meaningful? Can you compare two images? =

Which operations are meaningful? Can you add two images? += ?

Further Questions Is the data ordered in any sense? –Total order vs. partial order Does the order actually have any meaning, or is it just a convenience?

Modelling Data

Data Domains A data domain is the set of all the values that may be taken by a particular item of data UK_TOWNS –Aberdeen, Alnwick, …, Leeds, London, …, Southampton, …, York GENDER –Male, Female PERSON_WEIGHT –0-130kg (to 2 sig. fig.)

Domains The Entity/Relationship model definition: Each simple attribute of an entity type is associated with a value set, or domain, which specifies the set of values that may be assigned to that attribute for each individual entity

Domains The Relational model: –A domain is a set of atomic values –By atomic, we mean that each value in the domain is indivisible as far as the relational model is concerned –A common method of specifying a domain is to specify a data type from which the data values forming the domain are drawn

Rows, Columns and Domains

Domains “Domains are sets of things we can talk about. Relations are (true) statements about those things.” Chris Date Domain = Data Type = Object Class

Basic Data Types Numeric data types Boolean data types Enumerated data types Date and Time data types User-defined data types

Enforcing Type Constraints Some SQL databases can enforce domain constraints –Column constraints or CHECK constraints –Referential integrity constraints –Enumerated lists Otherwise, follow the procedural approach; code your own checks within the application program

Complex Object Models Unstructured –Bitmap image (BLOB) –Long text string (BLOB or CLOB) Structured –Defined by use of type constructors in an OODBMS –The most basic constructors are atom, tuple and set –Relationships between objects established using an Object ID (OID)

Flat tables in Relational Model FNAMEMINITLNAMESSNBDATEADDRESSSEXSALARYSUPERSSNDNO DNAMEDNUMBERMGRSSNMGRSTARTDATE DNUMBERDLOCATIONESSNPNOHOURS PNAMEPNUMBERPLOCATIONDNUM ESSNDEPENDENT_NAMESEXBDATERELATIONSHIP EMPLOYEE DEPT_LOCATIONSWORKS_ON PROJECT DEPENDENT

Complex Object - Department

Abstract Data Types An abstract data type is the OO concept that allows construction of an arbitrarily complex object Abstract data typing models classes, each with –A name –A collection of operations (methods) –A representation Abstract data typing supports a much more natural representation of real world problems Support for (some) complex objects has been added to relational DBMSs.

Temporal Data

The dimension of time is needed to answer such questions as: –What was the average price of product X during 1995? –In which month did we sell the most copies of video Y? –What was the treatment history for patient Z?

Characteristics of Time Time structure –Linear –Possible futures –Branching time –Directed acyclic graph –Periodic/cyclic Boundedness of time –Unbounded –Time origin exists –Bounded at both ends

Time Density: Discrete Timeline is isomorphic to the integers –Integers have a total order Timeline is composed of fixed periods, termed chronons Between each pair of chronons is a finite number of other chronons

Time Density: Dense Timeline is isomorphic to the rational numbers –Rational numbers have a partial order Between each pair of chronons is an infinite number of other chronons

Time Density: Continuous Timeline is isomorphic to the real numbers –Real numbers have a total order Between each pair of chronons is an infinite number of other chronons

Characteristics of Time Granularity if important –Event A occurs at 11.00am –Event B occurs at 3.00pm the same day –Does event A precede event B? –The answer is different if –Granularity is one day –Granularity is one minute There is also a distinction between sequence and time

Storing Times in a Database Various times may be associated with an event that appears in a database We may wish to record –The Valid Time of a fact – when the fact is true in reality –The Transaction Time of a fact – when the fact is current in the database, and can be retrieved –Both of these (bitemporal)

SQL Extensions TSQL includes: –A WHEN clause (see next slide) –Retrieval of timestamps –Retrieval of temporally ordered information –Using the TIME-SLICE clause to specify a time domain –Using the GROUP BY clause for modified aggregate functions

TSQL WHEN Clause Format of the SELECT … WHEN statement –SELECT { select-list } FROM { list of relations } WHERE { where-clause } WHEN { temporal clause } Temporal comparison operators include: –BEFORE/AFTER, FOLLOWS/PRECEDES DURING, EQUIVALENT, ADJACENT, OVERLAPS –(compare with Allen’s Interval Calculus)

Spatial Data

Data Types include: –Points –Regions –Boxes –Quadrangles –Polynomial surfaces –Vectors

Spatial Data Operations include: –Length –Intersect –Contains –Overlaps –Centre

Spatial Data Applications Computer Aided Design (CAD) Computer generated graphics Geographic Information Systems (GIS For these systems, the properties of interest would include: –Connectivity –Adjacency –Order –Metric relations

Spatial Data Characteristics In systems dealing with space: –Data objects may be highly complex –Data volumes may be very large –Data may be held in real time –Performance is not easy to achieve –Access is likely to be through specialised graphical front ends; operator skills are key –Query processing will not be performed using SQL

Multimedia Data

Textual Data Text data may be –Already in machine-readable form, from a word-processor, spreadsheet or other source –Read using OCR techniques Text data is essentially unstructured, and an index of some kind needs to be built –By a human operator –Automatically by building a inverted list of every significant word in the database

Textual Data Markup languages do give some structure to a document –HTML is a markup language for the Web XML (and its predecessor SGML) allows a programmer to create portable documents that contain structured data –Can also create new markup languages Character Large Objects (CLOBs) are now commonly supported by vendors –Able to store and handle text documents in addition to standard data –Provision of text search and retrieval facilities

Text and Documents Much data is stored in the form of text It would be very useful to be able to ask queries such as: –Find all the legal documents concerning client ‘Jones’ –Find all the suspects with false teeth who have been interviewed –Find all the articles on ‘databases’

Image Data Examples of still images include: –X-Rays –Maps –Photographs These are all classified as binary large objects (BLOBs) A BLOB has no semantics attached

Image Databases An image database needs to provide support for –Image analysis and pattern recognition –Image structuring and understanding –Spatial reasoning and image information retrieval Mainstream DB vendors now adding –Support for BLOBs –Access using QBIC (Query by Image Content)

Audio Data Digitised sound –Stored in various formats, such as WAV or MP3 –Consumes large amounts of storage –Compression techniques normally used MIDI (Musical Instrument Digital Interface) –More compact than digitised audio –Consists of a sequence of instructions: Note_On, Note_Off, Increase_Volume –Interpreted by a synthesiser

Video Data One of the most space hungry formats of all –Images stored as a sequence of frames –Each frame can consume over a megabyte –Frames typically played back at fps To integrate video and audio, interleaved file structures incorporate times sequencing of audio/video playback –Microsoft AVI –Apple Quicktime