SlideShare a Scribd company logo
1 of 24
Download to read offline
Database Management Systems 2009/10
                         – Chapter 1: Introduction –


                                   J. Gamper



  ◮   The Course
  ◮   The DB Field
  ◮   Basic Definitions
  ◮   The Relational Data Model
  ◮   Accessing DBs

 These slides were developed by:
 – Michael B¨hlen, University of Zurich, Switzerland
             o
 – Johann Gamper, University of Bozen-Bolzano, Italy

DMS 2009/10                              J. Gamper     1/24
The Course



  ◮   Course page
         ◮    http://www.inf.unibz.it/dis/teaching/DMS
  ◮   The slides are based on the following text books and associated material:
         ◮    A. Silberschatz, H. Korth, and S. Sudarshan: Database System Concept, 5
              edition, McGraw Hill, 2006.
         ◮    R. Elmasri and S.B. Navathe: Fundamentals of Database Systems, 4th
              edition, Pearson Addison Wesley, 2004.
  ◮   Additional Book
         ◮    Garcia-Molina, Ullman,Widom: Database Systems: The Complete Book,
              Prentice-Hall, 2002.




DMS 2009/10                                  J. Gamper                             2/24
The Course Content

  ◮   Storage and File Structure
         ◮    Physical Storage media, file and buffer manager
  ◮   Indexing and Hashing
         ◮    Ordered indices, B-trees, hashing
  ◮   Query Processing
         ◮    Measures of query cost, selection and join operation
  ◮   Query Optimization
         ◮    Transformation of relational expressions, evaluation plans
  ◮   Transactions
         ◮    ACID properties, SQL transactions
  ◮   Concurrency Control
         ◮    Lock-/timestamp-/validation-based protocols
  ◮   Recovery System
         ◮    Log-based recovery, shadow paging



DMS 2009/10                                       J. Gamper                3/24
The DB Field
  ◮   Journal Publications
         ◮    ACM Transaction on Database System (TODS)
         ◮    IEEE Transactions on Knowledge and Data Engineering (TKDE)
         ◮    The VLDB Journal
         ◮    Information Systems
  ◮   Conference Publications
         ◮    SIGMOD
         ◮    VLDB
         ◮    EDBT
         ◮    ICDE
  ◮   DB & LP Bibliography (Michael Ley, Uni Trier, Germany)
         ◮    http://www.informatik.uni-trier.de/˜ley/db/
  ◮   Commercial Products
         ◮    Oracle
         ◮    DB2 (IBM)
         ◮    Microsoft SQL Server
         ◮    Postgres
         ◮    Sybase
         ◮    Ingres
         ◮    Informix
         ◮    PC “DBMSs”: Paradox, Access, ...
DMS 2009/10                                   J. Gamper                    4/24
Basic Definitions



   ◮   Mini-world: The part of the real world we are interested in
   ◮   Data: Known facts about the mini-world that can be recorded
   ◮   Database (DB): A collection of related data
   ◮   Database Management System (DBMS): A software package to
       facilitate the creation/maintenance of databases
   ◮   Database System: DB + DBMS
   ◮   Meta Data: Information about the structure of the DB.
          ◮    Meta data is organized as a DB itself.




 DMS 2009/10                                    J. Gamper            5/24
Basic Definitions . . .



   ◮   A DBMS provides two kind of languages
          ◮    A data definition language (DDL) for specifying the database schema
                 ◮   the database schema is stored in the data dictionary
                 ◮   the content of data dictionary is called metadata
          ◮    A data manipulation language (DML) for updating and querying
               databases, i.e.,
                 ◮   retrieval of information
                 ◮   insertion of new information
                 ◮   deletion of information
                 ◮   modification of information




 DMS 2009/10                                        J. Gamper                       6/24
ANSI/SPARC Architecture

  ◮   The ANSI/SPARC three level schema architecture was designed to achieve
         ◮    program/data independence
         ◮    multiple user views
  ◮   Schemes are defined at 3 levels
         ◮    external level: describes various
              user views for parts of the
              database; often uses the logical
              schema
         ◮    logical level: describes the
              structure and constraints for the
              whole database; uses a logical
              schema
         ◮    internal level: describes data
              storage structures and access
              paths; uses a physical schema




