Download presentation
Presentation is loading. Please wait.
Published byBartholomew Carroll Modified over 8 years ago
1
BBM 371 – Data Management Lecture 3: Basic Concepts of DBMS 06.10.2015 Prepared by: Ebru Akçapınar Sezer, Gönenç Ercan
2
Some terms ► 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 can take unique value for an entity ► External Key: Key which is composed aspects of physical storage of record
3
Entity: Student ► 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
Continues.... ► Operation on Files: ► Read ► Write ► Types Of Access ► Sequential ► Random (Direct)
5
What Is a DBMS? ► 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
What Is a DBMS? ► 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
Typical DBMS use in Applications from internet
8
Typical table creation in DBMS (example) from internet
9
Sample Tables
10
Sample Query in DBMS 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
12
Sample SQL Queries 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
Structure of a DBMS ► 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
Schema for the DBMS levels ► 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
16
Conceptual Layer Physical Layer Base Tables Stored Tables... External Layer View
17
database 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 Physical View The DBMS must know – exact physical location – precise physical structure
18
database Employee Address 222, Galle Road, Colombo Name A.B.C. De Silva Designation Senior Lecturer NID 650370690V Logical View The user/application must know – existence – logical reference
19
Table Conceptual Layer ► 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.
20
database Lecturer Department Dept. of Computer Science Name A.B.C. De Silva Designation Senior LecturerAge 35 External View ► The user/application see ► authorised data ► own format
21
External View cont. ► 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
22
Exp: University Database ► 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
Data Independence ► 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
People who deal with databases ► Database implementers ► 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
Important Reason for looking ‘inside’ db ► 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
© 2025 SlidePlayer.com. Inc.
All rights reserved.