Data Models and Database Management Systems (DBMSs) Dr. Philip Cannata



Similar documents
Displaying Data from Multiple Tables. Chapter 4

Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB

SQL Introduction Chapter 7, sections 1 & 4. Introduction to SQL. Introduction to SQL. Introduction to SQL

Displaying Data from Multiple Tables

Introduction to SQL ( )

Overview of Database Management

Comp 3311 Database Management Systems. 2. Relational Model Exercises

Chapter 1. Writing Basic. SQL Statements

1. INTRODUCTION TO RDBMS

Aggregating Data Using Group Functions

Overview of Data Management

Access to Relational Databases Using SAS. Frederick Pratter, Destiny Corp.

1 File Processing Systems

Subqueries Chapter 6

Chapter 2. Data Model. Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel

Introduction. Introduction: Database management system. Introduction: DBS concepts & architecture. Introduction: DBS versus File system

Chapter 1: Introduction

RDBMS Using Oracle. Lecture Week 7 Introduction to Oracle 9i SQL Last Lecture. kamran.munir@gmail.com. Joining Tables

Introduction: Database management system

Data Big and Small: How Publisher gain Value out of Data in the Future

Database Access from a Programming Language: Database Access from a Programming Language

Database Access from a Programming Language:

Relational Algebra. Query Languages Review. Operators. Select (σ), Project (π), Union ( ), Difference (-), Join: Natural (*) and Theta ( )

3. Relational Model and Relational Algebra

Procedural Extension to SQL using Triggers. SS Chung

Databases and BigData

Elena Baralis, Silvia Chiusano Politecnico di Torino. Pag. 1. Physical Design. Phases of database design. Physical design: Inputs.

Producing Readable Output with SQL*Plus

Chapter 1: Introduction

Lesson 8: Introduction to Databases E-R Data Modeling

Chapter 1: Introduction. Database Management System (DBMS)

Objectives of Lecture 1. Labs and TAs. Class and Office Hours. CMPUT 391: Introduction. Introduction

We know how to query a database using SQL. A set of tables and their schemas are given Data are properly loaded

? Database Management

B2.2-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

Oracle/SQL Tutorial 1

CSE 132A. Database Systems Principles

Introduction to database management systems

History of Database Systems

7. Databases and Database Management Systems

David M. Kroenke and David J. Auer Database Processing 12 th Edition

Boyce-Codd Normal Form

Study Notes for DB Design and Management Exam 1 (Chapters 1-2-3) record A collection of related (logically connected) fields.

Ch.5 Database Security. Ch.5 Database Security Review

SQL DATA DEFINITION: KEY CONSTRAINTS. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 7

SQL is capable in manipulating relational data SQL is not good for many other tasks

Foundations of Information Management

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

Introduction to Object-Oriented and Object-Relational Database Systems

Information Management

SUBQUERIES AND VIEWS. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 6

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. Introduction to Databases. Why databases? Why not use XML?

COURSE NAME: Database Management. TOPIC: Database Design LECTURE 3. The Database System Life Cycle (DBLC) The database life cycle contains six phases;

SQL, PL/SQL FALL Semester 2013

Advance DBMS. Structured Query Language (SQL)

Database CIS 340. lab#6. I.Arwa Najdi

You can use command show database; to check if bank has been created.

Database Management System Choices. Introduction To Database Systems CSE 373 Spring 2013

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

Hacking and Protecting Oracle DB. Slavik Markovich CTO, Sentrigo

Simple SQL Queries (3)

Using TimesTen between your Application and Oracle. between your Application and Oracle. DOAG Conference 2011

Scheme G. Sample Test Paper-I

Computer Security: Principles and Practice

Rapid SQL XE Product Reviewer Guide

Chapter 7: Relational Database Design

Big Data. Marriage of RDBMS-DWH and Hadoop & Co. Author: Jan Ott Trivadis AG Trivadis. Big Data - Marriage of RDBMS-DWH and Hadoop & Co.

DBMS / Business Intelligence, SQL Server

Chapter 6: Integrity Constraints

Principles of Database Management Systems. Overview. Principles of Data Layout. Topic for today. "Executive Summary": here.

Elena Baralis, Silvia Chiusano Politecnico di Torino. Pag. 1. Query optimization. DBMS Architecture. Query optimizer. Query optimizer.

UltraQuest Cloud Server. White Paper Version 1.0

Retrieval: Multiple Tables and Aggregation

David M. Kroenke and David J. Auer Database Processing 11 th Edition Fundamentals, Design, and Implementation. Chapter Objectives

