6
1 Modeling Scientific Data Kai Lin Viswanath Nandigam SQL Exercises

Modeling Scientific Data Kai Lin Viswanath Nandigam

Embed Size (px)

DESCRIPTION

Modeling Scientific Data Kai Lin Viswanath Nandigam. SQL Exercises. Find all materials and rock types in the table view navdat.newmexicolat_long in the ‘Albuquerque Basin’ Region. SELECT material, rock_type FROM NAVDAT.NEWMEXICOLAT_LONG WHERE region = 'Albuquerque Basin'. - PowerPoint PPT Presentation

Citation preview

Page 1: Modeling Scientific Data Kai Lin Viswanath Nandigam

1

Modeling Scientific DataKai Lin

Viswanath Nandigam

SQL Exercises

Page 2: Modeling Scientific Data Kai Lin Viswanath Nandigam

2

SELECT material, rock_type

FROM

NAVDAT.NEWMEXICOLAT_LONG

WHERE region = 'Albuquerque Basin'

Find all materials and rock types in the table view

navdat.newmexicolat_long in the ‘Albuquerque Basin’ Region

Find all materials and rock types in the table view

navdat.newmexicolat_long in the ‘Albuquerque Basin’ Region

Page 3: Modeling Scientific Data Kai Lin Viswanath Nandigam

3

SELECT name

FROM navdat.geological_time

WHERE max_age < 30

ORDER BY min_age DESC, max_age ASC

Find all the geologic age names in the table view navdat.geological_time with the

condition that each geologic age should be completely after 30 million years ago

and sort the result above according to their time intervals

Find all the geologic age names in the table view navdat.geological_time with the

condition that each geologic age should be completely after 30 million years ago

and sort the result above according to their time intervals

Page 4: Modeling Scientific Data Kai Lin Viswanath Nandigam

4

SELECT MAX(latitude), MAX(longitude), MIN(latitude), MIN(longitude)

FROM

NAVDAT.NEWMEXICOLAT_LONG

WHERE region = 'Sandia Mountains'

Find maximum / minimum longitude / latitude

of the ‘Sandia Mountains’ coverage Region

in the table view navdat.newmexicolat_long

Find maximum / minimum longitude / latitude

of the ‘Sandia Mountains’ coverage Region

in the table view navdat.newmexicolat_long

Page 5: Modeling Scientific Data Kai Lin Viswanath Nandigam

5

SELECT name

FROM navdat.geological_time

WHERE max_age < min_age

Check if there is an error in the table view navdat.geological_time, for example, the starting time of

a geological age is later than its ending time

Check if there is an error in the table view navdat.geological_time, for example, the starting time of

a geological age is later than its ending time

Page 6: Modeling Scientific Data Kai Lin Viswanath Nandigam

6

SELECT name

FROM navdat.geological_time

WHERE max_age > min_age

ORDER BY max_age - min_age

FETCH FIRST 1 ROW ONLY

Find the shortest geologic age in the table view navdat.geological_time

Find the shortest geologic age in the table view navdat.geological_time