Download presentation
Presentation is loading. Please wait.
Published byCameron Carpenter Modified over 8 years ago
1
-ebru a.s. 2015
2
ATTRIBUTE: Description of entities For employee entity number, name, deptno, age, adr, salary..etc are attributes. RECORD: Stores whole information of an entity Fixed /variable length records Fixed/variable type records FILE : Organization of whole data’s of one entity set Employee file keeps all employee’s record KEY: One or more field to used for retrieve or sort file Primary Key: One or more field which van take unique value for an entity External Key: Key which is composed aspects of physical storage of record
3
Students( sid: string, name: string, login: string, age: integer, gpa: real ) sidnameloginagegpa 53666Jonesjones@cs183.4jones@cs 53688Smithsmith@ee183.2smith@ee 53650Smithsmith@math193.8smith@math Attribute Record FILE Data about entity
4
Operation on Files: Read Write Types Of Access Sequential Random (Direct)
5
A very large, integrated collection of data. Models real-world enterprise. Entities (e.g., students, courses) Relationships (e.g., Tarkan is taking CENG302) A Database Management System (DBMS) is a software package designed to store and manage databases. Well known commercial DBMS products: Oracle, DB2, Sybase etc. Data about entity
6
A Database Management System (DBMS) is a software package designed to store and manage databases. With DBMS Supports large volumes Data independence and efficient access. Reduced application development time. Data integrity and security. Concurrent access, recovery from crashes.
7
from internet
11
FAKULTE, BOLUM, OGRELM && references CREATE TABLE FAKULTE (FNO NUMBER(2) PRIMARY KEY, FADI CHAR(30) NOT NULL, DEK-SNO CHAR(6) NULL REFERENCE OGRELM(SNO)); CREATE TABLE BOLUM( BNO NUMBER(3) PRIMARY KEY, BADI CHAR(30) NOT NULL, FNO NUMBER(2) NOT NULL REFERENCE FAKULTE(FNO), BB-SNO CHAR(6) NULL REFERENCE OGRELM(SNO)); FNOFADIDEK-SNO FAKULTE OGRELM SNO reference BNOBADIFNOBB-SNO reference BOLUM Encapsulation of physical details from author
12
CREATE VIEW KMALZEME AS SELECT MKODU, ADI FROM MALZEME WHERE MKODU NOT IN (SELECT MKODU FROM TUKETİM); INSERT INTO BOLUM VALUES (356,’Bilgisayar Müh.’, ‘1234’); SELECT SNO, ADI FROM PERSONEL WHERE UCRETİ>1000;
13
A typical DBMS has a layered architecture. The figure does not show the concurrency control and recovery components. This is one of several possible architectures; each system has its own variations. Query Optimization and Execution Relational Operators Files and Access Methods Buffer Management Disk Space Management DB These layers must consider concurrency control and recovery
14
External (Sub) Schema – defines the external view of data as seen by a user or program Conceptual Schema – defines the logical view of data as seen by all users and programs Physical (Internal) Schema – defines the physical view of data as seen by a DBMS Schema for the DBMS levels
16
Conceptual Layer Physical Layer Base Tables Stored Tables... External Layer View
17
Physical View database The DBMS must know – exact physical location – precise physical structure Name (20 characters) Address (40 characters) NID (10 char) Designation (15 char) A.B.C. De Silva |222, Galle Road, Colombo | 650370690V|Senior Lecturer Employee record
18
database Logical View The user/application must know – existence – logical reference Employee Address 222, Galle Road, Colombo Name A.B.C. De Silva Designation Senior Lecturer NID 650370690V
19
The conceptual model is a logical representation of the entire contents of the database. The conceptual model is made up of base tables. Base tables are “real” in that they contain physical records. Table Conceptual Layer
20
database External View The user/application see – authorised data – own format Lecturer Department Dept. of Computer Science Name A.B.C. De Silva Designation Senior LecturerAge 35
21
External Views Allows to – hide unauthorised data e.g. salary, dob – provide user view e.g. view employee name, designation, department data taken from employee and department files – derive new attributes e.g. age derived from dob or nid External View cont.
22
Conceptual schema: Students(sid: string, name: string, login: string, age: integer, gpa:real) Courses(cid: string, cname:string, credits:integer) Enrolled(sid:string, cid:string, grade:string) Physical schema: Relations stored as unordered files. Index on first column of Students. External Schema (View): Course_info(cid:string,grade:integer)
23
Applications insulated from how data is structured and stored. Logical data independence: Protection from changes in logical structure of data. Physical data independence: Protection from changes in physical structure of data. * One of the most important benefits of using a DBMS!
24
Database implementors End users and DBMS vendors DB application programmers E.g. smart webmasters Database administrator (DBA) Designs logical /physical schemas Handles security and authorization Data availability, crash recovery Database tuning as needs evolve Must understand how a DBMS works!
25
DBA’s must know underlying technology to make decision (System installing, parameter setting) Decide best configuration of an application Data security and integrity Data processing
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.