290 likes | 392 Views
Database and DBMS. Why?. Databases can be considered as electronic filing systems. Computing power and amount of data is increasing . How do you convert all that data to useful information , tailored to your needs. Data vs information. Data + Structure = Information.
E N D
Why? • Databases can be considered as electronic filing systems. • Computing power and amount of data is increasing. • How do you convert all that data to useful information, tailored to your needs.
Data vs information Data + Structure = Information
Miniworld • A database represents some aspect of the real world, sometimes referred to as miniworld. • Changes in the miniworld are reflected in the database.
Simple Data. • Simple Data → Simple Information. • E.G. Dates of Birth of your family members. – Such information can be stored in memory. • Dates of Birth of your family, friends, co-workers. – Can be stored on a piece of paper or flat text files. • The Data here is simple, and information provided is straight forward, there is no need for a complex database.
Complex Data. Information on Gene X. • Protein • Species • Polymorphisms • More Proteins • Attributes
Flat File Approach • Data can still be stored in flat files. • May even work for single/small number of users. • Consistency issues. – No apparent relationships between different files/data. – No fixed protocols for data access. – Data integrity & duplication. • Data structure is rigid – makes it difficult to change or update.
Definition of Database. • A shared collection of logically related data (and a description of this data) designed to meet the information needs of an organisation. – Data is shared. – Collection. – Logically related (Entity relationship model – ER).
Real World Applications • Applications in the real world are usually rich in concepts and there are various associations among these concepts. • University Academic System – Courses – Faculty Allocated – Classes – Students – Schedule • Association between these concepts.
Terminology • Entity: an object or a concept from the real world • Entity set: a collection of entities • Attribute: a property of an entity • Relation: a “table” with columns and rows • Tuple: a row in a table • Relationship: an association between two or more entities • Database: a set of tables for entity sets and relationships • Rel. Database: a collection of normalized tables
Primary and Foreign Keys • The primary key is the candidate key that is selected to identify entities uniquely within the relation • A foreign key is an attribute or a set of attributes that matches the candidate key of some relation.
Some Biological Databases 1. DDBJ (DNA Data Bank of Japan) 2. EMBL Nucleotide DB (European Molecular Biology Laboratory) 3. GenBank (National Center for Biotechnology Information) 4. UniProtKB (Universal Protein Resource Knowledgebase) 5. Swiss-Prot Protein Knowledgebase (Swiss Institute of Bioinformatics) 6. PROSITE Database of Protein Families and Domains 7. Protein Data Bank (PDB) (Research Collaboratory for Structural Bioinformatics (RCSB)) Ref:http://en.wikipedia.org/wiki/Biological_database#Example_public_databases_for_molecular_biology and look through various database examples.
Problem 1 • A program is required to prompt the terminal operator for the maximum and minimum temperature readings on a particular day, accept those readings as integers, and calculate and display to the screen the average temperature, calculated by (maximum temperature + minimum temperature)/2.
Solution Pseudocode Begin program Print Get inputs #command for prompt Get max_temp, min_temp #command for inputs avg_temp= (max_Temp + min_temp)/2 # command for airthmetic process Print Output avg_temp #command for output End Program
Problem 2 • Calculate the circumference and area of a circle
Solution Pseudocode Begin program get radius, PI circumference = 2 * P I* radius area=PI * radius * radius display circumference, area End program
Problem 3 • an increment program with increment of 3, max=10, min=1
Solution Pseudocode Begin program for ( i=1; i<=10; i+3) display i i+3 End program
Problem 4 • a decrement fire program with user given values for increment, max, & min operator
Solution Pseudocode Begin program Print “Take value of” i, x, y for ( i; i>=x; i-y) display i i-y Print “FIRE” End program
Problem 5 • Given a user value tell the integer status in terms of being positive or negative
Solution Pseudocode Begin program Print “Take value of” x Get x If (x<0) diaplay “user entered a negative integer” Elseif (x>0) diaplay ”user entered a positive integer” Elseif(x==0) display “user has entered a zero“ End program