DMS 2009/10                                       J. Gamper               7/24
DBMS Functionality



  ◮   Stores and retrieves data
  ◮   Controls redundancy
  ◮   Ensures data consistency
  ◮   Enables sharing of data by multiple applications
  ◮   Supports concurrent access by multiple users
  ◮   Protects against loss of data
  ◮   Ensures security
  ◮   etc.




DMS 2009/10                              J. Gamper       8/24
Aspects of DB Research and Practice

   ◮   Design of languages
   ◮   Development of algorithms
   ◮   Data modeling
   ◮   User interface design
   ◮   Design of migration strategies
   ◮   Distributed databases
   ◮   Handling huge volumes of data
   ◮   New data models and systems
          ◮    XML/semi-structured databases
          ◮    Stream data processing
          ◮    Temporal and spatial databases
          ◮    GIS systems
   ◮   etc.



 DMS 2009/10                                    J. Gamper   9/24
Databases – Pros and Cons

   ◮   Pros                                                     ◮   Cons
          ◮    Logical                                               ◮   Huge and complex systems
          ◮    Data abstraction                                      ◮   Restrict functionality
          ◮    Meta reasoning                                        ◮   Substantial overhead
          ◮    Self describing, e.g., data dictionary                ◮   No direct data access
          ◮    Multiple user views
          ◮    Data sharing

   ◮   When not to use a DBMS
          ◮    Too high costs
                 ◮   High intitial investment (software, hardware, training)
                 ◮   Overhead for providing generality, security, recovery, integrity, and
                     concurrency
          ◮    Simple, well defined, and not-changing application
          ◮    No multi-user access required
          ◮    Stringent real-time requirements



 DMS 2009/10                                        J. Gamper                                  10/24
Relational Data Model
   ◮   Data are stored in relations/tables
         employee
         Name Dept        Salary
         Tom      SE      23K
         Lena     DB      33K

         department
         Dname Manager          Address
         SE       Tom           Boston
         DB       Lena          Tucson

         project
         Pid Dept      From          To
         14     SE     01.01.2005    31.12.2005
         173 SE        15.04.2005    30.10.2006
         201 DB        15.04.2005    31.03.2006


 DMS 2009/10                                 J. Gamper   11/24
Relational Data Model . . .



   ◮   A domain D is a set of atomic data values.
          ◮    phone numbers,CPR numbers, names, grades, birthdates, departments,
               {i,o,x,?,-}
          ◮    each domain includes the special value null for unknown or missing value
   ◮   With each domain a data type or format is specified.
          ◮    5 digit integers, yyyy-mm-dd, characters
   ◮   An attribute Ai describes the role of a domain in a relation schema.
          ◮    PhoneNr, Age, DeptName




 DMS 2009/10                                   J. Gamper                             12/24
Relational Data Model . . .


   ◮   A relation schema R(A1 , ..., An ) is made up of a relation name R and a
       list of attributes.
          ◮    employee(Name, Dept, Salary )
   ◮   A tuple t is an ordered list of values, i.e., t = (v1 , ..., vn ) with
       vi ∈ dom(Ai ).
          ◮    t = (Tom, SE , 23K )
   ◮   A relation r of the relation schema R(A1 , ..., An ) is a set of n-ary tuples.
          ◮    r = {(Tom, SE , 23K ), (Lene, DB, 33K )}
   ◮   A database DB is a set of relations.
          ◮    DB = {r , s, ...}
          ◮    r = {(Tom, SE , 23K ), (Lene, DB, 33K )}
          ◮    s = {(SE , Tom, Boston), (DB, Lena, Tucson)}




 DMS 2009/10                                   J. Gamper                            13/24
Properties of Relations




   ◮   A relation is a set of tuples, i.e.,
          ◮    no ordering between tuples and
          ◮    no duplicates (identical tuples) exist.
   ◮   Attributes within tuples are ordered
          ◮    At the logical level it is possible to have unordered tuples if the
               correspondence between values and attributes is maintained
          ◮    e.g., {Salary /23K , Name/Tom, Dept/SE }




 DMS 2009/10                                     J. Gamper                           14/24
