Database Part 1 PDF
Document Details
Uploaded by MarvelousClarinet
Misr University for Science and Technology
Tags
Summary
This document presents an overview of databases, covering topics such as database components, file processing systems, advantages of databases over file processing, and database management systems. It also provides examples of database applications and the different types of database languages.
Full Transcript
Database part 1 Dr. Marwa Mohanad Dr.Ayman Hussein Dr. Nermine Gamal Dr. Mohamed Ali Database A database is a collection of organized data, information, and records, typically stored electronically in a computer system. Def 2: A database is a shared collection of logicall...
Database part 1 Dr. Marwa Mohanad Dr.Ayman Hussein Dr. Nermine Gamal Dr. Mohamed Ali Database A database is a collection of organized data, information, and records, typically stored electronically in a computer system. Def 2: A database is a shared collection of logically related data that is stored to meet the requirements of different users of an organization A database is usually controlled by a database management system (DBMS). Data, DBMS, along with the applications that are associated with them, are referred to as a database system, often shortened to just database. Database ▪ Data Storage Purpose of Database Information that a person needs in his business, social, personal, and religious life. The power and purpose of information is not only in collecting and finding them but more importantly in using them. The main advantages that databases have over other, simpler data storage systems are access, sharing, integrity, and security. Examples of Database Applications ❑ Purchases from the supermarket ❑ Purchases using your credit card ❑ Booking a holiday at the travel agents ❑ Using the local library ❑ Taking out insurance ❑ Renting a video ❑ Using the Internet ❑ Studying at university File Processing Systems Library Examination Registration Library Examination Registration Applications Applications Applications Library Examination Registration Data Data Data Files Files Files Program and Data Interdependence 7 File Processing Systems Library Examination Registration Reg_Number Reg_Number Reg_Number Name Name Name Father Name Address Father Name Books Issued Class Phone Fine Semester Address Grade Class 8 Files Based Processing Disadvantages of File Processing ❑ Program-Data Dependence ❑ File structure is defined in the program code. ❑ All programs maintain metadata for each file they use ❑ Duplication of Data (Data Redundancy) ❑ Different systems/programs have separate copies of the same data – Same data is held by different programs. – Wasted space and potentially different values and/or different formats for the same item. ❑ Limited Data Sharing ❑ No centralized control of data ❑ Programs are written in different languages, and so cannot easily access each other’s files. Disadvantages of File Processing ❑ Lengthy Development Times ❑ Programmers must design their own file formats ❑ Excessive Program Maintenance ❑ 80% of information systems budget ❑ Vulnerable to Inconsistency ❑ Change in one table need changes in corresponding tables as well otherwise data will be inconsistent 11 SOLUTION: The DATABASE Approach ❑ Central repository of shared data ❑ Data is managed by a controlling agent ❑ Stored in a standardized, convenient form This requires a Database and Database Management System (DBMS) Advantages of Database Approach Library Examination Registration Library Examination Registration Applications Applications Applications Database Management System - Data Sharing - Data Independence - Controlled Redundancy University - Better Data Integrity Students Database 13 Database ▪ Data Storage DBMS Database ▪ Data Storage DBMS ▪ Access (Not network supported) ▪ MySQL Postgrea Mongo DB Maria DB ▪ MS SQL Server ▪ Oracle (Most powerful, Most expensive, High storage, Highly secure). Database Management System ❑ A software system that is used to create, maintain, and provide controlled access to users of a database. ❑ (Database) application program: A computer program that interacts with database by issuing an appropriate request (SQL statement) to the DBMS Database ▪ Data Storage DBMS ▪ Access (Not network supported) ▪ MySQL Postgrea Mongo DB Maria DB ▪ MS SQL Server ▪ Oracle. SQL “Database Language” Data Definition Language (DDL): defines the structure or schema of the database. Data Manipulation Language (DML): helps us deal with managing and manipulating data in the database. Design Database Data collection o Data Dictionary: It contains detailed information such as what is in the database, who is allowed to access it, where is the database physically stored etc. (DOCUMENTED) Data Analysis o Entity relationship diagram (ERD). o Draw Relational schema (RS). Design Database o Wizard o SQL Database wizard Database Wizard is a step by step process to create a database and user and finally adding the user to access the database. Database components Client Products Order Employee Department Delivery Database components Client o ID o Name o Phone o Address o Birthdate Database components Product o Product No o Name o Price o Details o Production Date o Expiry Date o Stock Database components Order o Order No o Date o Total Employee o Employee ID o Name o Job Department o Department No o Department name Database components Delivery o Phone No o Name o National ID Three components Entity ❑Regular: depend on itself. ❑Weak Attributes (Entity Descriptions): 75% of attributes are ERD normal ❑Unique: Patient ID, National ID, Phone No, ❑Multivalue: email address, address, Phone No ❑Optional: Birthdate ❑Composite: Name, birthdate, address ❑Derived: Changeable depends on an equation, GPA, Age Relationship Three components Entity Attributes (Entity Descriptions): Relationship (Connect entities with each other) ERD ❑1 to 1: Patient and hospital bed. ❑1 to many: Graduation project. ❑Many to many: courses and students registered. ✓ All relationship must be official with a transaction. ✓ Not all relationships are direct. ▪ Indirect relationship: Student and instructor through the course