70 likes | 210 Views
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'.
E N D
Modeling Scientific DataKai LinViswanath 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'
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 SELECT name FROM navdat.geological_time WHERE max_age < 30 ORDER BY min_age DESC, max_age ASC
Find maximum / minimum longitude / latitude of the ‘Sandia Mountains’ coverage Region in the table view navdat.newmexicolat_long SELECTMAX(latitude), MAX(longitude), MIN(latitude), MIN(longitude) FROM NAVDAT.NEWMEXICOLAT_LONG WHERE region = 'Sandia Mountains'
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 SELECT name FROM navdat.geological_time WHERE max_age < min_age
Find the shortest geologic age in the table view navdat.geological_time SELECT name FROM navdat.geological_time WHERE max_age > min_age ORDER BY max_age - min_age FETCH FIRST 1 ROW ONLY