Database Concepts and Architecture |
Database (DB)
|
|
NAME | ADDRESS | DUTY |
|
|
|
|
Holmes D. | 86 dundas | nurse |
|
|
|
|
Delagi B. | 7 orchard | nurse |
|
|
|
|
Bell G. | 53 delise | orderly |
|
|
|
|
Newport C. | 16 clifton | intern |
|
|
|
|
Anderson R. | 55 minto | intern |
|
|
|
|
Richie G. | 276 invemess | nurse |
|
|
|
|
Hughes J. | 418 daley | orderly |
|
|
|
|
Frank H. | 58 hillsboro | nurse |
|
|
|
|
Karplus W. | 580 dinnick | intern |
|
|
|
|
Colony R. | 125 evelyn | nurse |
|
|
Database Administrators (DBA)
Operators and maintenance personnel
Data Models, Schemas and Instances
Data model is a set of concepts that can be used to describe the structure of a database. By structure of a database we mean the data types, relationships, and constraints that should hold on the data. It can also include a set of operations for specifying retrievals and updates of the DB.
Categories of data models:
Database schema - the description of a database.
Schema diagram - a displayed schema.
Schema construct - each object in the schema.
Database instance (occurrence of state) - the data in the database at a particular moment in time.
Schema diagram
Data Independence - a degree of independence or insulation of the correct functioning of an application program or query from a wide variety of changes in the logical and physical organization, access paths, and storage mapping of the database
Component modules stored on disk:
Data model
Eloise has a file system for gathering and organising facts on movies, directors and movie stars.
When she adds a new movie to her files she gives it a reference number. She also lists the title of the movie; the type of movie; year in which it was produced, academy awards nominated and received etc.
Similarly, she assigns a number to any director whom she adds to the files. She also lists the directors name, year in which he or she was born, and when (if) they died.
Eloise uses this information to ask questions in a number of ways.
E.G. All the movies of a particular type that starred a certain actor or actress and won at least one academy award.
or The names of the movie that were directed by one particular director and that starred a particular actor.
Director file
DIRNUMB | DIRNAME |
|
|
1 | Allen, Woody |
|
|
2 | Hitchcock, Alfred |
|
|
3 | De Mille, Cecil B |
|
|
4 | Kubrick, Stanley |
|
|
5 | Preminger, Otto |
|
|
6 | Ford, John |
|
|
Star file
STARNUM | STARNAME | BIRTHPLACE |
|
|
1 | Allen, Woody | New York |
|
|
2 | Keaton, Diane | Los Angeles |
|
|
3 | Sellers, Peter | Southsea, Eng. |
|
|
4 | Scott George C | Wise, Va. |
|
|
5 | Mcdowell, M | Leeds, Eng |
|
|
6 | Grant, Cary | Bristol, Eng |
|
|
MVNUM | MVTITLE | YEARMADE | MVTYPE | NUMNOMS | NUMADS | DIRNUM |
1 | Annie Hall | 1977 | com |
|
|
|
2 | Dr Strangelove | 1964 | com |
|
|
|
3 | Clockwork Orange | 1971 | sci-fi |
|
|
|
4 | Psycho | 1960 | horror |
|
|
|
5 | The Birds | 1963 | horror |
|
|
|
6 | Grapes of Wrath | 1940 | drama |
|
|
|
Entities, Attributes and Relationships
Entity like a noun, a person, place or thing.
[eg for eloise they are directors, movies and movie stars]
Attribute this is a property of an entity. For the entity person, the list of attributes may include eye colour and height.
[for eloise the attributes of interest for the entity movie include movie title, type of movie, year of production etc.]
Examples of entities & attributes
|
|
|
|
|
|
|
|
|
|
|
Relationship - this is an association between entities.
For example there is an association between directors and movies.
A director is associated with all the movies she or he has directed, and a movie is associated with its director. i.e. A director is related to all the movies he or she had directed, and a movie is related to its director.
This is an example of a one-to-many relationship. One director is associated with many movies, but each movie is only associated with one director.
|
|
|
|
![]() |
relationship |
|
|
|
|
|
|
|
Here the relationship is represented by an arrow.
The 'one' part of the relationship, in this case director, is indicated by a single headed arrow, and the 'many' part of the relationship, in this case movie is indicated by a double-headed arrow.
We can use this knowledge to update our definition of a database.
A database is a structure that can house information about multiple types of entities, the attributes of these entities, and the relationships among the entities.