Accessing DBs




  ◮   The success of DBs also depends on the ease of data access.
  ◮   When accessing a (relational) DB two factors must be taken into account.
         ◮    The impedence mismatch.
         ◮    The interface to the DB.




DMS 2009/10                              J. Gamper                         15/24
Impedence Mismatch
  ◮   Impedence mismatch: The difference between the data models used in
      the application and in the DB, e.g., sets vs. records




  ◮   Cursor
         ◮    The most versatile way to connect a DB to a host language.
         ◮    Cursors are used to resolve the impedance mismatch.
         ◮    A cursor runs through the tuples of a relation/table.




DMS 2009/10                                  J. Gamper                     16/24
DB Interfaces




   ◮   Various interfaces to DBs exist, e.g.,
          ◮    Terminal interface (sqlplus, etc.)
          ◮    OCI (Oracle Call Interface)
          ◮    X/Open SQL CLI (Call Level Interface)
          ◮    ODBC (Open Data Base Connection), iODBC for Unix
          ◮    JDBC (Java Database Connectivity)
          ◮    DBI (Perl DB Interface)
          ◮    Embedded SQL




 DMS 2009/10                               J. Gamper              17/24
Oracle’s OCI



   ◮   The OCI is a set of C procedures to access an Oracle database e.g.,
          ◮    olon
          ◮    oparse
          ◮    oexec
          ◮    ologof
          ◮    odescr
          ◮    ofetch
          ◮    oopen
          ◮    odefin
          ◮    oclose
          ◮    obndrn




 DMS 2009/10                             J. Gamper                           18/24
Oracle’s OCI . . .
#include <ocidfn.h>
Lda Def lda;
Cda Def cda;
main() {
  orlon(&lda,hda,"scott",-1,"tiger",-1,0);
  oopen(&cda,&lda,0,-1,-1,0,-1);
  oparse(&cda,"SELECT * FROM cat",-1,0,2);
  odefin(&cda,1,&name,30,,-1,0,0,-1,-1,0,0);
  odefin(&cda,2,&type,30,,-1,0,0,-1,-1,0,0);

    oexec(&cda);
    for (;;) {
      if (ofetch(&cda1)) break;
        printf(" %s %s ", name, type);
    }

    oclose(&cda);
    ologof(&lda);
}

 DMS 2009/10                         J. Gamper   19/24
ODBC

  ◮   ODBC is a set of C procedures to access any(!) SQL database, e.g.,
         ◮    SQLAllocEnv
         ◮    SQLAllocStmt
         ◮    SQLDescribeCol
         ◮    SQLAllocConnect
         ◮    SQLPrepare
         ◮    SQLBindCol
         ◮    SQLConnect
         ◮    SQLSetParam
         ◮    SQLFetch
         ◮    SQLDisconnect
         ◮    SQLExecute
         ◮    SQLFreeConnect
         ◮    SQLExecDirect
         ◮    SQLFreeEnv
         ◮    SQLFreeStmt
  ◮   ODBC supports meta data.


DMS 2009/10                            J. Gamper                           20/24
ODBC . . .
#include <sqlcli .h>
SQLHENV e;
SQLHDBC c;
SQLHSTMT s;

int main() {
  SQLAllocEnv(&e);
  SQLAllocConnect(e,&c);
  SQLConnect(c, "ora1", SQL NTS, "scott", SQL NTS, "tiger", SQL NTS);
  SQLAllocStmt(c,&s);
  SQLPrepare(s,"select * from cat", SQL NTS);
  SQLExecute(s);
  SQLBindCol(s,1,SQL C CHAR,name,30,NULL);
  SQLBindCol(s,2,SQL C CHAR,type,30,NULL);

    SQLFetch(s);
    printf("%s %s", name, type);

    SQLFreeStmt(s,SQL DROP);
    SQLDisconnect(c);
    SQLFreeConnect(c);
    SQLFreeEnv(e);
}

 DMS 2009/10                           J. Gamper                        21/24