Comp 5311 Database Management Systems. 3. Structured Query Language 1

Week 1 Part 1: An Introduction to Database Systems. Databases and DBMSs. Why Use a DBMS? Why Study Databases??

Introduction to NoSQL Databases. Tore Risch Information Technology Uppsala University

Database Management. Chapter Objectives

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25)

Objectives of Lecture 1. Class and Office Hours. Labs and TAs. CMPUT 391: Introduction. Introduction

Ficha técnica de curso Código: IFCAD320a

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

Objectives. Oracle SQL and SQL*PLus. Database Objects. What is a Sequence?

Database Fundamentals

DECLARATION SECTION. BODY STATEMENTS... Required

CSE 233. Database System Overview

E6895 Advanced Big Data Analytics Lecture 4:! Data Store

CSE 530A Database Management Systems. Introduction. Washington University Fall 2013

Overview. Introduction to Database Systems. Motivation... Motivation: how do we store lots of data?

Big Data, Fast Data, Complex Data. Jans Aasman Franz Inc

Introduction to Ontologies

Sidebar Dashboard User Guide. Modified: June, 2013 Version 8.2

How to Design and Create Your Own Custom Ext Rep

! E6893 Big Data Analytics Lecture 9:! Linked Big Data Graph Computing (I)

Lecture 6. SQL, Logical DB Design

Ching-Yung Lin, Ph.D. Adjunct Professor, Dept. of Electrical Engineering and Computer Science IBM Chief Scientist, Graph Computing. October 29th, 2015

BUILDING OLAP TOOLS OVER LARGE DATABASES

Transcription:

Data Models and Database Management Systems (DBMSs) Dr. Philip Cannata 1

Data Models in the 1960s, 1970s, and 1980s Hierarchical Network (Graph) Relational Schema (Model) - first 1956 Vern Watts was IMS's chief architect for many years. Watts joined IBM in 1956 and worked at IBM's Silicon Valley development labs until his death on April 4, 2009. 1966 IBM began the designed of IMS with Rockwell and Caterpillar for the Apollo program, where it was used to inventory the very large bill of materials (BOM) for the Saturn V moon rocket and Apollo space vehicle. 1968 The first "IMS READY" message appeared on an IBM 2740 terminal in Downey, California, on 14 August 1968. 1965 CODASYL (Conference / Committee on Data Systems Languages) formed a List Processing Task Force. 1969 the network CODASYL database model was published. 1980s interest in CODASYL gradually faded due to growing interest in relational databases. Year Event 1970 Dr. E. F. Codd develops the relational database model. 1978 IBM develops the predecessor to SQL. 1979 Relational Software, Inc. (later renamed Oracle) releases the first relational DBMS, Oracle. 1982 IBM releases their first RDBMS, SQL/DS (SQL/Data System). 1985 IBM released DB2 (Database 2). 1987 Microsoft releases SQL Server. 1989 ANSI publishes first SQL standards (ANSI/ISO SQL-89, or SQL1). 1992 ANSI revises standards (ANSI/ISO SQL-92, or SQL2). 1999 ANSI publishes SQL3 (ANSI/ISO SQL:1999). 2003 ANSI publishes SQL4 (ANSI/ISO SQL:2003). Dr. Philip Cannata See humorous video here 2

