Dr. Robbert CS361 Data Management with SQL Information storage and Retrieval
Dr. Robbert CS361 Overview What is the difference between files and databases? Advantages of a database The basic structure of a database Oracle SQL
Dr. Robbert CS361 Comparison of File & Database Systems l File oriented t file contains data about one type of entity t each program owns its own file t file-system services used to access data t data duplication - redundancy l Database oriented t database contains data on multiple types of entities and relationships t data can be shared t DBMS provides service for sharing t data integrated and multiple access paths
Dr. Robbert CS361 ADVANTAGES OF DATABASE SYS l REDUCED REDUNDANCY - Controlling duplication l INTEGRATION AND SHARING OF DATA - One set of data to maintain l MAINTAINING CONSISTENCY - Data propagation l DATA ACCESS - Multiple access paths; High level language l STANDARDIZATION - Enforcing local and global standards l SECURITY - User access; Protection of Data l DATA INDEPENDENCE - Data descriptors separate from application program
Dr. Robbert CS361 APPLICATION PROGRAMS Appl Prog FILE SYSTEM Appl Prog Appl Prog
Dr. Robbert CS361
RELATION (Table) FILE Last Name First Name SS#DeptSalary SMITHJOHN ACC34000 ANDERSONMARY IS44000 CHINLOU IS50000 Tuples (rows) record Attributes (columns) field
Dr. Robbert CS361 RELATIONAL DATABASE MODEL TERMS TERMDEFINITION TupleA row in a relation CardinalityNumber of tuples in relation Attribute Column of relation Domain Value set from which attribute chosen DegreeNumber of attributes in relation Primary keyParticular candidate key Foreign key Attribute which references primary key in another relation
Dr. Robbert CS361 Oracle at Bentley Multi-user relational database Logon to your Bentley account THEN access Oracle Centralized Oracle database –allows sharing –security Multiple tablespaces, multiple databases
Dr. Robbert CS361 Basic SQL Command SELECT ATTRIBUTES FROM TABLENAME; SELECT * FROM ANIMAL; How to find out what tables exist in the database: SELECT * FROM TAB;
Dr. Robbert CS361 Basic SQL Commands How to find out what attributes exist in a table: DESCRIBE ANIMAL; SELECT ATTRIBUTES FROM TABLENAME WHERE CONSTRAINT; SELECT ANAME FROM ANIMAL WHERE ASPECIES = ‘LION’;