2 Introduction to Databases The most important component in an information systemCreated to support all levels of business operations:Day-to-day operationsTPS, CRM, ERPDecision-makingsDSS, data warehouseStrategic plans
3 Definitions Database: organized collection of logically related data A group of related filesData: stored representations of meaningful objects and eventsStructured: numbers, text, datesUnstructured: images, video, documentsInformation: data processed to increase knowledge in the person using the dataMetadata: data that describes the properties and context of user data
7 Limitations of the File-Based Approach Duplication of dataData inconsistencyLimited data sharingProgram-data dependenceWhen file structure changed, all programs that access the file must be modified to conform to the new file structure.The definition of the data is embedded in the program.Fixed queriesNo facilities for asking unplanned, ad hoc queries
8 Problems with Program-Data Dependency Each application program needs to include code for the metadata of each fileEach application program must have its own processing routines for reading, inserting, updating, and deleting data
9 Example: Comma-Delimited File It stores each data item with a comma separating each item and places double quotes around string fields.Student file with fields: SID, Sname, and GPA“S5”, ”Peter”, 3.0“S1”, “Paul”, 2.5Questions:How many students?What is average GPA?
10 Sequentially Accessing the Student File to Compute Average GPA Dim fileNumber, stCounter As IntegerDim SID, SNAME As StringDim gpa, sumGpa As DoublefileNumber = FreeFile()FileOpen(fileNumber, "c:\stdata.txt", OpenMode.Input)Do While Not EOF(fileNumber)Input(fileNumber, SID)Input(fileNumber, SNAME)Input(fileNumber, gpa)sumGpa += gpastCounter += 1LoopMessageBox.Show(sumGpa / stCounter.ToString)
11 Database Approach Central repository of shared data The database holds not only the data but also a description of the data.System catalog (repository , data dictionary, or metadata)A central location where data descriptions are stored.Data about dataProgram-data independence
12 Advantages of the Database Approach Program-data independenceThe separation of data descriptions from the application programs that use the data.Allows the data to change without changing the application programs.Planned data redundancyImproved data consistencyImproved data sharingEnforcement of standards
13 Database Management System (DBMS) A software that enables users to define, create, maintain, and control access to the database.Data Definition Language (DDL)Data Manipulation Language (DML)Control access:Security, integrity, concurrent access, recovery, support for data communication, etc.Utility servicesFile import/export, monitoring facilities, etc.Support Ad Hoc queries
14 Database Management System A software system that is used to create, maintain, and provide controlled access to user databasesOrder FilingSystemCentral databaseContains employee,order, inventory,pricing, andcustomer dataInvoicingSystemDBMSPayrollSystemDBMS manages data resources like an operating system manages hardware resources
16 Database Schema External Schema Conceptual Schema Internal schema User ViewsSubsets of Conceptual SchemaConceptual SchemaThis level describes what data is stored in the database and the relationships among the data.View of the data administratorE-R modelsInternal schemaLogical schemaUnderlying implementation and designRelational table designPhysical SchemaFile organizations, indexes
17 Figure 2-7 Three-schema architecture Different people have different views of the database…these are the external schemaThe internal schema is the underlying design and implementation
18 Data IndependenceData independence means that upper levels are unaffected by changes to lower levels.Logical data independenceChanges to the conceptual level, such as the addition of new entities, attributes, or relationships, should be possible without having to change the existing external level design.Physical data independenceChanges to the physical level, such as using a different file organization, indexes, should be possible without having to change the conceptual level design.
19 Three-Level Example Employee Entity Conceptual design:Employee entity with attributes: EmpID, EmpName, DateOfBirth, Salary, and Sex.Internal level:Logical schema:EmpID – 4 charactersEmpName – 30 charactersDateOfBirth – Date field 8 bytesSalary – Number(7,2)Sex – 1 characterPhysical schema:Record size = = 50 bytesSequential file with index on EmpID fieldExternal level:EmpAgeView:EmpID, EmpName, Age=Year(Today()) – Year(DateOfBirth)EmpSalaryView: EmpID, EmpName, Salary
20 Benefits of Using Views Views provide a level of security.Views provide a mechanism to customize the appearance of the database.Views provide a consistent, unchanging picture of the database, even if the underlying database is changed.
21 Database ApplicationIt is a program that interacts with the database at some point in its execution by issuing an appropriate request (typically an SQL statement) to the DBMS.Database programming
22 The Range of Database Applications Personal databases:Desktop, PDA/Smart PhoneWorkgroup databasesDepartmental/divisional databasesEnterprise databaseEnterprise Resource Planning (ERP)Integrate all enterprise functions (manufacturing, finance, sales, marketing, inventory, accounting, human resources)Data WarehouseIntegrated decision support system derived from various operational databases
23 The three components in a database application 1. Presentation – user interfaceMenus, forms, reports, etc2. Processing logicBusiness rules3. Database
24 Categories of Database Applications One-TierLegacy online transaction processingPC database applicationTwo-Tier client/serverClient-based presentation.Processing logic is buried either inside the user interface on the client or within the database on the server, or both.Three-Tier, N- tierProcessing logic is separated from the interface and database.
25 Database Server: A high processing power computer with advanced DBMS. SQL queriesClientDatabase ServerResultsDatabase Server: A high processing power computer with advanced DBMS.Client: A PC that runs database applications.SQL interface.
26 Client Functions Manages the user interface. Accepts and checks syntax of user input.Implements business rules.Generates database requests and transmits to server.Passes response back to user.
27 Database Server Functions Checks authorization.Accepts and processes database requests from clients.Ensures integrity constraints not violated.Performs query/update processing and transmits response to client.Provides concurrent database access, transaction management, and recovery control.
28 The Web as a Database Application Platform Three-tier architectureBrowser, web server, database server, processing logicAdvantages:Cross-platform supportGraphical user interface
30 Major Database Management Activities Creating databaseUpdating databaseQuerying database
31 Creating Database Analysis Design System analysisData Flow Diagram, UMLData modelingERDDesignMaps the data model on to a target database model.Implementation: Efficiently store and retrieve dataFile organization and index
32 Two Approaches to Database and IS Development SDLCSystem Development Life CycleDetailed, well-planned development processTime-consuming, but comprehensiveLong development cyclePrototypingRapid application development (RAD)Cursory attempt at conceptual data modelingDefine database during development of initial prototypeRepeat implementation and maintenance activities with new prototype versions
33 Systems Development Life Cycle (see also Figures 2.4, 2.5) PlanningAnalysisPhysical DesignImplementationMaintenanceLogical Design