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

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

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