Download Database Management Systems: Understanding Databases and DBMS - Prof. Willis Boughton and more Study notes Computer Science in PDF only on Docsity! Chapter 14 Databases and Database Management Systems What Is a Database? Database: a collection of related data stored in a manner so it can be retrieved selectively Database management system (DBMS): the software used to create, modify, and access databases DBMSs available for PCs include: Microsoft Access (most widely used) Lotus Approach Enterprise-level DBMSs include: Oracle (the market leader) IBM DB2 MySQL 1-2 What Is the Database Approach? Use databases, not just "regular" files for all data processing Using regular files is the file processing approach Advantages: Better information Faster response time Lower operating costs and storage requirements Improved data integrity and better data management Disadvantages: Higher software cost Increased vulnerability (backup is essential) Fundamental Database Concepts A database consists of one or more tables Each table contains information for one type of person, place, or thing, e.g., the Car table contains information for all cars A table consists of one or more records Each record contains information for one person, place or thing, e.g., record 5 in the Car table contains the information for car5 A record consists of one or more fields Each field contains one unit of information for that person, place, thing, e.g., the Color field contains the color for that car Table demo 3-4 Field Types Text: contains text, such as name and address Alphabetic: contains only letters, e.g., "hello: Alphanumeric: contains letters and numbers, e.g., "abc123" Number: contains a number such as a age Date: contains a date Many possible date formats The unambiguous date format is dd-mon-yyyy Currency: contains a currency number Has units such as dollars or Euros Several other types common Fields demo Queries and Reports A query selects records and fields from one or more tables and displays the selections For example, select all records for "John Smith" You specify the criteria to be matched, e.g., the value of the name field must be "John Smith" Can have multiple criteria, e.g., "John Smith" and year "2000" You specify the fields to be displayed for each matching record A report selects records and fields from one or more tables and prints the selections Similar to query except printed in a format you select Query demo 9-10 Data Dictionary Data dictionary: the repository of all data definitions in a DBMS, including: Database and table names Field definitions Queries and reports Security information: user access and passwords Relationships among tables Current information about each table, such as the number of records Enables consistent database programming Helps to ensure database information is consistent Data Integrity Data integrity: ensuring data are accurate and consistent Consistent means that a quantity, e.g., a person's name, has the same value everywhere Data validation: ensuring data integrity as the data are entered, as much as possible Done by defining validation criteria for fields DBMS enforces these criteria as data are entered Database locking: prevents two individuals from changing the same data at the same time Necessary when more than user is using the database 11-12 Data Integrity, Cont'd Types of Data Validation Alphabetic/numeric check: tests whether the correct type of characters are entered Range check: tests whether the entered number is in the acceptable range Numeric fields only Completeness check: tests whether the entry is complete, e.g., has entered a complete SSN Consistency check: tests whether the entry is consistent with other data, e.g., if state is Illinois, country must be U.S.A. 13-14