1. BASIC CONCEPTSBASIC CONCEPTS
1. What is a database?1. What is a database?
A database is a collection of data which can beA database is a collection of data which can be
used:used:
• alone, oralone, or
• combined / related to other datacombined / related to other data
to provide answers to the user’s question.to provide answers to the user’s question.
2. 2. What is a Database Management System?2. What is a Database Management System?
A DBMS is a collection of programs whichA DBMS is a collection of programs which
• provide management of databasesprovide management of databases
• control access to datacontrol access to data
• contain a query language to retrieve informationcontain a query language to retrieve information
easilyeasily
3. 3. Database Design3. Database Design
It is important to design the database in such a wayIt is important to design the database in such a way
that:that:
• A specific item can be reached easilyA specific item can be reached easily
(maximum guarantee that the desired record will be(maximum guarantee that the desired record will be
reached)reached)
• The database can respond to the user’sThe database can respond to the user’s
different questions easilydifferent questions easily
(necessary relationships are provided)(necessary relationships are provided)
DATABASE MANAGEMENT SYSTEMSDATABASE MANAGEMENT SYSTEMS
4. •The database occupies minimum storage spaceThe database occupies minimum storage space
(choosing data types and how to express a certain(choosing data types and how to express a certain
concept is important)concept is important)
•The database contains no unnecessary dataThe database contains no unnecessary data
(storing the gross salary is enough, the net salary(storing the gross salary is enough, the net salary
can be calculated from the gross salary)can be calculated from the gross salary)
• Data can be added and updated easilyData can be added and updated easily
without causing mistakeswithout causing mistakes
(no data redundancy)(no data redundancy)
DATABASE MANAGEMENT SYSTEMSDATABASE MANAGEMENT SYSTEMS
5. Data redundancyData redundancy
Different and conflicting versions of the same data
e.g. Employee database:
personal info payroll
- ID - ID (relating parameter)
- name - name (causes redundancy)
- address - gross salary
DATABASE MANAGEMENT SYSTEMSDATABASE MANAGEMENT SYSTEMS
6. STEPS IN DATABASE DESIGNSTEPS IN DATABASE DESIGN
• Requirement analysisRequirement analysis
What does the user want?What does the user want?
• Conceptual database designConceptual database design
Defining the entities and attributes, and theDefining the entities and attributes, and the
relationships between theserelationships between these --> The ER model--> The ER model
• Physical database designPhysical database design
Implementation of the conceptual design using aImplementation of the conceptual design using a
Database Management SystemDatabase Management System
DATABASE MANAGEMENT SYSTEMSDATABASE MANAGEMENT SYSTEMS
7. TERMINOLOGYTERMINOLOGY
• EntityEntity --> What is this table about?--> What is this table about? studentsstudents
• AttributeAttribute (Field) --> What items of information are(Field) --> What items of information are
necessary to keep concerning this entity?necessary to keep concerning this entity?
ID, name, department, year, advisorID, name, department, year, advisor
• RecordRecord (Tuple) --> A set of values for each attribute(Tuple) --> A set of values for each attribute
for one itemfor one item
2002765420027654 Ali KayaAli Kaya CAACAA 22 Ahmet DurukalAhmet Durukal
DATABASE MANAGEMENT SYSTEMSDATABASE MANAGEMENT SYSTEMS
8. • KeyKey --> The attribute used to define a required item--> The attribute used to define a required item
who is the advisor ofwho is the advisor of Ali KayaAli Kaya??
Types of keys:Types of keys:
** Primary KeyPrimary Key: Key used to uniquely identify a record: Key used to uniquely identify a record
** Foreign KeyForeign Key: A field in this table which is the Primary: A field in this table which is the Primary
key of another tablekey of another table
• RelationshipRelationship --> Definitions linking two or more tables--> Definitions linking two or more tables
DATABASE MANAGEMENT SYSTEMSDATABASE MANAGEMENT SYSTEMS