JDBC Interface


   ◮   JDBC is a set of Java procedures to access any(!) SQL database, e.g.,
          ◮    getConnection
          ◮    execute
          ◮    getColumnName
          ◮    createStatement
          ◮    exectueQuery
          ◮    getColumnType
          ◮    close
          ◮    executeUpdate
          ◮    getString
          ◮    getResultSet
          ◮    getObject
   ◮   JDBC supports meta data.




 DMS 2009/10                             J. Gamper                             22/24
JDBC Interface . . .
import java.sql.*;
class demo {

    public static void main (String args [])
        throws SQLException,ClassNotFoundException {

        // Load the Oracle JDBC driver
        Class.forName("oracle.jdbc.driver.OracleDriver");

        // Connect to the database
        Connection conn = DriverManager.getConnection(
          "jdbc:oracle:thin:@femto:1526:ora1", "scott", "tiger");

        // Create a statement
        Statement stmt = conn.createStatement ();
        // Insert a tuple into a relation
        stmt.execute("insert into r values(1,’abc’)");
        // Executes a query and displays the result
        ResultSet rset = stmt.executeQuery ("select * from r");
        while (rset.next())
          System.out.println(rset.getInt(1) + " " + rset.getString(2));
    }
}

 DMS 2009/10                               J. Gamper                      23/24
Embedded SQL




  ◮   Extended versions of, e.g., C, Pascal, and Fortran allow to embed SQL
      statements.
  ◮   A precompiler compiles these languages to, e.g., C with OCI library calls.
  ◮   The idea is that C with embedded SQL is easier to use than C with OCI
      calls.
  ◮   Embedded SQL is standardized (ISO, ANSI).




DMS 2009/10                              J. Gamper                             24/24

More Related Content

What's hot (20)

IMS concepts
IMS concepts IMS concepts
IMS concepts
 
Database system concepts and architecture
Database system concepts and architectureDatabase system concepts and architecture
Database system concepts and architecture
 
RDBMS
RDBMSRDBMS
RDBMS
 
Rdbms
RdbmsRdbms
Rdbms
 
Veena
VeenaVeena
Veena
 
IM02: Database Language
IM02: Database LanguageIM02: Database Language
IM02: Database Language
 
DDBMS Paper with Solution
DDBMS Paper with SolutionDDBMS Paper with Solution
DDBMS Paper with Solution
 
Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management System
 
5 data storage_and_indexing
5 data storage_and_indexing5 data storage_and_indexing
5 data storage_and_indexing
 
database concepts pdf :BEMIT
database concepts pdf :BEMITdatabase concepts pdf :BEMIT
database concepts pdf :BEMIT
 
3 db architecture
3 db architecture3 db architecture
3 db architecture
 
Unit 08 dbms
Unit 08 dbmsUnit 08 dbms
Unit 08 dbms
 
Unit 04 dbms
Unit 04 dbmsUnit 04 dbms
Unit 04 dbms
 
A concept of dbms
A concept of dbmsA concept of dbms
A concept of dbms
 
Cp 121 lecture 01
Cp 121 lecture 01Cp 121 lecture 01
Cp 121 lecture 01
 
"Diffrence between RDBMS, OODBMS and ORDBMS"
"Diffrence between RDBMS, OODBMS and  ORDBMS""Diffrence between RDBMS, OODBMS and  ORDBMS"
"Diffrence between RDBMS, OODBMS and ORDBMS"
 
RDBMS.
RDBMS.RDBMS.
RDBMS.
 
Lecture 02 architecture of dbms
Lecture 02 architecture of dbmsLecture 02 architecture of dbms
Lecture 02 architecture of dbms
 
Class363 1
Class363 1Class363 1
Class363 1
 
Implementation Issue with ORDBMS
Implementation Issue with ORDBMSImplementation Issue with ORDBMS
Implementation Issue with ORDBMS
 

Viewers also liked

Texas s ta r chart
Texas s ta r chartTexas s ta r chart
Texas s ta r chartbeathard1962
 
Relatório de desempenho digital intergastro
Relatório de desempenho digital   intergastroRelatório de desempenho digital   intergastro
Relatório de desempenho digital intergastroINTERGASTRO & TRAUMA
 