Hierarchical DBMS Example (A Contrived Hierarchical DBMS using HTML) Queries Show all employees: $('emp') Show employee with id=7876: $( #7876 ) Show all departments: $( dept') Show department of employee with id=7876: $('#7876').parent().andSelf() Show department of employees: $('emp').parent().andself() Show all employees with their department name: var r=$('emp').each(function( index, element ){console.log( $ (this).attr('empno'), $ (this).attr('ename'), $(this).attr('job'), $ (this).attr('mgr'), $ (this).attr('hiredate'), $(this).attr('sal'), $(this).attr('comm'), $ (this).parent().attr('dname') )}) Show all employees with their Dr. Philip Cannata manager s name: 3

Hierarchical DBMS Example (A Contrived Hierarchical DBMS using HTML) Queries Show all employees with their manager s name: var a = $ ("emp").each(function(){ try{ console.log( " EMPLOYEE: " + $ (this).attr('ename') + " MANAGER " + $("#"+ $ (this).attr("mgr")).attr('ename') ); }catch(e){} }); Dr. Philip Cannata 4

Hierarchical DBMS Example (A Second Contrived Hierarchical DBMS using HTML) Queries Show all managers: $( mgr') Show all employees with their manager s name: var r=$('emp').each(function( index, element ){console.log( $ (this).attr('empno'), $ (this).attr('ename'), $(this).attr('job'), $ (this).attr('mgr'), $ (this).attr('hiredate'), $(this).attr('sal'), $(this).attr('comm'), $ (this).parent().parent().attr('ename') )} ) Dr. Philip Cannata 5

Dr. E. F. Codd 1. Humans only know how to store data on Disk or in Memory in the form of Mathematical Relations (Tables). 2. So, the Data Model should be Relational (i.e., Tables). 3. Also, DBMSs should have an ad hoc query language. A mathematical Relation is a subset of the cross-product of a set of Domains. e.g., Example 1 Example 2 <! 0! 1! 0! 2! 0! 3!!! 1! 2! 1! 3!!! 2! 3!!! D1: People! Phil! Rita! D2: Ages! 60! 65! D3: Gender! M! F! People! Ages! Gender! Phil! 60! M! Phil! 60! F! Phil! 65! M! Phil! 65! F! Rita! 60! M! Rita! 60! F! Rita! 65! M! Rita! 65! F! Dr. Philip Cannata 6

Traditional Data Management in the 1980s, 1990s, and 2000s Hierarchical Network (Graph) Relational Schema (Model) - first 1956 Vern Watts was IMS's chief architect for many years. Watts joined IBM in 1956 and worked at IBM's Silicon Valley development labs until his death on April 4, 2009. 1966 IBM began the designed of IMS with Rockwell and Caterpillar for the Apollo program, where it was used to inventory the very large bill of materials (BOM) for the Saturn V moon rocket and Apollo space vehicle. 1968 The first "IMS READY" message appeared on an IBM 2740 terminal in Downey, California, on 14 August 1968. 1965 CODASYL (Conference / Committee on Data Systems Languages) formed a List Processing Task Force. 1969 the network CODASYL database model was published. 1980s interest in CODASYL gradually faded due to growing interest in relational databases. Year Event 1970 Dr. E. F. Codd develops the relational database model. 1978 IBM develops the predecessor to SQL. 1979 Relational Software, Inc. (later renamed Oracle) releases the first relational DBMS, Oracle. 1982 IBM releases their first RDBMS, SQL/DS (SQL/Data System). 1985 IBM released DB2 (Database 2). 1987 Microsoft releases SQL Server. 1989 ANSI publishes first SQL standards (ANSI/ISO SQL-89, or SQL1). 1992 ANSI revises standards (ANSI/ISO SQL-92, or SQL2). 1999 ANSI publishes SQL3 (ANSI/ISO SQL:1999). 2003 ANSI publishes SQL4 (ANSI/ISO SQL:2003). Dr. Philip Cannata 7

There were many other Data Models, but most were not implemented as DBMSs. ER Data Model is still used in Data Modeling Introduced by Peter Chen in 1976 - "The Entity Relationship Model: Toward a Unified View of Data" for entity relationship modeling. Dr. Philip Cannata 8

There were many other Data Models but, most were not implemented as DBMSs. IDEF1X Data Model is still used in Data Modeling Dr. Philip Cannata 9

There were many other Data Models, but most were not implemented as DBMSs. IE Data Model is still used in Data Modeling Dr. Philip Cannata 10

There were many other Data Models, but most were not implemented as DBMSs. UML Data Model is still used in Data Modeling ac count account_number balance 0..* 0..1 branch branch_name branch_city assets 0..* 0..1 0..* customer customer_name customer_street customer_city 0..* 0..* loan 0..* loan_number amount Dr. Philip Cannata 11

There were many other Data Models, but most were not implemented as DBMSs. OO DBMSs were implemented but failed Dr. Philip Cannata 12

There were many other Data Models, but most were not implemented as DBMSs. LDAP was implemented and still exists today as Directory Servers (e.g., Active Directory) Dr. Philip Cannata 13

There were many other Data Models, but most were not implemented as DBMSs. EAV was implemented Dr. Philip Cannata 14

EAV Evolved into RDF and other NoSQL DBMSs Dr. Philip Cannata 15

Data Management Today NoSQL Schema(Model)-later Big Data Schema(Model)-never Relational (YeSQL) Schema(Model)-first Dr. Philip Cannata 16

Data Management Today NoSQL Schema(Model)-later https://training.edb.utexas.edu/node/2329 Big Data Schema(Model)-never http://www.lynda.com/nosql-tutorials/ NoSQL-SQL-Professionals/368756-2.html? srchtrk=index:1%0alinktypeid: 2%0Aq:nosql%0Apage:1%0As:relevance %0Asa:true%0Aproducttypeid:2 Relational (YeSQL) Schema(Model)-first I don t endorse all of the statements in this course but it does represent what many people are preaching. Dr. Philip Cannata 17

Dr. Philip Cannata 18

cs347 Data Management NoSQL Schema(Model)-later Big Data Schema(Model)-never 2 Relational (YeSQL) Schema-first Dr. Philip Cannata The Complexity goes Somewhere! SIM Circa 1980! 19

DataStax Graph Databases http://www.datastax.com/2015/03/qa-cassandra-and-titandb-insights-into-datastaxs-graph-strategy - minute 10:45-28:00 Dr. Philip Cannata 20

Dr. Philip Cannata 21

Demo of Neo4j Cypher Graph Database Language I ll be using the Apex 5 REST interface for this demo. Dr. Philip Cannata 22

Demo of Neo4j Cypher Graph Database Language The Apex 5 REST interface is similar to POSTMAN. Dr. Philip Cannata 23

Demo of Neo4j Cypher Graph Database Language "CREATE (:emp { EMPNO : 7369, ENAME : 'SMITH', JOB : 'CLERK', MGR : 7902, HIREDATE : '17- DEC-80', SAL : 800, COMM : 0, DEPTNO : 20})" Notice: I didn t create an emp table before this insert. Dr. Philip Cannata 24

Demo of Neo4j Cypher Graph Database Language "CREATE (:dept { DEPTNO : 20, DNAME : 'RESEARCH', LOC : 'DALLAS' })" Dr. Philip Cannata 25

Demo of Neo4j Cypher Graph Database Language "MATCH (a:emp),(b:dept) WHERE a.deptno = 20 AND b.deptno = 20 CREATE (a)<-[:employees]-(b)" Creating a Relationship. Dr. Philip Cannata 26

Demo of Neo4j Cypher Graph Database Language "MATCH(a:emp) RETURN a" Dr. Philip Cannata 27

Demo of Neo4j Cypher Graph Database Language "MATCH(a:emp)<-[:employees]-(b:dept) WHERE b.deptno = 20 RETURN b, a.ename, a.job, a.mgr, a.deptno, a.hiredate" Dr. Philip Cannata 28

Demo of Neo4j Cypher Graph Database Language I ll load this behind the scenes and then do a few more examples. Dr. Philip Cannata 29

SIM DDL for the emp/dept Database Creating a Relationships. Dr. Philip Cannata 30

Demo of Neo4j Cypher Graph Database Language "MATCH(a:emp)-[:dept]->(b:dept) RETURN b.dname, a.ename" Dr. Philip Cannata 31

Demo of Neo4j Cypher Graph Database Language "MATCH(a:emp)<-[:employees]-(b:dept) WHERE b.deptno = 20 RETURN b, a.ename, a.job, a.mgr, a.deptno, a.hiredate" Dr. Philip Cannata 32

cs347 Data Management NoSQL Schema(Model)-later Big Data Schema(Model)-never 2 4 Relational (YeSQL) Schema-first The Complexity goes Somewhere! 1 3 Dr. Philip Cannata SIM Circa 1980! 33

All Data Models are Ignoring the First Data Model! from http://fitelson.org/125/aristotle.pdf Dr. Philip Cannata 34

Except for SIM, which was implemented in the 1980s and still exists at UT with Me Based on the 1981 paper Database Description with SDM: A Semantic Database Model by Michael Hammer and. Dennis McLeod, see class calendar for a pdf version of the paper. Doug Tolbert Dr. Philip Cannata 35

Dr. Philip Cannata 36

SIM DDL for the emp/dept Database Creating a Relationships. Dr. Philip Cannata 37

Revealing a Secret Dr. Philip Cannata 38

{'query': u'"match(a:emp) RETURN a"'} ReL statement is: MATCH(a:emp) RETURN a SIM is: FROM EMP RETRIEVE *; Revealing a Secret ReL is a research system that I ve built with the help of my students. ReL is a fork of jython, which is a python interpreter written in Java that incorporates various Data Models. In this case, ReL converts Neo4j/Cypher into SIM and then converts SIM to SPARQL. ReL is also being run as my RESTful Server. SPARQL is: SELECT DISTINCT empno, deptno, comm, job, mgr, ename, hiredate, sal from table( sem_match('select * where { GRAPH <emp_schema> {?indiv rdf:type :emp }?indiv :empno?empno.?indiv :deptno?deptno.?indiv :comm?comm.?indiv :job?job.?indiv :mgr?mgr.?indiv :ename?ename.?indiv :hiredate?hiredate.?indiv :sal?sal. }', SEM_MODELS('F2015_CS370_SIM'), null, SEM_ALIASES( SEM_ALIAS('', '#')), null) ) (('EMPNO', 'DEPTNO', 'COMM', 'JOB', 'MGR', 'ENAME', 'HIREDATE', 'SAL'), (7900, 30, 0, 'CLERK', 7698, 'JAMES', '03-DEC-81', 950), (7698, 30, 0, 'MANAGER', 7839, 'BLAKE', '01-MAY-81', 2850))... Dr. Philip Cannata 39

Revealing a Secret When I loaded the full Cypher, this was built under the covers by ReL. Dr. Philip Cannata 40

Revealing a Secret "MATCH(a:emp)<-[:employees]-(b:dept) WHERE b.deptno = 20 RETURN b, a.ename, a.job, a.mgr, a.deptno, a.hiredate" Dr. Philip Cannata 41

Revealing a Secret {'query': u'"match(a:emp)<-[:employees]-(b:dept) WHERE b.deptno = 20 RETURN b, a.ename, a.job, a.mgr, a.deptno, a.hiredate"'} ReL statement is: MATCH(a:emp)<-[:employees]-(b:dept) WHERE b.deptno = 20 RETURN b, a.ename, a.job, a.mgr, a.deptno, a.hiredate SIM is: FROM DEPT RETRIEVE *, ENAME OF employees, JOB OF employees, MGR OF employees, DEPTNO OF employees, HIREDATE OF employees WHERE DEPTNO = 20; SPARQL is: SELECT DISTINCT deptno, dname, loc, x0_1, x1_1, x2_1, x3_1, x4_1 from table( sem_match('select * where { GRAPH <dept_schema> {?indiv rdf:type :dept }?indiv :deptno?deptno.?indiv :dname?dname.?indiv :loc?loc.?indiv :deptno :20. OPTIONAL {?indiv :employees?x0_0.?x0_0 :ename?x0_1.?indiv :employees?x0_0.?x0_0 :job?x1_1.?indiv :employees?x0_0.?x0_0 :mgr?x2_1.?indiv :employees?x0_0.?x0_0 :deptno?x3_1.?indiv :employees?x0_0.?x0_0 :hiredate?x4_1. } }', SEM_MODELS('F2015_CS370_SIM'), null, SEM_ALIASES( SEM_ALIAS('', '#')), null) ) (('DEPTNO', 'DNAME', 'LOC', 'X0_1', 'X1_1', 'X2_1', 'X3_1', 'X4_1'), (20, 'RESEARCH', 'DALLAS', 'ADAMS', 'CLERK', 7788, 20, '12-JAN-83'), (20, 'RESEARCH', 'DALLAS', 'SCOTT', 'ANALYST', 7566, 20, '09-DEC-82'))... Dr. Philip Cannata 42

How is the Neo4j/Cypher to SIM translation done in ReL? MATCH (e:emp)-[:deptno]->(d:dept)-[:orgnum]->(o:org) WHERE e.empno = 111 RETURN e.empno, e.ename, e.sal, d.dname, o.oname In CS345, you learn to parse this kind of statement and build an Abstract Syntax Tree (AST): You use a set of formal grammars to do this. You also learn how to travers the AST and output something like SIM (I teach how to do this using a Visitor pattern). This work was done by Carson Ball as a CS370 project this past Summer. Carson has had cs345, cs375, and cs347. I would hire him! Dr. Philip Cannata 43

Revealing another Secret Dr. Philip Cannata 44

Others are Starting to Discover this Secret DataStax Graph Databases http://www.datastax.com/2015/03/qa-cassandra-and-titandb-insights-into-datastaxs-graph-strategy - minute 29:00 to the end Dr. Philip Cannata 45

But there s More that Others are Not Discovering Yet I ll do this behind the scenes. What would expect from this SPARQL query? Dr. Philip Cannata 46

class/subclass Inferencing is just the beginning For more information on Inferencing, see Chapter 9 of the Learning SPARQL book (see the Books and Papers Tab on the class website). Dr. Philip Cannata 47

cs347 Data Management NoSQL Schema(Model)-later Big Data Schema(Model)-never 2 5 6 4 Relational (YeSQL) Schema-first The Complexity goes Somewhere! 1 3 Dr. Philip Cannata SIM Circa 1980! 48

Useful Free Books! See the Books and Papers Tab on the class website. Dr. Philip Cannata 49