SI 654 Database Application Design Winter 2004 Dragomir R. Radev 1 © 2002 by Prentice Hall Course logistics 2 © 2002 by Prentice Hall Administrivia • Instructor: Dragomir R. Radev (radev@umich.edu), 3080 West Hall Connector, (734) 615-5225 • Office hours: TBD • Course page: http://www.si.umich.edu/~radev/654 • Class time: Fridays, 1-4PM, 311 WH 3 © 2002 by Prentice Hall Book information • Database Processing by David Kroenke (8th Edition, Prentice Hall, ISBN 0-13-065551-1) : http://www.prenhall.com/kroenke • Managing and Using MySQL by Reese, Yarger, and King (O'Reilly, ISBN 0-596-00211-4) : http://www.oreilly.com/catalog/msql2/ • Optional reading: Database Management Systems by Ramakrishnan and Gerhke (McGraw-Hill, ISBN 0-07-245052-5) : http://www.cs.wisc.edu/~dbbook/ • Optional reading: Data Mining by Han and Kamber (Morgan Kaufmann, ISBN 1-55860-489-8): http://www.cs.sfu.ca/~han/dmbook 4 © 2002 by Prentice Hall Assignments • Assignment 1: Entity-Relationship Model, Relational Model, SQL • Assignment 2: Database design using ERWin and Oracle • Assignment 3: Database design using MySQL • Assignment 4: XML, Data Mining, and other advanced topics 5 © 2002 by Prentice Hall Final project • • • • • 6 Proposal Database design Progress report Project Final presentation © 2002 by Prentice Hall Grading • • • • 7 Four assignments: 40% (10% each) Project + presentation: 30% Final exam: 25% Class participation: 5% © 2002 by Prentice Hall Policies • Class participation counts as 5% of the grade • Timely submission of assignments is important • Syllabus can be amended during the semester • Honors Code 8 © 2002 by Prentice Hall Notes on programming • All students will do some programming as part of the assignments. • For the final project, teams will be formed in ways to include students with diverse backgrounds. 9 © 2002 by Prentice Hall Syllabus - I • • • • • • • • • • 10 DK Ch. 1. Introduction to Database Processing DK Ch. 2. Introduction to Database Development DK Ch. 3. The Entity-Relationship Model DK Ch. 5. The Relational Model and Normalization DK Ch. 6. Database Design Using Entity-Relationship Models READING The ERWin System DK Ch. 8. Foundations of Relational Implementation DK Ch. 9. Structured Query Language RYK Ch. 1 MySQL DK Ch. 16. JDBC, Java Server Pages, and MySQL © 2002 by Prentice Hall Syllabus - II • • • • • • • • • 11 RYK Ch. 3 SQL according to MySQL DK Ch. 10. Database Application Design DK Ch. 11. Managing Multi-User Databases RYK Ch. 7 Database Design DK Ch. 12. Managing Databases with Oracle (DK Ch. 14). Networks, Multi-Tier Architectures, and XML READING XML and query languages for XML READING Data Mining DK App. A. Data Structures for Database Processing © 2002 by Prentice Hall Database Processing Eighth Edition Introduction to Database Processing 12 Chapter 1 David M. Kroenke © 2002 by Prentice Hall Art or Engineering • Database design and development involves both art and engineering – Gathering and organizing user requirements is an art – Transforming the resulting designs into physical applications involves engineering 13 © 2002 by Prentice Hall Types of Data Stored • Today, most newer databases are able to store a large variety of data, including… – Scalar data • Names, dates, phone numbers – Pictures – Audio – Video 14 © 2002 by Prentice Hall Database Example 1 Mary Richards Housepainting – – – – 15 Self Employed Entrepreneur Single User Database 3 Tables (Customers, Jobs, Source) Data Needs: • Track how customers, jobs, and referrals relate • Record bid estimates • Track referral sources • Produce mailing labels © 2002 by Prentice Hall Mary Richards’ Tables SOURCE CUSTOMER JOB 16 © 2002 by Prentice Hall Database Example 2 Treble Clef Music – Multi-User database on LAN – 3 Tables (Customers, Instruments, Rentals) – Data Needs: • Track instrument rentals • Handle multi-user issues 17 © 2002 by Prentice Hall Treble Clef Form 1 18 © 2002 by Prentice Hall Treble Clef Form 2 19 © 2002 by Prentice Hall Treble Clef Form 3 20 © 2002 by Prentice Hall Database Example 3 State Licensing & Vehicle Registration Bureau – 52 Centers, 37 Offices, Hundreds of Users – 40 Tables – Data Needs: • Track drivers licensing issues – traffic violations, accidents, arrests, limitations • Track auto registration issues – revenue, law enforcement • Integrate the needs of many departments 21 © 2002 by Prentice Hall Database Example 4 Calvert Island Reservations Centre – – – – 22 Chamber of Commerce Promotional database provides access to data Customer and reservation database processes Data Needs: • Store multimedia data (photos, video clips, sound clips) • Must be Web / browser accessible • Uses Web technologies including HTTP, DHTML, and XML © 2002 by Prentice Hall Comparison Among Database Examples 23 © 2002 by Prentice Hall Reading assignments • • • • 24 1/16 - Chapters 1 & 2 1/23 - Chapters 3 & 5 1/30 - Chapters 6 & 8 2/6 - Chapter 9 + ERWIN docs © 2002 by Prentice Hall Applications versus Database Management Systems (DBMS) • The Database Management System (DBMS) provides functionality above and beyond the storage of information. – Users want to see reports, forms, and query results – not simply data – As such, application development is crucial to the design and development of the DBMS 25 © 2002 by Prentice Hall In the Beginning, There Were File-Processing Systems • The first business information systems stored information by grouping similar data into separate files. 26 © 2002 by Prentice Hall A File-Processing System 27 © 2002 by Prentice Hall Problems with File-Processing Systems • • • • • 28 Data separated and isolated Data often duplicated Application program dependent Incompatible data files Difficult to understand © 2002 by Prentice Hall Duplication of Data • When storing the same data in multiple locations, the likelihood of inconsistency is very high. • What is my real name? – Table 1: my name is Dan – Table 2: my name is Danielle – Table 3: my name is Daniel – Table 4: my name is Don 29 © 2002 by Prentice Hall The Data in a DBMS • • • • 30 Data is integrated Data duplication is reduced Data is program independent Data is easy to understand © 2002 by Prentice Hall A DMBS 31 © 2002 by Prentice Hall Database is Self-Describing • A database contains a data dictionary • A data dictionary is data about the data (metadata) – It describes the structure and format of the information contained within the database 32 © 2002 by Prentice Hall The Hierarchy of Data FileProcessing DBMS 33 © 2002 by Prentice Hall DBMS –the Past • 1970, E.F. Codd • Normalization Process • Compute Intensive 34 © 2002 by Prentice Hall DBMS –the Present • Ashton - Tate: dBase II, now Borland • Oracle, Focus, Ingress ported down • Paradox, Revelation, MDBS, Helix, Foxpro, Access built specifically for microcomputers 35 © 2002 by Prentice Hall DBMS –the Future Trends • • • • 36 Client-Server Applications Integration of Internet Technology Distributed Processing Object-Oriented DBMS © 2002 by Prentice Hall Database Processing Eighth Edition Introduction to Database Development 37 Chapter 2 David M. Kroenke © 2002 by Prentice Hall The Components of the Database System • • • • • • 38 The Database Contents The DBMS The Application Programs The Developers The Users The Database © 2002 by Prentice Hall Database System Components 39 © 2002 by Prentice Hall Database Contents • • • • 40 User Data Metadata Indexes Application Metadata © 2002 by Prentice Hall User Data • • • • 41 A table of data is called a relation Columns are fields or attributes Rows are entities Relations must be structured properly © 2002 by Prentice Hall Metadata • Metadata describes the structure and format of the data and the overall database • System tables store metadata – number of tables and table names – number of fields and field names – primary key fields – field names, data types, and length 42 © 2002 by Prentice Hall Indexes • Improve performance • Improve accessibility • (Overhead data) 43 © 2002 by Prentice Hall Application Metadata • Stores the structure and format of – forms – reports – queries – other application components 44 © 2002 by Prentice Hall The DBMS • Design Tools Subsystem • Run-Time Subsystem • DBMS Engine 45 © 2002 by Prentice Hall Design Tools Subsystem • Tools to design and develop – tables – forms – queries – reports • Programming Languages – macros – languages 46 © 2002 by Prentice Hall Run-Time Subsystem • Processes database components created by design tools 47 © 2002 by Prentice Hall DBMS Engine • Intermediary between the design tools and run-time subsystems and the data • Also handles . . . – transaction management – locking – backup and recovery 48 © 2002 by Prentice Hall Creating the Database • Defining the database schema • Creating the tables • Defining the relationships among the tables 49 © 2002 by Prentice Hall The Database Schema • Defines a database’s structure – Tables - subjects within the database – Relationships - one-to-many or 1:N – Domains - set of values a column may have – Business rules - restrictions on data values 50 © 2002 by Prentice Hall Defining Tables using Microsoft Access 51 © 2002 by Prentice Hall Defining Relationships Among the Tables using Microsoft Access 52 © 2002 by Prentice Hall Components of Applications • • • • • 53 Forms Queries Reports Menus Application Programs © 2002 by Prentice Hall A Browser Data Entry Form 54 © 2002 by Prentice Hall A Query in Microsoft Access 55 © 2002 by Prentice Hall A Report in Microsoft Access 56 © 2002 by Prentice Hall A Menu in Microsoft Access 57 © 2002 by Prentice Hall Database Development Approaches • Prototype • Top-down development • Bottom-up development 58 © 2002 by Prentice Hall Prototype Development • Develop portions of the database and submit to users for feedback, refinement, and enhancement 59 © 2002 by Prentice Hall Top-down Development • General requirements to specific requirements • A global perspective 60 © 2002 by Prentice Hall Bottom-up Development • Specific requirements to general requirements • Typically faster and less risky 61 © 2002 by Prentice Hall The Data Model • A data model defines and graphically depicts the data structure and relationships among the data 62 © 2002 by Prentice Hall Data Modeling Creation • • • • • 63 Interviewing users Documenting requirements Building a data model Building a database prototype A process of inference – Working backwards © 2002 by Prentice Hall Common Data Models • Entity-Relationship Model • Semantic Object Model 64 © 2002 by Prentice Hall