Texas s ta r chart
Texas s ta r chartTexas s ta r chart
Texas s ta r chartbeathard1962
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasadpaddu123
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasadpaddu123
 

Viewers also liked (9)

Texas s ta r chart
Texas s ta r chartTexas s ta r chart
Texas s ta r chart
 
01 intro
01 intro01 intro
01 intro
 
Mics capital presentation
Mics capital presentationMics capital presentation
Mics capital presentation
 
ER model
ER modelER model
ER model
 
Doc1
Doc1Doc1
Doc1
 
Relatório de desempenho digital intergastro
Relatório de desempenho digital   intergastroRelatório de desempenho digital   intergastro
Relatório de desempenho digital intergastro
 
Texas s ta r chart
Texas s ta r chartTexas s ta r chart
Texas s ta r chart
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 

Similar to Dms01

Database management system overview
Database management system overviewDatabase management system overview
Database management system overviewNj Saini
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDhruveeHalvadiya
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxAnmolThakur67
 
csedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdfcsedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdfSameerKhanPathan7
 
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...Dipen Parmar
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureMustafa Kamel Mohammadi
 
Complete first chapter rdbm 17332
Complete first chapter rdbm 17332Complete first chapter rdbm 17332
Complete first chapter rdbm 17332Tushar Wagh
 
databasesystemsconollyslide1-151102101031-lva1-app6892.pptx
databasesystemsconollyslide1-151102101031-lva1-app6892.pptxdatabasesystemsconollyslide1-151102101031-lva1-app6892.pptx
databasesystemsconollyslide1-151102101031-lva1-app6892.pptxsalutiontechnology
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of DatabaseMarlon Jamera
 
Introduction to DBMS.pptx
Introduction to DBMS.pptxIntroduction to DBMS.pptx
Introduction to DBMS.pptxSreenivas R
 
Lecture 1 database system notes full.pptx
Lecture 1 database system notes full.pptxLecture 1 database system notes full.pptx
Lecture 1 database system notes full.pptxsalutiontechnology
 
Database systems - Chapter 1
Database systems - Chapter 1Database systems - Chapter 1
Database systems - Chapter 1shahab3
 

Similar to Dms01 (20)

Database management system overview
Database management system overviewDatabase management system overview
Database management system overview
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptx
 
Bab9
Bab9Bab9
Bab9
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptx
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
csedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdfcsedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdf
 
Database Management System ppt
Database Management System pptDatabase Management System ppt
Database Management System ppt
 
Unit01 dbms
Unit01 dbmsUnit01 dbms
Unit01 dbms
 
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
 
27 fcs157al2
27 fcs157al227 fcs157al2
27 fcs157al2
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and Architecture
 
Complete first chapter rdbm 17332
Complete first chapter rdbm 17332Complete first chapter rdbm 17332
Complete first chapter rdbm 17332
 
databasesystemsconollyslide1-151102101031-lva1-app6892.pptx
databasesystemsconollyslide1-151102101031-lva1-app6892.pptxdatabasesystemsconollyslide1-151102101031-lva1-app6892.pptx
databasesystemsconollyslide1-151102101031-lva1-app6892.pptx
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
 
Mis chapter 7 database systems
Mis chapter 7 database systemsMis chapter 7 database systems
Mis chapter 7 database systems
 
Introduction to DBMS.pptx
Introduction to DBMS.pptxIntroduction to DBMS.pptx
Introduction to DBMS.pptx
 
James hall ch 9
James hall ch 9James hall ch 9
James hall ch 9
 
Lecture 1 database system notes full.pptx
Lecture 1 database system notes full.pptxLecture 1 database system notes full.pptx
Lecture 1 database system notes full.pptx
 
