INTRODUCTION OF DATABASE By Hendra Achmadi MM, MAcc. Database Environment Database Management System (DBMS): a DBMS is a collection of programs that enables users to create and maintain a database. The DBMS is a general-purpose software system used for defining, constructing, and manipulatingdatabases. Defininga database involves: specifying data types, structures, and constraints for the data to be stored in the database. Constructinga database is the process of storing the data itself. Manipulatinga database includes functions such as querying the database to retrieve specific data, updating the database to reflect changes, and generating reports from the data. Database System Environment Database System Environment Data Hardware Software Procedure People Three Level ANSI-SPARC ( The American National Standards Institut, Standards Planning and Requirement Committee Architecture) User 1 View 1 •All Entities, attribute, relationship •Constrain in data •Security and integrity information •Storage space allocation for data and indexes •Storage size of data User 2 View 2 Conceptual Schema Internal Schema •Data placement •Data compression and encryption Database User 3 View 3 Characteristics of the database processing approach In traditional file processing, each user defines and implements the files needed for a specific application. When users are interested in the same data, each user maintains separate files and programs to manipulate these files. This redundancy results in wasted storage space and in redundant efforts to maintain common data up-to-date. In the database approach, a single repository of data is maintained and accessed by many users. This approach has the following characteristics: • Insulation between programs and data • Support of multiple views of the data • Sharing data and multi-user transaction processing J. Valenzuela, INSY 3400, Fall 2001 People related to the database environment Data & Database administrators: A DBA oversees and manages the database environment. The DBA is responsible for authorizing access to the database, monitoring its use, and acquiring software and hardware resources as needed. Database Designers: A DBD is responsible for identifying the data to be stored, for choosing appropriate structures to store this data. End users: These are the people who jobs require access to the database. The Relational Database Database Relational: Dipandang oleh user/pengguna sebagai himpunan relation ( Table) Struktur Table : Terdiri dari bagian Heading dan Body Bagian Heading sebagai himpunan attribute Bagian Body sebagai himpunan tuple, dengan setiap tuplenya adalah himpunan pasangan attribute dan nilainya Setiap tuple didefinisikan unik oleh primary key The Relational Database Example 1 – single user A painter paints houses of customers. The customers are referred by other persons (sources). The Relational Database Gives the relations (tables) in the database The Relational Database Example 2 -multiple users (manager – salesclerks) A music shop (Treble Clef Music) rents music instruments and keeps track of all invoices Example-4 Reservation center of a hotel • promotion of the hotel • register website visitors for later promotion • store and manage reservations Multimedia data (photos, video clips, sound) • Clients, who use a browser • DBMS managers, use the DBMS • • • • Data separated and isolated;independent files Data often duplicated; Application programs dependent on file format; Files are often not compatible with one another; File Processing System File Processing System different formats for compatible data It is difficult to represent data in users’ perspectives; difficult to represent relationships File Processing System Integrated data; only 1 database Reduced data duplication; Program/Data independence; change format, relations, no consequences on programs Easier representation of the user perspectives; relationships are part of the database a database is a self-describing collection of integrated records. self-describing : data dictionary, metadata, structure of DB integrated : files, metadata, indexes, application metadata. Querying, updates ↔transactions Short History of DBMS 50’s file systems 60’s network, hierarchical DB 1970 Codd: Relational DB 70’s implementation of RDBMS 80’s introduction of microcomputer DBMS: dBase 80-90’s LAN, client-server database architecture 90’s DBMS and Internet, distributed databases Currently: data mining special purpose DB’s : spatial, very large, multimedia • object-oriented DB XML Komponen Utama RDBMS System Service: Komponen yang merupakan fungsi pendukung operasi sistem, komunikasi operator, logging Locking Service: Komponen yang merupakan fungsi kendali dalam mengelola akses data bersama Database Service: Komponen yang fungsi pendukung definisi, pembacaan dan pemutahiran data. Introduction to Database Design workshop: Data collection: Questions used in this exercise 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. (Definition/description) Describe to me unambiguously the data that the field contains. (Length) What’s the longest # characters or the largest amount it could contain? (Realistically speaking) (Character support) Is every character on the keyboard valid to enter in this field, or only some characters? (Required value) Must the field have some value in it? Should we require the user to enter a value for that field? (Null support) Could that field be empty or unknown and still be valid? (Uniqueness) Must the value entered into the field be unique among all the records? Could more than one record have the same value entered into that field? (Values entered by system vs. user) Is there a way that we could fill in the value of this field for the user, without asking them to type it in? Where would the value of that field come from? (Default value) Is there a value that’s the most common value for the field, the most likely value for the field, the most likely thing the user would type in? This may be governed by business rules, not by the data itself. (Type of key) Is the field a key? If so, what type of key is it? (Edit rule) When the record is first created, does a value have to be entered, or can it wait until later? Can the user change the value after the record is created? (Comparisons allowed) Does it make sense to compare this field to other fields or other values that we know? Does it make sense to compare the value of this field on this record to that on another record? What comparison might we make? (Operations allowed) Does it make sense to perform mathematical operations on this field? Would those operations involve the same field on other records, or other fields in our database? (Range of values, picklist) Are there any fields for which we could realistically enumerate every possible value this field could contain? What are they? (Input mask) Consider our Friend’s birthday field. What problems could we have with this field when multiple people start typing data into this field? How can we generically describe a standard for entering data into this field? Are there other fields with this problem? (Range of values, Decimal places) Find a numeric field. What’s the largest value it could contain? (Realistically speaking) Smallest? How many decimals does it make sense to store in this number? (We don’t have a good example of this in the address database.)