Presentation is loading. Please wait.

Presentation is loading. Please wait.

Principles of GIS Fundamental database concepts – II Shaowen Wang

Similar presentations


Presentation on theme: "Principles of GIS Fundamental database concepts – II Shaowen Wang"— Presentation transcript:

1 Principles of GIS Fundamental database concepts – II Shaowen Wang
CyberInfrastructure and Geospatial Information Laboratory (CIGI) Department of Geography and Geographic Information Science Department of Computer Science Department of Urban and Regional Planning National Center for Supercomputing Applications (NCSA) University of Illinois at Urbana-Champaign September 12, 2013

2 Connecting to DB % ssh username@geo480.cigi.uiuc.edu Login to DB
Enter password Help: %psql --help Login to DB % psql -U geog480 -d geog480db

3 Some Postgres Commands
List all accessible databases # \l Connect to a DB named 'geog480db' # \c geog480db List all the tables in current DB # \dt, # \d (show all relations)‏ Quit # \q

4 SQL Commands Create Tables Delete table
# create table test(key int, attr varchar(20), value float); Delete table # drop table test;

5 SQL Commands Insert a row Update table contents Delete rows
# insert into test values(1, 'attr0', 100); Update table contents # update test set attr='attr1' where key=1; Delete rows # delete from test where key=1;

6 SQL Commands List contents of table # select * from test;
# select * from test where attr='attr1';

7 Extended Entity-Relationship Model
Sub-type Specialization Super-type Generalization Inheritance

8 Object-Orientation Object State Behavior Class Attributes Method

9 O-O Features Encapsulation Inheritance and polymorphism
Reduces modeling complexity Promotes reuse Inheritance and polymorphism Combats impedance mismatch Metaphorical power

10 Relational Databases Attribute Tuple Relation scheme Relation

11 Relation ID Candidate key Primary key

12 Operations on Relations
Project Restrict

13 Relational Algebra Derived relational operators Performance Join
Natural join Performance

14 Extensible RDBMS RDBMS problems when handling spatial data
Data structure Performance Search

15 Logging into the system
% ssh Login name: netid Password: your password % psql -U username –d tutorial Login name: geog480 Password: same

16 End of This Class


Download ppt "Principles of GIS Fundamental database concepts – II Shaowen Wang"

Similar presentations


Ads by Google