Database systems - Chapter 1
Database systems - Chapter 1Database systems - Chapter 1
Database systems - Chapter 1
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Dms01

  • 1. Database Management Systems 2009/10 – Chapter 1: Introduction – J. Gamper ◮ The Course ◮ The DB Field ◮ Basic Definitions ◮ The Relational Data Model ◮ Accessing DBs These slides were developed by: – Michael B¨hlen, University of Zurich, Switzerland o – Johann Gamper, University of Bozen-Bolzano, Italy DMS 2009/10 J. Gamper 1/24
  • 2. The Course ◮ Course page ◮ http://www.inf.unibz.it/dis/teaching/DMS ◮ The slides are based on the following text books and associated material: ◮ A. Silberschatz, H. Korth, and S. Sudarshan: Database System Concept, 5 edition, McGraw Hill, 2006. ◮ R. Elmasri and S.B. Navathe: Fundamentals of Database Systems, 4th edition, Pearson Addison Wesley, 2004. ◮ Additional Book ◮ Garcia-Molina, Ullman,Widom: Database Systems: The Complete Book, Prentice-Hall, 2002. DMS 2009/10 J. Gamper 2/24
  • 3. The Course Content ◮ Storage and File Structure ◮ Physical Storage media, file and buffer manager ◮ Indexing and Hashing ◮ Ordered indices, B-trees, hashing ◮ Query Processing ◮ Measures of query cost, selection and join operation ◮ Query Optimization ◮ Transformation of relational expressions, evaluation plans ◮ Transactions ◮ ACID properties, SQL transactions ◮ Concurrency Control ◮ Lock-/timestamp-/validation-based protocols ◮ Recovery System ◮ Log-based recovery, shadow paging DMS 2009/10 J. Gamper 3/24
  • 4. The DB Field ◮ Journal Publications ◮ ACM Transaction on Database System (TODS) ◮ IEEE Transactions on Knowledge and Data Engineering (TKDE) ◮ The VLDB Journal ◮ Information Systems ◮ Conference Publications ◮ SIGMOD ◮ VLDB ◮ EDBT ◮ ICDE ◮ DB & LP Bibliography (Michael Ley, Uni Trier, Germany) ◮ http://www.informatik.uni-trier.de/˜ley/db/ ◮ Commercial Products ◮ Oracle ◮ DB2 (IBM) ◮ Microsoft SQL Server ◮ Postgres ◮ Sybase ◮ Ingres ◮ Informix ◮ PC “DBMSs”: Paradox, Access, ... DMS 2009/10 J. Gamper 4/24
  • 5. Basic Definitions ◮ Mini-world: The part of the real world we are interested in ◮ Data: Known facts about the mini-world that can be recorded ◮ Database (DB): A collection of related data ◮ Database Management System (DBMS): A software package to facilitate the creation/maintenance of databases ◮ Database System: DB + DBMS ◮ Meta Data: Information about the structure of the DB. ◮ Meta data is organized as a DB itself. DMS 2009/10 J. Gamper 5/24
  • 6. Basic Definitions . . . ◮ A DBMS provides two kind of languages ◮ A data definition language (DDL) for specifying the database schema ◮ the database schema is stored in the data dictionary ◮ the content of data dictionary is called metadata ◮ A data manipulation language (DML) for updating and querying databases, i.e., ◮ retrieval of information ◮ insertion of new information ◮ deletion of information ◮ modification of information DMS 2009/10 J. Gamper 6/24
  • 7. ANSI/SPARC Architecture ◮ The ANSI/SPARC three level schema architecture was designed to achieve ◮ program/data independence ◮ multiple user views ◮ Schemes are defined at 3 levels ◮ external level: describes various user views for parts of the database; often uses the logical schema ◮ logical level: describes the structure and constraints for the whole database; uses a logical schema ◮ internal level: describes data storage structures and access paths; uses a physical schema DMS 2009/10 J. Gamper 7/24
  • 8. DBMS Functionality ◮ Stores and retrieves data ◮ Controls redundancy ◮ Ensures data consistency ◮ Enables sharing of data by multiple applications ◮ Supports concurrent access by multiple users ◮ Protects against loss of data ◮ Ensures security ◮ etc. DMS 2009/10 J. Gamper 8/24
  • 9. Aspects of DB Research and Practice ◮ Design of languages ◮ Development of algorithms ◮ Data modeling ◮ User interface design ◮ Design of migration strategies ◮ Distributed databases ◮ Handling huge volumes of data ◮ New data models and systems ◮ XML/semi-structured databases ◮ Stream data processing ◮ Temporal and spatial databases ◮ GIS systems ◮ etc. DMS 2009/10 J. Gamper 9/24
  • 10. Databases – Pros and Cons ◮ Pros ◮ Cons ◮ Logical ◮ Huge and complex systems ◮ Data abstraction ◮ Restrict functionality ◮ Meta reasoning ◮ Substantial overhead ◮ Self describing, e.g., data dictionary ◮ No direct data access ◮ Multiple user views ◮ Data sharing ◮ When not to use a DBMS ◮ Too high costs ◮ High intitial investment (software, hardware, training) ◮ Overhead for providing generality, security, recovery, integrity, and concurrency ◮ Simple, well defined, and not-changing application ◮ No multi-user access required ◮ Stringent real-time requirements DMS 2009/10 J. Gamper 10/24
  • 11. Relational Data Model ◮ Data are stored in relations/tables employee Name Dept Salary Tom SE 23K Lena DB 33K department Dname Manager Address SE Tom Boston DB Lena Tucson project Pid Dept From To 14 SE 01.01.2005 31.12.2005 173 SE 15.04.2005 30.10.2006 201 DB 15.04.2005 31.03.2006 DMS 2009/10 J. Gamper 11/24
  • 12. Relational Data Model . . . ◮ A domain D is a set of atomic data values. ◮ phone numbers,CPR numbers, names, grades, birthdates, departments, {i,o,x,?,-} ◮ each domain includes the special value null for unknown or missing value ◮ With each domain a data type or format is specified. ◮ 5 digit integers, yyyy-mm-dd, characters ◮ An attribute Ai describes the role of a domain in a relation schema. ◮ PhoneNr, Age, DeptName DMS 2009/10 J. Gamper 12/24
  • 13. Relational Data Model . . . ◮ A relation schema R(A1 , ..., An ) is made up of a relation name R and a list of attributes. ◮ employee(Name, Dept, Salary ) ◮ A tuple t is an ordered list of values, i.e., t = (v1 , ..., vn ) with vi ∈ dom(Ai ). ◮ t = (Tom, SE , 23K ) ◮ A relation r of the relation schema R(A1 , ..., An ) is a set of n-ary tuples. ◮ r = {(Tom, SE , 23K ), (Lene, DB, 33K )} ◮ A database DB is a set of relations. ◮ DB = {r , s, ...} ◮ r = {(Tom, SE , 23K ), (Lene, DB, 33K )} ◮ s = {(SE , Tom, Boston), (DB, Lena, Tucson)} DMS 2009/10 J. Gamper 13/24
  • 14. Properties of Relations ◮ A relation is a set of tuples, i.e., ◮ no ordering between tuples and ◮ no duplicates (identical tuples) exist. ◮ Attributes within tuples are ordered ◮ At the logical level it is possible to have unordered tuples if the correspondence between values and attributes is maintained ◮ e.g., {Salary /23K , Name/Tom, Dept/SE } DMS 2009/10 J. Gamper 14/24
  • 15. Accessing DBs ◮ The success of DBs also depends on the ease of data access. ◮ When accessing a (relational) DB two factors must be taken into account. ◮ The impedence mismatch. ◮ The interface to the DB. DMS 2009/10 J. Gamper 15/24
  • 16. Impedence Mismatch ◮ Impedence mismatch: The difference between the data models used in the application and in the DB, e.g., sets vs. records ◮ Cursor ◮ The most versatile way to connect a DB to a host language. ◮ Cursors are used to resolve the impedance mismatch. ◮ A cursor runs through the tuples of a relation/table. DMS 2009/10 J. Gamper 16/24
  • 17. DB Interfaces ◮ Various interfaces to DBs exist, e.g., ◮ Terminal interface (sqlplus, etc.) ◮ OCI (Oracle Call Interface) ◮ X/Open SQL CLI (Call Level Interface) ◮ ODBC (Open Data Base Connection), iODBC for Unix ◮ JDBC (Java Database Connectivity) ◮ DBI (Perl DB Interface) ◮ Embedded SQL DMS 2009/10 J. Gamper 17/24
  • 18. Oracle’s OCI ◮ The OCI is a set of C procedures to access an Oracle database e.g., ◮ olon ◮ oparse ◮ oexec ◮ ologof ◮ odescr ◮ ofetch ◮ oopen ◮ odefin ◮ oclose ◮ obndrn DMS 2009/10 J. Gamper 18/24
  • 19. Oracle’s OCI . . . #include <ocidfn.h> Lda Def lda; Cda Def cda; main() { orlon(&lda,hda,"scott",-1,"tiger",-1,0); oopen(&cda,&lda,0,-1,-1,0,-1); oparse(&cda,"SELECT * FROM cat",-1,0,2); odefin(&cda,1,&name,30,,-1,0,0,-1,-1,0,0); odefin(&cda,2,&type,30,,-1,0,0,-1,-1,0,0); oexec(&cda); for (;;) { if (ofetch(&cda1)) break; printf(" %s %s ", name, type); } oclose(&cda); ologof(&lda); } DMS 2009/10 J. Gamper 19/24
  • 20. ODBC ◮ ODBC is a set of C procedures to access any(!) SQL database, e.g., ◮ SQLAllocEnv ◮ SQLAllocStmt ◮ SQLDescribeCol ◮ SQLAllocConnect ◮ SQLPrepare ◮ SQLBindCol ◮ SQLConnect ◮ SQLSetParam ◮ SQLFetch ◮ SQLDisconnect ◮ SQLExecute ◮ SQLFreeConnect ◮ SQLExecDirect ◮ SQLFreeEnv ◮ SQLFreeStmt ◮ ODBC supports meta data. DMS 2009/10 J. Gamper 20/24
  • 21. ODBC . . . #include <sqlcli .h> SQLHENV e; SQLHDBC c; SQLHSTMT s; int main() { SQLAllocEnv(&e); SQLAllocConnect(e,&c); SQLConnect(c, "ora1", SQL NTS, "scott", SQL NTS, "tiger", SQL NTS); SQLAllocStmt(c,&s); SQLPrepare(s,"select * from cat", SQL NTS); SQLExecute(s); SQLBindCol(s,1,SQL C CHAR,name,30,NULL); SQLBindCol(s,2,SQL C CHAR,type,30,NULL); SQLFetch(s); printf("%s %s", name, type); SQLFreeStmt(s,SQL DROP); SQLDisconnect(c); SQLFreeConnect(c); SQLFreeEnv(e); } DMS 2009/10 J. Gamper 21/24
  • 22. JDBC Interface ◮ JDBC is a set of Java procedures to access any(!) SQL database, e.g., ◮ getConnection ◮ execute ◮ getColumnName ◮ createStatement ◮ exectueQuery ◮ getColumnType ◮ close ◮ executeUpdate ◮ getString ◮ getResultSet ◮ getObject ◮ JDBC supports meta data. DMS 2009/10 J. Gamper 22/24
  • 23. JDBC Interface . . . import java.sql.*; class demo { public static void main (String args []) throws SQLException,ClassNotFoundException { // Load the Oracle JDBC driver Class.forName("oracle.jdbc.driver.OracleDriver"); // Connect to the database Connection conn = DriverManager.getConnection( "jdbc:oracle:thin:@femto:1526:ora1", "scott", "tiger"); // Create a statement Statement stmt = conn.createStatement (); // Insert a tuple into a relation stmt.execute("insert into r values(1,’abc’)"); // Executes a query and displays the result ResultSet rset = stmt.executeQuery ("select * from r"); while (rset.next()) System.out.println(rset.getInt(1) + " " + rset.getString(2)); } } DMS 2009/10 J. Gamper 23/24
  • 24. Embedded SQL ◮ Extended versions of, e.g., C, Pascal, and Fortran allow to embed SQL statements. ◮ A precompiler compiles these languages to, e.g., C with OCI library calls. ◮ The idea is that C with embedded SQL is easier to use than C with OCI calls. ◮ Embedded SQL is standardized (ISO, ANSI). DMS 2009/10 J. Gamper 24/24