SELECT max(latitude) FROM [690].[All3col]


________________________________________


SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM [690].[All3col] AS maxLat


________________________________________


WITH bounds (minLat,minLong,maxLat,maxLong)
  AS (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM [690].[All3col] AS maxLat)
SELECT * FROM bounds


________________________________________


WITH data (species, latitude, longitude) AS (SELECT * from [690].[All3col]), bounds (minLat,minLong,maxLat,maxLong)
  AS (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data)
SELECT * FROM bounds


________________________________________


WITH data AS (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong)
  AS (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data)
SELECT * FROM bounds


________________________________________


WITH data AS
         (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data)
SELECT * FROM bounds


________________________________________


WITH data AS
         (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data)
SELECT (latitude-bounds.minLat)/0.1 from data,bounds


________________________________________


WITH data AS
         (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data)
SELECT (data.latitude-bounds.minLat)/0.1 AS latBin, (data.longitude-bounds.minLong)/0.1 AS longBin from data, bounds


________________________________________


WITH data AS
         (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data)
SELECT data.species,(data.latitude-bounds.minLat)/0.1 AS latBin, (data.longitude-bounds.minLong)/0.1 AS longBin from data, bounds


________________________________________


WITH data AS
         (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data)
SELECT data.species,floor((data.latitude-bounds.minLat)/0.1) AS latBin, floor((data.longitude-bounds.minLong)/0.1) AS longBin from data, bounds


________________________________________


WITH data AS
         (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,floor((data.latitude-bounds.minLat)/0.1) AS latBin, floor((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds)
SELECT * FROM binnedSpecies


________________________________________


WITH data AS
         (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,floor((data.latitude-bounds.minLat)/0.1) AS latBin, floor((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds)
SELECT latBin,longBin,COUNT(species) FROM binnedSpecies GROUP BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,floor((data.latitude-bounds.minLat)/0.1) AS latBin, floor((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds)
SELECT latBin AS count,longBin,COUNT(species) FROM binnedSpecies GROUP BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * from [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,floor((data.latitude-bounds.minLat)/0.1) AS latBin, floor((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds)
SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     bounds (minLat,minLong,maxLat,maxLong) AS
         (SELECT min(latitude),min(longitude),max(latitude),max(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,floor((data.latitude-bounds.minLat)/0.1) AS latBin, floor((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT * from binnedSpeciesCount


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     bounds (minLat,minLong) AS
         (SELECT min(latitude),min(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,floor((data.latitude-bounds.minLat)/0.1) AS latBin, floor((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT * from binnedSpeciesCount


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     bounds (minLat,minLong) AS
         (SELECT MIN(latitude),MAX(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/0.1) AS latBin, FLOOR((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT * from binnedSpeciesCount ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     bounds (minLat,minLong) AS
         (SELECT MIN(latitude),MIN(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/0.1) AS latBin, FLOOR((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT * from binnedSpeciesCount ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     bounds (minLat,minLong) AS
         (SELECT MIN(latitude),MIN(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/0.1) AS latBin, FLOOR((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*0.1+0.1/2) AS latitude,(bounds.minLong+longBin*0.1+0.1/2) AS longitude,numSpecies from binnedSpeciesCount,bounds ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     binSize(binSize) AS
         (SELECT 0.1),
     bounds (minLat,minLong) AS
         (SELECT MIN(latitude),MIN(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/0.1) AS latBin, FLOOR((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*0.1+0.1/2) AS latitude,(bounds.minLong+longBin*0.1+0.1/2) AS longitude,numSpecies from binnedSpeciesCount,bounds ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds (minLat,minLong) AS
         (SELECT MIN(latitude),MIN(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/0.1) AS latBin, FLOOR((data.longitude-bounds.minLong)/0.1) AS longBin FROM data, bounds),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*0.1+0.1/2) AS latitude,(bounds.minLong+longBin*0.1+0.1/2) AS longitude,numSpecies from binnedSpeciesCount,bounds ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds (minLat,minLong) AS
         (SELECT MIN(latitude),MIN(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*0.1+0.1/2) AS latitude,(bounds.minLong+longBin*0.1+0.1/2) AS longitude,numSpecies from binnedSpeciesCount,bounds ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds (minLat,minLong) AS
         (SELECT MIN(latitude),MIN(longitude) FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*binSize+binSize/2) AS latitude,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies from binnedSpeciesCount,bounds,parameters ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MIN(latitude) AS minLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*binSize+binSize/2) AS latitude,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies from binnedSpeciesCount,bounds,parameters ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MIN(latitude) AS minLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*binSize+binSize/2) AS latitude,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies from binnedSpeciesCount,bounds,parameters ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((bounds.maxLat-data.latitude)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.maxLat-latBin*binSize-binSize/2) AS latitude,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies from binnedSpeciesCount,bounds,parameters ORDER BY latBin DESC,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((bounds.maxLat-data.latitude)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),
     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.maxLat-latBin*binSize-binSize/2) AS latitude,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies from binnedSpeciesCount,bounds,parameters ORDER BY latBin,longBin


________________________________________


SELECT * FROM [690].[All3col]


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((bounds.maxLat-data.latitude)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),

     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.maxLat-latBin*binSize-binSize/2) AS latitude,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies from binnedSpeciesCount,bounds,parameters ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((bounds.maxLat-data.latitude)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),

     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.maxLat-latBin*binSize-binSize/2) AS latitude,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies from binnedSpeciesCount,bounds,parameters ORDER BY latBin,longBin


________________________________________


SELECT latitude,longitude FROM [690].[OR3col] WHERE longitude>=0
UNION ALL SELECT latitude,longitude+360 FROM [690].[OR3col] WHERE longitude<0


________________________________________


SELECT species,latitude,longitude FROM [690].[OR3col] WHERE longitude>=0
UNION ALL SELECT species,latitude,longitude+360 FROM [690].[OR3col] WHERE longitude<0


________________________________________


SELECT latitude,species,longitude FROM [690].[OR3col]


________________________________________


SELECT max(timestamp),min(timestamp) from [1002].[Tokyo_0_merged.csv]


________________________________________


SELECT * FROM [1002].[Tokyo_0_merged.csv]


________________________________________


SELECT min(timestamp) FROM [1002].[Tokyo_0_merged.csv]


________________________________________


SELECT COUNT(*) FROM [1002].[Tokyo_0_merged.csv]


________________________________________


SELECT COUNT(*)/3600 FROM [1002].[Tokyo_0_merged.csv]


________________________________________


SELECT COUNT(*)/3600/24 FROM [1002].[Tokyo_0_merged.csv]


________________________________________


SELECT max(timestamp) FROM [1002].[Tokyo_0_merged.csv]


________________________________________


SELECT COUNT(*) FROM [1002].[Tokyo_0_merged.csv] where timestamp='SATSLF0086'


________________________________________


SELECT COUNT(*) FROM [1002].[Tokyo_0_merged.csv] where timestamp<>'SATSLF0086'


________________________________________


SELECT max(timestamp) FROM [1002].[Tokyo_0_merged.csv] where timestamp<>'SATSLF0086'


________________________________________


SELECT * FROM [1002].[Tokyo_0_merged.csv] where timestamp='SATSLF0086'


________________________________________


SELECT t1.species,t2.species
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
WHERE (t1.latitude-t2.latitude)*(t1.latitude-t2.latitude) < 0.1


________________________________________


SELECT t1.species,t2.species
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
  WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.1


________________________________________


SELECT t1.species,t2.species
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
  WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.01


________________________________________


SELECT t1.species,t2.species
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
  WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.001


________________________________________


SELECT COUNT(t1.species)
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
  WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.001


________________________________________


SELECT COUNT(t1.species)
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.0001


________________________________________


SELECT COUNT(t1.species)
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.000001


________________________________________


SELECT COUNT(t1.species)
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.000001
      AND t1.latitude is not null
      AND t2.latitude is not null


________________________________________


SELECT t1.species,t2.species
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.000001
      AND t1.latitude is not null
      AND t2.latitude is not null


________________________________________


SELECT *
FROM [354].[OR3col_pos]
WHERE species = 'Acronicta impressa'


________________________________________


SELECT COUNT(*)
FROM [354].[OR3col_pos]
WHERE species = 'Acronicta impressa'


________________________________________


SELECT *
FROM [354].[OR3col_pos]
WHERE species = 'Acronicta impressa'


________________________________________


SELECT *
FROM [354].[OR3col_pos]
WHERE latitude = 45.117


________________________________________


SELECT t1.species,t2.species
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.000001
  AND t1.latitude IS NOT NULL
  AND t2.latitude IS NOT NULL
  AND t1.species < t2.species


________________________________________


SELECT COUNT(t1.species)
FROM [354].[OR3col_pos] t1
   , [354].[OR3col_pos] t2
WHERE sqrt(power(t1.latitude-t2.latitude,2)+power(t1.longitude-t2.longitude,2)) < 0.000001
  AND t1.latitude IS NOT NULL
  AND t2.latitude IS NOT NULL
  AND t1.species < t2.species


________________________________________


SELECT meth.Seqname
      ,COUNT(*)
FROM [354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
GROUP by meth.Seqname



________________________________________


SELECT meth.GroupID
      ,COUNT(*)
FROM [354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
GROUP by meth.GroupID



________________________________________


SELECT oyster.groupid
      ,COUNT(*)
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster,
     [354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
GROUP BY oyster.groupid


________________________________________


SELECT oyster.groupid
      ,COUNT(*)
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
   OR meth.startidx > oyster.startidx AND meth.startidx > meth.endidx
GROUP BY oyster.groupid


________________________________________


SELECT oyster.groupid
      ,COUNT(*)
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
   OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx
GROUP BY oyster.groupid


________________________________________


SELECT oyster.groupid
      ,COUNT(*)
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
   OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx
  AND oyster.groupid LIKE 'ID=CGI_10000001;'
GROUP BY oyster.groupid



________________________________________


SELECT oyster.groupid
      ,COUNT(*)
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
  OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
  AND oyster.groupid LIKE 'ID=CGI_10000001;'
GROUP BY oyster.groupid



________________________________________


SELECT oyster.groupid
      ,COUNT(*)
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
  OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
  AND oyster.groupid LIKE 'ID=ID=CGI_10024878;'
GROUP BY oyster.groupid



________________________________________


SELECT oyster.groupid
      ,COUNT(*)
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
  OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
  AND oyster.groupid LIKE 'ID=CGI_10024878;'
GROUP BY oyster.groupid



________________________________________


SELECT oyster.groupid
      ,COUNT(*) AS cnt
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
  OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
  AND oyster.groupid LIKE 'ID=CGI_10024878;'
GROUP BY oyster.groupid



________________________________________


SELECT *
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
   OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
   AND oyster.groupid LIKE 'ID=CGI_10024878;'


________________________________________


SELECT *
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
  AND oyster.groupid LIKE 'ID=CGI_10024878;'


________________________________________


SELECT oyster.groupid
     , COUNT(*) as cnt
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT oyster.groupid
     , COUNT(*) as methcnt
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT REPLACE(oyster.groupid,';', '')
     , COUNT(*) as methcnt
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT * FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE Seqname NOT LIKE '##date'



________________________________________


SELECT * FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,0,2) NOT LIKE '##'



________________________________________


SELECT * FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,REPLACE(GroupID,';.*','') AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,REPLACE(GroupID,';','') AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,PATINDEX(GroupID,';.*') AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,REPLACE(GroupID,'%;.*%','') AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,PATINDEX(GroupID,'%;.*%') AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,PATINDEX(GroupID,'%;%') AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,PATINDEX(GroupID,';') AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,PATINDEX(';',GroupID) AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,PATINDEX('%;%',GroupID) AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,SUBSTRING(GroupID,0,CHARINDEX(';',GroupID)) AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,RTRIM(SUBSTRING(GroupID,0,CHARINDEX(';',GroupID))) AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT Seqname,Source,Feature,StartIdx,EndIdx,Score,Strand,Frame,RTRIM(SUBSTRING(GroupID,0,0)) AS GroupID
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT REPLACE(oyster.groupid,';', '')
     , COUNT(*) as methcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT oyster.groupid
     , COUNT(*) as methcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT Seqname
     , Source
     , Feature
     , StartIdx
     , EndIdx
     , Score
     , Strand
     , Frame
     , CASE WHEN CHARINDEX(';', GroupID) = 0
            THEN GroupID
            ELSE SUBSTRING(GroupID, 1, CHARINDEX(';', GroupID)-1)
       END AS GroupID
     , CASE WHEN CHARINDEX(';', GroupID) = 0
            THEN ''
            ELSE SUBSTRING(GroupID, CHARINDEX(';', GroupID)+1, LEN(GroupID))
       END AS Comment
FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff]


________________________________________


SELECT Seqname
     , Source
     , Feature
     , StartIdx
     , EndIdx
     , Score
     , Strand
     , Frame
     , CASE WHEN CHARINDEX(';', GroupID) = 0
            THEN GroupID
            ELSE SUBSTRING(GroupID, 1, CHARINDEX(';', GroupID)-1)
       END AS GroupID
     , CASE WHEN CHARINDEX(';', GroupID) = 0
            THEN ''
            ELSE SUBSTRING(GroupID, CHARINDEX(';', GroupID)+1, LEN(GroupID))
       END AS Comment
FROM [354].[table_bivalvia_methylated_20CG_20as_20bed.txt.gff]


________________________________________


SELECT Seqname
     , Source
     , Feature
     , StartIdx
     , EndIdx
     , Score
     , Strand
     , Frame
     , CASE WHEN CHARINDEX(';', GroupID) = 0
            THEN GroupID
            ELSE SUBSTRING(GroupID, 1, CHARINDEX(';', GroupID)-1)
       END AS GroupID
     , CASE WHEN CHARINDEX(';', GroupID) = 0
            THEN ''
            ELSE SUBSTRING(GroupID, CHARINDEX(';', GroupID)+1, LEN(GroupID))
       END AS Comment
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) NOT LIKE '##'



________________________________________


SELECT oyster.groupid
     , COUNT(*) as methcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT oyster.groupid
     , COUNT(*) as methcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT oyster.groupid
     , COUNT(*) as methcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid 


________________________________________


SELECT oyster.groupid
     , COUNT(*) as methcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[cni1319n_oyster_v9_M_fuzznuc_CG.gff] allcg
WHERE oyster.seqname=allcg.seqname
  AND (oyster.startidx > allcg.startidx AND oyster.startidx < allcg.endidx
       OR allcg.startidx > oyster.startidx AND allcg.startidx < oyster.endidx)
GROUP BY oyster.groupid 


________________________________________


SELECT oyster.GroupID
     , COUNT(*) as allCGcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[cni1319n_oyster_v9_M_fuzznuc_CG.gff] allcg
WHERE oyster.seqname=allcg.seqname
  AND (oyster.startidx > allcg.startidx AND oyster.startidx < allcg.endidx
       OR allcg.startidx > oyster.startidx AND allcg.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT oyster.GroupID
     , COUNT(*) as methCGcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid 


________________________________________


SELECT oyster.GroupID
     , COUNT(*) as methCGcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT methCG.GroupID
     , methCGcnt/allCGcnt
FROM [354].[methylated_CG_gene_count] methCG
   , [354].[all_CG_gene_count] allCG
WHERE methCG.GroupID = allCG.GroupID



________________________________________


SELECT methCG.GroupID
     , 1.0*methCGcnt/allCGcnt
FROM [354].[methylated_CG_gene_count] methCG
   , [354].[all_CG_gene_count] allCG
WHERE methCG.GroupID = allCG.GroupID



________________________________________


SELECT methCG.GroupID
     , 1.0*methCGcnt/allCGcnt
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID



________________________________________


SELECT allCG.GroupID
     , 1.0*methCGcnt/allCGcnt
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID



________________________________________


SELECT allCG.GroupID
     , CASE WHEN methCGcnt IS NULL
            THEN 0
            ELSE 1.0*methCGcnt/allCGcnt END as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID



________________________________________


SELECT allCG.GroupID
     , CASE WHEN methCGcnt IS NULL
            THEN 0
            ELSE 1.0*methCGcnt/allCGcnt END as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID



________________________________________


SELECT oyster.GroupID
     , COUNT(*) as methCGcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
    ,[354].[bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT geneDesc.Column1
     , geneDesc.Column2
     , geneDesc.Column3
     , geneDesc.Column4
     , geneDesc.Column5
     , methRatio.MethRatio
FROM [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  , [354].[methylation_ratio_CG_gene] methRatio
  WHERE geneDesc.Column1 = SUBSTRING(methRatio.GroupID, CHARINDEX('CGI', methRatio.GroupID), LEN(methRatio.GroupID))


________________________________________


SELECT allCG.GroupID
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID



________________________________________


SELECT COUNT(*) FROM [354].[Gene_Description_and_Methylation_Ratio_Oyster]


________________________________________


SELECT TOP 5 * FROM [354].[Gene_Description_and_Methylation_Ratio_Oyster]


________________________________________


SELECT geneDesc.*
     , methRatio.MethRatio
FROM [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
   , [354].[methylation_ratio_CG_gene] methRatio
WHERE geneDesc.Column1 = SUBSTRING(methRatio.GroupID, CHARINDEX('CGI', methRatio.GroupID), LEN(methRatio.GroupID))


________________________________________


SELECT oyster.GroupID
     , COUNT(*) as methCGcnt
FROM [354].[oyster.v9.glean.final.rename.mRNA.gff] oyster
   , [354].[bivalvia_methylated_20CG_20as_20bed.txt.gff] meth
WHERE oyster.seqname=meth.seqname
  AND (oyster.startidx > meth.startidx AND oyster.startidx < meth.endidx
       OR meth.startidx > oyster.startidx AND meth.startidx < oyster.endidx)
GROUP BY oyster.groupid


________________________________________


SELECT * FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff]


________________________________________


SELECT EndIdx as "End" FROM [354].[table_oyster.v9.glean.final.rename.mRNA.gff]


________________________________________


SELECT * FROM [354].[TJGR_Gene_SPID_evalue_Description.txt]
WHERE Column2 <> Column4



________________________________________


SELECT geneDesc.*
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
ON geneDesc.Column1 = SUBSTRING(methCG.GroupID, CHARINDEX('CGI', methCG.GroupID), LEN(methCG.GroupID))


________________________________________


SELECT geneDesc.*
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 = SUBSTRING(methCG.GroupID, CHARINDEX('CGI', methCG.GroupID), LEN(methCG.GroupID))


________________________________________


SELECT geneDesc.*
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 = SUBSTRING(methCG.GroupID, CHARINDEX('CGI', methCG.GroupID), LEN(methCG.GroupID))


________________________________________


SELECT geneDesc.*
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 = SUBSTRING(methCG.GroupID, CHARINDEX('CGI', methCG.GroupID), LEN(methCG.GroupID))
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID




________________________________________


SELECT geneDesc.*
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM ([354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID)
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 = SUBSTRING(methCG.GroupID, CHARINDEX('CGI', methCG.GroupID), LEN(methCG.GroupID))




________________________________________


SELECT geneDesc.*
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM ([354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID)
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 = SUBSTRING(allCG.GroupID, CHARINDEX('CGI', allCG.GroupID), LEN(allCG.GroupID))




________________________________________


SELECT geneDesc.*
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 = SUBSTRING(allCG.GroupID, CHARINDEX('CGI', allCG.GroupID), LEN(allCG.GroupID))




________________________________________


SELECT COUNT(*) FROM [354].[Gene_Description_and_Methylation_Ratio_Oyster]


________________________________________


SELECT Seqname
     , Source
     , Feature
     , StartIdx
     , EndIdx
     , Score
     , Strand
     , Frame
     , CASE WHEN CHARINDEX(';', GroupID) = 0
            THEN GroupID
            ELSE SUBSTRING(GroupID, 1, CHARINDEX(';', GroupID)-1)
       END AS GroupID
     , CASE WHEN CHARINDEX(';', GroupID) = 0
            THEN ''
            ELSE SUBSTRING(GroupID, CHARINDEX(';', GroupID)+1, LEN(GroupID))
       END AS Comment
FROM [354].[table_cni1319n_oyster_v9_M_fuzznuc_CG.gff]
WHERE SUBSTRING(Seqname,1,2) <> '##'



________________________________________


SELECT COUNT(*) FROM [354].[Gene_Description_and_Methylation_Ratio_Oyster]


________________________________________


SELECT TOP 10 * FROM [354].[Gene_Description_and_Methylation_Ratio_Oyster]


________________________________________


SELECT COUNT(*) FROM [354].[Gene_Description_and_Methylation_Ratio_Oyster]


________________________________________


SELECT COUNT(*) FROM [354].[Gene_Description_and_Methylation_Ratio_Oyster]


________________________________________


SELECT geneDesc.*
     , methRatio.MethRatio
FROM [354].[methylation_ratio_CG_gene] methRatio
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 = SUBSTRING(methRatio.GroupID, CHARINDEX('CGI', methRatio.GroupID), LEN(methRatio.GroupID))





________________________________________


SELECT geneDesc.*
     , methRatio.MethRatio
FROM [354].[methylation_ratio_CG_gene] methRatio
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(methRatio.GroupID,
                   CHARINDEX('CGI', methRatio.GroupID),
                   LEN(methRatio.GroupID))





________________________________________


SELECT geneDesc.*
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))




________________________________________


SELECT allCG.GroupID
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID



________________________________________


SELECT COUNT(*) FROM [354].[all_CG_gene_count]


________________________________________


SELECT COUNT(*) FROM [354].[cni1319n_oyster_v9_M_fuzznuc_CG.gff]


________________________________________


SELECT COUNT(*) FROM [354].[cni1319n_oyster_v9_M_fuzznuc_CG.gff]


________________________________________


SELECT allCG.GroupID
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID



________________________________________


SELECT allCG.GroupID
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID



________________________________________


SELECT allCG.GroupID
     , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
ON methCG.GroupID = allCG.GroupID



________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((bounds.maxLat-data.latitude)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),

     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.maxLat-latBin*binSize-binSize/2) AS latitude,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies from binnedSpeciesCount,bounds,parameters


________________________________________


SELECT COUNT(*) FROM [354].[SPID_GOnumber.txt]


________________________________________


SELECT COUNT(*) FROM [354].[SPID_GOnumber.txt]


________________________________________


SELECT COUNT(*) FROM [354].[SPID_GOnumber.txt]


________________________________________


SELECT COUNT(*) FROM [354].[SPID_GOnumber.txt]


________________________________________


SELECT TOP 5 * FROM [354].[gp_association.goa_uniprot]


________________________________________


SELECT COUNT(*) FROM [354].[OR3col_pos]


________________________________________


SELECT * FROM [354].[Dan's binning] a,
  [354].[Dan's binning] b
  WHERE a.latitude=b.latitude
  AND a.numSpecies > 100


________________________________________


SELECT * FROM [354].[Dan's binning] a,
  [354].[Dan's binning] b
  WHERE a.latitude=b.latitude
  AND a.numSpecies > b.numSpecies * 5


________________________________________


SELECT * FROM [354].[Dan's binning] a,
  [354].[Dan's binning] b
  WHERE a.latitude=b.latitude
  AND a.numSpecies > b.numSpecies * 500
  AND b.numSpecies > 0


________________________________________


SELECT TOP 1 * FROM [354].[Dan's binning] a,
  [354].[Dan's binning] b



________________________________________


SELECT latitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT COUNT(*)
  FROM [354].[methylation_ratio_CG_gene]
  WHERE MethRatio > 0.5



________________________________________


SELECT * FROM [1002].[LineP_CAMERA_annotation.csv]
  WHERE ProteinGroup LIKE 'PG_73'



________________________________________


SELECT COUNT(*)
FROM [1002].[LineP_CAMERA_annotation.csv]
WHERE FinalTaxonomy = 'Myoviridae'



________________________________________


SELECT FinalTaxonomy,COUNT(*)
FROM [1002].[LineP_CAMERA_annotation.csv]
GROUP BY FinalTaxonomy



________________________________________


SELECT FinalTaxonomy,COUNT(*)
FROM [1002].[LineP_CAMERA_annotation.csv]
GROUP BY FinalTaxonomy
  ORDER by COUNT(*) DESC


________________________________________


SELECT COUNT(*) FROM [354].[SPID_GOnumber.txt]


________________________________________


SELECT TOP 5 * FROM [354].[SPID_GOnumber.txt]


________________________________________


SELECT Distinct TABLE_NAME FROM information_schema.TABLES


________________________________________


SELECT Distinct principal_id FROM sys.TABLES


________________________________________


select TOP 1 * from sys.database_permissions


________________________________________


select TOP 1 * from sys.database_permissions, sys.database_principals


________________________________________


SELECT TOP 1 *
FROM sys.database_permissions perm
JOIN sys.database_principals princip
  ON perm.grantee_principal_id = princip.principal_id
 AND princip.name = '446'


________________________________________


SELECT TOP 1 *
FROM sys.database_principals princip




________________________________________


SELECT TOP 100 name
FROM sys.database_principals princip




________________________________________


SELECT TOP 1 *
FROM sys.database_permissions perm
JOIN sys.database_principals princip
  ON perm.grantee_principal_id = princip.principal_id
 AND princip.name = '446'


________________________________________


SELECT TOP 1 *
FROM sys.database_permissions perm
JOIN sys.database_principals princip
  ON perm.grantee_principal_id = princip.principal_id
 AND princip.name = '446'


________________________________________


SELECT TOP 1 *
FROM sys.database_principals princip




________________________________________


SELECT name
FROM sys.database_principals princip




________________________________________


SELECT name
FROM sys.database_principals




________________________________________


SELECT name
FROM sys.database_principals
WHERE name LIKE '%dhalperi%'



________________________________________


SELECT leftT.follower, rightT.followee
  FROM [1314howe].[twitter4M] leftT
  JOIN [1314howe].[twitter4M] rightT
    ON leftT.followee=rightT.follower



________________________________________


SELECT COUNT(*)
 FROM( 

SELECT DISTINCT leftT.follower AS x, rightT.followee AS z
  FROM [1314howe].[twitter4M] leftT
  JOIN [1314howe].[twitter4M] rightT
    ON leftT.followee=rightT.follower
  ) dt



________________________________________


SELECT COUNT(*)
 FROM( 

SELECT DISTINCT leftT.follower AS x, rightT.followee AS z
  FROM [1314howe].[twitter4M] leftT
  JOIN [1314howe].[twitter4M] rightT
    ON leftT.followee=rightT.follower
  WHERE leftT.follower=5
  ) dt



________________________________________


SELECT COUNT(*)
 FROM( 

SELECT DISTINCT leftT.follower AS x, rightT.followee AS z
  FROM [1314howe].[twitter4M] leftT
  JOIN [1314howe].[twitter4M] rightT
    ON leftT.followee=rightT.follower
  WHERE leftT.follower=11
  ) dt



________________________________________


SELECT COUNT(*)
 FROM( 

SELECT DISTINCT leftT.follower AS x, rightT.followee AS z
  FROM [1314howe].[twitter4M] leftT
  JOIN [1314howe].[twitter4M] rightT
    ON leftT.followee=rightT.follower
  WHERE leftT.follower=1000
  ) dt



________________________________________


SELECT COUNT(*)
 FROM( 

SELECT DISTINCT leftT.follower AS x, rightT.followee AS z
  FROM [1314howe].[twitter4M] leftT
  JOIN [1314howe].[twitter4M] rightT
    ON leftT.followee=rightT.follower
  WHERE leftT.follower=1000
  ) dt



________________________________________



SELECT COUNT(*)
FROM [1314howe].[twitter4M]
WHERE follower = 1000


________________________________________


SELECT COUNT(*)
 FROM( 

SELECT DISTINCT leftT.follower AS x, rightT.followee AS z
  FROM [1314howe].[twitter4M] leftT
  JOIN [1314howe].[twitter4M] rightT
    ON leftT.followee=rightT.follower
  WHERE leftT.follower=1000
  ) joined



________________________________________


SELECT COUNT(*)
 FROM( 

SELECT DISTINCT leftT.follower AS x, rightT.followee AS z
  FROM [1314howe].[twitter4M] leftT
  JOIN [1314howe].[twitter4M] rightT
    ON leftT.followee=rightT.follower
  WHERE leftT.follower=1000
  ) joined
WHERE x = 1000



________________________________________


SELECT * from [1314howe].[twitter4M]
  WHERE follower=1000
    AND followee=6093162


________________________________________


SELECT * from [1314howe].[twitter4M]
  WHERE follower=6093162
    AND followee=5920532


________________________________________


SELECT COUNT(*) from [1314howe].[twitter4M]




________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.615784]


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.6157841]


________________________________________


SELECT Column1 AS follower
     , Column2 AS followee
FROM [354].[table_twitter_rv.6157841E77A8]


________________________________________


SELECT COUNT(*)
 FROM( 

SELECT DISTINCT leftT.follower AS x, rightT.followee AS z
  FROM [354].[twitter_rv.6157841] leftT
  JOIN [354].[twitter_rv.6157841] rightT
    ON leftT.followee=rightT.follower
  WHERE leftT.follower=1000
  ) joined



________________________________________


SELECT COUNT(*) 
  FROM ( SELECT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined


________________________________________


SELECT COUNT(*) 
  FROM ( SELECT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.6157841]
  
--  FROM ( SELECT leftT.follower AS x, rightT.followee AS z 
--    FROM [354].[twitter_rv.6157841] leftT 
--    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
  --2005274093



________________________________________


SELECT COUNT(*) 
  FROM ( SELECT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined


________________________________________


SELECT COUNT(*) 
  FROM ( SELECT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
  WHERE x < 1000



________________________________________


SELECT COUNT(*) 
  FROM ( SELECT DISTINCT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
  WHERE x < 5



________________________________________


SELECT COUNT(*) 
  FROM ( SELECT DISTINCT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
  WHERE x < 100



________________________________________


SELECT COUNT(*) 
  FROM ( SELECT DISTINCT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
  WHERE x < 200



________________________________________


SELECT COUNT(*) 
  FROM ( SELECT DISTINCT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
  WHERE x < 300



________________________________________


SELECT COUNT(*) 
  FROM ( SELECT DISTINCT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
  WHERE x < 400



________________________________________


SELECT COUNT(*) 
  FROM ( SELECT DISTINCT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
  WHERE x < 1000



________________________________________


SELECT COUNT(*)
FROM (
   SELECT follower AS x,followee AS y,min(follower) AS ignored
   FROM [354].[twitter_rv.6157841]
   GROUP BY follower,followee
) grouped
WHERE x < 100



________________________________________


SELECT COUNT(*)
FROM (
   SELECT follower AS x,followee AS y,min(follower) AS ignored
   FROM [354].[twitter_rv.6157841]
   GROUP BY follower,followee
) grouped
WHERE x < 1000



________________________________________


SELECT COUNT(*)
FROM (
   SELECT follower AS x,followee AS y,min(follower) AS ignored
   FROM [354].[twitter_rv.6157841]
   GROUP BY follower,followee
) grouped
WHERE x < 10000



________________________________________


SELECT COUNT(*)
FROM (
   SELECT follower AS x,followee AS y,min(follower) AS ignored
   FROM [354].[twitter_rv.6157841]
   GROUP BY follower,followee
) grouped
WHERE x < 100000



________________________________________


SELECT COUNT(*)
FROM (
   SELECT follower AS x,followee AS y,min(follower) AS ignored
   FROM [354].[twitter_rv.6157841]
   GROUP BY follower,followee
) grouped
WHERE x < 1000000



________________________________________


SELECT COUNT(*)
FROM (
   SELECT follower AS x,followee AS y,min(follower) AS ignored
   FROM [354].[twitter_rv.6157841]
   GROUP BY follower,followee
) grouped
WHERE x < 10000000



________________________________________


SELECT COUNT(*)
FROM ( SELECT DISTINCT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
WHERE x < 10



________________________________________


SELECT COUNT(*)
FROM ( SELECT DISTINCT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
WHERE x < 100



________________________________________


SELECT COUNT(*)
FROM ( SELECT DISTINCT leftT.follower AS x, rightT.followee AS z 
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower ) joined
WHERE x < 500



________________________________________


SELECT COUNT(*)
FROM ( SELECT leftT.follower AS x, rightT.followee AS z, MIN(leftT.follower) as ignored
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower
    GROUP BY leftT.follower, rightT.followee) joined
WHERE x < 100



________________________________________


SELECT COUNT(*)
FROM ( SELECT leftT.follower AS x, rightT.followee AS z, MIN(leftT.follower) as ignored
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower
    GROUP BY leftT.follower, rightT.followee) joined
WHERE x < 500



________________________________________


SELECT COUNT(*)
FROM ( SELECT leftT.follower AS x, rightT.followee AS z, MIN(leftT.follower) as ignored
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower
    GROUP BY leftT.follower, rightT.followee) joined
WHERE x < 2000



________________________________________


SELECT COUNT(*)
FROM ( SELECT leftT.follower AS x, rightT.followee AS z, MIN(leftT.follower) as ignored
    FROM [354].[twitter_rv.6157841] leftT 
    JOIN [354].[twitter_rv.6157841] rightT ON leftT.followee=rightT.follower
    GROUP BY leftT.follower, rightT.followee) joined
WHERE x < 10000



________________________________________


SELECT COUNT(*)
  FROM [354].[twitter_rv.615784]


________________________________________


SELECT COUNT(*)
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
    ON a.Column1=b.Column2


________________________________________


SELECT DISTINCT *
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
      ON a.Column1=b.Column2



________________________________________


SELECT DISTINCT a.Column1 AS x
              , b.Column2 AS z
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
      ON a.Column1=b.Column2



________________________________________


SELECT COUNT(*)
  FROM (
SELECT DISTINCT a.Column1 AS x
              , b.Column2 AS z
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
      ON a.Column1=b.Column2) joined



________________________________________


SELECT COUNT(*)
  FROM (
SELECT DISTINCT a.Column1 AS x
              , b.Column2 AS z
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
      ON a.Column2=b.Column1) joined



________________________________________


SELECT * FROM [354].[tmpColumnNameTest]


________________________________________


SELECT latitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT
       a.Column1 AS x
     , b.Column2 AS y
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
    ON a.Column2 = b.Column1


________________________________________


SELECT x,y,ROW_NUMBER()
  OVER(PARTITION BY x ORDER BY y ASC) AS "Row Number"
  FROM [354].[twitter_join_600k]


________________________________________


SELECT DISTINCT x,y
  FROM
  
(SELECT x,y,ROW_NUMBER()
  OVER(PARTITION BY x ORDER BY y ASC) AS "Row Number"
    FROM [354].[twitter_join_600k]
  ) joined



________________________________________


SELECT COUNT(*)
FROM 
(SELECT DISTINCT x,y
  FROM
  
(SELECT x,y,ROW_NUMBER()
  OVER(PARTITION BY x ORDER BY y ASC) AS "Row Number"
    FROM [354].[twitter_join_600k]
) joined) joined_distinct



________________________________________


SELECT COUNT(*)
FROM (SELECT DISTINCT x,y
  FROM [354].[twitter_join_600k]
) joined_distinct



________________________________________


SELECT
       a.Column1 AS x
     , b.Column2 AS y
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
    ON a.Column2 = b.Column1
  OPTION (MERGE JOIN)



________________________________________


SELECT
       a.Column1 AS x
     , b.Column2 AS y
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
    ON a.Column2 = b.Column1
  OPTION (MERGE JOIN, ORDER GROUP)



________________________________________


SELECT
       a.Column1 AS x
     , b.Column2 AS y
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
    ON a.Column2 = b.Column1
  OPTION (MERGE JOIN, ORDER GROUP)



________________________________________


SELECT x,y,ROW_NUMBER()
  OVER(PARTITION BY x ORDER BY y ASC) AS "Row Number"
  FROM
  (
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
  ) joined
    OPTION (MERGE JOIN, ORDER GROUP)



________________________________________


SELECT x,y FROM
(
  SELECT TOP 1 x,y,ROW_NUMBER()
  OVER(PARTITION BY x ORDER BY y ASC) AS rownum
  FROM
  (
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
  ) joined
  ) joined_distinct
    OPTION (MERGE JOIN, ORDER GROUP)




________________________________________


SELECT x,y FROM
(
  SELECT x,y,ROW_NUMBER()
  OVER(PARTITION BY x ORDER BY y ASC) AS rownum
  FROM
  (
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
  ) joined
  ) joined_distinct
  WHERE rownum = 1
    OPTION (MERGE JOIN, ORDER GROUP)




________________________________________


SELECT COUNT(*) FROM
(
  SELECT x,y,ROW_NUMBER()
  OVER(PARTITION BY x ORDER BY x ASC) AS rownum
  FROM
  (
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
  ) joined
  ) joined_distinct
  WHERE rownum = 1
    OPTION (MERGE JOIN, ORDER GROUP)




________________________________________


    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
     ORDER BY x ASC



________________________________________


    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
     ORDER BY x,y ASC



________________________________________


    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
     ORDER BY x ASC



________________________________________


SELECT x,y, SUM(1) OVER(PARTITION BY X) AS rownum
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
--     ORDER BY x ASC
) joined


________________________________________


SELECT DISTINCT x,y
FROM (
SELECT x,y,SUM(1) OVER(PARTITION BY x) AS rownum
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
--     ORDER BY x ASC
) joined
) joined_distinct



________________________________________


SELECT COUNT(*)
  FROM (
SELECT DISTINCT x,y
FROM (
SELECT x,y,SUM(1) OVER(PARTITION BY x) AS rownum
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
--     ORDER BY x ASC
) joined
) joined_windowed
) joined_distinct


________________________________________


SELECT COUNT(*)
  FROM (
SELECT DISTINCT x,y
FROM (
  SELECT x,y,ROW_NUMBER() OVER(PARTITION BY x ORDER BY x) AS rownum
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
--     ORDER BY x ASC
) joined
) joined_windowed
) joined_distinct


________________________________________


SELECT COUNT(*)
  FROM (
SELECT DISTINCT x,y
FROM (
SELECT x,y,ROW_NUMBER() OVER(PARTITION BY x ORDER BY x) AS rownum
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
--     ORDER BY x ASC
) joined
) joined_windowed
  WHERE rownum = 1
) joined_distinct


________________________________________


SELECT x,COUNT(y) OVER(PARTITION BY x) AS rownum
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
--     ORDER BY x ASC
) joined




________________________________________


SELECT x,COUNT(y) OVER(PARTITION BY x) AS rownum
FROM
(
    SELECT DISTINCT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
--     ORDER BY x ASC
) joined




________________________________________


SELECT x,COUNT(DISTINCT y)
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
--     ORDER BY x ASC
) joined
GROUP BY X



________________________________________


SELECT x,COUNT(DISTINCT y)
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
) joined
GROUP BY X
  OPTION (MERGE JOIN, ORDER GROUP)


________________________________________


SELECT x,COUNT(DISTINCT y)
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
) joined
GROUP BY x
  OPTION (MERGE JOIN)


________________________________________


SELECT x,COUNT(DISTINCT y)
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
) joined
GROUP BY x



________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.Column1 AS x
         , b.Column2 AS y
      FROM [354].[twitter_rv.615784] a
      JOIN [354].[twitter_rv.615784] b
        ON a.Column2 = b.Column1
) joined
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.followee
) joined
WHERE x < 1000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.followee
) joined
WHERE x < 10000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.followee
) joined
WHERE x < 100000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.followee
) joined
WHERE x < 400000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.followee
) joined
WHERE x < 800000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.followee
) joined
WHERE x < 1200000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.followee
) joined
WHERE x < 2400000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.followee
) joined
WHERE x < 4800000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.followee
) joined
WHERE x < 9600000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE x < 100
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE x < 400
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE x < 1000
GROUP BY x
) summed


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE x < 1000
GROUP BY x
) summed
OPTION (MERGE JOIN)



________________________________________


SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE x < 1000
GROUP BY x



________________________________________


SELECT x,COUNT(DISTINCT y) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS y
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE x < 1000
GROUP BY x
OPTION (MERGE JOIN, ORDER GROUP)


________________________________________


SELECT z,COUNT(DISTINCT x) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS z
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE z < 1000
GROUP BY z
--OPTION (MERGE JOIN, ORDER GROUP)


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT z,COUNT(DISTINCT x) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS z
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE z < 1000
GROUP BY z
--OPTION (MERGE JOIN, ORDER GROUP)
) joined_distinct


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT z,COUNT(DISTINCT x) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS z
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE z < 4000
GROUP BY z
--OPTION (MERGE JOIN, ORDER GROUP)
) joined_distinct


________________________________________


SELECT SUM(cnt)
FROM
(
SELECT z,COUNT(DISTINCT x) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS z
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE z < 1000
GROUP BY z
) joined_distinct
OPTION (MERGE JOIN)



________________________________________


SELECT SUM(cnt)
FROM
(
SELECT z,COUNT(DISTINCT x) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS z
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE z < 1000
GROUP BY z
) joined_distinct
OPTION (MERGE JOIN, ORDER GROUP)



________________________________________


SELECT SUM(cnt)
FROM
(
SELECT z,COUNT(DISTINCT x) AS cnt
FROM
(
    SELECT
           a.follower AS x
         , b.followee AS z
      FROM [354].[twitter_rv.6157841] a
      JOIN [354].[twitter_rv.6157841] b
        ON a.followee = b.follower
) joined
WHERE z < 10000
GROUP BY z
) joined_distinct
--OPTION (MERGE JOIN, ORDER GROUP)



________________________________________


SELECT DISTINCT
       a.Column1 AS x
     , b.Column2 AS y
  FROM [354].[twitter_rv.615784] a
  JOIN [354].[twitter_rv.615784] b
    ON a.Column2 = b.Column1


________________________________________


SELECT Column1 AS x
     , Column2 AS y
  FROM [354].[table_t_6200000]


________________________________________


SELECT x, COUNT(y) AS outdegree
FROM [354].[twitter_rv.6200000]
GROUP BY x
ORDER BY outdegree DESC



________________________________________


SELECT y, COUNT(x) AS indegree
FROM [354].[twitter_rv.6200000]
GROUP BY y
ORDER BY indegree DESC



________________________________________


SELECT y, COUNT(x) AS indegree
FROM [354].[twitter_rv.6200000]
GROUP BY y
ORDER BY indegree DESC



________________________________________


SELECT x,indegree+outdegree
FROM [354].[twitter_rv.6200000.indegree]
   , [354].[twitter_rv.6200000.outdegree]
WHERE x = y


________________________________________


SELECT x,indegree+outdegree AS sumdegree
FROM [354].[twitter_rv.6200000.indegree]
   , [354].[twitter_rv.6200000.outdegree]
WHERE x = y
ORDER BY sumdegree DESC  



________________________________________


SELECT x % 10 AS bucket, SUM(sumdegree) AS edges
FROM [354].[twitter_rv.6200000.sumdegree]
GROUP BY (x % 10)
ORDER BY edges DESC  


________________________________________


SELECT x % 10 AS bucket, SUM(sumdegree) AS edges
FROM [354].[twitter_rv.6200000.sumdegree]
GROUP BY (x % 10)
ORDER BY edges DESC  


________________________________________


SELECT * FROM [354].[twitter_rv.6157841]
WHERE follower=12


________________________________________


SELECT DISTINCT x FROM [354].[twitter_rv.6200000]


________________________________________


SELECT COUNT(DISTINCT x) FROM [354].[twitter_rv.6200000]


________________________________________


SELECT COUNT(DISTINCT y) FROM [354].[twitter_rv.6200000]


________________________________________


SELECT y AS x FROM [354].[twitter_rv.6200000]
UNION
SELECT x FROM [354].[twitter_rv.6200000]



________________________________________


SELECT COUNT(DISTINCT X) FROM
  (SELECT y AS x FROM [354].[twitter_rv.6200000]
UNION
SELECT x FROM [354].[twitter_rv.6200000]
    ) fsddfs


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%stress%'


________________________________________


SELECT COUNT(*) from [354].[twitter_rv.6157841]


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.6157841]


________________________________________


SELECT COUNT(*) AS cnt FROM [354].[twitter_rv.6157841]


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.6157841]


________________________________________


SELECT MAX(follower) FROM [354].[twitter_rv.6157841]


________________________________________


SELECT MAX(followee) FROM [354].[twitter_rv.6157841]


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.615784]


________________________________________


SELECT TOP 1 * FROM [354].[Dan's binning] a,
  [354].[Dan's binning] b



________________________________________


SELECT TOP 1 * FROM [354].[Dan's binning] a,
  [354].[Dan's binning]  b



________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.net]


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.net]


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.net]


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.net]


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.net]


________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.net]


________________________________________


SELECT * FROM [412].[3 peps per protein areas averaged]
  ORDER BY protein asc



________________________________________


SELECT * FROM [412].[3 peps per protein areas averaged]
  ORDER BY protein desc



________________________________________


SELECT * FROM [267].[3 peps per protein.txt]
  ORDER BY protein desc



________________________________________


SELECT protein
     , avg(CAST([11_01 TotalArea] AS FLOAT))
     , avg(CAST([11_02 TotalArea] AS FLOAT))
     , avg(CAST([11_03 TotalArea] AS FLOAT))
     , avg(CAST([2_01 TotalArea] AS FLOAT))
     , avg(CAST([2_02 TotalArea] AS FLOAT))
     , avg(CAST([2_03 TotalArea] AS FLOAT))
     , avg(CAST([5_01 TotalArea] AS FLOAT))
     , avg(CAST([5_02 TotalArea] AS FLOAT))
     , avg(CAST([5_03 TotalArea] AS FLOAT))
     , avg(CAST([8_01 TotalArea] AS FLOAT))
     , avg(CAST([8_02 TotalArea] AS FLOAT))
     , avg(CAST([8_03 TotalArea] AS FLOAT))
     , avg(CAST([26_01 TotalArea] AS FLOAT))
     , avg(CAST([26_02 TotalArea] AS FLOAT))
     , avg(CAST([26_02 TotalArea] AS FLOAT))
     , avg(CAST([26_03 TotalArea] AS FLOAT))
     , avg(CAST([29_01 TotalArea] AS FLOAT))
     , avg(CAST([29_02 TotalArea] AS FLOAT))
     , avg(CAST([29_03 TotalArea] AS FLOAT))
     , avg(CAST([32_01 TotalArea] AS FLOAT))
     , avg(CAST([32_02 TotalArea] AS FLOAT))
     , avg(CAST([32_03 TotalArea] AS FLOAT))
     , avg(CAST([35_01 TotalArea] AS FLOAT))
     , avg(CAST([35_02 TotalArea] AS FLOAT))
     , avg(CAST([35_03 TotalArea] AS FLOAT))
     , avg(CAST([221_01 TotalArea] AS FLOAT))
     , avg(CAST([221_02 TotalArea] AS FLOAT))
     , avg(CAST([221_03 TotalArea] AS FLOAT))
     , avg(CAST([224_01 TotalArea] AS FLOAT))
     , avg(CAST([224_02 TotalArea] AS FLOAT))
     , avg(CAST([224_03 TotalArea] AS FLOAT))
     , avg(CAST([227_01 TotalArea] AS FLOAT))
     , avg(CAST([227_02 TotalArea] AS FLOAT))
     , avg(CAST([227_03 TotalArea] AS FLOAT))
     , avg(CAST([230_01 TotalArea] AS FLOAT))
     , avg(CAST([230_02 TotalArea] AS FLOAT))
     , avg(CAST([230_02 TotalArea] AS FLOAT))
     , avg(CAST([242_01 TotalArea] AS FLOAT))
     , avg(CAST([242_02 TotalArea] AS FLOAT))
     , avg(CAST([242_03 TotalArea] AS FLOAT))
     , avg(CAST([245_01 TotalArea] AS FLOAT))
     , avg(CAST([245_02 TotalArea] AS FLOAT))
     , avg(CAST([245_03 TotalArea] AS FLOAT))
     , avg(CAST([248_01 TotalArea] AS FLOAT))
     , avg(CAST([248_02 TotalArea] AS FLOAT))
     , avg(CAST([248_03 TotalArea] AS FLOAT))
     , avg(CAST([251_01 TotalArea] AS FLOAT))
     , avg(CAST([251_02 TotalArea] AS FLOAT))
     , avg(CAST([251_03 TotalArea] AS FLOAT))
FROM [267].[3 peps per protein.txt]
GROUP BY protein



________________________________________


SELECT protein
  , '11_01 TotalArea' AS [TotalArea]
  , [11_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '11_02 TotalArea' AS [TotalArea]
  , [11_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '11_03 TotalArea' AS [TotalArea]
  , [11_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '2_01 TotalArea' AS [TotalArea]
  , [2_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '2_02 TotalArea' AS [TotalArea]
  , [2_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '2_03 TotalArea' AS [TotalArea]
  , [2_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '221_01 TotalArea' AS [TotalArea]
  , [221_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '221_02 TotalArea' AS [TotalArea]
  , [221_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '221_03 TotalArea' AS [TotalArea]
  , [221_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '224_01 TotalArea' AS [TotalArea]
  , [224_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '224_02 TotalArea' AS [TotalArea]
  , [224_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '224_03 TotalArea' AS [TotalArea]
  , [224_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '227_01 TotalArea' AS [TotalArea]
  , [227_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '227_02 TotalArea' AS [TotalArea]
  , [227_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '227_03 TotalArea' AS [TotalArea]
  , [227_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '230_01 TotalArea' AS [TotalArea]
  , [230_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '230_02 TotalArea' AS [TotalArea]
  , [230_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '230_03 TotalArea' AS [TotalArea]
  , [230_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '242_01 TotalArea' AS [TotalArea]
  , [242_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '242_02 TotalArea' AS [TotalArea]
  , [242_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '242_03 TotalArea' AS [TotalArea]
  , [242_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '245_01 TotalArea' AS [TotalArea]
  , [245_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '245_02 TotalArea' AS [TotalArea]
  , [245_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '245_03 TotalArea' AS [TotalArea]
  , [245_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '248_01 TotalArea' AS [TotalArea]
  , [248_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '248_02 TotalArea' AS [TotalArea]
  , [248_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '248_03 TotalArea' AS [TotalArea]
  , [248_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '251_01 TotalArea' AS [TotalArea]
  , [251_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '251_02 TotalArea' AS [TotalArea]
  , [251_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '251_03 TotalArea' AS [TotalArea]
  , [251_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '26_01 TotalArea' AS [TotalArea]
  , [26_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '26_02 TotalArea' AS [TotalArea]
  , [26_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '26_03 TotalArea' AS [TotalArea]
  , [26_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '29_01 TotalArea' AS [TotalArea]
  , [29_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '29_02 TotalArea' AS [TotalArea]
  , [29_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '29_03 TotalArea' AS [TotalArea]
  , [29_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '32_01 TotalArea' AS [TotalArea]
  , [32_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '32_02 TotalArea' AS [TotalArea]
  , [32_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '32_03 TotalArea' AS [TotalArea]
  , [32_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '35_01 TotalArea' AS [TotalArea]
  , [35_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '35_02 TotalArea' AS [TotalArea]
  , [35_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '35_03 TotalArea' AS [TotalArea]
  , [35_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '5_01 TotalArea' AS [TotalArea]
  , [5_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '5_02 TotalArea' AS [TotalArea]
  , [5_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '5_03 TotalArea' AS [TotalArea]
  , [5_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '8_01 TotalArea' AS [TotalArea]
  , [8_01 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '8_02 TotalArea' AS [TotalArea]
  , [8_02 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]
UNION ALL
SELECT protein
  , '8_03 TotalArea' AS [TotalArea]
  , [8_03 TotalArea] AS [Value]
FROM [267].[3 peps per protein.txt]



________________________________________


SELECT protein
     , TotalArea
     , avg(value) as average
  FROM [354].[3_peps_per_protein_pivoted]
GROUP BY protein, TotalArea
ORDER BY average DESC



________________________________________


SELECT protein
     , TotalArea
     , AVG(CAST(value AS FLOAT)) as average
  FROM [354].[3_peps_per_protein_pivoted]
GROUP BY protein, TotalArea
ORDER BY average DESC



________________________________________


SELECT protein
     , TotalArea
     , AVG(CAST(value AS FLOAT)) as average
  FROM [354].[3_peps_per_protein_pivoted]
GROUP BY protein, TotalArea
ORDER BY protein, average DESC



________________________________________


SELECT protein
     , TotalArea
     , AVG(CAST(value AS FLOAT)) as average
  FROM [354].[3_peps_per_protein_pivoted]
GROUP BY protein, TotalArea
ORDER BY protein, TotalArea DESC



________________________________________


SELECT protein
     , TotalArea
     , AVG(CAST(value AS FLOAT)) as average
  FROM [354].[3_peps_per_protein_pivoted]
GROUP BY protein, TotalArea
ORDER BY protein, TotalArea ASC



________________________________________


SELECT * FROM [412].[3 peps per protein areas averaged]


________________________________________


SELECT * FROM [412].[3 peps per protein areas averaged]


________________________________________


SELECT x, COUNT(DISTINCT y)
FROM (SELECT leftT.follower AS x,rightT.followee AS y
      FROM [354].[twitter_rv.6200000] leftT
      JOIN [354].[twitter_rv.6200000] rightT
        ON leftT.followee=rightT.follower) result
where x < 1000
  GROUP BY x




________________________________________


SELECT x, COUNT(DISTINCT z)
FROM (SELECT leftT.follower AS x,rightT.followee AS z
      FROM [354].[twitter_rv.6200000] leftT
      JOIN [354].[twitter_rv.6200000] rightT
        ON leftT.followee=rightT.follower) result
where x < 3000
  GROUP BY x




________________________________________


SELECT COUNT("mRNA methylated CpGs") FROM [267].[GeneCounts_mRNA.txt]


________________________________________


--SELECT COUNT("mRNA methylated CpGs") FROM [267].[GeneCounts_mRNA.txt]
SELECT COUNT("CDS methylated CpGs") FROM [267].[GeneCounts_mRNA.txt]


________________________________________


SELECT COUNT("mRNA methylated CpGs")
     , COUNT("CDS methylated CpGs")
FROM [267].[GeneCounts_mRNA.txt]


________________________________________


SELECT TOP 3 * FROM [1123].[BiGill_methratio_v9_A.txt]


________________________________________


SELECT TOP 3 * FROM [1123].[BiGill_methratio_v9_A.txt]


________________________________________


SELECT DISTINCT pos,strand
FROM [1123].[BiGill_methratio_v9_A.txt]
GROUP BY pos, strand



________________________________________


SELECT  DISTINCT TOP 3 pos,strand
FROM [1123].[BiGill_methratio_v9_A.txt]
GROUP BY pos, strand



________________________________________


SELECT DISTINCT pos,strand
  FROM (SELECT TOP 10 * FROM [1123].[BiGill_methratio_v9_A.txt]) x
 GROUP BY pos, strand



________________________________________


SELECT *
FROM [823].[CGbigill5x_asgff]
ORDER BY score DESC


________________________________________


SELECT TOP 10 *
FROM [823].[CGbigill5x_asgff]
ORDER BY score DESC


________________________________________


SELECT TOP 10 *
FROM [823].[CGbigill5x_asgff]
WHERE score > '1'


________________________________________


SELECT TOP 10 *
FROM [823].[CGbigill5x_asgff]
WHERE score > '1.000'


________________________________________


SELECT TOP 10 *
FROM [823].[CGbigill5x_asgff]
WHERE score > '1.000' OR score < '0'


________________________________________


SELECT TOP 10 *
FROM [823].[CGbigill5x_asgff]
WHERE CAST(score AS NUMERIC) < 3


________________________________________


SELECT *
FROM [823].[CGbigill5x_asgff]
WHERE ISNUMERIC(score) = 0


________________________________________


SELECT TOP 1 *
FROM [823].[CGbigill5x_asgff]
WHERE ISNUMERIC(score) = 0


________________________________________


SELECT TOP 1 *
FROM [823].[CGbigill5x_asgff]
  --WHERE ISNUMERIC(score) = 0
WHERE CAST(score AS NUMERIC) < 0.25



________________________________________


SELECT *
-- SELECT TOP 1 *
FROM [823].[CGbigill5x_asgff]
WHERE ISNUMERIC(score) = 0
--WHERE CAST(score AS NUMERIC) < 0.25



________________________________________


SELECT *
-- SELECT TOP 1 *
FROM [823].[CGbigill5x_asgff]
WHERE ISNUMERIC(score) <> 1
--WHERE CAST(score AS NUMERIC) < 0.25



________________________________________


SELECT *
  FROM [823].[CGbigill5x_asgff]
  WHERE score='.'



________________________________________


SELECT TOP 1 *
  FROM [823].[CGbigill5x_asgff]
  WHERE score='.'



________________________________________


SELECT TOP 1 *
  FROM [823].[CGbigill5x_asgff]
  WHERE isnumeric(score + 'e0') <> 1



________________________________________


SELECT TOP 1 *
  FROM [823].[CGbigill5x_asgff]
--  WHERE isnumeric(score + 'e0') <> 1
  ORDER BY score ASC



________________________________________


SELECT TOP 1 *
  FROM [823].[CGbigill5x_asgff]
--  WHERE isnumeric(score + 'e0') <> 1
  ORDER BY score DESC



________________________________________


SELECT *
FROM [823].[CGbigill5x_asgff]
WHERE isnumeric(score) = 1
  AND CAST(score AS NUMERIC) < 0.25



________________________________________


SELECT *
FROM [823].[CGbigill5x_asgff]
--WHERE isnumeric(score) = 1
--  AND CAST(score AS NUMERIC) < 0.25
WHERE isnumeric(score) <> 1
-- WHERE CAST(score AS NUMERIC) < 0.25



________________________________________


SELECT score
FROM [823].[CGbigill5x_asgff]
--WHERE isnumeric(score) = 1
--  AND CAST(score AS NUMERIC) < 0.25
WHERE isnumeric(score) <> 1
--AND score < 0.25



________________________________________


SELECT score
FROM [823].[CGbigill5x_asgff]
--WHERE isnumeric(score) = 1
--  AND CAST(score AS NUMERIC) < 0.25
WHERE ISNUMERIC(score)=1 AND CONVERT(NUMERIC,score) < 0.25
--WHERE isnumeric(score) <> 1
--AND score < 0.25



________________________________________


SELECT *
FROM [823].[CGbigill5x_asgff]
--WHERE isnumeric(score) = 1
--  AND CAST(score AS NUMERIC) < 0.25
--WHERE ISNUMERIC(score)=1 AND CONVERT(NUMERIC,score) < 0.25
--WHERE isnumeric(score) <> 1
--AND score < 0.25



________________________________________


SELECT *
FROM [823].[CGbigill5x_asgff]
--WHERE isnumeric(score) = 1
--  AND CAST(score AS NUMERIC) < 0.25
--WHERE ISNUMERIC(score)=1 AND CONVERT(NUMERIC,score) < 0.25
--WHERE isnumeric(score) <> 1
--AND score < 0.25
ORDER BY score DESC


________________________________________


SELECT [score]
FROM [823].[CGbigill5x_asgff]
--WHERE CAST([score] AS NUMERIC) < 0.25
WHERE isnumeric(score) = 1 AND CAST(score AS NUMERIC) < 0.25
--WHERE ISNUMERIC(score)=1 AND CONVERT(NUMERIC,score) < 0.25
--WHERE isnumeric(score) <> 1
--AND score < 0.25
--ORDER BY score DESC


________________________________________


SELECT [score]
FROM [823].[CGbigill5x_asgff]
--WHERE CAST([score] AS NUMERIC) < 0.25
WHERE isnumeric(score) = 1 AND CAST(score AS NUMERIC) < 0.25
ORDER BY score DESC
--WHERE ISNUMERIC(score)=1 AND CONVERT(NUMERIC,score) < 0.25
--WHERE isnumeric(score) <> 1
--AND score < 0.25
--ORDER BY score DESC


________________________________________


SELECT CAST(score AS NUMERIC) AS scoreNum
FROM [823].[CGbigill5x_asgff]
--WHERE CAST([score] AS NUMERIC) < 0.25
WHERE isnumeric(score) = 1 AND CAST(score AS NUMERIC) < 0.25
ORDER BY scoreNum DESC
--WHERE ISNUMERIC(score)=1 AND CONVERT(NUMERIC,score) < 0.25
--WHERE isnumeric(score) <> 1
--AND score < 0.25
--ORDER BY score DESC


________________________________________


SELECT CAST(score AS FLOAT) AS scoreNum
FROM [823].[CGbigill5x_asgff]


________________________________________


SELECT top 1 CAST(score AS FLOAT) AS scoreNum
FROM [823].[CGbigill5x_asgff]
WHERE CAST(score AS FLOAT) < 0.25



________________________________________


SELECT top 3 CAST(score AS FLOAT) AS scoreNum
FROM [823].[CGbigill5x_asgff]
  WHERE CAST(score AS FLOAT) < cast(0.25 AS FLOAT)



________________________________________


SELECT * FROM [823].[CGbigill5x]
WHERE CAST(ratio AS FLOAT) < 0.25
AND ratio <> 'NA'



________________________________________


SELECT top 10 CAST(score AS FLOAT) AS scoreNum
FROM [823].[CGbigill5x_asgff]
  WHERE CAST(score AS FLOAT) < cast(0.25 AS FLOAT)
  AND SCORE <> 'NA'


________________________________________


SELECT top 10 CAST(score AS FLOAT) AS scoreNum
FROM [823].[CGbigill5x_asgff]
  WHERE CAST(score AS FLOAT) < cast(0.25 AS FLOAT)
  AND score <> 'NA'


________________________________________


SELECT CAST(score AS FLOAT) AS scoreNum
FROM [823].[CGbigill5x_asgff]
  WHERE CAST(score AS FLOAT) < cast(0.25 AS FLOAT)
  AND score <> 'NA'


________________________________________


SELECT CAST(score AS FLOAT) AS scoreNum
FROM [823].[CGbigill5x_asgff]
  WHERE CAST(score AS FLOAT) < 0.25
  AND score <> 'NA'


________________________________________


SELECT * FROM [823].[CGbigill5x]
WHERE CAST(ratio AS NUMERIC) < 0.25
AND ratio <> 'NA'



________________________________________


SELECT * FROM [823].[CGbigill5x]
WHERE CAST(ratio AS NUMERIC) < 0.25
AND ratio <> 'NA'
ORDER BY ratio DESC



________________________________________


SELECT * FROM [823].[CGbigill5x_asgff]
WHERE CAST(score AS NUMERIC) < 0.25
AND score <> 'NA'
ORDER BY score DESC



________________________________________


SELECT x.*
FROM
   (SELECT * FROM [354].[precedence_1358.txt] WHERE value <> 'NA') x
WHERE CAST(value as FLOAT) < 0.5
  



________________________________________


SELECT *
FROM [precedence_1358.txt]
WHERE value <> 'NA'
      AND CAST(value as FLOAT) < 0.5


________________________________________


SELECT *
FROM [precedence_1358.txt]
WHERE value <> 'NA'
      AND CAST(value as FLOAT) < 0.5


________________________________________


SELECT *
FROM [precedence_1358.txt]
WHERE CASE WHEN VALUE <> 'NA'
      THEN CAST(value as FLOAT)
      ELSE 1000 END < 0.5



________________________________________


SELECT *
FROM [precedence_1358.txt]
WHERE CASE WHEN VALUE <> 'NA'
      THEN CAST(value as FLOAT)
      ELSE 1000 END < 0.5



________________________________________


SELECT *
FROM [precedence_1358.txt]
WHERE value <> 'NA'
      AND CAST(value as FLOAT) < 0.5


________________________________________


SELECT [1045].[NWSblastnGBnt_no_rRNA.txt].Column2 AS GI,
       [1045].[NWSblastnGBnt_no_rRNA.txt].Column5 AS Description 
FROM [1045].[NWSblastnGBnt_no_rRNA.txt]


________________________________________


SELECT COUNT(DISTINCT x)
  FROM (SELECT followee as x FROM [354].[twitter_rv.6200000]
        UNION
    SELECT follower as x FROM [354].[twitter_rv.6200000]) z;


________________________________________


SELECT l.followee, COUNT(*)
FROM [354].[twitter_rv.6200000] l,
     [354].[twitter_rv.6200000] r
WHERE l.followee=r.follower
GROUP BY l.followee



________________________________________


SELECT l.followee, COUNT(*) as cnt
FROM [354].[twitter_rv.6200000] l,
     [354].[twitter_rv.6200000] r
WHERE l.followee=r.follower
GROUP BY l.followee
ORDER BY cnt DESC



________________________________________


SELECT *
FROM [354].[table_UniProtSpeciesList20130607.csv]
ORDER BY [TaxonCode],[Species]  



________________________________________


SELECT *
FROM  [412].[isotigs with CGIDs and total reads mapped]
  WHERE isnumeric([EM2A]) = 0


________________________________________


SELECT *
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE isnumeric([EM2A]) = 0 AND [EM2A] <> NULL


________________________________________


SELECT CAST([EM2A] AS FLOAT)
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE isnumeric([EM2A]) = 1


________________________________________


SELECT CAST([EM2A] AS FLOAT) as tmp
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE isnumeric([EM2A]) = 1
ORDER BY tmp


________________________________________


SELECT CAST([EM2A] AS FLOAT) as tmp
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE isnumeric([EM2A]) = 1
ORDER BY tmp DESC


________________________________________


SELECT *
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE [Isotig] = 'Contig62418'



________________________________________


    SELECT CAS001, 
    CASE WHEN CAS001=2 THEN 'NM'
         WHEN CAS001=1 THEN 'M'
         WHEN CAS001=0 THEN 'U' END
    AS CAS001MethStat
    FROM [412].[summed presence absence fragment peaks]



________________________________________


SELECT COUNT(*) FROM [354].[twitter_rv.6200000_join_results]


________________________________________


SELECT ID
     , SUM(Coffee*CostBlack+Milk*CostMilk) AS TotalSpent
FROM [33].[consumption.csv] JOIN [33].[info.csv]
  ON data_date = Date
GROUP BY ID


________________________________________


SELECT ID
     , SUM(Coffee*CostBlack+Milk*CostMilk) AS TotalSpent
FROM [33].[consumption.csv]
JOIN [33].[info.csv]
  ON data_date = Date
GROUP BY ID
ORDER BY TotalSpent DESC



________________________________________


SELECT ID
     , SUM(Coffee*CostBlack+Milk*CostMilk) AS TotalSpent
FROM [33].[consumption.csv]
JOIN [33].[info.csv]
  ON data_date = Date
GROUP BY ID
ORDER BY TotalSpent DESC



________________________________________


SELECT ID
     , SUM(Coffee*CostBlack+Milk*CostMilk) AS TotalSpent
FROM [33].[consumption.csv] consumption
JOIN [33].[info.csv] info
  ON consumption.data_date = info.Date
GROUP BY ID
ORDER BY TotalSpent DESC



________________________________________


SELECT ID
     , SUM(Coffee*CostBlack+Milk*CostMilk) AS TotalSpent
FROM [33].[consumption.csv] consumption
JOIN [33].[info.csv] info
  ON consumption.[data_date] = info.[Date]
GROUP BY ID
ORDER BY TotalSpent DESC



________________________________________


SELECT ID
     , SUM(Coffee*CostBlack+Milk*CostMilk) AS TotalSpent
FROM [33].[consumption.csv] consumption
JOIN [33].[info.csv] info
  ON consumption.[data_date] = info.[Date]
GROUP BY ID
ORDER BY TotalSpent DESC



________________________________________


SELECT [1385name]
     , [Q #]
     , [Answer]
  FROM [354].[FinalSurveyCourse2013.csv]
WHERE [Answer Match] = 'Checked'



________________________________________


SELECT 1385name, pivot_table.*
  FROM [354].[1385name, question, and answer]
PIVOT (
  MIN([Answer])
  FOR [Q #] IN ([1], [2])
) AS pivot_table



________________________________________


SELECT pivot_table.*
  FROM [354].[1385name, question, and answer]
PIVOT (
  MIN([Answer])
  FOR [Q #] IN ([1], [2])
) AS pivot_table



________________________________________


SELECT pivot_table.*
  FROM [354].[1385name, question, and answer]
PIVOT (
  MIN([Answer])
  FOR [Q #] IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[14],[15],[16],[17],[18],[19],[20],[21],[22])
) AS pivot_table



________________________________________


SELECT *
FROM [354].[1385name, question, and answer]
PIVOT (
  MAX([Answer])
  FOR [Q #] IN ([1],[2],[3],[4],[5],
                [6],[7],[8],[9],[10],
                [11],[12],[13],[14],[15],
                [16],[17],[18],[19],[20],
                [21],[22])
) AS pivot_table




________________________________________


SELECT *
FROM [354].[1385name, question, and answer]
PIVOT (
  MAX([Answer])
  FOR [Q #] IN ([1],[2],[3],[4],[5],
                [6],[7],[8],[9],[10],
                [11],[12],[13],[14],[15],
                [16],[17],[18],[19],[20],
                [21],[22])
) AS pivot_table
ORDER BY 1385name ASC



________________________________________


SELECT *
FROM [354].[1385name, question, and answer]
PIVOT (
  MAX([Answer])
  FOR [Q #] IN ([1],[2],[3],[4],[5],
                [6],[7],[8],[9],[10],
                [11],[12],[13],[14],[15],
                [16],[17],[18],[19],[20],
                [21],[22])
) AS pivot_table




________________________________________


SELECT *
FROM [354].[1385name, question, and answer]
PIVOT (
  MAX([Answer])
  FOR [Q #] IN ([1],[2],[3],[4],[5],
                [6],[7],[8],[9],[10],
                [11],[12],[13],[14],[15],
                [16],[17],[18],[19],[20],
                [21],[22])
) AS pivot_table
ORDER BY 1385name ASC



________________________________________


SELECT *
FROM [354].[1385name, question, answer, pivoted]
ORDER BY 1385name ASC




________________________________________


SELECT *
FROM [354].[1385name, question, and answer]
PIVOT (
  MAX([Answer])
  FOR [Q #] IN ([1],[2],[3],[4],[5],
                [6],[7],[8],[9],[10],
                [11],[12],[13],[14],[15],
                [16],[17],[18],[19],[20],
                [21],[22])
) AS pivot_table
ORDER BY 1385name



________________________________________


SELECT *
FROM [354].[1385name, question, and answer]
PIVOT (
  MAX([Answer])
  FOR [Q #] IN ([1],[2],[3],[4],[5],
                [6],[7],[8],[9],[10],
                [11],[12],[13],[14],[15],
                [16],[17],[18],[19],[20],
                [21],[22])
) AS pivot_table
ORDER BY 1385name ASC



________________________________________


SELECT

chr as seqname,

'methratio' as source,

'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,

strand,

'.' as frame,

'.' as attribute
FROM [1123].

[BiGill_methratio_v9_A.txt]

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'


________________________________________


SELECT

chr as seqname,

'methratio' as source,

'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,

strand,

'.' as frame,

'.' as attribute
FROM [1123].

[BiGill_methratio_v9_A.txt]

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'
  and cast(ratio as float) >= 0.5


________________________________________


SELECT

chr as seqname,

'methratio' as source,

'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,

strand,

'.' as frame,

'.' as attribute
FROM [1123].

[BiGill_methratio_v9_A.txt]

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'
and cast(ratio as numeric) >= 0.5


________________________________________


SELECT max(ratio)
FROM [1123].[BiGill_methratio_v9_A.txt]
where 
ratio <> 'NA'




________________________________________


SELECT max(cast(ratio as float))
FROM [1123].[BiGill_methratio_v9_A.txt]
where 
ratio <> 'NA'




________________________________________


SELECT max(ratio)
FROM [1123].

[BiGill_methratio_v9_A.txt]

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'
and cast(ratio as numeric) >= 0.5


________________________________________


SELECT COUNT(*) FROM [1123].[BiGill_methratio_v9_A.txt]


________________________________________


SELECT
* --cast(ratio as float) as score, 
FROM [1123].
[BiGO_betty_plain_methratio_v1.txt] betty 



________________________________________


SELECT
* --cast(ratio as float) as score, 
FROM [1123].
[BiGO_betty_plain_methratio_v1.txt] betty 



________________________________________


SELECT
* --cast(ratio as float) as score, 
FROM [1123].
[BiGO_betty_plain_methratio_v1.txt] betty 



________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
WHERE [ratio] <> 'NA'



________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
WHERE [ratio] <> 'NA'



________________________________________


SELECT 
chr as seqname,

'methratio' as source,

'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score, 
strand,

'.' as frame,

'.' as attribute

FROM [354].
[clean_BiGO_betty_plain_methratio_v1.txt] betty 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5
and cast(ratio as float) >= 0.500


________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
WHERE [ratio] <> 'NA'



________________________________________


SELECT [Institution]
     , [PI]
     , [Postdocs] as [Postdoc]
     , [Graduate Student]
     , [Undergraduate Student]
FROM [354].[geomics_tally.csv]


________________________________________


SELECT CASE WHEN [Graduate Student]='H. Close'
            THEN 'Harvard'
            ELSE [Institution] END AS [Institution]
     , [PI]
     , [Postdocs] as [Postdoc]
     , [Graduate Student]
     , [Undergraduate Student]
FROM [354].[geomics_tally.csv]


________________________________________


SELECT CASE WHEN [Graduate Student]='H. Close'
            THEN 'Harvard'
       WHEN [Postdocs] = 'J. Labonte'
            THEN 'Bigelow'
            ELSE [Institution] END AS [Institution]
     , [PI]
     , [Postdocs] as [Postdoc]
     , [Graduate Student]
     , [Undergraduate Student]
FROM [354].[geomics_tally.csv]


________________________________________


SELECT *
  FROM [354].[geomics_tally_prep1]
 WHERE [Graduate Student] LIKE '%Carlson%'


________________________________________


SELECT DISTINCT [Institution], [PI]
  FROM [354].[geomics_tally.csv]


________________________________________


SELECT DISTINCT [Institution], [Postdocs] as [Postdoc]
  FROM [354].[geomics_tally.csv]


________________________________________


SELECT DISTINCT [Institution], [Postdocs] as [Postdoc]
  FROM [354].[geomics_tally.csv]
 WHERE [Postdocs] <> NULL



________________________________________


SELECT DISTINCT [Institution], [Postdocs] as [Postdoc]
  FROM [354].[geomics_tally.csv]
 WHERE [Postdocs] IS NOT NULL


________________________________________


SELECT DISTINCT [Institution], [Postdocs] as [Postdoc]
  FROM [354].[geomics_tally.csv]
 WHERE [Postdocs] IS NOT NULL


________________________________________


SELECT [Institution]
     , CASE WHEN LEN(LTRIM([Postdocs])) = 0
            THEN NULL
            ELSE [Postdocs] END AS [Postdoc]
     , CASE WHEN LEN(LTRIM([Graduate Student])) = 0
            THEN NULL
            ELSE [Graduate Student] END AS [Graduate Student]
     , CASE WHEN LEN(LTRIM([Undergraduate Student])) = 0
            THEN NULL
            ELSE [Undergraduate Student] END AS [Undergraduate Student]
     , CASE WHEN LEN(LTRIM([Staff])) = 0
            THEN NULL
            ELSE [Staff] END AS [Staff]
  FROM [354].[table_geomics_tally.csv]


________________________________________


SELECT [Institution], [PI]
     , CASE WHEN LEN(LTRIM([Postdocs])) = 0
            THEN NULL
            ELSE [Postdocs] END AS [Postdoc]
     , CASE WHEN LEN(LTRIM([Graduate Student])) = 0
            THEN NULL
            ELSE [Graduate Student] END AS [Graduate Student]
     , CASE WHEN LEN(LTRIM([Undergraduate Student])) = 0
            THEN NULL
            ELSE [Undergraduate Student] END AS [Undergraduate Student]
     , CASE WHEN LEN(LTRIM([Staff])) = 0
            THEN NULL
            ELSE [Staff] END AS [Staff]
  FROM [354].[table_geomics_tally.csv]


________________________________________


SELECT DISTINCT [Institution], [Postdoc]
  FROM [354].[geomics_tally.csv]
 WHERE [Postdoc] IS NOT NULL


________________________________________


SELECT DISTINCT [Institution], [Postdoc]
  FROM [354].[geomics_tally.csv]




________________________________________


SELECT DISTINCT [Institution], [Postdoc]
  FROM [354].[geomics_tally.csv]
 WHERE [Postdoc] IS NOT NULL


________________________________________


SELECT DISTINCT [Institution], [PI], [Graduate Student]
  FROM [354].[geomics_tally.csv]
 WHERE [Graduate Student] IS NOT NULL


________________________________________


SELECT DISTINCT [Institution], [PI], [Postdoc]
  FROM [354].[geomics_tally.csv]
 WHERE [Postdoc] IS NOT NULL


________________________________________


SELECT DISTINCT [Institution], [PI], [Undergraduate Student]
  FROM [354].[geomics_tally.csv]
 WHERE [Undergraduate Student] IS NOT NULL


________________________________________


SELECT DISTINCT [Institution], [PI], [Staff]
  FROM [354].[geomics_tally.csv]
 WHERE [Staff] IS NOT NULL


________________________________________


SELECT 'PI' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_pis]
  



________________________________________


SELECT 'PI' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_pis]
  
UNION
  
SELECT 'Postdoc' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_postdocs]




________________________________________


SELECT 'PI' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_pis]
  
UNION ALL
  
SELECT 'Postdoc' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_postdocs]

UNION ALL
  
SELECT 'Grad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_grads]

UNION ALL
  
SELECT 'Undergrad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_undergrads]

UNION ALL
  
SELECT 'Staff' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_staff]



________________________________________


SELECT 'PI' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_pis]
  
UNION ALL
  
SELECT 'Postdoc' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_postdocs]

UNION ALL
  
SELECT 'Grad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_grads]

UNION ALL
  
SELECT 'Undergrad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_undergrads]

UNION ALL
  
SELECT 'Staff' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_staff]

UNION ALL
  
SELECT 'Institution' AS [Type]
     , COUNT(*) AS [Count]
FROM (SELECT DISTINCT [Institution]
      FROM [354].[geomics_staff]) x



________________________________________


SELECT 'PI' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_pis]
  
UNION ALL
  
SELECT 'Postdoc' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_postdocs]

UNION ALL
  
SELECT 'Grad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_grads]

UNION ALL
  
SELECT 'Undergrad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_undergrads]

UNION ALL
  
SELECT 'Staff' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_staff]

UNION ALL
  
SELECT 'Institution' AS [Type]
     , COUNT(*) AS [Count]
FROM (SELECT DISTINCT [Institution]
      FROM [354].[geomics_tally.csv]) x



________________________________________


SELECT DISTINCT [Institution]
  FROM [354].[geomics_tally.csv]


________________________________________


SELECT CASE WHEN [Institution]='UW'
            THEN 'U. Washington'
            ELSE [Institution] END AS [Institution]
     , [PI]
     , CASE WHEN LEN(LTRIM([Postdocs])) = 0
            THEN NULL
            ELSE [Postdocs] END AS [Postdoc]
     , CASE WHEN LEN(LTRIM([Graduate Student])) = 0
            THEN NULL
            ELSE [Graduate Student] END AS [Graduate Student]
     , CASE WHEN LEN(LTRIM([Undergraduate Student])) = 0
            THEN NULL
            ELSE [Undergraduate Student] END AS [Undergraduate Student]
     , CASE WHEN LEN(LTRIM([Staff])) = 0
            THEN NULL
            ELSE [Staff] END AS [Staff]
  FROM [354].[table_geomics_tally.csv]


________________________________________


SELECT 'PI' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_pis]
  
UNION ALL
  
SELECT 'Postdoc' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_postdocs]

UNION ALL
  
SELECT 'Grad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_grads]

UNION ALL
  
SELECT 'Undergrad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_undergrads]

UNION ALL
  
SELECT 'Staff' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_staff]

UNION ALL
  
SELECT 'Institution' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_institutions]



________________________________________


SELECT DISTINCT [Institution]
  FROM [354].[geomics_tally.csv]


________________________________________


SELECT DISTINCT [Institution]
  FROM [354].[geomics_tally.csv]


________________________________________


SELECT [Institution], [PI] AS [Person]
FROM [354].[geomics_pis]
  
UNION ALL
  
SELECT [Institution], [Postdoc] AS [Person]
FROM [354].[geomics_postdocs]

UNION ALL
  
SELECT [Institution], [Graduate Student] AS [Person]
FROM [354].[geomics_grads]

UNION ALL
  
SELECT [Institution], [Undergraduate Student] AS [Person]
FROM [354].[geomics_undergrads]

UNION ALL
  
SELECT [Institution], [Staff] AS [Person]
FROM [354].[geomics_staff]



________________________________________


SELECT [Institution]
     , [PI] AS [Person]
     , 'PI' AS [Role]
FROM [354].[geomics_pis]
  
UNION ALL
  
SELECT [Institution], [Postdoc] AS [Person]
     , 'Postdoc' AS [Role]
FROM [354].[geomics_postdocs]

UNION ALL
  
SELECT [Institution], [Graduate Student] AS [Person]
     , 'Graduate Student' AS [Role]
FROM [354].[geomics_grads]

UNION ALL
  
SELECT [Institution], [Undergraduate Student] AS [Person]
     , 'Undergraduate Student' AS [Role]
FROM [354].[geomics_undergrads]

UNION ALL
  
SELECT [Institution], [Staff] AS [Person]
     , 'Staff' AS [Role]
FROM [354].[geomics_staff]



________________________________________


SELECT [Institution]
     , Count(*) AS [Number of People]
FROM [354].[geomics_people]
GROUP BY [Institution]


________________________________________


SELECT [Institution]
     , Count(*) AS [Number of People]
FROM [354].[geomics_people]
GROUP BY [Institution]
ORDER BY [Number of People] DESC


________________________________________


SELECT [Institution]
     , Count(*) AS [Number of People]
FROM [354].[geomics_people]
GROUP BY [Institution]



________________________________________


SELECT CASE WHEN [Institution]='UW'
            THEN 'U. Washington'
            ELSE [Institution] END AS [Institution]
     , [PI]
     , CASE WHEN LEN(LTRIM([Postdocs])) = 0
            THEN NULL
            ELSE [Postdocs] END AS [Postdoc]
     , CASE WHEN LEN(LTRIM([Graduate Student])) = 0
            THEN NULL
            ELSE [Graduate Student] END AS [Graduate Student]
     , CASE WHEN LEN(LTRIM([Undergraduate Student])) = 0
            THEN NULL
            ELSE [Undergraduate Student] END AS [Undergraduate Student]
     , CASE WHEN LEN(LTRIM([Staff])) = 0
            THEN NULL
            ELSE [Staff] END AS [Staff]
  FROM [354].[table_geomics_tally.csv]
  WHERE [Institution] <> 'UCLA' OR [PI] <> 'C. Deutsch' -- Curtis Deutsch is listed twice, once at UCLA and once at U. Washington. Keep only 1



________________________________________


SELECT [Institution]
     , [PI] AS [Person]
     , 'PI' AS [Role]
FROM [354].[geomics_pis]
  
UNION ALL
 
SELECT [Institution], [Postdoc] AS [Person]
     , 'Postdoc' AS [Role]
FROM [354].[geomics_postdocs]

UNION ALL
  
SELECT [Institution], [Graduate Student] AS [Person]
     , 'Graduate Student' AS [Role]
FROM [354].[geomics_grads]

UNION ALL
  
SELECT [Institution], [Undergraduate Student] AS [Person]
     , 'Undergraduate Student' AS [Role]
FROM [354].[geomics_undergrads]

UNION ALL
  
SELECT [Institution], [Staff] AS [Person]
     , 'Staff' AS [Role]
FROM [354].[geomics_staff]



________________________________________


SELECT DISTINCT [Institution], [PI]
FROM [354].[geomics_tally.csv]


________________________________________


SELECT 'PI' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_pis]
 
UNION ALL
  
SELECT 'Postdoc' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_postdocs]

UNION ALL
  
SELECT 'Grad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_grads]

UNION ALL
  
SELECT 'Undergrad' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_undergrads]

UNION ALL
  
SELECT 'Staff' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_staff]

UNION ALL
  
SELECT 'Institution' AS [Type]
     , COUNT(*) AS [Count]
FROM [354].[geomics_institutions]



________________________________________


SELECT * FROM [412].[Skyline Data precursor 2]


________________________________________


SELECT * FROM [412].[Skyline Data precursor 2]
WHERE [FragmentIon] like 'precursor'



________________________________________


SELECT * FROM [412].[Skyline Data precursor 2]
WHERE [FragmentIon] like 'precursor'


________________________________________


SELECT * FROM [412].[Skyline Data precursor 2]
WHERE [FragmentIon] = 'precursor'


________________________________________


SELECT [All Proteins],
([CG2 total SpC]/[protein length]) AS [CG2 SpC/L]
FROM [412].[All proteins with length]


________________________________________


SELECT [All Proteins],
  (CAST([CG2 total SpC] AS FLOAT)/[protein length]) AS [CG2 SpC/L]
FROM [412].[All proteins with length]


________________________________________


SELECT [All Proteins],
       (CAST([CG2 total SpC] AS FLOAT)/[protein length]) AS [CG2 SpC/L]
FROM [412].[All proteins with length]


________________________________________


SELECT [All Proteins],
       SUM(CAST([CG2 total SpC] AS FLOAT)/[protein length]) AS [SUM CG2 SpC/L]
FROM [412].[All proteins with length]
GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins]
     , CAST([CG2 total SpC] AS FLOAT)/[protein length] AS [CG2 SpC/L]
     , CAST([CG5 total SpC] AS FLOAT)/[protein length] AS [CG5 SpC/L]
FROM [412].[All proteins with length]




________________________________________


SELECT TOP 1 [id]
FROM [748].[BlackAB_DESeq.txt]



________________________________________


SELECT TOP 1 a.[CONTIG], b.[id]
FROM [748].[BlackAB_Tax] a,
     [748].[BlackAB_DESeq.txt] b



________________________________________


SELECT TOP 100 a.[CONTIG], b.[id]
FROM [748].[BlackAB_Tax] a,
     [748].[BlackAB_DESeq.txt] b



________________________________________


SELECT TOP 100 a.[CONTIG]
FROM [748].[BlackAB_Tax] a


________________________________________


SELECT TOP 100 a.[COLUMN1]
FROM [748].[lft_BlackAbalone_v3_swissprot_blastout_tax1.txt] a


________________________________________


SELECT DATEDIFF(second, MAX([DateTime]), GETDATE()) FROM [1059].[sds_view]


________________________________________


SELECT DATEDIFF(second, MAX([DateTime]), GETDATE()) FROM [1059].[stats_view]


________________________________________


SELECT DATEDIFF(minute, MAX([DateTime]), GETDATE()) FROM [1059].[stats_view]


________________________________________


SELECT DATEDIFF(minute, MAX([DateTime]), GETDATE()) FROM [1059].[sds_view]


________________________________________


SELECT DATEDIFF(minute, MAX([DateTime]), GETDATE()) FROM [1059].[sds_view]


________________________________________


SELECT DATEDIFF(minute, MAX([DateTime]), GETDATE()) FROM [1059].[sds_view]


________________________________________


SELECT DATEDIFF(minute, MAX([DateTime]), GETDATE()) FROM [1059].[sds_view]


________________________________________


SELECT GETDATE()



________________________________________


SELECT [2800 avg NSAF]/NULLIF([400 avg NSAF],0) FROM [412].[NSAF with averages per treatment]


________________________________________


SELECT CASE WHEN [400 avg NSAF] = 0
            THEN NULL
            ELSE [2800 avg NSAF]/[400 avg NSAF]
            END FROM [412].[NSAF with averages per treatment]


________________________________________


SELECT * FROM [1118].[periodic_table]


________________________________________


SELECT z,melt_kelvin FROM
  (SELECT * FROM [1118].[periodic_table]) x


________________________________________


SELECT [z],[melt_kelvin] FROM
  (SELECT * FROM [1118].[periodic_table]) x


________________________________________


SELECT *
FROM [354].[geomics_people]
WHERE Institution = 'Bigelow'


________________________________________


SELECT *
FROM [354].[geomics_people]
WHERE Institution = 'UCLA'


________________________________________


SELECT *
FROM [354].[geomics_people]
WHERE Institution = 'MIT'


________________________________________


SELECT Source, COUNT(*)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Source



________________________________________


SELECT Source, Station, COUNT(*)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Source, Station



________________________________________


SELECT DISTINCT( Station)
  FROM [446].[GeoMICS_key.csv]




________________________________________


SELECT DISTINCT(Station)
  FROM [446].[GeoMICS_key.csv]
WHERE Source='McL'



________________________________________


SELECT Station, Source, [Depth..m.], Count(*)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Station, Source, [Depth..m.]



________________________________________


SELECT Station, Source, [Depth..m.] AS Depth, Count(*)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Station, Source, [Depth..m.]



________________________________________


SELECT Station, COUNT(*)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Station


________________________________________


SELECT Source, COUNT(*)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Source


________________________________________


SELECT [Institution],[PI] AS [Person], 'PI' AS [Role]
FROM [354].[geomics_pis]


________________________________________


SELECT [Institution],[PI] AS [Person], 'PI' AS [Role]
FROM [354].[geomics_pis]
  
UNION ALL
  
SELECT [Institution],[Staff] AS [Person], 'Staff' AS [Role]
FROM [354].[geomics_staff]



________________________________________


SELECT [Institution],[PI] AS [Person], 'PI' AS [Role]
FROM [354].[geomics_pis]
  
UNION ALL
  
SELECT [Institution],[Staff] AS [Person], 'Staff' AS [Role]
FROM [354].[geomics_staff]

ORDER BY PERSON ASC



________________________________________


SELECT 'KM1314' AS [Cruise
     , [file]
     , [fsc_small]
     , [chl_small]
     , [evt]
     , [opp]
     , [pop]
  FROM [1059].[STATS_VIEW]


________________________________________


SELECT 'KM1314' AS [Cruise]
     , [file]
     , [fsc_small]
     , [chl_small]
     , [evt]
     , [opp]
     , [pop]
  FROM [1059].[STATS_VIEW]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) <> 1
            THEN [protein]
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein]))
            END AS [protein]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1
            THEN [protein]
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein]))
            END AS [protein]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1
            THEN [protein]
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein]))
            END AS [protein]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1
            THEN [protein]
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [first_protein]
      , [tot indep spectra]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1
            THEN [protein]
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
      , PATINDEX('[0-9]%', [protein]) as [start]
      , CHARINDEX(',', [protein])-PATINDEX('[0-9]%', [protein]) as [length]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
      , PATINDEX('[0-9]%', [protein]) as [start]
      , CHARINDEX(',', [protein])-PATINDEX('[0-9]%', [protein]) as [length]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
      , PATINDEX('%[0-9]%', [protein]) as [start]
      , CHARINDEX(',', [protein])-PATINDEX('[0-9]%', [protein]) as [length]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
      , PATINDEX('[0-9]', [protein]) as [start]
      , CHARINDEX(',', [protein])-PATINDEX('[0-9]%', [protein]) as [length]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT LEN([protein]) - LEN(REPLACE([protein], ',', '')) + 1
  FROM [412].[A1 file 21 reduced]


________________________________________


SELECT LEN([protein]) - LEN(REPLACE([protein], ',', '')) + 1 AS [protein count]
  FROM [412].[A1 file 21 reduced]


________________________________________


SELECT * FROM [354].[table_geomics_tally.csv]


________________________________________


SELECT COUNT(DISTINCT PI)
  FROM [354].[geomics_tally.csv]


________________________________________


SELECT * FROM [354].[table_geomics_tally.csv]


________________________________________


SELECT z, symbol
FROM [354].[periodic.txt]


________________________________________


SELECT z AS y, symbol
FROM [354].[periodic.txt]


________________________________________


SELECT [z] AS [y], symbol
FROM [354].[periodic.txt]


________________________________________


SELECT [z] AS [y y], symbol
FROM [354].[periodic.txt]


________________________________________


SELECT REPLACE(name, 'H', '')
  FROM [354].[table_periodic.txt570F3]


________________________________________


SELECT [group], COUNT(*) as items
  FROM [354].[periodic.txt]
  GROUP BY [group]
  having COUNT(*) > 5



________________________________________


SELECT Institution, Person, Role
     , ROW_NUMBER() OVER (PARTITION BY Institution
       ORDER BY Person DESC) AS PersonNumber
FROM [354].[geomics_people]


________________________________________


SELECT Institution, Person
FROM (
  SELECT Institution, Person, Role
       , ROW_NUMBER() OVER (PARTITION BY Institution
         ORDER BY Person DESC) AS PersonNumber
  FROM [354].[geomics_people]
) [inner]
WHERE [inner].PersonNUmber < 4



________________________________________


SELECT Institution, Person
FROM (
  SELECT Institution, Person, Role
       , ROW_NUMBER() OVER (PARTITION BY Institution
         ORDER BY Person DESC) AS PersonNumber
  FROM [354].[geomics_people]
) [inner]
WHERE [inner].PersonNumber < 4



________________________________________


SELECT Institution, Person
FROM (
  SELECT Institution, Person, Role
       , ROW_NUMBER() OVER (PARTITION BY Institution
         ORDER BY Person DESC) AS PersonNumber
  FROM [354].[Snapshot of geomics_people]
) [inner]
WHERE [inner].PersonNumber < 4


________________________________________


  SELECT Institution, Person, Role
       , ROW_NUMBER() OVER (PARTITION BY Institution
         ORDER BY Person DESC) AS PersonNumber
       , COUNT(*) OVER (PARTITION BY Institution) AS Count
  FROM [354].[Snapshot of geomics_people]




________________________________________


  SELECT Institution, Person, Role
       , ROW_NUMBER() OVER (PARTITION BY Institution
         ORDER BY Person DESC) AS PersonNumber
       , COUNT(*) OVER (PARTITION BY Institution) AS PCount
       , COUNT(*) OVER (PARTITION BY Role) AS Count

  FROM [354].[Snapshot of geomics_people]




________________________________________


SELECT * FROM [354].[705AData]


________________________________________


SELECT 1


________________________________________


SELECT 1+2


________________________________________


SELECT 1
WHERE 1 = 1


________________________________________


SELECT 1
WHERE 1 = 1


________________________________________


SELECT 1
WHERE 1 = 0


________________________________________


SELECT 1
WHERE 1 = 0 or 1=1


________________________________________


SELECT 1
  WHERE CASE WHEN 1=1 THEN NULL ELSE 1 END = 1 AND 1=1


________________________________________


SELECT 1
  WHERE CASE WHEN 1=1 THEN NULL ELSE 1 END = 1 AND 1=0


________________________________________


SELECT 1
  WHERE CASE WHEN 1=1 THEN NULL ELSE 1 END = 1 OR 1=1


________________________________________


SELECT MAX(x) FROM
  (SELECT NULL AS x
   UNION ALL
    SELECT 1 AS x) y




________________________________________


SELECT followee, COUNT(*) as degree
FROM [354].[twitter_rv.6200000]
GROUP BY followee


________________________________________


SELECT followee, COUNT(*) as degree
FROM [354].[twitter_rv.6200000]
GROUP BY followee
ORDER BY degree DESC


________________________________________


SELECT TOP 1 followee, COUNT(*) as degree
FROM [354].[twitter_rv.6200000]
GROUP BY followee
ORDER BY degree DESC


________________________________________


SELECT TOP 1 followee, COUNT(*) as degree
FROM [354].[twitter_rv.6200000]
GROUP BY followee
ORDER BY degree DESC



________________________________________


SELECT * FROM(
  SELECT followee, COUNT(*) as degree
  FROM [354].[twitter_rv.6200000]
  GROUP BY followee
) foo
GROUP BY followee, degree
HAVING degree=MAX(degree)


________________________________________


SELECT followee, COUNT(*) AS degree
  FROM [354].[twitter_rv.6200000]
GROUP BY followee
  HAVING COUNT(*) >= ALL (
    SELECT COUNT(*)
  FROM [354].[twitter_rv.6200000]
    GROUP BY followee
  )


________________________________________


SELECT followee, count(*)
FROM [354].[twitter_rv.6200000]
GROUP BY followee


________________________________________


SELECT followee, count(*) as degree
FROM [354].[twitter_rv.6200000]
GROUP BY followee


________________________________________


SELECT followee, count(*) as degree
FROM [354].[twitter_rv.6200000]
GROUP BY followee
ORDER BY followee ASC


________________________________________


SELECT followee, count(*) as degree
FROM [354].[twitter_rv.6200000]
GROUP BY followee
ORDER BY degree ASC


________________________________________


WITH vertices AS (SELECT followee as v FROM [354].[twitter_rv.6200000]
  UNION SELECT follower as v FROM [354].[twitter_rv.6200000])
SELECT v FROM vertices


________________________________________


WITH vertices AS
    (SELECT followee as v
     FROM [354].[twitter_rv.6200000]
     UNION
     SELECT follower as v
     FROM [354].[twitter_rv.6200000])
SELECT v, COUNT(follower)
FROM vertices
LEFT OUTER JOIN [354].[twitter_rv.6200000]
ON vertices.v = [354].[twitter_rv.6200000].followee
GROUP BY v


________________________________________


WITH vertices AS
    (SELECT followee as v
     FROM [354].[twitter_rv.6200000]
     UNION
     SELECT follower as v
     FROM [354].[twitter_rv.6200000])
SELECT v, COUNT(follower) as outdegree
FROM vertices
LEFT OUTER JOIN [354].[twitter_rv.6200000]
ON vertices.v = [354].[twitter_rv.6200000].followee
GROUP BY v
ORDER BY outdegree ASC


________________________________________


WITH vertices AS
    (SELECT followee as v
     FROM [354].[twitter_rv.6200000]
     UNION
     SELECT follower as v
     FROM [354].[twitter_rv.6200000])
SELECT v, COUNT(*) as outdegree
FROM vertices
LEFT OUTER JOIN [354].[twitter_rv.6200000]
ON vertices.v = [354].[twitter_rv.6200000].followee
GROUP BY v
ORDER BY outdegree ASC


________________________________________


WITH vertices AS
    (SELECT followee as v
     FROM [354].[twitter_rv.6200000]
     UNION
     SELECT follower as v
     FROM [354].[twitter_rv.6200000])
SELECT v, COUNT(follower) as outdegree
FROM vertices
LEFT OUTER JOIN [354].[twitter_rv.6200000]
ON vertices.v = [354].[twitter_rv.6200000].followee
GROUP BY v
ORDER BY outdegree ASC


________________________________________


WITH Edges AS (SELECT followee as [start], follower as [end]  FROM [354].[twitter_rv.6200000])
  SELECT COUNT(*)
  FROM Edges s, Edges d
  WHERE s.[end] = d.[start]


________________________________________


SELECT COUNT(*)
FROM [354].[small_graph] s
   , [354].[small_graph]  d
WHERE s.s = d.d


________________________________________


SELECT COUNT(*)
FROM [354].[small_graph] first
   , [354].[small_graph] second
WHERE first.d = second.s


________________________________________


SELECT first.s, second.s, third.s
FROM [354].[small_graph] first
   , [354].[small_graph] second
   , [354].[small_graph] third
WHERE first.d = second.s
  AND second.d = third.s
  AND third.d = first.s


________________________________________


SELECT first.s, second.s, third.s
FROM [354].[small_graph] first
   , [354].[small_graph] second
   , [354].[small_graph] third
WHERE first.d = second.s
  AND second.d = third.s
  AND third.d = first.s
  AND first.s < second.s AND second.s < third.s


________________________________________


SELECT first.s, second.s, third.s
FROM [354].[small_graph] first
   , [354].[small_graph] second
   , [354].[small_graph] third
WHERE first.d = second.s
  AND second.d = third.s
  AND third.d = first.s
  AND first.s > second.s AND second.s > third.s


________________________________________


SELECT first.s, second.s, third.s
FROM [354].[small_graph] first
   , [354].[small_graph] second
   , [354].[small_graph] third
WHERE first.d = second.s
  AND second.d = third.s
  AND third.d = first.s
  AND first.s > second.s AND first.s > third.s


________________________________________


SELECT first.s, second.s, third.s
FROM [354].[small_graph] first
   , [354].[small_graph] second
   , [354].[small_graph] third
WHERE first.d = second.s
  AND second.d = third.s
  AND third.d = first.s
  AND first.s < second.s AND first.s < third.s


________________________________________


SELECT s, COUNT(*) as degree
FROM [354].[small_graph]
GROUP BY s


________________________________________


SELECT COUNT(*) as degree
FROM [354].[small_graph]
GROUP BY s


________________________________________


SELECT max(rank)
FROM [354].[publicadhocPageRank2_3.csv]


________________________________________


SELECT count(*)
FROM [354].[publicadhocPageRank2_3.csv]


________________________________________


SELECT TOP 10 *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status <> 'success'
  ORDER BY id DESC


________________________________________


SELECT *
FROM [sqlshare].[sqlshare].[1385_query_log]
WHERE status = 'success'
ORDER BY id ASC


________________________________________


SELECT id, query
FROM [sqlshare].[sqlshare].[1385_query_log]
WHERE status = 'success'
ORDER BY id ASC


________________________________________


SELECT * --id, query
FROM [sqlshare].[sqlshare].[1385_query_log]
WHERE status = 'success'
ORDER BY id ASC


________________________________________


SELECT id, owner, query
FROM [sqlshare].[sqlshare].[1385_query_log]
WHERE status = 'success'
ORDER BY id ASC


________________________________________


select 5 as [end]


________________________________________


SELECT * FROM [412].[output_temp.txt]


________________________________________


SELECT *
FROM [354].[periodic.txt]
WHERE boil_kelvin < 100



________________________________________


SELECT *
FROM [354].[periodic.txt]
WHERE boil_kelvin < 100



________________________________________


SELECT name, boil_kelvin-melt_kelvin
FROM [354].[periodic.txt]


________________________________________


SELECT name, boil_kelvin-melt_kelvin as diff
FROM [354].[periodic.txt]
ORDER by diff asc


________________________________________


SELECT name, boil_kelvin-melt_kelvin as diff
FROM [354].[periodic.txt]
ORDER by diff desc


________________________________________


SELECT name, boil_kelvin-melt_kelvin as diff
FROM [354].[periodic.txt]
WHERE boil_kelvin > 0
ORDER by diff asc


________________________________________


SELECT max(timestamp) FROM [1057].[Tokyo1_sds_timestamp]


________________________________________


SELECT min(timestamp) FROM [1057].[Tokyo1_sds_timestamp]


________________________________________


SELECT min(timestamp) FROM [1057].[Tokyo1_uway_timestamp_1col]


________________________________________


SELECT max(timestamp) FROM [1057].[Tokyo1_uway_timestamp_1col]


________________________________________


SELECT 1


________________________________________


SELECT cast('11:35 PM' as time)


________________________________________


SELECT cast(cast('11:35 PM' as time) as datetime)


________________________________________


SELECT datepart(second, cast('11:35 PM' as time))


________________________________________


SELECT datediff(second, cast('11:35 PM' as time), cast('12:00 AM' as time))


________________________________________


SELECT datediff(second, cast('12:00 AM' as time), cast('11:35 PM' as time))


________________________________________


SELECT datediff(second, cast('5:45 AM' as time), cast('11:35 PM' as time))


________________________________________


SELECT datediff(hour, cast('5:45 AM' as time), cast('11:35 PM' as time))


________________________________________


SELECT datediff(second, cast('5:45 AM' as time), cast('11:35 PM' as time))


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  Pathway like'immune'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  Pathway like'%cell%'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[SPID and GO Numbers]go
  on
 blast.Column3=go.SPID


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[SPID and GO Numbers]go
  on
 blast.Column3=go.SPID


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[SPID and GO Numbers]go
  on
 blast.Column3=go.SPID
  Left join
  [1123].[GO_to_GOslim]slim
  on
 go.GOID=slim.GO_id


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[SPID and GO Numbers]go
  on
 blast.Column3=go.SPID
  Left join
  [1123].[GO_to_GOslim]slim
  on
 go.GOID=slim.GO_id
  where
  aspect = 'P'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[SPID and GO Numbers]go
  on
 blast.Column3=go.SPID
  Left join
  [1123].[GO_to_GOslim]slim
  on
 go.GOID=slim.GO_id




________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[SPID and GO Numbers]go
  on
 blast.Column3=go.SPID
  Left join
  [1123].[GO_to_GOslim]slim
  on
 go.GOID=slim.GO_id
  where 
  aspect = 'P'




________________________________________


SELECT * FROM [1017].[RNAseq_count.txt]Counts
  left join
  [1017].[Phel_clc_blastn_nt_nopipes_3.tab]BLAST
  on
  Counts.Feature=BLAST.Column1


________________________________________


SELECT * FROM [1017].[RNAseq_count.txt]Counts
  left join
  [1017].[Phel_clc_blastn_nt_nopipes_3.tab]BLAST
  on
  Counts.Feature=BLAST.Column1
  Where
  (V_CF71+V_CF34+V_CF26)>(HK_CF2+HK_CF35+HK_CF70)



________________________________________


SELECT * FROM [1017].[Phel_clc_RNAseq_count.txt]count
Left join
[299].[Phel_clc_blastn_nt_nopipes.tab]go
on
  count.Feature=go.Column1





________________________________________


SELECT * FROM [1017].[Phel_clc_RNAseq_count.txt]count
Left join
[299].[Phel_clc_blastn_nt_nopipes.tab]go
on
  count.Feature=go.Column1
      where 
  Column16 like '%Pisaster%'





________________________________________


SELECT * FROM [1017].[RNAseq_count.txt]Counts
  left join
  [1017].[Phel_clc_blastn_nt_nopipes_3.tab]BLAST
  on
  Counts.Feature=BLAST.Column1
  Where
  (V_CF71+V_CF34+V_CF26)>(HK_CF2+HK_CF35+HK_CF70)



________________________________________


SELECT * FROM [1017].[RNAseq_count.txt]Counts
  left join
  [1017].[Phel_clc_blastn_nt_nopipes_3.tab]BLAST
  on
  Counts.Feature=BLAST.Column1
  Where
  (V_CF71+V_CF34+V_CF26)>3*(HK_CF2+HK_CF35+HK_CF70)



________________________________________


SELECT * FROM [1017].[RNAseq_count.txt]Counts
  left join
  [1017].[Phel_clc_blastn_nt_nopipes_3.tab]BLAST
  on
  Counts.Feature=BLAST.Column1
  Where
  (V_CF71+V_CF34+V_CF26)>3*(HK_CF2+HK_CF35+HK_CF70)


________________________________________


SELECT * FROM [1123].[Phel_deseq2_sig_results_c]sig
left join
[1017].[Phel_clc_blastx_uniprot_sprot_sqlready.tab]bla
on
sig.Column1=bla.Column1


________________________________________


SELECT * FROM [1017].[Phel_clc_RNAseq_count.txt]blast
  left join
  [1017].[Phel_clc_blastx_uniprot_sprot_sqlready.tab]prot
  on
  blast.Feature=prot.Column1


________________________________________


SELECT * FROM [1017].[HK_V_DESeq_sitesb.txt]hits
  left join
  [1017].[Phel_clc_blastx_uniprot_sprot_sqlready.tab]prot
  on
  hits.Column1=prot.Column1
  
  


________________________________________


SELECT * FROM [1017].[DESeq2_join_spid.txt]deg
  left join
  [94].[Phel_clc_blastx_uniprot_sprot_sqlready_1.tab]eval
  on
  deg.Column1=eval.Column1



________________________________________


SELECT * FROM [94].[Phel_clc_blastx_uniprot_sprot_sqlready_1.tab]eval
left join
  [1017].[DESeq2_join_spid.txt]deg
  on
  eval.Column1=deg.Column1



________________________________________


SELECT * FROM   [1017].[DESeq2_join_spid.txt]deg
  left join
  [94].[Phel_clc_blastx_uniprot_sprot_sqlready_1.tab]eval
  on
  deg.Column1=eval.Column1




________________________________________


SELECT * FROM   [1017].[DESeq2_join_spid.txt]deg
  left join
  [94].[Phel_clc_blastx_uniprot_sprot_sqlready_1.tab]eval
  on
  deg.Column1=eval.Column1
 where 
  Column21 = 'sp'



________________________________________


SELECT * FROM [1017].[Phel_clc_uniprot_sprot_05_fixed.tab]
  where
  Code='STRPU'


________________________________________


SELECT * FROM [1017].[Phel_clc_uniprot_sprot_05_fixed.tab]
  where
  Code = '%STRPU%'


________________________________________


SELECT * FROM [1017].[Phel_clc_uniprot_sprot_05_fixed.tab]prot
  where
  Code = '%STRPU%'


________________________________________


SELECT * FROM [1017].[Phel_clc_uniprot_sprot_05_fixed.tab]prot
  where
  Code like '%STRPU%'


________________________________________


SELECT * FROM [1017].[STRPU annotations]STR
  left join
  [1017].[Significant_Genes_Annotations_Enrichment.csv]log
on
  STR.Contig=log.Column1


________________________________________


SELECT * FROM [1017].[head_genes_wIF.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
on
  wIF.head=wAge.head


________________________________________


SELECT * FROM [1017].[head_genes_wIF.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
on
  wIF.head=wAge.head
 


________________________________________


SELECT * FROM [1017].[head_genes_wIF_1.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wIF.heads=wAge.head


________________________________________


SELECT * FROM [1017].[head_genes_wIF_1.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wIF.heads=wAge.head
  where
  head='%FBgn'


________________________________________


SELECT * FROM [1017].[head_genes_wIF_1.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wIF.heads=wAge.head
  where
  head='%FBgn%'


________________________________________


SELECT * FROM [1017].[head_genes_wIF_1.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wIF.heads=wAge.head
  where
  head='*FBgn'


________________________________________


SELECT * FROM [1017].[head_genes_wIF_1.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wIF.heads=wAge.head
  where
  head='*FBgn'


________________________________________


SELECT * FROM [1017].[head_genes_wIF_1.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wIF.heads=wAge.head
  where
  head = '*FBgn'


________________________________________


SELECT * FROM [1017].[head_genes_wIF_1.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wIF.heads=wAge.head
  where
  head = '*FB'


________________________________________


SELECT * FROM [1017].[head_genes_wIF_1.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wIF.heads=wAge.head
 


________________________________________


SELECT * FROM [1017].[head_genes_wIF_1.txt]wIF
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wIF.heads=wAge.head
 


________________________________________


SELECT * FROM   [1017].[head_genes_wAge.txt]wAge
  left join
  [1017].[head_genes_wIF_1.txt]wIF
  on
  wAge.head=wIF.heads
 


________________________________________


SELECT * FROM [1017].[all_aged_FB_pvals.txt]FB
  left join
  [1017].[uniprot_converted_agedheadgenes_2.tab]spid
  on
  FB.Column1=spid.FlyBase


________________________________________


SELECT * FROM [1017].[matched_DEGs_IFheads_2]
  where
  heads='%FBgn'


________________________________________


SELECT * FROM [1017].[matched_DEGs_IFheads_2]
  where
  heads='FBgn'


________________________________________


SELECT * FROM [1017].[matched_DEGs_IFheads_2]
  where
  heads='&FBgn'


________________________________________


SELECT * FROM [1017].[matched_DEGs_IFheads_2]
  where
  heads='FBgn%%%%%%%'


________________________________________


SELECT * FROM [1017].[matched_DEGs_IFheads_2]
  where
  heads='~FBgn'


________________________________________


SELECT * FROM [1017].[head_genes_wIF.txt]wif
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wif.heads=wAge.head




________________________________________


SELECT * FROM [1017].[head_genes_wAge.txt]wAge
  left join
  [1017].[head_genes_wIF.txt]wif
  on
  wAge.head=wif.heads




________________________________________


SELECT * FROM [1017].[head_genes_wIF.txt]wif
  left join
  [1017].[head_genes_wAge.txt]wAge
  on
  wif.heads=wAge.head





________________________________________


SELECT * FROM [1017].[matched_headgenes_IF_ages]gene
  left join
  [1017].[table_RPKMs_headswAge_FBid.txt]rpkm
  on
  gene.heads=rpkm.Column1


________________________________________


SELECT * FROM [1017].[allRPKMs_FBids.txt]rpkm
  left join
  [1017].[matched_headgenes_IF_ages]matched
  on 
  rpkm.ID=matched.heads


________________________________________


SELECT * FROM [1017].[aged&IF_genes_wRPKMs]
  where
  heads like '%FBgn'


________________________________________


SELECT * FROM [1017].[aged&IF_genes_wRPKMs]
  where
  heads like '%FB'


________________________________________


SELECT * FROM [1017].[aged&IF_genes_wRPKMs]
  where
ID = heads


________________________________________


SELECT * FROM [1017].[aged&IF_genes_wRPKMs]rpkm
  left join
  [1017].[table_KEGG_aa1341b_agedif.txt]kegg
  on
  rpkm.ID=kegg.AA


________________________________________


SELECT * FROM [1017].[aged&IF_genes_wRPKMs]rpkm
  left join
  [1017].[table_KEGG_aa1341b_agedif.txt]kegg
  on
  rpkm.ID=kegg.AA
  where
  AA like '%FBGN'


________________________________________


SELECT * FROM [1017].[aged&IF_genes_wRPKMs]rpkm
  left join
  [1017].[table_KEGG_aa1341b_agedif.txt]kegg
  on
  rpkm.ID=kegg.AA
  


________________________________________


SELECT * FROM [1017].[rpkm_aa1341b_age&IF]
  where
  AA like '%FBGN'


________________________________________


SELECT * FROM [1017].[rpkm_aa1341b_age&IF]rpkm
 left join
  [1017].[table_FBid_genename.txt]gene
  on
  rpkm.AA=gene.ID


________________________________________


SELECT * FROM [1017].[defense_response_heads_AgeIF.txt]df
  left join
  [1017].[aged&IF_genes_wRPKMs]rpkm
 on
 df.def_resp=rpkm.ID 


________________________________________


SELECT * FROM [1017].[defense_response_heads_AgeIF.txt]df
  left join
  [1017].[aged&IF_genes_wRPKMs]rpkm
 on
 df.def_resp=rpkm.ID 
  left join
  [1017].[FBid_genename.txt]gene
  on
  df.def_resp=gene.ID 


________________________________________


SELECT * FROM [1017].[thorax_genes_wIF_1.txt]wif
  left join
  [1017].[thorax_genes_wAge_1.txt]age 
  on
  wif.ID=age.ID


________________________________________


SELECT * FROM [1017].[thorax_genes_wAge_1.txt]thor
  left join
  [1017].[head_genes_wAge.txt]head
  on
  thor.ID=head.head


________________________________________


SELECT * FROM [1017].[thorax_genes_wAge_1.txt]thor
  left join
  [1017].[head_genes_wAge.txt]brain
  on
  thor.ID=brain.head


________________________________________


SELECT * FROM [1017].[thorax_genes_wAge_1.txt]thor
  left join
  [1017].[head_genes_wIF.txt]wif
  on
  thor.ID=wif.heads


________________________________________


SELECT * FROM [1017].[thorax_genes_wIF_1.txt]thor
  left join
  [1017].[head_genes_wIF.txt]wif
  on
  thor.ID=wif.heads


________________________________________


SELECT * FROM [1017].[thorax_genes_wAge_1.txt]thor
  left join
  [1017].[head_genes_wAge.txt]brain
  on
  thor.ID=brain.head


________________________________________


SELECT * FROM [1017].[thorax_age_head_age_genes]age
  left join
  [1017].[thorax_if_heads_if_genes ]wif
  on 
  age.ID=wif.ID


________________________________________


SELECT * FROM [1017].[thorax_age_head_age_genes]age
  left join
  [1017].[thorax_if_heads_if_genes ]wif
  on 
  age.head=wif.heads


________________________________________


SELECT * FROM [1017].[headgenes_25.txt]head
  left join
  [1017].[table_thoraxgenes_25_1.txt]thor
  on
  head.headID=thor.thorID


________________________________________


SELECT * FROM [1017].[table_thoraxgenes_25_1.txt]thor
  left join
  [1017].[headgenes_25.txt]head
  on
  thor.thorID=head.headID


________________________________________


SELECT * FROM [1152].[table_del_drugbank_interactions.txt]


________________________________________


SELECT * FROM [1152].[table_del_drugbank_interactions.txt]
  where Column2 = 'Abacavir'


________________________________________


SELECT TOP 10 *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  ORDER BY id DESC


________________________________________


SELECT TOP 100 *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  ORDER BY id DESC


________________________________________


SELECT TOP 10 *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  ORDER BY id DESC;


________________________________________


SELECT TOP 1000 *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  ORDER BY id DESC;


________________________________________


SELECT TOP 10 *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  ORDER BY id DESC;


________________________________________


SELECT TOP 10 owner, query, status
  FROM [sqlshare].[sqlshare].[1385_query_log]
  ORDER BY id DESC;


________________________________________


SELECT TOP 10 owner, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  ORDER BY id DESC;


________________________________________


SELECT TOP 1000 owner, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  ORDER BY id DESC;


________________________________________


SELECT owner, count(1) as cnt
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  group by owner
  ORDER BY cnt DESC;


________________________________________


SELECT TOP 1000 owner, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  ORDER BY id DESC;





________________________________________


SELECT top 10 owner, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  group by owner, query;





________________________________________


SELECT top 1000 owner, query, count(1) as cnt
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  group by owner, query
  order by cnt;





________________________________________


SELECT top 1000 owner, query, count(1) as cnt
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  group by owner, query
  order by cnt;





________________________________________


SELECT top 1000 owner, query, count(1) as cnt
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  group by owner, query
  order by cnt desc;





________________________________________


SELECT top 1000 owner, query, count(1) as cnt
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  group by owner, query
  order by cnt asc;





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success';




________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success';




________________________________________


SELECT owner, query, count(1) as cnt
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  group by owner, query
  order by cnt desc;





________________________________________


SELECT query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  group by query;





________________________________________


SELECT query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%group%'
  group by query;





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%group%'
  group by query;





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%group%';





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%group by%';





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '% join %';





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '% IN %';





________________________________________


SELECT query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '% IN %';





________________________________________


SELECT query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '% IN ( select%';





________________________________________


SELECT query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%(select%';





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%(select%';





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%( select%';





________________________________________


SELECT query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%( select%';





________________________________________


SELECT query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%( select%' or query like '%(select%';





________________________________________


SELECT query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%( select%' or query like '%(select%' order by len(query) desc;





________________________________________


SELECT top 50 query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success'
  and query like '%( select%' or query like '%(select%' order by len(query) desc;





________________________________________


SELECT top 50 query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success';





________________________________________


SELECT top 5000 query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  WHERE status = 'success';





________________________________________


SELECT top 5000 id, query
  FROM [sqlshare].[sqlshare].[1385_query_log];





________________________________________


SELECT query
  FROM [sqlshare].[sqlshare].[1385_query_log]
where query like '%(select%';





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
where query like '%(select%' and status = 'success';





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
where query like '%(select%' and status <> 'success';





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
where status <> 'success';





________________________________________


SELECT count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
where status = 'success';





________________________________________


SELECT status, count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
group by status;





________________________________________


SELECT status, count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where (query like '%(select%' or query like '%( select%')
group by status;





________________________________________


SELECT status, count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where query like '%group by%'
group by status;





________________________________________


SELECT status, count(1)
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where query like '%having%'
group by status;





________________________________________



SELECT *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where query like '%(select%';



________________________________________



SELECT *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id > 210 and id < 225
   order by id desc;



________________________________________



SELECT id, owner, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id > 210 and id < 225
   order by id desc;



________________________________________



SELECT id, owner, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id > 210 and id < 230
   order by id desc;



________________________________________



SELECT *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where query like '%(select%';




________________________________________



SELECT id, owner, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id >= 2660 and id <= 2680
  order by id desc;




________________________________________



SELECT id, owner, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id >= 2660 and id <= 2680
  order by id desc;




________________________________________



SELECT id, owner, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id >= 2650 and id <= 2680
  order by id desc;




________________________________________



SELECT id, owner, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id >= 2630 and id <= 2680
  order by id desc;




________________________________________



SELECT id, owner, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id >= 2630 and id <= 2690
  order by id desc;




________________________________________



SELECT id, owner, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id >= 2630 and id <= 2750
  order by id desc;




________________________________________



SELECT id, owner, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id >= 2630 and id <= 2700
  order by id desc;




________________________________________



SELECT id, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id >= 2630 and id <= 2700 and owner = '1002'
  order by id desc;




________________________________________



SELECT id, status, query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  where id >= 2637 and id <= 2700 and owner = '1002'
  order by id desc;




________________________________________


SELECT TOP 10 *
  FROM [sqlshare].[sqlshare].[1385_query_log]
  ORDER BY id DESC


________________________________________


SELECT TOP 10 *
  FROM [sqlshare].[sqlshare].[1385_query_log] where id = 1424
  ORDER BY id DESC


________________________________________


SELECT TOP 10 query
  FROM [sqlshare].[sqlshare].[1385_query_log] where id = 1424
  ORDER BY id DESC


________________________________________


SELECT TOP 10 query
  FROM [sqlshare].[sqlshare].[1385_query_log]
  ORDER BY id DESC


________________________________________


SELECT TOP 10 query FROM [sqlshare].[sqlshare].[1385_query_log] where id = 1424 ORDER BY id DESC


________________________________________


SELECT TOP 10 query FROM [sqlshare].[sqlshare].[1385_query_log] where id = 3161 ORDER BY id DESC


________________________________________


SELECT TOP 10 query FROM [sqlshare].[sqlshare].[1385_query_log] where id = 4026 ORDER BY id DESC


________________________________________


SELECT * FROM [1080].[ProcessedQueries_Sqlshare_2.csv]
  order by ops desc;


________________________________________


SELECT * FROM [1080].[ProcessedQueries_Sqlshare_2.csv]
  where length > 100 order by ops desc;


________________________________________


SELECT Source FROM 
  [1080].[ProcessedQueries_Sqlshare_2.csv]
  order by owner;
  


________________________________________


SELECT Query FROM 
  [1080].[ProcessedQueries_Sqlshare_2.csv]
  order by owner;
  


________________________________________


SELECT * FROM [1080].[ProcessedQueries_Sqlshare_2.csv] order by keywords desc;


________________________________________


SELECT time, Long FROM [table_Tokyo_0_3Mbined_data.csv]



________________________________________


SELECT time, Long, Lat FROM [Tokyo_0_3Mbined_data.csv]



________________________________________


SELECT time, [long.dc] , [lat.dc], [speed.km.h.], T1, T2, C1, S, [O2.Conc..uM.], [Air.Sat....], [Temp..Deg.] FROM [Tokyo_0_3Mbined_data.csv]



________________________________________


SELECT time, [long.dc] , [lat.dc], [speed.km.h.], T1, T2, C1, [O2.Conc..uM.], [Air.Sat....], [Temp..Deg.] FROM [Tokyo_0_3Mbined_data.csv]



________________________________________


SELECT T1, C1, S, SV, T2, [O2.Conc..uM.],[X.NO3..uMol.L.],[X.NO3..mg.L.],[speed.km.h.], Lat, [N.S], Long, [E.W]
  FROM [1002].[Tokyo_0_raw_data_all.csv]



________________________________________


SELECT T1, C1, S, SV, T2, [O2.Conc..uM.],[X.NO3..uMol.L.],[X.NO3..mg.L.],[speed.km.h.], Lat, [N.S], Long, [E.W]
  FROM [1002].[Tokyo_1_raw_data_all.csv]



________________________________________


SELECT T1, C1, S, SV, T2, [O2.Conc..uM.],[X.NO3..uMol.L.],[X.NO3..mg.L.]
  FROM [1002].[Tokyo_1_raw_data_all.csv]



________________________________________


SELECT T1, C1, S, SV, T2, [O2.Conc..uM.],[X.NO3..uMol.L.],[X.NO3..mg.L.]
  FROM [1002].[Tokyo_1_raw_data_all.csv]



________________________________________


SELECT T1, C1, S, SV, T2, [O2.Conc..uM.],[X.NO3..uMol.L.],[X.NO3..mg.L.]
  FROM [1002].[Tokyo_0_raw_data_all.csv]


________________________________________


SELECT T1, C1, S, SV, T2, [O2.Conc..uM.],[X.NO3..uMol.L.],[X.NO3..mg.L.]
  FROM [1002].[Tokyo_0_raw_data_all.csv]



________________________________________


SELECT T1, C1, S, SV, T2, [O2.Conc..uM.],[X.NO3..uMol.L.],[X.NO3..mg.L.]
  FROM [1002].[Tokyo_1_raw_data_all.csv]



________________________________________


SELECT top 100 * 
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t
 WHERE o.date = t.date
   AND o.time = t.time



________________________________________


SELECT count(*) 
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t
 WHERE o.date = t.date
   AND o.time = t.time



________________________________________


SELECT count(*) 
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[table_Tokyo_0_suna.csv] s
 WHERE o.date = t.date
   AND o.time = t.time
  
   AND o.date = s.date
   AND o.time = s.time



________________________________________


SELECT [O2.Conc..uM.],[Air.Sat....],[Temp..Deg.],T1, C1, S, SV, T2
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t
 WHERE o.date = t.date
   AND o.time = t.time



________________________________________


SELECT top 1000 date, time 
  FROM [1002].[Tokyo_1_suna.csv]
order by date, time



________________________________________


SELECT date,count(*)
  FROM [1002].[Tokyo_1_suna.csv]
group by date



________________________________________


SELECT date,count(*)
  FROM [1002].[Tokyo_1_suna.csv]
group by date
  order by date



________________________________________


SELECT date,isdate(date), count(*)
  FROM [1002].[Tokyo_1_suna.csv]
group by date
 order by date



________________________________________


--SELECT date,isdate(date) as x, count(*)
--  FROM [1002].[Tokyo_1_suna.csv]
--group by date
-- order by date

select isdate(160511);



________________________________________


--SELECT date,isdate(date) as x, count(*)
--  FROM [1002].[Tokyo_1_suna.csv]
--group by date
-- order by date

select datepart(month, isdate(160511));



________________________________________


--SELECT date,isdate(date) as x, count(*)
--  FROM [1002].[Tokyo_1_suna.csv]
--group by date
-- order by date

select datepart(month, cast('160511' as date));



________________________________________


--SELECT date,isdate(date) as x, count(*)
--  FROM [1002].[Tokyo_1_suna.csv]
--group by date
-- order by date

select datepart(year, cast('160511' as date));



________________________________________


--SELECT date,isdate(date) as x, count(*)
--  FROM [1002].[Tokyo_1_suna.csv]
--group by date
-- order by date

select substring('160511',0,2) as day
     , substring('160511',2,4) as month
     , substring('160511',4,6) as year
  ;



________________________________________


--SELECT date,isdate(date) as x, count(*)
--  FROM [1002].[Tokyo_1_suna.csv]
--group by date
-- order by date

select substring('160511',0,2) as day
     , substring('160511',2,2) as month
     , substring('160511',4,2) as year
  ;



________________________________________


--SELECT date,isdate(date) as x, count(*)
--  FROM [1002].[Tokyo_1_suna.csv]
--group by date
-- order by date

select substring('160511',1,2) as day
     , substring('160511',3,2) as month
     , substring('160511',5,2) as year
  ;



________________________________________


--SELECT date,isdate(date) as x, count(*)
--  FROM [1002].[Tokyo_1_suna.csv]
--group by date
-- order by date

--select month + '/' + day + '/' + year as date)  
--  from

select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(stime,len(time) - 3,2) as minutes
     , substring(stime,len(time) - 1,2) as seconds
     , substring(stime,1,len(time) - 4) as hour
     , *
  from (
select cast(time as varchar) as stime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x



________________________________________


--SELECT date,isdate(date) as x, count(*)
--  FROM [1002].[Tokyo_1_suna.csv]
--group by date
-- order by date

--select month + '/' + day + '/' + year as date)  
--  from

select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(stime,len(time) - 3,2) as minutes
     , substring(stime,len(time) - 1,2) as seconds
     , substring(stime,1,len(time) - 4) as hour
     , *
  from (
select cast(time as varchar) as stime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x



________________________________________


select cast(time as varchar) as stime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]


________________________________________


select cast(time as varchar) as stime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  where len(cast(time as varchar)) < 4



________________________________________


select cast(time as varchar) as stime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
order by time asc



________________________________________


select date, min(time), max(time), count(time)
from [1002].[Tokyo_1_suna.csv]
group by date



________________________________________


select date, min(time)
from [1002].[Tokyo_1_suna.csv]
group by date



________________________________________


select date, min(time), max(time), count(time)
from [1002].[Tokyo_1_suna.csv]
group by date



________________________________________


select date, min(time), max(time)
from [1002].[Tokyo_1_suna.csv]
group by date



________________________________________


select min(time), max(time), count(time)
from [1002].[Tokyo_1_suna.csv]
group by date



________________________________________


select min(time),count(time),max(time)
from [1002].[Tokyo_1_suna.csv]
group by date



________________________________________


--select min(time),count(time),max(time)
--from [1002].[Tokyo_1_suna.csv]
--group by date
  
select 235958 / 86400.0



________________________________________


SELECT [O2.Conc..uM.],[Air.Sat....],[Temp..Deg.],T1, C1, S, SV, T2, o.[long.dc], o.[lat.dc]
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t
 WHERE o.date = t.date
   AND o.time = t.time



________________________________________


SELECT [O2.Conc..uM.],[Air.Sat....],[Temp..Deg.],T1, C1, S, SV, T2, o.date, o.time, o.[long.dc], o.[lat.dc]
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t
 WHERE o.date = t.date
   AND o.time = t.time



________________________________________


select date, min(time)
from [1002].[Tokyo_1_suna.csv]
group by date




________________________________________


select date, time 
from [1002].[Tokyo_1_suna.csv]
order by time



________________________________________


select top 100 date, time 
from [1002].[Tokyo_1_suna.csv]
where date = '180511'
order by time



________________________________________






________________________________________


select top 100 date, time
from [1002].[Tokyo_1_suna.csv]
where date = '180511'
order by time



________________________________________


SELECT * FROM [1002].[table_Tokyo_1_suna.csv]
  order by date



________________________________________


SELECT [O2.Conc..uM.],[Air.Sat....],[Temp..Deg.],T1, C1, S, SV, T2, o.date, o.time, o.[long.dc], o.[lat.dc]
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t
 WHERE o.date = t.date
   AND o.time = t.time
  order by o.date



________________________________________


SELECT [O2.Conc..uM.],[Air.Sat....],[Temp..Deg.],[X.NO3..mg.L.],T1, C1, S, SV, T2, o.date, o.time, o.[long.dc], o.[lat.dc]
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date 
   AND o.date = s.date
   AND t.date = s.date
   AND o.time = t.time
   AND o.time = s.time
   AND t.time = s.time
  order by o.date


________________________________________


SELECT * FROM [1002].[table_Tokyo_0_mims.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_suna.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_suna.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_suna.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_1_optode.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_1_mims.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_1_tsg.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_optode.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_optode.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_suna.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_optode.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_suna.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_tsg.csv]
  order by date



________________________________________


SELECT [O2.Conc..uM.],[Air.Sat....],[Temp..Deg.],[X.NO3..uMol.L.],T1, C1, S, SV, T2, o.date, o.time, o.[long.dc], o.[lat.dc]
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_tsg.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_tsg.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_tsg.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_tsg.csv]
  order by date



________________________________________


SELECT * FROM [1002].[table_Tokyo_0_tsg.csv]
  order by date



________________________________________


SELECT avg(T1) as Temperature
FROM (
  SELECT distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
  FROM (
    SELECT *, cast(time as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data.csv]
  ) x
) bins
GROUP BY binid


________________________________________


SELECT binid
 , avg(T1) as Temperature
 , avg(S) as Salinity

FROM (
  SELECT distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
  FROM (
    SELECT *, cast(time as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data.csv]
  ) x
) bins
GROUP BY binid


________________________________________


SELECT [O2.Conc..uM.] as Oxygen
  , T1
  , C1
  , S
  , SV
  , T2
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t
 WHERE o.date = t.date
   AND o.time = t.time
  order by o.date



________________________________________


SELECT [O2.Conc..uM.] as Oxygen
  , T1
  , C1
  , S
  , SV
  , T2
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity

FROM (
  SELECT distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
  FROM (
    SELECT *, cast(time as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data.csv]
  ) x
) bins
GROUP BY binid


________________________________________


select substring(stime,1,2) as hours
     , substring(stime,3,2) as minutes 
     , substring(stime,5,2) as seconds
     , day, month, year
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y



________________________________________


select top 100 substring(stime,1,2) as hours
     , substring(stime,3,2) as minutes 
     , substring(stime,5,2) as seconds
     , day, month, year, ztime
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y



________________________________________


select top 100 substring(stime,1,2) as hours
     , substring(stime,3,2) as minutes 
     , substring(stime,5,2) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 6,6) as stime
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y



________________________________________


select top 100 substring(stime,1,2) as hours
     , substring(stime,3,2) as minutes 
     , substring(stime,5,2) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 6,6) as stime
  , time
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y



________________________________________


select top 100 substring(stime,1,2) as hours
     , substring(stime,3,2) as minutes 
     , substring(stime,5,2) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 6,6) as stime
  , time, *
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y



________________________________________


select * From (
select substring(stime,1,2) as hours
     , substring(stime,3,2) as minutes 
     , substring(stime,5,2) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 6,6) as stime
  , time
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y
)  z
where minutes > 60 or seconds > 60



________________________________________


select * From (
select substring(stime,1,2) as hours
  , cast(substring(stime,3,2) as integer) as minutes 
  , cast(substring(stime,5,2) as integer) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 6,6) as stime
  , time
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y
)  z
where minutes > 60 or seconds > 60



________________________________________


select * From (
select substring(stime,1,2) as hours
  , cast(substring(stime,3,2) as integer) as minutes 
  , cast(substring(stime,5,2) as integer) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 5,6) as stime
  , time
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y
)  z
where minutes > 60 or seconds > 60



________________________________________


select * From (
select substring(stime,1,2) as hours
  , cast(substring(stime,3,2) as integer) as minutes 
  , cast(substring(stime,5,2) as integer) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 7,6) as stime
  , time
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y
)  z
where minutes > 60 or seconds > 60



________________________________________


select * From (
select substring(stime,1,2) as hours
  , cast(substring(stime,3,2) as integer) as minutes 
  , cast(substring(stime,5,2) as integer) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 5,6) as stime
  , time
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y
)  z
where minutes > 60 or seconds > 60



________________________________________


select * From (
select substring(stime,1,2) as hours
  , substring(stime,0,2) as hours2
  , cast(substring(stime,3,2) as integer) as minutes 
  , cast(substring(stime,5,2) as integer) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 5,6) as stime
  , time
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
) y
)  z
where minutes > 60 or seconds > 60



________________________________________


select * From (
select substring(xxtime,1,2) as hours
  , substring(xxtime,0,2) as hours2
  , cast(substring(xxtime,3,2) as integer) as minutes 
  , cast(substring(xxtime,5,2) as integer) as seconds
     , day, month, year, ztime
  , substring(ztime,len(ztime) - 5,6) as stime
  , time
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as xxtime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
 ) y
) z
where minutes > 60 or seconds > 60



________________________________________


select * From (
select substring(xxtime,1,2) as hours
  , substring(xxtime,0,2) as hours2
  , cast(substring(xxtime,3,2) as integer) as minutes 
  , cast(substring(xxtime,5,2) as integer) as seconds
  , substring(ztime,len(ztime) - 5,6) as stime
 , time, ztime
  , day, month, year
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as xxtime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
 ) y
) z
where minutes > 60 or seconds > 60



________________________________________


select * From (
select substring(xxtime,1,4) as hours
  , substring(xxtime,0,2) as hours2
  , cast(substring(xxtime,3,2) as integer) as minutes 
  , cast(substring(xxtime,5,2) as integer) as seconds
  , substring(ztime,len(ztime) - 5,6) as stime
 , time, ztime
  , day, month, year
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as xxtime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
 ) y
) z
where minutes > 60 or seconds > 60



________________________________________


select * From (
  select substring(cast(time as varchar),1,4) as hours
  , substring(xxtime,0,2) as hours2
  , cast(substring(xxtime,3,2) as integer) as minutes 
  , cast(substring(xxtime,5,2) as integer) as seconds
  , substring(ztime,len(ztime) - 5,6) as stime
 , time, ztime
  , day, month, year
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as xxtime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
 ) y
) z
where minutes > 60 or seconds > 60



________________________________________


select * From (
  select substring(xxtime,1,4) as hours
  , substring(xxtime,0,2) as hours2
  , cast(substring(xxtime,3,2) as integer) as minutes 
  , cast(substring(xxtime,5,2) as integer) as seconds
  , substring(ztime,len(ztime) - 5,6) as stime
 , time, ztime, xxtime
  , day, month, year
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as xxtime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
 ) y
) z
where minutes > 60 or seconds > 60



________________________________________


select * From (
  select substring(xxtime,2,2) as hours
  , substring(xxtime,0,2) as hours2
  , cast(substring(xxtime,3,2) as integer) as minutes 
  , cast(substring(xxtime,5,2) as integer) as seconds
  , substring(ztime,len(ztime) - 5,6) as stime
 , time, ztime, xxtime
  , day, month, year
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as xxtime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
 ) y
) z
where minutes > 60 or seconds > 60



________________________________________


select * From (
  select substring(stime,2,2) as hours
  , cast(substring(stime,4,2) as integer) as minutes 
  , cast(substring(stime,6,2) as integer) as seconds
  , substring(ztime,len(ztime) - 5,6) as stime
 , time, ztime
  , day, month, year
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  
  ) x
 ) y
) z
where minutes > 60 or seconds > 60



________________________________________


select *
  From (
  select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , cast(substring(stime,2,2) as integer) as hours
     , cast(substring(stime,4,2) as integer) as minutes 
     , cast(substring(stime,6,2) as integer) as seconds
     , *
   
  from (
select substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select *
  From (
  select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select *
  From (
  select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , cast(substring(stime,1,3) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


SELECT cast(substring('008573',1,3) as integer)


________________________________________


SELECT substring('008573',1,3)


________________________________________


SELECT substring('008573',1,2)


________________________________________


select *
  From (
  select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(ztime,len(ztime) - 6,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select *
  From (
  select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(ztime,len(ztime) - 7,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select *
  From (
  select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select *
  From (
  select day + '/' + month + '/' + year as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select *
  From (
    select cast(month + '/' + day + '/' + year as date) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as date
  From (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as date
     , *
  From (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , *
  From (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , [X.NO3..uMol.L.] as NO3_in_uMol_per_L
     , [X.NO3..mg.L.] as NO3_in_mg_per_L
     , [GPS.week] as GPS_week
     , [seconds.in.week] as seconds_in_week 
     , [long.dc] as longitude
     , [lat.dc] as latitude
  From (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , [X.NO3..uMol.L.] as NO3_in_uMol_per_L
     , [X.NO3..mg.L.] as NO3_in_mg_per_L
     , [GPS.week] as GPS_week
     , [seconds.in.week] as seconds_in_week 
  From (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from [1002].[Tokyo_1_suna.csv]
  ) x
 ) y
) z



________________________________________


select dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , [X.NO3..uMol.L.] as NO3_in_uMol_per_L
     , [X.NO3..mg.L.] as NO3_in_mg_per_L
     , [GPS.week] as GPS_week
     , [seconds.in.week] as seconds_in_week 
  From (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from (
  SELECT * FROM [1002].[Tokyo_1_suna.csv]
  UNION 
  SELECT * FROM [1002].[Tokyo_0_suna.csv] 
) u
) x
 ) y
) z



________________________________________


select dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , [X.NO3..uMol.L.] as NO3_in_uMol_per_L
     , [X.NO3..mg.L.] as NO3_in_mg_per_L
     , [GPS.week] as GPS_week
     , [seconds.in.week] as seconds_in_week 
  From (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from (
  SELECT 'Tokyo_0' as source, * FROM [1002].[Tokyo_1_suna.csv]
  UNION 
  SELECT 'Tokyo_1' as source, * FROM [1002].[Tokyo_0_suna.csv] 
) u
) x
 ) y
) z



________________________________________


select source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , [X.NO3..uMol.L.] as NO3_in_uMol_per_L
     , [X.NO3..mg.L.] as NO3_in_mg_per_L
     , [GPS.week] as GPS_week
     , [seconds.in.week] as seconds_in_week 
  From (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes 
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from (
  SELECT 'Tokyo_0' as source, * FROM [1002].[Tokyo_1_suna.csv]
  UNION 
  SELECT 'Tokyo_1' as source, * FROM [1002].[Tokyo_0_suna.csv] 
) u
) x
 ) y
) z



________________________________________


SELECT 'Tokyo_1' as source, cast([Temp..Deg.] as float)
    FROM [1002].[Tokyo_1_optode.csv]
--  UNION
--  SELECT 'Tokyo_0' as source, * FROM [1002].[Tokyo_0_optode.csv]
 


________________________________________


SELECT 'Tokyo_1' as source, cast([CalPhase..Deg.] as float)
    FROM [1002].[Tokyo_1_optode.csv]
--  UNION
--  SELECT 'Tokyo_0' as source, * FROM [1002].[Tokyo_0_optode.csv]
 


________________________________________


SELECT 'Tokyo_1' as source, cast([O2.Conc..uM.] as float)
    FROM [1002].[Tokyo_1_optode.csv]
--  UNION
--  SELECT 'Tokyo_0' as source, * FROM [1002].[Tokyo_0_optode.csv]
 


________________________________________


SELECT 'Tokyo_1' as source, cast([Air.Sat....] as float)
    FROM [1002].[Tokyo_1_optode.csv]
--  UNION
--  SELECT 'Tokyo_0' as source, * FROM [1002].[Tokyo_0_optode.csv]
 


________________________________________


SELECT 'Tokyo_1' as source, cast([TCPhase..Deg.] as float)
    FROM [1002].[Tokyo_1_optode.csv]
--  UNION
--  SELECT 'Tokyo_0' as source, * FROM [1002].[Tokyo_0_optode.csv]
 


________________________________________


SELECT 'Tokyo_1' as source
  , cast([TCPhase..Deg.] as float)
  , cast([C1RPh..Deg.] as float)
  
    FROM [1002].[Tokyo_1_optode.csv]
--  UNION
--  SELECT 'Tokyo_0' as source, * FROM [1002].[Tokyo_0_optode.csv]
 


________________________________________


SELECT 'Tokyo_1' as source
  , cast([TCPhase..Deg.] as float)
 -- , cast([C1RPh..Deg.] as float)
  
    FROM [1002].[Tokyo_0_optode.csv]
--  UNION
--  SELECT 'Tokyo_0' as source, * FROM [1002].[Tokyo_0_optode.csv]
 


________________________________________


--SELECT 'Tokyo_1' as source
 -- , cast([TCPhase..Deg.] as float)
--    , cast([C1RPh..Deg.] as float) 
--    FROM [1002].[Tokyo_0_optode.csv]
--  UNION
  SELECT 'Tokyo_0' as source, *
    FROM [1002].[Tokyo_0_optode.csv]
    where isnumeric([C1RPh..Deg.]) = 0 



________________________________________


--SELECT 'Tokyo_1' as source
 -- , cast([TCPhase..Deg.] as float)
--    , cast([C1RPh..Deg.] as float) 
--    FROM [1002].[Tokyo_0_optode.csv]
--  UNION
  SELECT date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , Instrument
     , case when [Serial.] = 'NA' then NULL else [Serial.] end as serial
     , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as O2_conc_in_uM
     , case when [Air.Sat....] = 'NA' then NULL else [Air.Sat....] end as air_saturation
     , case when [Temp..Deg.] = 'NA' then NULL else [Temp..Deg.] end as temperature_in_C
     , case when [CalPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as calphase
     , case when [TCPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as tcphase
     , case when [C1RPh..Deg.] = 'NA' then NULL else [C1RPh..Deg.] end as C1rph
     , case when [C2RPh..Deg.] = 'NA' then NULL else [C2RPh..Deg.] end as C2rph
     , case when [C1Amp..mV.] = 'NA' then NULL else [C1Amp..mV.] end as C1amp_in_mv
     , case when [C2Amp..mV.] = 'NA' then NULL else [C2Amp..mV.] end as C2amp_in_mv
     , case when [RawTemp..mV.]  = 'NA' then NULL else [RawTemp..mV.] end as rawtemp_in_mv
     , [C.Star.serial.] as C_star_serial
     , [Reference.raw] as reference_raw
     , [Signal.raw] as signal_raw
     , [Corrected.signal] as corrected_signal
     , [Calc..beam.c] as calc_beam_c
     , [Internal.thermistor] as internal_thermistor
     , [GPS.week] as gps_week
     , [seconds.in.week] as seconds_in_week
    FROM [1002].[Tokyo_0_optode.csv]
    where isnumeric([C.Star.serial.]) = 0 



________________________________________


--SELECT 'Tokyo_1' as source
 -- , cast([TCPhase..Deg.] as float)
--    , cast([C1RPh..Deg.] as float) 
--    FROM [1002].[Tokyo_0_optode.csv]
--  UNION
  SELECT date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , Instrument
     , case when [Serial.] = 'NA' then NULL else [Serial.] end as serial
     , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as O2_conc_in_uM
     , case when [Air.Sat....] = 'NA' then NULL else [Air.Sat....] end as air_saturation
     , case when [Temp..Deg.] = 'NA' then NULL else [Temp..Deg.] end as temperature_in_C
     , case when [CalPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as calphase
     , case when [TCPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as tcphase
     , case when [C1RPh..Deg.] = 'NA' then NULL else [C1RPh..Deg.] end as C1rph
     , case when [C2RPh..Deg.] = 'NA' then NULL else [C2RPh..Deg.] end as C2rph
     , case when [C1Amp..mV.] = 'NA' then NULL else [C1Amp..mV.] end as C1amp_in_mv
     , case when [C2Amp..mV.] = 'NA' then NULL else [C2Amp..mV.] end as C2amp_in_mv
     , case when [RawTemp..mV.]  = 'NA' then NULL else [RawTemp..mV.] end as rawtemp_in_mv
     , [C.Star.serial.] as C_star_serial
     , [Reference.raw] as reference_raw
     , [Signal.raw] as signal_raw
     , [Corrected.signal] as corrected_signal
     , [Calc..beam.c] as calc_beam_c
     , [Internal.thermistor] as internal_thermistor
     , [GPS.week] as gps_week
     , [seconds.in.week] as seconds_in_week
    FROM [1002].[Tokyo_0_optode.csv]
    where isnumeric([Reference.raw]) = 0 



________________________________________


--SELECT 'Tokyo_1' as source
 -- , cast([TCPhase..Deg.] as float)
--    , cast([C1RPh..Deg.] as float) 
--    FROM [1002].[Tokyo_0_optode.csv]
--  UNION
  SELECT date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , Instrument
     , case when [Serial.] = 'NA' then NULL else [Serial.] end as serial
     , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as O2_conc_in_uM
     , case when [Air.Sat....] = 'NA' then NULL else [Air.Sat....] end as air_saturation
     , case when [Temp..Deg.] = 'NA' then NULL else [Temp..Deg.] end as temperature_in_C
     , case when [CalPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as calphase
     , case when [TCPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as tcphase
     , case when [C1RPh..Deg.] = 'NA' then NULL else [C1RPh..Deg.] end as C1rph
     , case when [C2RPh..Deg.] = 'NA' then NULL else [C2RPh..Deg.] end as C2rph
     , case when [C1Amp..mV.] = 'NA' then NULL else [C1Amp..mV.] end as C1amp_in_mv
     , case when [C2Amp..mV.] = 'NA' then NULL else [C2Amp..mV.] end as C2amp_in_mv
     , case when [RawTemp..mV.]  = 'NA' then NULL else [RawTemp..mV.] end as rawtemp_in_mv
     , [C.Star.serial.] as C_star_serial
     , [Reference.raw] as reference_raw
     , [Signal.raw] as signal_raw
     , [Corrected.signal] as corrected_signal
     , [Calc..beam.c] as calc_beam_c
     , [Internal.thermistor] as internal_thermistor
     , [GPS.week] as gps_week
     , [seconds.in.week] as seconds_in_week
    FROM [1002].[Tokyo_0_optode.csv]



________________________________________


SELECT 'Tokyo_1' as source
     , date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , Instrument
     , case when [Serial.] = 'NA' then NULL else [Serial.] end as serial
     , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as O2_conc_in_uM
     , case when [Air.Sat....] = 'NA' then NULL else [Air.Sat....] end as air_saturation
     , case when [Temp..Deg.] = 'NA' then NULL else [Temp..Deg.] end as temperature_in_C
     , case when [CalPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as calphase
     , case when [TCPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as tcphase
     , case when [C1RPh..Deg.] = 'NA' then NULL else [C1RPh..Deg.] end as C1rph
     , case when [C2RPh..Deg.] = 'NA' then NULL else [C2RPh..Deg.] end as C2rph
     , case when [C1Amp..mV.] = 'NA' then NULL else [C1Amp..mV.] end as C1amp_in_mv
     , case when [C2Amp..mV.] = 'NA' then NULL else [C2Amp..mV.] end as C2amp_in_mv
     , case when [RawTemp..mV.]  = 'NA' then NULL else [RawTemp..mV.] end as rawtemp_in_mv
     , [C.Star.serial.] as C_star_serial
     , [Reference.raw] as reference_raw
     , [Signal.raw] as signal_raw
     , [Corrected.signal] as corrected_signal
     , [Calc..beam.c] as calc_beam_c
     , [Internal.thermistor] as internal_thermistor
     , [GPS.week] as gps_week
     , [seconds.in.week] as seconds_in_week
FROM [1002].[Tokyo_0_optode.csv]
  UNION
  SELECT 'Tokyo_0' as source
     , date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , Instrument
     , case when [Serial.] = 'NA' then NULL else [Serial.] end as serial
     , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as O2_conc_in_uM
     , case when [Air.Sat....] = 'NA' then NULL else [Air.Sat....] end as air_saturation
     , case when [Temp..Deg.] = 'NA' then NULL else [Temp..Deg.] end as temperature_in_C
     , case when [CalPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as calphase
     , case when [TCPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as tcphase
     , case when [C1RPh..Deg.] = 'NA' then NULL else [C1RPh..Deg.] end as C1rph
     , case when [C2RPh..Deg.] = 'NA' then NULL else [C2RPh..Deg.] end as C2rph
     , case when [C1Amp..mV.] = 'NA' then NULL else [C1Amp..mV.] end as C1amp_in_mv
     , case when [C2Amp..mV.] = 'NA' then NULL else [C2Amp..mV.] end as C2amp_in_mv
     , case when [RawTemp..mV.]  = 'NA' then NULL else [RawTemp..mV.] end as rawtemp_in_mv
     , [C.Star.serial.] as C_star_serial
     , [Reference.raw] as reference_raw
     , [Signal.raw] as signal_raw
     , [Corrected.signal] as corrected_signal
     , [Calc..beam.c] as calc_beam_c
     , [Internal.thermistor] as internal_thermistor
     , [GPS.week] as gps_week
     , [seconds.in.week] as seconds_in_week
    FROM [1002].[Tokyo_0_optode.csv]



________________________________________


  SELECT 'Tokyo_0' as source
     , date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , Instrument
     , case when [Serial.] = 'NA' then NULL else [Serial.] end as serial
     , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as O2_conc_in_uM
     , case when [Air.Sat....] = 'NA' then NULL else [Air.Sat....] end as air_saturation
     , case when [Temp..Deg.] = 'NA' then NULL else [Temp..Deg.] end as temperature_in_C
     , case when [CalPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as calphase
     , case when [TCPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as tcphase
     , case when [C1RPh..Deg.] = 'NA' then NULL else [C1RPh..Deg.] end as C1rph
     , case when [C2RPh..Deg.] = 'NA' then NULL else [C2RPh..Deg.] end as C2rph
     , case when [C1Amp..mV.] = 'NA' then NULL else [C1Amp..mV.] end as C1amp_in_mv
     , case when [C2Amp..mV.] = 'NA' then NULL else [C2Amp..mV.] end as C2amp_in_mv
     , case when [RawTemp..mV.]  = 'NA' then NULL else [RawTemp..mV.] end as rawtemp_in_mv
     , [C.Star.serial.] as C_star_serial
     , [Reference.raw] as reference_raw
     , [Signal.raw] as signal_raw
     , [Corrected.signal] as corrected_signal
     , [Calc..beam.c] as calc_beam_c
     , [Internal.thermistor] as internal_thermistor
     , [GPS.week] as gps_week
     , [seconds.in.week] as seconds_in_week
    FROM [1002].[Tokyo_0_optode.csv]
  UNION

SELECT 'Tokyo_1' as source
     , date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , Instrument
     , case when [Serial.] = 'NA' then NULL else [Serial.] end as serial
     , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as O2_conc_in_uM
     , case when [Air.Sat....] = 'NA' then NULL else [Air.Sat....] end as air_saturation
     , case when [Temp..Deg.] = 'NA' then NULL else [Temp..Deg.] end as temperature_in_C
     , case when [CalPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as calphase
     , case when [TCPhase..Deg.] = 'NA' then NULL else [CalPhase..Deg.] end as tcphase
     , case when [C1RPh..Deg.] = 'NA' then NULL else [C1RPh..Deg.] end as C1rph
     , case when [C2RPh..Deg.] = 'NA' then NULL else [C2RPh..Deg.] end as C2rph
     , case when [C1Amp..mV.] = 'NA' then NULL else [C1Amp..mV.] end as C1amp_in_mv
     , case when [C2Amp..mV.] = 'NA' then NULL else [C2Amp..mV.] end as C2amp_in_mv
     , case when [RawTemp..mV.]  = 'NA' then NULL else [RawTemp..mV.] end as rawtemp_in_mv
     , [C.Star.serial.] as C_star_serial
     , [Reference.raw] as reference_raw
     , [Signal.raw] as signal_raw
     , [Corrected.signal] as corrected_signal
     , [Calc..beam.c] as calc_beam_c
     , [Internal.thermistor] as internal_thermistor
     , [GPS.week] as gps_week
     , [seconds.in.week] as seconds_in_week
FROM [1002].[Tokyo_0_optode.csv]




________________________________________


--SELECT *
--  FROM [1002].[Tokyo_0_tsg.csv]
--  UNION
SELECT * 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE Isnumeric(T1) = 0



________________________________________


--SELECT *
--  FROM [1002].[Tokyo_0_tsg.csv]
--  UNION
SELECT * 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE Isnumeric(C1) = 0



________________________________________


--SELECT 
--  FROM [1002].[Tokyo_0_tsg.csv]
--  UNION
SELECT Instr as instrument
     , date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , case when C1 = 'NA' then NULL else C1 end as C1
     , S, SV, T2
     , [GPS.week] as gps_week
     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE Isnumeric(C1) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
     , case when T1 = 'NA' then NULL else T1 end as T1
     , case when C1 = 'NA' then NULL else C1 end as C1
     , case when S = 'NA' then NULL else S end as S
     , case when SV = 'NA' then NULL else SV end as SV
     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(S) = 0
  or isnumeric(SV) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
     , case when T1 = 'NA' then NULL else T1 end as T1
     , case when C1 = 'NA' then NULL else C1 end as C1
     , case when S = 'NA' then NULL else S end as S
     , case when SV = 'NA' then NULL else SV end as SV
     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(T1) = 0
  or isnumeric(T2) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
     , case when T1 = 'NA' then NULL else T1 end as T1
     , case when C1 = 'NA' then NULL else C1 end as C1
     , case when S = 'NA' then NULL else S end as S
     , case when SV = 'NA' then NULL else SV end as SV
     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(Instr) = 1



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(Instr) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(T1) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  , T1
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(T1) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(T1) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(T1) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--     , case when T1 = 'NA' then NULL else T1 end as T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
     , case when 'NA' = x then NULL else x end as x
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM (SELECT *
,    cast(T1 as varchar) as x 
    FROM [1002].[Tokyo_1_tsg.csv]
  ) b
--  WHERE isnumeric(T1) = 0



________________________________________


SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
       , T1 
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_0_tsg.csv]
UNION
SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
       , T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM [1002].[Tokyo_1_tsg.csv]
--  WHERE isnumeric(T1) = 0



________________________________________


SELECT Instr as instrument
     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
       , T1 
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_0_tsg.csv]
UNION
SELECT Instr as instrument
     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
       , T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM [1002].[Tokyo_1_tsg.csv]
--  WHERE isnumeric(T1) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--       , T1 
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
     , date, time
     , [long.dc] as longitude
--     , [lat.dc] as latitude
       , T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([long.dc]) = 0



________________________________________


--SELECT Instr as instrument
--     , date, time
--     , [long.dc] as longitude
--     , [lat.dc] as latitude
--       , T1 
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
--  FROM [1002].[Tokyo_0_tsg.csv]
--UNION
SELECT Instr as instrument
     , date, time
     , [long.dc] as longitude
--     , [lat.dc] as latitude
       , T1
--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM [1002].[Tokyo_0_tsg.csv]
  WHERE isnumeric([long.dc]) = 0



________________________________________


SELECT Instr as instrument
     , date, time
       , case when [long.DC] = 'NA' then NULL else [long.DC] end as longitude
--     , [lat.dc] as latitude
       , T1 
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_0_tsg.csv]
UNION
SELECT Instr as instrument
     , date, time
     , [long.dc] as longitude
 --    , [lat.dc] as latitude
       , T1

--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([long.dc]) = 0



________________________________________


SELECT Instr as instrument
     , date, time
       , case when [long.DC] = 'NA' then NULL else [long.DC] end as longitude
       , case when [lat.DC] = 'NA' then NULL else [lat.DC] end as longitude
       , T1 
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_0_tsg.csv]
UNION
SELECT Instr as instrument
     , date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1

--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([long.dc]) = 0



________________________________________


SELECT Instr as instrument
     , date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1 
--     , case when C1 = 'NA' then NULL else C1 end as C1
--     , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 
  FROM [1002].[Tokyo_0_tsg.csv]
    WHERE isnumeric([lat.dc]) = 1
    AND isnumeric([long.dc]) = 1
UNION
SELECT Instr as instrument
     , date, time
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1

--     , case when C1 = 'NA' then NULL else C1 end as C1
 --    , case when S = 'NA' then NULL else S end as S
--     , case when SV = 'NA' then NULL else SV end as SV
--     , case when T2 = 'NA' then NULL else T2 end as T2
--     , [GPS.week] as gps_week
--     , [seconds.in.week] as secondds_in_week 

  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([lat.dc]) = 1 
    AND isnumeric([long.dc]) = 1



________________________________________


SELECT *
  FROM [1002].[Tokyo_0_tsg.csv]
 WHERE isnumeric([lat.dc]) = 1
   AND isnumeric([long.dc]) = 1
UNION
SELECT *
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([lat.dc]) = 1 
    AND isnumeric([long.dc]) = 1



________________________________________


SELECT 'Tokyo_0' as source, *
  FROM [1002].[Tokyo_0_tsg.csv]
 WHERE isnumeric([lat.dc]) = 1
   AND isnumeric([long.dc]) = 1
UNION
SELECT 'Tokyo_1' as source, *
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([lat.dc]) = 1 
    AND isnumeric([long.dc]) = 1



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , *
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    


________________________________________


SELECT source
     --, dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , *
  FROM (
    select --cast(month + '/' + day + '/' + year as datetime) as ddate
      cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_optode_no_NA]
) x
) y
) z    


________________________________________


SELECT source
     --, dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , *
  FROM (
    select --cast(month + '/' + day + '/' + year as datetime) as ddate
      cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_optode_no_NA]
) x
) y
) z    


________________________________________


SELECT source
     --, dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , *
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_optode_no_NA]
) x
) y
) z    


________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , *
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_optode_no_NA]
) x
) y
) z    


________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source 
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp 
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1 
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from 
  [1002].[Tokyo_tsg_cleaned]
) x
 ) y
) z    



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Instrument, serial, O2_conc_in_uM
     , air_saturation, temperature_in_C, calphase
     , tcphase, C1rph, C2rph, C1amp_in_mv, C2amp_in_mv
     , rawtemp_in_mv, C_star_serial, reference_raw
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_optode_no_NA]
) x
) y
) z    


________________________________________


SELECT cast(timestamp as float)
  FROM [1002].[Tokyo_tsg]



________________________________________


  SELECT distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x



________________________________________


SELECT binid
--  , avg(T1) as Temperature
--  , avg(S) as Salinity

FROM (
  SELECT distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
    ) y
    WHERE isdate(binid) = 1
--) bins
--GROUP BY binid    



________________________________________


SELECT timestamp
      FROM [1002].[Tokyo_tsg]
 GROUP BY timestamp



________________________________________



  SELECT  ts --distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
GROUP BY ts





________________________________________


SELECT cast(binsize as datetime) as binid
  FROM (
    SELECT 3.0 as binsize
      FROM sys.tables--[1002].[Tokyo_suna]
  ) x
GROUP BY cast(binsize as datetime)





________________________________________


SELECT cast(binsize as datetime) as binid
  FROM (
    SELECT 3.0 as binsize
      FROM [1002].[Tokyo_0_tsg.csv]
  ) x
GROUP BY cast(binsize as datetime)



________________________________________


SELECT *
  FROM 
  (
    SELECT 3.0 as binsize
  FROM (
SELECT 'Tokyo_0' as source, T1
--     , T!, C1, S, SV, T2
  FROM [1002].[Tokyo_0_tsg.csv]
 WHERE isnumeric([lat.dc]) = 1
   AND isnumeric([long.dc]) = 1
UNION
SELECT 'Tokyo_1' as source, T1
--     , T!, C1, S, SV, T2
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([lat.dc]) = 1 
    AND isnumeric([long.dc]) = 1
  ) x
    ) y
GROUP BY binsize



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z 


________________________________________


SELECT [O2.Conc..uM.] as Oxygen
  , [X.NO3..uMol.L.] as Nitrate
  , T1
  , C1
  , S
  , SV
  , T2
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , Nitrate
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
FROM (
  SELECT distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
  FROM (
    SELECT *, cast(time as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data.csv]
  ) x
) bins
GROUP BY binid


________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , Nitrate
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , Nitrate
     , T1
     , C1
     , S
     , SV
     , T2
     , case when [Oxygen] = 'NA' then NULL else [Oxygen] end
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , Nitrate
     , T1
     , C1
     , S
     , SV
     , T2
     , case when [Oxygen] = 'NA' then NULL else [Oxygen] end
     , case when [longitude] = 'NA' then NULL else [longitude] end
     , case when [latitude] = 'NA' then NULL else [latitude] end
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity

FROM (
  SELECT distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
  FROM (
    SELECT *, cast(time as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data.csv]
  ) x
) bins
GROUP BY binid


________________________________________


SELECT [O2.Conc..uM.] as Oxygen
  , [X.NO3..uMol.L.] as Nitrate
  , T1
  , C1
  , S
  , SV
  , T2
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end
  , case when o.[long.dc] = 'NA' then NULL else o.[long.dc] end
  , case when o.[lat.dc] = 'NA' then NULL else o.[lat.dc] end
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT [O2.Conc..uM.] as Oxygen
  , [X.NO3..uMol.L.] as Nitrate
  , T1
  , C1
  , S
  , SV
  , T2
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as  Oxygen
  , case when o.[long.dc] = 'NA' then NULL else o.[long.dc] end as longitude
  , case when o.[lat.dc] = 'NA' then NULL else o.[lat.dc] end as latitude
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT [X.NO3..uMol.L.] as Nitrate
  , T1
  , C1
  , S
  , SV
  , T2
  , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as  Oxygen
  , o.date
  , o.time
  , case when o.[long.dc] = 'NA' then NULL else o.[long.dc] end as longitude
  , case when o.[lat.dc] = 'NA' then NULL else o.[lat.dc] end as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , Nitrate
     , T1
     , C1
     , S
     , SV
     , T2
   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t
 WHERE o.date = t.date
   AND o.time = t.time
  order by o.date



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , Nitrate
     , T1
     , C1
     , S
     , SV
     , T2
   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , case when [X.NO3..uMol.L.] = 'NA' then NULL else [X.NO3..uMol.L.] end as  Nitrate
  , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as  Oxygen
  , o.date
  , o.time
  , case when o.[long.dc] = 'NA' then NULL else o.[long.dc] end as longitude
  , case when o.[lat.dc] = 'NA' then NULL else o.[lat.dc] end as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , Nitrate
     , T1
     , C1
     , S
     , SV
     , T2
   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , Nitrate
     , T1
     , C1
     , S
     , SV
     , T2
   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t
 WHERE o.date = t.date
   AND o.time = t.time
  order by o.date



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 



________________________________________


select *
  from [1002].[Tokyo_0_merged_data.csv]
  Where longitude = '2.'



________________________________________


select *
  from [1002].[Tokyo_0_merged_data.csv]
  Where latitude = '2.'



________________________________________


select *
  from [1002].[Tokyo_0_merged_data.csv]
  Where Oxygen = '2.'



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , case when [X.NO3..uMol.L.] = 'NA' then NULL else [X.NO3..uMol.L.] end as  Nitrate
  , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as  Oxygen
  , case when o.time = '12.03' then NULL else o.time end as  time
  , case when o.date = '5.46' then NULL else o.date end as  date
  , case when o.[long.dc] = 'NA' then NULL else o.[long.dc] end as longitude
  , case when o.[lat.dc] = 'NA' then NULL else o.[lat.dc] end as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity

FROM (
  SELECT distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid


________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , longitude, latitude
     , Oxygen
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z 
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 
  order by timestamp



________________________________________


SELECT  *
 , case when [X.NO3..uMol.L.] = 'NA' then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  FROM [1002].[table_Tokyo_1_suna.csv]


________________________________________


SELECT * FROM [1002].[table_Tokyo_0_suna.csv]
  order by date



________________________________________


SELECT  * FROM [1002].[table_Tokyo_1_suna.csv]


________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , case when [X.NO3..uMol.L.] = 'NA' then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as  Oxygen
  , case when o.time = '12.03' then NULL else o.time end as  time
  , case when o.date = '5.46' then NULL else o.date end as  date
  , case when o.[long.dc] = 'NA' then NULL else o.[long.dc] end as longitude
  , case when o.[lat.dc] = 'NA' then NULL else o.[lat.dc] end as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z 
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , substring('0' + cast(date as varchar), len('0' + cast(date as varchar)) - 5, 6)  as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 
  order by timestamp



________________________________________


SELECT * 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(C1) = 0



________________________________________


SELECT * 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(T1) = 0



________________________________________


SELECT * 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(C1) = 0
     and C1 != 'NA'



________________________________________


SELECT *
  FROM 
  (
    SELECT 3.0 as binsize
  FROM (
SELECT 'Tokyo_0' as source
    --, T1
    , cast(C1 as varchar) as C1
--         , case when C1 = 'NA' then NULL else C1 end as C1
    --   , T!, C1, S, SV, T2
  FROM [1002].[Tokyo_0_tsg.csv]
 WHERE isnumeric([lat.dc]) = 1
   AND isnumeric([long.dc]) = 1
UNION
SELECT 'Tokyo_1' as source
   --  , case when T1 = 'NA' then NULL else T1 end as T1
     , case when C1 = 'NA' then NULL else C1 end as C1
--     , T!, C1, S, SV, T2
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([lat.dc]) = 1 
    AND isnumeric([long.dc]) = 1
  ) x
    ) y
GROUP BY binsize



________________________________________


SELECT *
  FROM 
  (
    SELECT 3.0 as binsize
  FROM (
SELECT 'Tokyo_0' as source
    , T1
    , cast(C1 as varchar) as C1
    , S, SV, T2
  FROM [1002].[Tokyo_0_tsg.csv]
 WHERE isnumeric([lat.dc]) = 1
   AND isnumeric([long.dc]) = 1
UNION
SELECT 'Tokyo_1' as source
    , T1 
    , case when C1 = 'NA' then NULL else C1 end as C1
    , S, SV, T2
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([lat.dc]) = 1 
    AND isnumeric([long.dc]) = 1
  ) x
    ) y
GROUP BY binsize



________________________________________


SELECT * 
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric(S) = 0
     or isnumeric(SV) = 0



________________________________________


SELECT 'Tokyo_0' as source
    , Instr
    , [long.dc]
    , [lat.dc]
    , T1
    , cast(C1 as varchar) as C1
    , S
    , SV
    , T2
  FROM [1002].[Tokyo_0_tsg.csv]
 WHERE isnumeric([lat.dc]) = 1
   AND isnumeric([long.dc]) = 1
UNION
SELECT 'Tokyo_1' as source
    , Instr
    , [long.dc]
    , [lat.dc]
    , T1 
    , case when C1 = 'NA' then NULL else C1 end as C1
    , S
    , SV
    , T2
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([lat.dc]) = 1 
    AND isnumeric([long.dc]) = 1



________________________________________


SELECT 'Tokyo_0' as source
    , Instr
    , date, time
    , [long.dc]
    , [lat.dc]
    , T1
    , cast(C1 as varchar) as C1
    , S
    , SV
    , T2
  FROM [1002].[Tokyo_0_tsg.csv]
 WHERE isnumeric([lat.dc]) = 1
   AND isnumeric([long.dc]) = 1
UNION
SELECT 'Tokyo_1' as source
    , Instr
    , date, time
    , [long.dc]
    , [lat.dc]
    , T1 
    , case when C1 = 'NA' then NULL else C1 end as C1
    , S
    , SV
    , T2
  FROM [1002].[Tokyo_1_tsg.csv]
  WHERE isnumeric([lat.dc]) = 1 
    AND isnumeric([long.dc]) = 1



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z    


________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z    


________________________________________


--SELECT binid
--  , avg(T1) as Temperature
--  , avg(S) as Salinity

--FROM (
  SELECT --distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
--) bins
--GROUP BY binid


________________________________________


--SELECT binid
--  , avg(T1) as Temperature
--  , avg(S) as Salinity

--FROM (
  SELECT distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
--) bins
--GROUP BY binid


________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity

FROM (
  SELECT --distinct cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        3.0 as binid, *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid


________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z    


________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z    


________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z    


________________________________________


SELECT binid
--  , avg(T1) as Temperature
--  , avg(S) as Salinity

FROM (
  SELECT -- distinct cast(
    floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as binid 
    --as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
  WHERE isdate(binid) = 0 
--GROUP BY binid


________________________________________


SELECT binid, timestamp, ts
--  , avg(T1) as Temperature
--  , avg(S) as Salinity

FROM (
  SELECT -- distinct cast(
    floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as binid 
    --as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
  WHERE isdate(binid) = 0 
--GROUP BY binid


________________________________________


SELECT binid, timestamp, ts, cast(binid as datetime) 
--  , avg(T1) as Temperature
--  , avg(S) as Salinity

FROM (
  SELECT -- distinct cast(
    floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as binid 
    --as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
  --WHERE cast(binid as datetime) 
--GROUP BY binid


________________________________________


SELECT binid FROM (
SELECT binid, timestamp, ts, cast(binid as datetime) c
--  , avg(T1) as Temperature
--  , avg(S) as Salinity

FROM (
  SELECT -- distinct cast(
    floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as binid 
    --as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
  ) remove
  --WHERE cast(binid as datetime) 
GROUP BY binid


________________________________________


SELECT binid FROM (
SELECT binid, timestamp, ts, cast(binid as datetime) c
--  , avg(T1) as Temperature
--  , avg(S) as Salinity

FROM (
  SELECT -- distinct cast(
    floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as binid 
    --as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
  ) remove
  --WHERE cast(binid as datetime) 
GROUP BY binid


________________________________________


--SELECT binid FROM (
SELECT binid
 -- timestamp, ts, cast(binid as datetime) c
  , avg(T1) as Temperature
  , avg(S) as Salinity

FROM (
  SELECT -- distinct cast(
 -- cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
--ts as binid
  3 as binid
  --as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
--  ) remove
  --WHERE cast(binid as datetime) 
GROUP BY binid


________________________________________


SELECT binid
  --, avg(T1) 
  from (
SELECT source
     , ddate as binid
     --, dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select --cast(
      month + '/' + day + '/' + year  as ddate
--      as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z    
  ) 1358
    where isdate(binid) = 0
 --   group by binid



________________________________________


SELECT binid
  --, avg(T1) 
  from (
SELECT source
     , ddate as binid
     --, dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
  FROM (
    select --cast(
      month + '/' + day + '/' + year  as ddate
    --    as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z    
  ) 1358
    where isdate(binid) = 0
 --   group by binid



________________________________________


SELECT binid, sdate
  --, avg(T1) 
  from (
SELECT source
     , ddate as binid
     --, dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
     , sdate
  FROM (
    select --cast(
      month + '/' + day + '/' + year  as ddate
    --    as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
select substring(sdate,1,2) as day
     , substring(sdate,3,2) as month
     , substring(sdate,5,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z    
  ) 1358
    where isdate(binid) = 0
 --   group by binid



________________________________________


SELECT binid, sdate
  --, avg(T1) 
  from (
SELECT source
     , ddate as binid
     --, dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
     , sdate
  FROM (
    select --cast(
      month + '/' + day + '/' + year  as ddate
    --    as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
    select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z    
  ) 1358
    where isdate(binid) = 0
 --   group by binid



________________________________________


SELECT source
     , dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , Instr as instrument
     , [long.dc] as longitude
     , [lat.dc] as latitude
     , T1
     , C1
     , S
     , SV
     , T2
     , sdate
  FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *
  from (
    select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
     , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_tsg_cleaned]
) x
) y
) z



________________________________________


--SELECT binid FROM (
SELECT binid
 -- timestamp, ts, cast(binid as datetime) c
  , avg(T1) as Temperature
  , avg(S) as Salinity

FROM (
  SELECT -- distinct cast(
 -- cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
--ts as binid
  3 as binid
  --as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
--  ) remove
  --WHERE cast(binid as datetime) 
GROUP BY binid


________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid


________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid


________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT * FROM [1002].[Tokyo_binned_tsg_snapshot]


________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
FROM (
  SELECT  cast(floor(ts) + floor((ts -
floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid
  order by binid asc


________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(C1) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2

FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
  , avg(longitude) as longitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
  , avg(longitude) as longitude
  , avg(latitude) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
 , avg(T1) as Temperature
 , avg(S) as Salinity
FROM (
 SELECT  cast(floor(ts) + floor((ts -
floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
 FROM (
   SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
     FROM [1002].[Tokyo_tsg]
 ) x
) bins
GROUP BY binid
 order by binid asc



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z 
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(C1) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , case when [X.NO3..uMol.L.] = 'NA' then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as  Oxygen
  , o.[long.dc] as longitude
  , o.[lat.dc] as longitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.[long.dc] as longitude
  , o.[lat.dc] as longitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , case when [X.NO3..uMol.L.] = 'NA' then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when [O2.Conc..uM.] = 'NA' then NULL else [O2.Conc..uM.] end as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , time
     , date
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , time
     , date
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , time
     , date
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time
  order by o.date



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , time
     , date
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
  , avg(longitude) as longitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(C1) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


select *
  From [1002].[Tokyo_0_merged_data.csv]
  where isnumeric(longitude) = 0



________________________________________


select *
  From [1002].[Tokyo_0_merged_data.csv]
  where isnumeric(longitude) = 1



________________________________________


select *
  From [1002].[Tokyo_0_merged_data.csv]
  where isnumeric(longitude) = 0



________________________________________


select *
  From [1002].[Tokyo_0_merged_data.csv]
  where isnumeric(latitude) = 0



________________________________________


select *
  From [1002].[Tokyo_0_merged_data.csv]
  where isnumeric(Oxygen) = 0



________________________________________


select *
  From [1002].[Tokyo_0_merged_data.csv]
  where isnumeric(C1) = 0



________________________________________


select *
  From [1002].[Tokyo_0_merged_data.csv]
  where isnumeric(Nitrate_uM) = 0



________________________________________


SELECT binid
 , avg(T1) as Temperature
 , avg(S) as Salinity
 , avg(longitude) as longitude
 , avg(latitude) as latitude
FROM (
 SELECT  cast(floor(ts) + floor((ts -
floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
 FROM (
   SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
     FROM [1002].[Tokyo_tsg]
 ) x
) bins
GROUP BY binid
 order by binid asc



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric(t.[long.dc]) = 1
  AND isnumeric(t.[lat.dc]) = 1
  AND isnumeric(s.[long.dc]) = 1
  AND isnumeric(s.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric(t.[long.dc]) = 1
  AND isnumeric(t.[lat.dc]) = 1
  AND isnumeric(s.[long.dc]) = 1
  AND isnumeric(s.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT binid
 , avg(T1) as Temperature
 , avg(S) as Salinity
 , avg(longitude) as longitude
 , avg(latitude) as latitude
FROM (
 SELECT  cast(floor(ts) + floor((ts -
floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
 FROM (
   SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
     FROM [1002].[Tokyo_tsg]
 ) x
) bins
GROUP BY binid
 order by binid asc



________________________________________


SELECT binid
 , avg(T1) as Temperature
 , avg(S) as Salinity
 , avg(longitude) as longitude
 , avg(latitude) as latitude
FROM (
 SELECT  cast(floor(ts) + floor((ts -
floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
 FROM (
   SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
     FROM [1002].[Tokyo_tsg]
 ) x
) bins
GROUP BY binid
 order by binid asc



________________________________________


SELECT binid
 , avg(T1) as Temperature
 , avg(S) as Salinity
 , avg(longitude) as longitude
 , avg(latitude) as latitude
FROM (
 SELECT  cast(floor(ts) + floor((ts -
floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
       , *
 FROM (
   SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
     FROM [1002].[Tokyo_tsg]
 ) x
) bins
GROUP BY binid
 order by binid asc



________________________________________


SELECT T1
  , cast(C1 as varchar) as C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , time
     , date
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time



________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(C1) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
  , avg(cast(longitude as float)) as longitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(time) as time
  , avg(date) as date
  , avg(T1) as T1
  , avg(C1) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
  , avg(cast(Oxygen as float)) as Oxygen
  , avg(cast(Nitrate_uM as float)) as Nitrate_uM
  , avg(cast(longitude as float)) as longitude
  , avg(cast(latitude as float)) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(C1) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
  , avg(cast(Oxygen as float)) as Oxygen
  , avg(cast(Nitrate_uM as float)) as Nitrate_uM
  , avg(cast(longitude as float)) as longitude
  , avg(cast(latitude as float)) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as T1

  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
  , avg(cast(Oxygen as float)) as Oxygen
  , avg(cast(Nitrate_uM as float)) as Nitrate_uM
  , avg(cast(longitude as float)) as longitude
  , avg(cast(latitude as float)) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
  , avg(cast(Oxygen as float)) as Oxygen
  , avg(cast(Nitrate_uM as float)) as Nitrate_uM
  , avg(cast(longitude as float)) as longitude
  , avg(cast(latitude as float)) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT T1
  , case when C1 = 'NA' then NULL else C1 end as C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT T1
  , cast(C1 as float) as C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , time
     , date
     , T1

     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT T1
  , case when C1 = 'NA' then NULL else C1 end as C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(C1) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
  , avg(cast(Oxygen as float)) as Oxygen
  , avg(cast(Nitrate_uM as float)) as Nitrate_uM
  , avg(cast(longitude as float)) as longitude
  , avg(cast(latitude as float)) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , time
     , date
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT T1
  , case when C1 = 'NA' then NULL else C1 end as C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT * FROM [1002].[table_Tokyo_1_tsg.csv]
  order by C1



________________________________________


SELECT * FROM [1002].[table_Tokyo_1_tsg.csv]
  order by C1 asc



________________________________________


SELECT * FROM [1002].[table_Tokyo_1_tsg.csv]
  order by C1 desc



________________________________________


SELECT T1
  , case when C1 = 'NA' then NULL else C1 end as C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , time
     , date
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , [X.NO3..uMol.L.] as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND isnumeric(C1) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(cast(C1 as float)) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
  , avg(cast(Oxygen as float)) as Oxygen
  , avg(cast(Nitrate_uM as float)) as Nitrate_uM
  , avg(cast(longitude as float)) as longitude
  , avg(cast(latitude as float)) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(cast(C1 as float)) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
  , avg(cast(Oxygen as float)) as Oxygen
  , avg(cast(Nitrate_uM as float)) as Nitrate_uM
  , avg(cast(longitude as float)) as longitude
  , avg(cast(latitude as float)) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , avg(T1) as T1
  , avg(C1) as C1
  , avg(S) as S
  , avg(SV) as SV
  , avg(T2) as T2
  , avg(cast(Oxygen as float)) as Oxygen
  , avg(cast(Nitrate_uM as float)) as Nitrate_uM
  , avg(cast(longitude as float)) as longitude
  , avg(cast(latitude as float)) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , round(avg(T1),3) as T1
  , round(avg(C1),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , round(avg(T1),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT T1
  , C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , [O2.Conc..uM.] as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND isnumeric([X.NO3..uMol.L.]) = 1
  AND isnumeric([O2.Conc..uM.]) = 1
  AND isnumeric(C1) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_1_optode.csv] o,
       [1002].[Tokyo_1_tsg.csv] t,
       [1002].[Tokyo_1_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time




________________________________________


SELECT T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , o.date
  , o.time
  , o.[long.dc] as longitude
  , o.[lat.dc] as latitude
  
  FROM [1002].[Tokyo_0_optode.csv] o,
       [1002].[Tokyo_0_tsg.csv] t,
       [1002].[Tokyo_0_suna.csv] s
 WHERE isnumeric(o.[long.dc]) = 1
  AND isnumeric(o.[lat.dc]) = 1
  AND o.date = t.date
  AND o.date = s.date
  AND t.date = s.date
  AND o.time = t.time
  AND o.time = s.time
  AND t.time = s.time



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
     , time
     , date
     , T1
     , C1
     , S
     , SV
     , T2
     , Oxygen
     , Nitrate_uM
     , longitude
     , latitude

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged_data.csv]
) x
) y
) z
  order by timestamp



________________________________________


SELECT binid
  , round(avg(T1),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , round(avg(T1),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT *
  FROM [1002].[Tokyo_0_merged_data_time_binned]
  
  UNION
  
SELECT *
  FROM [1002].[Tokyo_1_merged_data_time_binned] 


________________________________________


SELECT 'Tokyo_0' as source
  , *
  FROM [1002].[Tokyo_0_merged_data_time_binned]
  
  UNION
  
SELECT 'Tokyo_1' as source
  , *
  FROM [1002].[Tokyo_1_merged_data_time_binned] 


________________________________________


SELECT 'Tokyo_0' as source
  , *
  FROM [1002].[Tokyo_0_merged_data_time_binned]
  
  UNION
  
SELECT 'Tokyo_1' as source
  , *
  FROM [1002].[Tokyo_1_merged_data_time_binned] 


________________________________________


SELECT binid
  , round(avg(T1),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT 'Tokyo_0' as source, *
  FROM [1002].[Tokyo_0_merged_data_time_binned]     
 UNION    
 SELECT 'Tokyo_1' as source   , *   
 FROM [1002].[Tokyo_1_merged_data_time_binned] 



________________________________________



SELECT binid
  , avg(T1) as Temperature
  , avg(S) as Salinity
FROM (
  SELECT  cast(floor(ts) + floor((ts -
floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 5.0 as binsize
      FROM [1002].[Tokyo_tsg]
  ) x
) bins
GROUP BY binid
  order by binid asc


________________________________________


SELECT  longitude
  , latitude
  , SALINITY
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , Xaccel
  , Yaccel
  , Zaccel
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , s.time
  , s.day
  
  FROM [1002].[table_sds.tab] s, [1002].[Tokyo_0_merged_data_time.csv] t
  WHERE timestamp = s.time



________________________________________


SELECT  longitude
  , latitude
  , SALINITY
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , Xaccel
  , Yaccel
  , Zaccel
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , s.time
  , s.day
  , [file]
  
  FROM [1002].[table_sds.tab] s, [1002].[Tokyo_0_merged_data_time.csv] t
  WHERE timestamp = s.time



________________________________________


SELECT  *  
  FROM [1002].[table_sds.tab] s
  LEFT JOIN [1002].[Tokyo_0_merged_data_time.csv] t
  ON t.timestamp = s.time



________________________________________


SELECT time
FROM[1002].[sds.tab]
ORDER BY time DESC



________________________________________


SELECT time
FROM[1002].[sds.tab]
ORDER BY time



________________________________________


SELECT s.time
  , t.timestamp
FROM[1002].[sds.tab] s,
  [1002].[Tokyo_1_merged_data_time.csv] t
  ORDER BY s.time



________________________________________


SELECT ISDATE(s.time)
  , t.timestamp
FROM[1002].[sds.tab] s,
  [1002].[Tokyo_1_merged_data_time.csv] t
  ORDER BY s.time



________________________________________


SELECT s.time as time
  , t.timestamp as time
FROM[1002].[sds.tab] s,
  [1002].[Tokyo_1_merged_data_time.csv] t
  ORDER BY s.time



________________________________________


SELECT s.time as smalldatetime
  , t.timestamp as smalldatetime
FROM[1002].[sds.tab] s,
  [1002].[Tokyo_1_merged_data_time.csv] t
  ORDER BY s.time



________________________________________


SELECT cast(s.time as datetime) as time_sds
  , cast(t.timestamp as datetime) as time_tsg
FROM[1002].[sds.tab] s,
  [1002].[Tokyo_1_merged_data_time.csv] t
  ORDER BY time_sds



________________________________________


SELECT *,
  cast(s.time as datetime) as timestamp
  FROM [1002].[table_sds.tab] s 



________________________________________


SELECT TOP 1 *
FROM [1002].[Tokyo_1_merged_data_time.csv] t,[1002].[sds.tab] s
    WHERE t.timestamp <> s.timestamp
ORDER BY t.timestamp DESC


________________________________________


SELECT TOP 1 s.*
  , t.longitude
  , t.latitude
FROM [1002].[Tokyo_1_merged_data_time.csv] t,[1002].[sds.tab] s
    WHERE t.timestamp <= s.timestamp
ORDER BY t.timestamp DESC


________________________________________


SELECT TOP 1 s.*
  , t.longitude
  , t.latitude
FROM [1002].[Tokyo_1_merged_data_time.csv] t,[1002].[sds.tab] s
    WHERE t.timestamp <= s.timestamp
ORDER BY t.timestamp


________________________________________


SELECT TOP 1 s.*
  , t.longitude
  , t.latitude
FROM [1002].[Tokyo_1_merged_data_time.csv] t,[1002].[sds.tab] s
    WHERE t.timestamp <> s.timestamp
ORDER BY t.timestamp


________________________________________


SELECT s.*
  , t.longitude
  , t.latitude
FROM [1002].[Tokyo_1_merged_data_time.csv] t,[1002].[sds.tab] s
    WHERE t.timestamp <> s.timestamp
ORDER BY t.timestamp


________________________________________


SELECT s.*
  , t.timestamp
  , t.longitude
  , t.latitude
FROM [1002].[Tokyo_1_merged_data_time.csv] t,[1002].[sds.tab] s
    WHERE t.timestamp <> s.timestamp
ORDER BY t.timestamp


________________________________________


SELECT TOP 1 s.*
  , t.timestamp
  , t.longitude
  , t.latitude
FROM [1002].[Tokyo_1_merged_data_time.csv] t,[1002].[sds.tab] s
    WHERE t.timestamp <> s.timestamp
ORDER BY t.timestamp


________________________________________


SELECT s.*
  , t.timestamp
  , t.longitude
  , t.latitude
FROM [1002].[Tokyo_1_merged_data_time.csv] t,[1002].[sds.tab] s
    WHERE t.timestamp <> s.timestamp
ORDER BY t.timestamp


________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_2_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , [AI.1] as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , [AI.1] as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_2_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , [AI.1] as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT binid
  , round(avg(T1),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(T1),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid

  , round(avg(T1),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT * FROM [1002].[table_Tokyo_1_merged.csv]
  ORDER BY [AI.1]



________________________________________


SELECT * FROM [1002].[table_Tokyo_1_merged.csv]
  ORDER BY [AI.1] DESC



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_2_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(T1),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(T1),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(S),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , REPLACE(S,'s=','') as S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(T1),3) as T1
  , round(avg(C1),3) as C1
  , round(avg(cast(S as float)),3) as S
  , round(avg(SV),3) as SV
  , round(avg(T2),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT 'Tokyo_0' as source, *
  FROM [1002].[Tokyo_0_merged_data_time_binned]     
UNION    
SELECT 'Tokyo_1' as source   , *   
FROM [1002].[Tokyo_1_merged_data_time_binned]
UNION    
SELECT 'Tokyo_2' as source   , *   
FROM [1002].[Tokyo_2_merged_data_time_binned] 



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_4_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp


________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_3_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp


________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_3_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , S
  , SV
  , T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_4_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , case when isnumeric(T1) = 0 then NULL else T1 end as T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as C1
  , case when isnumeric(S) = 0 then NULL else S end as S
  , case when isnumeric(SV) = 0 then NULL else SV end as SV
  , case when isnumeric(T2) = 0 then NULL else T2 end as T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_4_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , case when isnumeric(T1) = 0 then NULL else T1 end as T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as C1
  , case when isnumeric(S) = 0 then NULL else S end as S
  , case when isnumeric(SV) = 0 then NULL else SV end as SV
  , case when isnumeric(T2) = 0 then NULL else T2 end as T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_3_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , case when isnumeric(T1) = 0 then NULL else T1 end as T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as C1
  , case when isnumeric(S) = 0 then NULL else S end as S
  , case when isnumeric(SV) = 0 then NULL else SV end as SV
  , case when isnumeric(T2) = 0 then NULL else T2 end as T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_2_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , case when isnumeric(T1) = 0 then NULL else T1 end as T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as C1
  , case when isnumeric(S) = 0 then NULL else S end as S
  , case when isnumeric(SV) = 0 then NULL else SV end as SV
  , case when isnumeric(T2) = 0 then NULL else T2 end as T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_1_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT dateadd(second, seconds,dateadd(minute, minutes, dateadd(hour, hours, ddate))) as timestamp
  , case when isnumeric([AI.1]) = 0 then NULL else [AI.1] end as Fluo
  , case when isnumeric(T1) = 0 then NULL else T1 end as  T1
  , case when isnumeric(C1) = 0 then NULL else C1 end as  C1
  , REPLACE(S,'s=','') as S
  , case when isnumeric(SV) = 0 then NULL else SV end as  SV
  , case when isnumeric(T2) = 0 then NULL else T2 end as  T2
  , case when isnumeric([X.NO3..uMol.L.]) = 0 then NULL else [X.NO3..uMol.L.] end as  Nitrate_uM
  , case when isnumeric([O2.Conc..uM.]) = 0 then NULL else [O2.Conc..uM.] end as  Oxygen
  , date
  , time
  , [long.dc] as longitude
  , [lat.dc] as latitude
  

   FROM (
    select cast(month + '/' + day + '/' + year as datetime) as ddate
     , cast(substring(stime,1,2) as integer) as hours
     , cast(substring(stime,3,2) as integer) as minutes
     , cast(substring(stime,5,2) as integer) as seconds
     , *   
  from (
select substring(sdate,len(sdate) - 5,2) as day
     , substring(sdate,len(sdate) - 3,2) as month
     , substring(sdate,len(sdate) - 1,2) as year
     , substring(ztime,len(ztime) - 5,6) as stime
     , *
  from (
select '00000' + cast(time as varchar) as ztime
    , '0' + cast(date as varchar) as sdate
     , *
from
  [1002].[Tokyo_0_merged.csv]
) x
) y
) z
  WHERE isnumeric([long.dc]) = 1
  AND isnumeric([lat.dc]) = 1
  order by timestamp



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(cast(T1 as float)),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(cast(S as float)),3) as S
  , round(avg(cast(SV as float)),3) as SV
  , round(avg(cast(T2 as float)),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_3_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(cast(T1 as float)),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(cast(S as float)),3) as S
  , round(avg(cast(SV as float)),3) as SV
  , round(avg(cast(T2 as float)),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_4_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(cast(T1 as float)),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(cast(S as float)),3) as S
  , round(avg(cast(SV as float)),3) as SV
  , round(avg(cast(T2 as float)),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid 
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_0_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(cast(T1 as float)),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(cast(S as float)),3) as S
  , round(avg(cast(SV as float)),3) as SV
  , round(avg(cast(T2 as float)),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_1_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(cast(T1 as float)),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(cast(S as float)),3) as S
  , round(avg(cast(SV as float)),3) as SV
  , round(avg(cast(T2 as float)),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc



________________________________________


SELECT 'Tokyo_0' as source, *
FROM [1002].[Tokyo_0_merged_data_time_binned]     
UNION    
SELECT 'Tokyo_1' as source   , *   
FROM [1002].[Tokyo_1_merged_data_time_binned]
UNION    
SELECT 'Tokyo_2' as source   , *   
FROM [1002].[Tokyo_2_merged_data_time_binned] 
UNION    
SELECT 'Tokyo_3' as source   , *   
FROM [1002].[Tokyo_3_merged_data_time_binned] 
UNION    
SELECT 'Tokyo_4' as source   , *   
FROM [1002].[Tokyo_4_merged_data_time_binned] 
  



________________________________________


SELECT * FROM [1314howe].[Pile Point tide events labeled by tidal cycle]


________________________________________


SELECT top 20 * FROM [1002].[table_Tokyo_4_merged.csv] order by time


________________________________________


SELECT top 1 * FROM [1002].[table_Tokyo_4_merged.csv] order by time


________________________________________


SELECT top 1 * FROM [1002].[table_Tokyo_4_merged.csv] order by time*tp


________________________________________


SELECT top 1 * FROM [1002].[table_Tokyo_4_merged.csv] order by time+tp


________________________________________


SELECT  * FROM [1002].[table_Tokyo_4_merged.csv] order by time+tp


________________________________________


select top 5* from (SELECT  top 5000 * FROM [1002].[table_Tokyo_4_merged.csv] order by time+tp) qry 


________________________________________


select top 5* from (SELECT  top 5000 * FROM [1002].[table_Tokyo_4_merged.csv] order by time+tp) qry ORDER by qry.Lat


________________________________________


select top 1 * from (SELECT  top 5000 * FROM [1002].[table_Tokyo_4_merged.csv] order by time+tp) qry ORDER by qry.Lat


________________________________________


SELECT  top 5 * FROM [1002].[Tokyo_ALL_merged_data_time_binned] 


________________________________________


SELECT  top 1 * FROM [1002].[Tokyo_ALL_merged_data_time_binned] 


________________________________________


SELECT * FROM [274].[table_us_budget_1.txt] where Year != '#'


________________________________________


SELECT * FROM [274].[table_us_budget_1.txt] where Year not like '#%'


________________________________________


SELECT * FROM [372].[flights09]


________________________________________


SELECT ORIGIN, DEST
FROM [372].[flights09]




________________________________________


SELECT ORIGIN, DEST, TAIL_NUM
FROM [372].[flights09]




________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM
FROM [372].[flights09]




________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM, YEAR, MONTH, DAY_OF_MONTH, COUNT(*)
FROM [372].[flights09]
GROUP BY ORIGIN, DEST, TAIL_NUM, FL_NUM, YEAR, MONTH, DAY_OF_MONTH




________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM, YEAR, MONTH, DAY_OF_MONTH, COUNT(*) AS num
FROM [372].[flights09]
GROUP BY ORIGIN, DEST, TAIL_NUM, FL_NUM, YEAR, MONTH, DAY_OF_MONTH
ORDER BY num



________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM, YEAR, MONTH, DAY_OF_MONTH, COUNT(*) AS num
FROM [372].[flights09]
GROUP BY ORIGIN, DEST, TAIL_NUM, FL_NUM, YEAR, MONTH, DAY_OF_MONTH
ORDER BY num DESC




________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM, YEAR, MONTH, DAY_OF_MONTH, CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]




________________________________________


SELECT TOP 10 ORIGIN, DEST
FROM [372].[flights09_part]



________________________________________


SELECT *
FROM [372].[flights09_part] AS f
WHERE EXISTS (SELECT *
  FROM [372].[flights09_part]
  WHERE TAIL_NUM LIKE f.TAIL_NUM)


________________________________________


SELECT DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH)
FROM [372].[flights09_part]


________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM, DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]




________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM, DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]




________________________________________


SELECT c.*
FROM [372].[flights09_part] AS c JOIN
(SELECT *
  FROM [372].[flights09_part]) AS p
  ON p.TAIL_NUM = c.TAIL_NUM
  AND (p.DATE < c.date OR (p.DATE = c.DATE AND p.ARR_TIME <= c.DEP_TIME))


________________________________________


SELECT *
FROM [372].[flights09_part] AS c JOIN
(SELECT *
  FROM [372].[flights09_part]) AS p
  ON p.TAIL_NUM = c.TAIL_NUM
  AND (p.DATE < c.date OR (p.DATE = c.DATE AND p.ARR_TIME <= c.DEP_TIME))


________________________________________


SELECT p.DEST
FROM [372].[flights09_part] AS c JOIN
(SELECT TOP 1 *
  FROM [372].[flights09_part]) AS p
  ON p.TAIL_NUM = c.TAIL_NUM
  AND (p.DATE < c.date OR (p.DATE = c.DATE AND p.ARR_TIME <= c.DEP_TIME))
WHERE p.DEST != c.ORIGIN



________________________________________


SELECT p.DEST
FROM [372].[flights09_part] AS c JOIN
(SELECT TOP 1 *
  FROM [372].[flights09_part]
  ORDER BY DATE, ARR_TIME DESC) AS p
  ON p.TAIL_NUM = c.TAIL_NUM
  AND (p.DATE < c.date OR (p.DATE = c.DATE AND p.ARR_TIME <= c.DEP_TIME))
WHERE p.DEST != c.ORIGIN



________________________________________


SELECT p.DEST, c.ORIGIN
FROM [372].[flights09_part] AS c JOIN
(SELECT TOP 1 *
  FROM [372].[flights09_part]
  ORDER BY DATE, ARR_TIME DESC) AS p
  ON p.TAIL_NUM = c.TAIL_NUM
  AND (p.DATE < c.date OR (p.DATE = c.DATE AND p.ARR_TIME <= c.DEP_TIME))
WHERE p.DEST != c.ORIGIN



________________________________________


SELECT p.DEST, c.ORIGIN, p.ARR_TIME
FROM [372].[flights09_part] AS c JOIN
(SELECT TOP 1 *
  FROM [372].[flights09_part]
  ORDER BY DATE, ARR_TIME DESC) AS p
  ON p.TAIL_NUM = c.TAIL_NUM
  AND (p.DATE < c.date OR (p.DATE = c.DATE AND p.ARR_TIME <= c.DEP_TIME))
WHERE p.DEST != c.ORIGIN



________________________________________


SELECT p.ORIGIN, p.DEST, c.ORIGIN, c.DEST, p.ARR_TIME, c.DEP_TIME
FROM [372].[flights09_part] AS c JOIN
(SELECT TOP 1 *
  FROM [372].[flights09_part]
  ORDER BY DATE, ARR_TIME DESC) AS p
  ON p.TAIL_NUM = c.TAIL_NUM
  AND (p.DATE < c.date OR (p.DATE = c.DATE AND p.ARR_TIME <= c.DEP_TIME))
WHERE p.DEST = c.ORIGIN



________________________________________


SELECT p.ORIGIN, p.DEST, c.ORIGIN, c.DEST, p.ARR_TIME, c.DEP_TIME
FROM [372].[flights09_part] AS c JOIN
(SELECT TOP 1 *
  FROM [372].[flights09_part]
  ORDER BY DATE, ARR_TIME DESC) AS p
  ON p.TAIL_NUM = c.TAIL_NUM
  AND (p.DATE < c.DATE OR (p.DATE = c.DATE AND p.ARR_TIME <= c.DEP_TIME))
WHERE p.DEST = c.ORIGIN



________________________________________


SELECT p.ORIGIN, p.DEST, c.ORIGIN, c.DEST, p.DATE, p.ARR_TIME, c.DATE, c.DEP_TIME
FROM [372].[flights09_part] AS c JOIN
(SELECT TOP 1 *
  FROM [372].[flights09_part]
  ORDER BY DATE, ARR_TIME DESC) AS p
  ON p.TAIL_NUM = c.TAIL_NUM
  AND (p.DATE < c.DATE OR (p.DATE = c.DATE AND p.ARR_TIME <= c.DEP_TIME))
WHERE p.DEST = c.ORIGIN



________________________________________


SELECT *
FROM [372].[flights09_part]



________________________________________


SELECT *
FROM [372].[flights09_part] c
  JOIN [372].[flights09_part] n
  ON c.TAIL_NUM = n.TAIL_NUM



________________________________________


SELECT *
FROM [372].[flights09_part] c
  JOIN [372].[flights09_part] n
  ON 2 > 1



________________________________________


SELECT *
FROM [372].[flights09_part] c
WHERE NOT EXISTS(
    SELECT TOP 1 *
    FROM [372].[flights09_part] n
    WHERE c.TAIL_NUM = n.TAIL_NUM
  AND (c.DATE < n.DATE OR (n.DATE = DATE AND c.ARR_TIME <= n.DEP_TIME))
  ORDER BY n.DATE, n.ARR_TIME DESC
)



________________________________________


SELECT *
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON c.TAIL_NUM = n.TAIL_NUM
AND (c.DATE < n.DATE OR (c.DATE = n.DATE AND c.ARR_TIME <= n.DEP_TIME))



________________________________________


SELECT c.DEST, n.ORIGIN
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON c.TAIL_NUM = n.TAIL_NUM
AND (c.DATE < n.DATE OR (c.DATE = n.DATE AND c.ARR_TIME <= n.DEP_TIME))



________________________________________


SELECT c.DEST, n.ORIGIN
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON c.TAIL_NUM = n.TAIL_NUM
AND (c.DATE < n.DATE OR (c.DATE = n.DATE AND c.ARR_TIME <= n.DEP_TIME))
AND c.DEST != n.ORIGIN



________________________________________


SELECT c.DEST, n.ORIGIN
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON c.TAIL_NUM = n.TAIL_NUM
  AND (c.DATE < n.DATE
    OR (c.DATE = n.DATE AND c.ARR_TIME <= n.DEP_TIME))
  AND c.DEST != n.ORIGIN



________________________________________


SELECT c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON c.TAIL_NUM = n.TAIL_NUM
  AND (c.DATE < n.DATE
    OR (c.DATE = n.DATE AND c.ARR_TIME <= n.DEP_TIME))
  AND c.DEST != n.ORIGIN



________________________________________


SELECT c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON c.TAIL_NUM = n.TAIL_NUM
  AND (c.DATE < n.DATE
    OR (c.DATE = n.DATE AND c.ARR_TIME <= n.DEP_TIME))
  AND c.DEST != n.ORIGIN



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON c.TAIL_NUM = n.TAIL_NUM
  AND (c.DATE < n.DATE
    OR (c.DATE = n.DATE AND c.ARR_TIME <= n.DEP_TIME))
  AND c.DEST != n.ORIGIN



________________________________________


SELECT ORIGIN, DEST, DISTANCE
FROM [372].[flights09]


________________________________________


SELECT DISTINCT ORIGIN, DEST, DISTANCE
FROM [372].[flights09]


________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]




________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]




________________________________________


SELECT ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]




________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY DATE, DEP_TIME) ID, *
FROM [372].[flights09_part]


________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY YEAR) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]




________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n
  ON c.TAIL_NUM = n.TAIL_NUM



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] s
    WHERE c.TAIL_NUM = s.TAIL_NUM
    AND c.DEST != s.ORIGIN
    AND (c.DATE < s.DATE
      OR (c.DATE = s.DATE AND c.ARR_TIME <= s.DEP_TIME))
    ORDER BY c.DATE, s.DATE DESC)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY c.DATE, next.DATE ASC)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY c.DATE ASC, next.DATE ASC)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY c.DATE ASC, next.DATE ASC)



________________________________________


SELECT c.TAIL_NUM, n.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY c.DATE ASC, next.DATE ASC)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY c.DATE ASC, next.DATE ASC)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY c.DATE ASC, next.DATE ASC)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY next.DATE ASC, next.DEP_TIME)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY next.DATE ASC, next.DEP_TIME)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 n.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY next.DATE ASC, next.DEP_TIME ASC)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 next.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND c.DEST != next.ORIGIN
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY next.DATE ASC, next.DEP_TIME ASC)



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n 
ON 
  n.ID = 
  ( SELECT TOP 1 next.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY next.DATE ASC, next.DEP_TIME ASC)
  AND c.DEST != n.ORIGIN



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n  
ON
  n.ID = 
  ( SELECT TOP 1 next.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY next.DATE ASC, next.DEP_TIME ASC)
WHERE c.DEST != n.ORIGIN



________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY TAIL_NUM, YEAR, DEP_TIME) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]




________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY TAIL_NUM, YEAR, DEP_TIME) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]
WHERE TAIL_NUM != null




________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY TAIL_NUM, YEAR, DEP_TIME) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]
WHERE TAIL_NUM IS NOT null




________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY TAIL_NUM, YEAR, DEP_TIME) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]
WHERE TAIL_NUM != ''




________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n  
ON
  n.ID = 
  ( SELECT TOP 1 next.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY next.DATE ASC, next.DEP_TIME ASC)
WHERE c.DEST != n.ORIGIN



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n  
ON
  n.ID = 
  ( SELECT TOP 1 next.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY next.DATE ASC, next.DEP_TIME ASC)
WHERE c.DEST != n.ORIGIN



________________________________________


SELECT c.TAIL_NUM, c.DEST, n.ORIGIN, c.ARR_TIME, n.DEP_TIME, c.DATE, n.DATE, c.ID, n.ID
FROM [372].[flights09_part] c JOIN
  [372].[flights09_part] n  
ON
  n.ID = 
  ( SELECT TOP 1 next.ID
    FROM [372].[flights09_part] next
    WHERE c.TAIL_NUM = next.TAIL_NUM
    AND (c.DATE < next.DATE
      OR (c.DATE = next.DATE AND c.ARR_TIME <= next.DEP_TIME))
    ORDER BY next.DATE ASC, next.DEP_TIME ASC)
WHERE c.DEST != n.ORIGIN



________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM ORDER BY YEAR) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]




________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM ORDER BY YEAR) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]
WHERE TAIL_NUM != ''




________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM ORDER BY YEAR, MONTH, DAY_OF_MONTH, ARR_TIME) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]
WHERE TAIL_NUM != ''




________________________________________


SELECT *
FROM [372].[flights_09_pre] a JOIN
 [372].[flights_09_pre] b
ON a.TAIL_NUM=b.TAIL_NUM AND a.ID < b.ID AND a.DEST != b.ORIGIN




________________________________________


SELECT *
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN




________________________________________


SELECT *
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN




________________________________________


SELECT *
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN


________________________________________


SELECT a.TAIL_NUM, a.DEST ORIGIN, b.ORIGIN DEST, a.DATE, b.DATE, a.ARR_TIME, b.ARR_TIME 
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN


________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM ORDER BY YEAR, MONTH, DAY_OF_MONTH, DEP_TIME) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]
WHERE TAIL_NUM != ''




________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM ORDER BY YEAR, MONTH, DAY_OF_MONTH, DEP_TIME) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09]
WHERE TAIL_NUM != ''




________________________________________


SELECT *
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN


________________________________________


SELECT *
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN


________________________________________


SELECT *
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN


________________________________________


SELECT a.TAIL_NUM, a.CARRIER, a.DEST ORIGIN, b.ORIGIN DEST, a.DATE EARLIEST, a.ARR_TIME ETIME, b.DATE LATEST, b.DEP_TIME LTIME 
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN


________________________________________


SELECT a.TAIL_NUM, a.CARRIER, a.DEST ORIGIN, b.ORIGIN DEST, a.DATE EARLIEST, a.ARR_TIME ETIME, b.DATE LATEST, b.DEP_TIME LTIME 
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
  AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN
WHERE a.ARR_TIME != ''



________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM ORDER BY YEAR, MONTH, DAY_OF_MONTH, DEP_TIME) ID, ORIGIN, DEST, TAIL_NUM, FL_NUM,
  DATEFROMPARTS(YEAR, MONTH, DAY_OF_MONTH) DATE, 
  CARRIER, DEP_TIME, ARR_TIME, DISTANCE, AIR_TIME 
FROM [372].[flights09] a
WHERE TAIL_NUM != ''
  AND '' != ALL(
    SELECT ARR_TIME
    FROM [372].[flights09] b
    WHERE a.TAIL_NUM = b.TAIL_NUM)
  AND '' != ALL(
    SELECT DEP_TIME
    FROM [372].[flights09] b
    WHERE a.TAIL_NUM = b.TAIL_NUM)




________________________________________


SELECT a.TAIL_NUM, a.CARRIER, a.DEST ORIGIN, b.ORIGIN DEST, a.DATE EARLIEST, a.ARR_TIME ETIME, b.DATE LATEST, b.DEP_TIME LTIME 
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN


________________________________________


SELECT a.TAIL_NUM, a.CARRIER, a.DEST ORIGIN, b.ORIGIN DEST, a.DATE EARLIEST, a.ARR_TIME ETIME, b.DATE LATEST, b.DEP_TIME LTIME 
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN


________________________________________


SELECT a.TAIL_NUM, a.CARRIER, a.DEST ORIGIN, b.ORIGIN DEST, a.DATE EARLIEST, a.ARR_TIME ETIME, b.DATE LATEST, b.DEP_TIME LTIME 
FROM [372].[flights_09_pre] a JOIN
  [372].[flights_09_pre] b
    ON a.TAIL_NUM=b.TAIL_NUM
    AND a.ID + 1 = b.ID AND a.DEST != b.ORIGIN


________________________________________


SELECT *
FROM [372].[ghost_flights] f JOIN
  [372].[airports] a
  ON f.ORIGIN = a."IATA/FAA"


________________________________________


SELECT f.*, o.Latitude oLat, o.Longitude oLon, d.Latitude dLat, d.Longitude dLong
FROM [372].[ghost_flights] f JOIN
  [372].[airports] o
  ON f.ORIGIN = o."IATA/FAA" JOIN
  [372].[airports] d
  ON f.DEST = d."IATA/FAA"


________________________________________


SELECT f.*, o.Latitude oLat, o.Longitude oLon, d.Latitude dLat, d.Longitude dLong
FROM [372].[ghost_flights] f JOIN
  [372].[airports] o
  ON f.ORIGIN = o."IATA/FAA" JOIN
  [372].[airports] d
  ON f.DEST = d."IATA/FAA"


________________________________________


SELECT *
FROM [372].[ghostflights_locations]
CROSS APPLY (
      VALUES
      (1, oLat, oLon), (2, dLat, dLong)
   ) M (PATH_ORDER, Lat, Lon);



________________________________________


SELECT TAIL_NUM, Lat, Lon, ORIGIN, DEST, PATH_ORDER
FROM [372].[ghostflights_locations]
CROSS APPLY (
      VALUES
      (1, oLat, oLon), (2, dLat, dLong)
) M (PATH_ORDER, Lat, Lon);



________________________________________


SELECT f.*, o.Latitude oLat, o.Longitude oLon, d.Latitude dLat, d.Longitude dLon
FROM [372].[ghost_flights] f JOIN
  [372].[airports] o
  ON f.ORIGIN = o."IATA/FAA" JOIN
  [372].[airports] d
  ON f.DEST = d."IATA/FAA"


________________________________________


SELECT f.*, o.Latitude oLat, o.Longitude oLon, d.Latitude dLat, d.Longitude dLon
FROM [372].[ghost_flights] f JOIN
  [372].[airports] o
  ON f.ORIGIN = o."IATA/FAA" JOIN
  [372].[airports] d
  ON f.DEST = d."IATA/FAA"


________________________________________


SELECT TAIL_NUM, Lat, Lon, ORIGIN, DEST, PATH_ORDER
FROM [372].[ghostflights_locations]
CROSS APPLY (
      VALUES
      (1, oLat, oLon), (2, dLat, dLon)
) M (PATH_ORDER, Lat, Lon);



________________________________________


SELECT TAIL_NUM, CARRIER, Lat, Lon, ORIGIN, DEST, PATH_ORDER
FROM [372].[ghostflights_locations]
CROSS APPLY (
      VALUES
      (1, oLat, oLon), (2, dLat, dLon)
) M (PATH_ORDER, Lat, Lon);



________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM, ETIME, LTIME ORDER BY PATH_ORDER), TAIL_NUM, CARRIER, Lat, Lon, ORIGIN, DEST, PATH_ORDER
FROM [372].[ghostflights_locations]
CROSS APPLY (
      VALUES
      (1, oLat, oLon), (2, dLat, dLon)
) M (PATH_ORDER, Lat, Lon);



________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM, ETIME, LTIME, PATH_ORDER ORDER BY TAIL_NUM) PATH_ID, TAIL_NUM, CARRIER, Lat, Lon, ORIGIN, DEST, PATH_ORDER
FROM [372].[ghostflights_locations]
CROSS APPLY (
      VALUES
      (1, oLat, oLon), (2, dLat, dLon)
) M (PATH_ORDER, Lat, Lon);



________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM, ORIGIN, DEST ORDER BY TAIL_NUM) PATH_ID, TAIL_NUM, CARRIER, Lat, Lon, ORIGIN, DEST, PATH_ORDER
FROM [372].[ghostflights_locations]
CROSS APPLY (
      VALUES
      (1, oLat, oLon), (2, dLat, dLon)
) M (PATH_ORDER, Lat, Lon);



________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM, ORIGIN, DEST, EARLIEST, ETIME ORDER BY TAIL_NUM) PATH_ID, TAIL_NUM, CARRIER, Lat, Lon, ORIGIN, DEST, PATH_ORDER
FROM [372].[ghostflights_locations]
CROSS APPLY (
      VALUES
      (1, oLat, oLon), (2, dLat, dLon)
) M (PATH_ORDER, Lat, Lon);



________________________________________


SELECT ROW_NUMBER() OVER (PARTITION BY TAIL_NUM, ORIGIN, DEST, EARLIEST, ETIME ORDER BY TAIL_NUM), f.*, o.Latitude oLat, o.Longitude oLon, d.Latitude dLat, d.Longitude dLon
FROM [372].[ghost_flights] f JOIN
  [372].[airports] o
  ON f.ORIGIN = o."IATA/FAA" JOIN
  [372].[airports] d
  ON f.DEST = d."IATA/FAA"


________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY TAIL_NUM), f.*, o.Latitude oLat, o.Longitude oLon, d.Latitude dLat, d.Longitude dLon
FROM [372].[ghost_flights] f JOIN
  [372].[airports] o
  ON f.ORIGIN = o."IATA/FAA" JOIN
  [372].[airports] d
  ON f.DEST = d."IATA/FAA"


________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY TAIL_NUM) PATH_ID, f.*, o.Latitude oLat, o.Longitude oLon, d.Latitude dLat, d.Longitude dLon
FROM [372].[ghost_flights] f JOIN
  [372].[airports] o
  ON f.ORIGIN = o."IATA/FAA" JOIN
  [372].[airports] d
  ON f.DEST = d."IATA/FAA"


________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY TAIL_NUM) PATH_ID, f.*, o.Latitude oLat, o.Longitude oLon, d.Latitude dLat, d.Longitude dLon
FROM [372].[ghost_flights] f JOIN
  [372].[airports] o
  ON f.ORIGIN = o."IATA/FAA" JOIN
  [372].[airports] d
  ON f.DEST = d."IATA/FAA"


________________________________________


SELECT PATH_ID, TAIL_NUM, CARRIER, Lat, Lon, ORIGIN, DEST, PATH_ORDER
FROM [372].[ghostflights_locations]
CROSS APPLY (
      VALUES
      (1, oLat, oLon), (2, dLat, dLon)
) M (PATH_ORDER, Lat, Lon);



________________________________________


SELECT ROW_NUMBER() OVER (ORDER BY TAIL_NUM) PATH_ID, f.*, o.Latitude oLat, o.Longitude oLon, d.Latitude dLat, d.Longitude dLon
FROM [372].[ghost_flights] f JOIN
  [372].[airports] o
  ON f.ORIGIN = o."IATA/FAA" JOIN
  [372].[airports] d
  ON f.DEST = d."IATA/FAA"


________________________________________


SELECT *
FROM [372].[crunchbase_acquisitions]
WHERE company_permalink != ''



________________________________________


SELECT * FROM [372].[crunchbase_investments]
WHERE company_permalink != ''


________________________________________


select * from [372].[invest]


________________________________________


select sum(raised_amount_usd)
from [372].[invest]



________________________________________


select company_permalink, sum(raised_amount_usd)
from [372].[invest]
group by company_permalink



________________________________________


select company_name, company_permalink, sum(raised_amount_usd)
from [372].[invest]
group by company_permalink, company_name



________________________________________


select company_name, company_permalink, sum(raised_amount_usd) as funding
from [372].[invest]
group by company_permalink, company_name
having sum(raised_amount_usd) > 0



________________________________________


SELECT *
FROM [372].[funding_cleaned]
order by funding desc


________________________________________


SELECT cast(replace(price_amount, ',', '') as numeric) FROM [372].[acqui]
 where price_amount != ''


________________________________________


SELECT company_permalink, company_name, cast(replace(price_amount, ',', '') as numeric) FROM [372].[acqui]
 where price_amount != ''


________________________________________


SELECT company_permalink, company_name, cast(replace(price_amount, ',', '') as numeric) FROM [372].[acqui]
 where price_amount != ''
  and  price_currency_code = 'USD'


________________________________________


SELECT company_permalink, company_name, cast(replace(price_amount, ',', '') as numeric) as price FROM [372].[acqui]
 where price_amount != ''
  and  price_currency_code = 'USD'


________________________________________


SELECT *
FROM [372].[acqui_cleaned] a, [372].[funding_cleaned] f
--where a.company_permalink = f.company_permalink


________________________________________


SELECT a.company_permalink, a.price, a.company_name, f.funding
FROM [372].[acqui_cleaned] a, [372].[funding_cleaned] f
--where a.company_permalink = f.company_permalink


________________________________________


SELECT a.company_permalink, a.company_name
FROM [372].[acqui_cleaned] a, [372].[funding_cleaned] f
where a.company_name = f.company_name


________________________________________


SELECT a.company_permalink, a.company_name
FROM [372].[acqui_cleaned] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink


________________________________________


select company_name, company_permalink, cast(sum(raised_amount_usd) as numeric) as funding
from [372].[invest]
group by company_permalink, company_name
having sum(raised_amount_usd) > 0



________________________________________


SELECT a.company_permalink, a.company_name, f.funding
FROM [372].[acqui_cleaned] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink


________________________________________


SELECT a.company_permalink, a.company_name, f.funding
FROM [372].[acqui_cleaned_mat] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink


________________________________________


select * from [372].[acqui_cleaned_mat]


________________________________________


SELECT a.company_permalink, a.company_name, f.funding
FROM [372].[materialized_acqui_cleaned_mat] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink


________________________________________


SELECT * FROM [materialized_acqui_cleaned_mat]


________________________________________


SELECT * FROM [acqui_cleaned_mat]


________________________________________


SELECT a.company_permalink, a.company_name, f.funding
  FROM (SELECT company_permalink, company_name, cast(replace(price_amount, ',', '') as numeric) as price FROM [372].[acqui]
 where price_amount != ''
  and  price_currency_code = 'USD') a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink


________________________________________


SELECT a.company_permalink, a.company_name, f.funding, cast(replace(price_amount, ',', '') as numeric) as price
  FROM [372].[acqui] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink
  and a.price_amount != ''
  and a.price_amount not like '%-%'
  and  a.price_currency_code = 'USD'


________________________________________


SELECT a.company_permalink, a.company_name, f.funding, cast(replace(price_amount, ',', '') as numeric) as price
  FROM [372].[acqui] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink
  and a.price_amount != ''
  and a.price_amount not like '%-%'
  and  a.price_currency_code = 'USD'
order by cast(replace(price_amount, ',', '') as numeric) - funding


________________________________________


SELECT a.company_permalink, a.company_name, f.funding, cast(replace(price_amount, ',', '') as numeric) as price, cast(replace(price_amount, ',', '') as numeric) - funding
 as profit FROM [372].[acqui] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink
  and a.price_amount != ''
  and a.price_amount not like '%-%'
  and  a.price_currency_code = 'USD'
order by cast(replace(price_amount, ',', '') as numeric) - funding


________________________________________


SELECT a.company_permalink, a.company_name, f.funding, cast(replace(price_amount, ',', '') as numeric) as price, cast(replace(price_amount, ',', '') as numeric) - funding
 as profit FROM [372].[acqui] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink
  and a.price_amount != ''
  and a.price_amount not like '%-%'
  and  a.price_currency_code = 'USD'
order by cast(replace(price_amount, ',', '') as numeric) - funding DESC


________________________________________


SELECT a.company_permalink, a.company_name, f.funding, cast(replace(price_amount, ',', '') as numeric) as price, cast(replace(price_amount, ',', '') as numeric) - funding
 as profit, acquired_at
 FROM [372].[acqui] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink
  and a.price_amount != ''
  and a.price_amount not like '%-%'
  and  a.price_currency_code = 'USD'
order by cast(replace(price_amount, ',', '') as numeric) - funding DESC


________________________________________


SELECT a.company_permalink, a.company_name, f.funding, cast(replace(price_amount, ',', '') as numeric) as price, cast(replace(price_amount, ',', '') as numeric) - funding
 as profit, acquired_at, acquirer_name
 FROM [372].[acqui] a, [372].[funding_cleaned] f
where a.company_permalink = f.company_permalink
  and a.price_amount != ''
  and a.price_amount not like '%-%'
  and  a.price_currency_code = 'USD'
order by cast(replace(price_amount, ',', '') as numeric) - funding DESC


________________________________________


select * from [342].[KingCountySenatorRecount_2010.csv]



________________________________________


SELECT * FROM [1307].[table_of_elements.csv] where period = 2


________________________________________


SELECT * FROM [1002].[seaflow-Tokyo_1-stats.csv] WHERE pop = 'synecho'
  
  



________________________________________


SELECT * FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


SELECT * FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


SELECT * FROM [1002].[Tokyo_ALL_merged_data_time_binned]
  


________________________________________


SELECT Fluo, T1, S, Oxygen, Nitrate_uM, longitude, latitude 
   FROM [1002].[Tokyo_ALL_merged_data_time_binned] 
  
;


________________________________________


SELECT Fluo, T1, S, Oxygen, Nitrate_uM, longitude, latitude 
   FROM [1002].[Tokyo_ALL_merged_data_time_binned] 
WHERE source = 'Tokyo_1'  
;


________________________________________


SELECT source, Fluo, T1, S, Oxygen, Nitrate_uM, longitude, latitude 
   FROM [1002].[Tokyo_ALL_merged_data_time_binned] 
WHERE source = 'Tokyo_1'  
;


________________________________________


SELECT source, Fluo, T1, S, Oxygen, Nitrate_uM, longitude, latitude 
   FROM [1002].[Tokyo_ALL_merged_data_time_binned] 
WHERE source = 'Tokyo_0'  
;


________________________________________


SELECT * FROM [1057].[Tokyo_underway_chl1.csv] Order BY [time.1] asc


________________________________________


SELECT [date.1]/10000
  AS day,
  ([date.1]%10000)/100 AS month,
  ([date.1]%100) AS year,
  [time.1]/10000 as hour,
  ([time.1]%10000)/100 as minute,
  ([time.1]%100) as second
  FROM [1057].[Tokyo_underway_chl1.csv]
  


________________________________________


SELECT [date.1]/10000
  AS day,
  ([date.1]%10000)/100 AS month,
  ([date.1]%100) AS year,
  [time.1]/10000 as hour,
  ([time.1]%10000)/100 as minute,
  ([time.1]%100) as second,
  [long.dc],[lat.dc],T1,S, chl
  FROM [1057].[Tokyo_underway_chl1.csv]
  


________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day,hour, minute,second,0) as timestamp
  FROM [1057].[Tokyo1_uway_timestamp]


________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day,hour, minute,second,0) as timestamp,
  [long.dc],[lat.dc],T1,S,chl
  FROM [1057].[Tokyo1_uway_timestamp]


________________________________________


SELECT * FROM [1057].[Tokyo_1_sds_1.csv],
  [1057].[Tokyo1_uway_timestamp_1col]


________________________________________


SELECT CAST('20'+ time AS datetime) FROM [1057].[Tokyo_1_sds_1.csv],
  [1057].[Tokyo1_uway_timestamp_1col]


________________________________________


SELECT CONVERT(datetime, time, 3) FROM [1057].[Tokyo_1_sds_1.csv],
  [1057].[Tokyo1_uway_timestamp_1col]


________________________________________


SELECT CONVERT(datetime, time, 3) FROM [1057].[Tokyo_1_sds_1.csv]


________________________________________


SELECT CONVERT(datetime, time, 3),
  LAT, LON, [BULK.RED], day, [file]
  FROM [1057].[Tokyo_1_sds_1.csv]


________________________________________


SELECT CONVERT(datetime, time, 3) AS timestamp,
  LAT, LON, [BULK.RED], day, [file]
  FROM [1057].[Tokyo_1_sds_1.csv]


________________________________________


SELECT U.timestamp, S.timestamp, U.T1, U.S
  FROM [1057].[Tokyo1_sds_timestamp] as S, 
  [1057].[Tokyo1_uway_timestamp_1col] as U
  


________________________________________


SELECT S.timestamp, AVG(U.T1), AVG(U.S)
  FROM [1057].[Tokyo1_sds_timestamp] as S, 
  [1057].[Tokyo1_uway_timestamp_1col] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(U.T1) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[Tokyo1_sds_timestamp] as S, 
  [1057].[Tokyo1_uway_timestamp_1col] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED]
  FROM [1057].[Tokyo_1_sds_1.csv] as S,
  [1057].[Tokyo1_sds_TS] as T
 


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED]
  FROM [1057].[Tokyo_1_sds_1.csv] as S,
  [1057].[Tokyo1_sds_TS] as T


________________________________________


SELECT S.timestamp, AVG(U.T1) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[Tokyo1_sds_timestamp] as S, 
  [1057].[Tokyo1_uway_timestamp_1col] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED]
  FROM [1057].[Tokyo1_sds_timestamp] as S,
  [1057].[Tokyo1_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT [date.1]/10000
  AS day,
  ([date.1]%10000)/100 AS month,
  ([date.1]%100) AS year,
  [time.1]/10000 as hour,
  ([time.1]%10000)/100 as minute,
  ([time.1]%100) as second,
  [long.dc],[lat.dc],T1,S, chl
  FROM [1057].[Tokyo_underway_chl2.csv]


________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day,hour, minute,second,0) as timestamp,
  [long.dc],[lat.dc],T1,S,chl
  FROM [1057].[Tokyo2_uway_timestamp]



________________________________________


SELECT CONVERT(datetime, time, 3) AS timestamp,
  LAT, LON, [BULK.RED], day, [file]
  FROM [1057].[Tokyo_2_sds.csv]


________________________________________


SELECT CONVERT(datetime, time, 3) AS timestamp,
  LAT, LON, [BULK.RED], day, [file]
  FROM [1057].[Tokyo_2_sds.csv]


________________________________________


SELECT CONVERT(datetime, time, 3) AS timestamp,
  LAT, LON, [BULK.RED], day, [file]
  FROM [1057].[Tokyo_2_sds.csv]


________________________________________


SELECT S.timestamp, AVG(U.T1) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[Tokyo_2_sds_timestamp.csv] as S, 
  [1057].[Tokyo2_uway_timestamp_1col] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED]
  FROM [1057].[Tokyo_2_sds_timestamp.csv] as S,
  [1057].[Tokyo_2_sds_TS.csv] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT [date.1]/10000
  AS day,
  ([date.1]%10000)/100 AS month,
  ([date.1]%100) AS year,
  [time.1]/10000 as hour,
  ([time.1]%10000)/100 as minute,
  ([time.1]%100) as second,
  [long.dc],[lat.dc],T1,S, chl
  FROM [1057].[Tokyo_underway_chl3.csv]


________________________________________


SELECT [date.1]/10000
  AS day,
  ([date.1]%10000)/100 AS month,
  ([date.1]%100) AS year,
  [time.1]/10000 as hour,
  ([time.1]%10000)/100 as minute,
  ([time.1]%100) as second,
  [long.dc],[lat.dc],T1,S, chl
  FROM [1057].[Tokyo_underway_chl3.csv]


________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day,hour, minute,second,0) as timestamp,
  [long.dc],[lat.dc],T1,S,chl
  FROM [1057].[Tokyo3_uway_timestamp]


________________________________________


SELECT CONVERT(datetime, time, 3) AS timestamp,
  LAT, LON, [BULK.RED], day, [file]
  FROM [1057].[Tokyo_3_sds_1.csv]


________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day,hour, minute,second,0) as timestamp,
  [long.dc],[lat.dc],T1,S,chl
  FROM [1057].[Tokyo3_uway_timestamp]


________________________________________


SELECT CAST(U.T1 as FLOAT) as [OCEAN.TEMP], CAST(U.S as FLOAT) as SALINITY
  FROM  [1057].[Tokyo3_uway_timestamp_1col] as U
  


________________________________________


SELECT [date.1]/10000
  AS day,
  ([date.1]%10000)/100 AS month,
  ([date.1]%100) AS year,
  [time.1]/10000 as hour,
  ([time.1]%10000)/100 as minute,
  ([time.1]%100) as second,
  [long.dc],[lat.dc],T1,S, chl
  FROM [1057].[Tokyo_underway_chl4.csv]


________________________________________


SELECT [date.1]/10000
  AS day,
  ([date.1]%10000)/100 AS month,
  ([date.1]%100) AS year,
  [time.1]/10000 as hour,
  ([time.1]%10000)/100 as minute,
  ([time.1]%100) as second,
  [long.dc],[lat.dc],T1,S, chl
  FROM [1057].[Tokyo_underway_chl4.csv]


________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day,hour, minute,second,0) as timestamp,
  [long.dc],[lat.dc],T1,S,chl
  FROM [1057].[Tokyo4_uway_timestamp]


________________________________________


SELECT CONVERT(datetime, time, 3) AS timestamp,
  LAT, LON, [BULK.RED], day, [file]
  FROM [1057].[Tokyo_4_sds.csv]


________________________________________


SELECT CONVERT(datetime, time, 3) AS timestamp,
  LAT, LON, [BULK.RED], day, [file]
  FROM [1057].[Tokyo_4_sds.csv]


________________________________________


SELECT CAST(T1 as FLOAT) as [OCEAN.TEMP], CAST(S as FLOAT) as SALINITY
  FROM  [1057].[Tokyo4_uway_timestamp_1col]
  


________________________________________


SELECT CAST(T1 as FLOAT) as [OCEAN.TEMP], CAST(S as FLOAT) as SALINITY
  FROM  [1057].[Tokyo4_uway_timestamp_1col]



________________________________________


SELECT T1 FROM [1057].[Tokyo4_uway_timestamp_1col]
WHERE ISNUMERIC(T1)<>1


________________________________________


SELECT * FROM [1057].[Tokyo4_uway_timestamp_1col]
WHERE ISNUMERIC(T1)<>0


________________________________________


SELECT * FROM [1057].[Tokyo3_uway_timestamp_1col]
WHERE ISNUMERIC(T1)<>0


________________________________________


SELECT * FROM [1057].[Tokyo4_uway_timestamp_1col]
  WHERE ISNUMERIC(T1)<>0 AND ISNUMERIC(S)<>0


________________________________________


SELECT * FROM [1057].[Tokyo3_uway_timestamp_1col]
  WHERE ISNUMERIC(T1)<>0 AND ISNUMERIC(S)<>0


________________________________________


SELECT * FROM [1057].[Tokyo4_uway_timestamp_noNA]
  WHERE ISNUMERIC(T1)<>1
  


________________________________________


SELECT * FROM [1057].[Tokyo4_uway_timestamp_noNA]
  WHERE ISNUMERIC(S)<>1
  


________________________________________


SELECT * FROM [1057].[Tokyo3_uway_timestamp_noNA]
  WHERE ISNUMERIC(S)<>1
  


________________________________________


SELECT * FROM [1057].[Tokyo3_uway_timestamp_noNA]
  WHERE ISNUMERIC(T1)<>1
  


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as numeric)) as [OCEAN.TEMP], AVG(cast(U.S as numeric)) as SALINITY
  FROM [1057].[Tokyo4_sds_timestamp] as S, 
  [1057].[Snapshot of Tokyo4_uway_timestamp_noNA] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  AND ISNUMERIC(U.T1)<>0 AND ISNUMERIC(U.S)<>0 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo4_sds_timestamp] as S, 
  [1057].[Snapshot of Tokyo4_uway_timestamp_noNA] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo4_sds_timestamp] as S, 
  [1057].[Tokyo4_uway_timestamp_noNA] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED]
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S,
  [1057].[Tokyo3_sds_TS] as T
  WHERE S.timestamp = T.timestamp




________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED]
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S,
  [1057].[Tokyo3_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED]
  FROM [1057].[Tokyo4_sds_timestamp] as S,
  [1057].[Tokyo4_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT DATEPART(month, jday) as M
  FROM [1057].[KiloMoana1_uway]


________________________________________


SELECT DATEPART(month, jday) as month,
  DATEPART(day,jday) as day
  FROM [1057].[KiloMoana1_uway]


________________________________________


SELECT [DMY]/10000
  AS day,
  ([DMY]%10000)/100 AS month,
  ([DMY]%100) AS year,
  [HMS]/10000 as hour,
  ([HMS]%10000)/100 as minute,
  ([HMS]%100) as second,
  LAT,LON,SALINITY,[OCEAN.TEMP], CHL
  FROM [1057].[KiloMoana_1_sds_1.csv]



________________________________________


SELECT [DMY]/10000
  AS day,
  ([DMY]%10000)/100 AS month,
  ([DMY]%100) AS year,
  [HMS]/10000 as hour,
  ([HMS]%10000)/100 as minute,
  ([HMS]%100) as second,
  LAT,LON,SALINITY,[OCEAN.TEMP], CHL
  FROM [1057].[KiloMoana_1_sds_1.csv]



________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day,hour, minute,second,0) as timestamp,
  LAT,LON, SALINITY,[OCEAN.TEMP],CHL
  FROM [1057].[KiloMoana_1_sds_timestamp]


________________________________________


SELECT DATEPART(month, jday-1) as month,
  DATEPART(day,jday-1) as day
  FROM [1057].[KiloMoana1_uway]


________________________________________


SELECT DATEPART(month, jday-1) as month,
  DATEPART(day,jday-1) as day,
  LAT, LONG, T, S, hour, [min] as minute, sec as second
  FROM [1057].[KiloMoana1_uway]


________________________________________


SELECT DATEPART(month, jday-1) as month,
  DATEPART(day,jday-1) as day,
  LAT, LONG, T, S, hour, [min] as minute, sec as second
  FROM [1057].[KiloMoana1_uway]


________________________________________


SELECT DATEPART(month, jday-1) as month,
  DATEPART(day,jday-1) as day,
  LAT, LONG, T, S, year, hour, [min] as minute, sec as second
  FROM [1057].[KiloMoana1_uway]


________________________________________


SELECT 
  DATETIMEFROMPARTS(year,month,day,hour, minute,second,0) as timestamp,
  LAT, LONG, T, S
  FROM [1057].[KiloMoana1_uway_timestamp]


________________________________________


SELECT S.timestamp, AVG(U.T1) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[Tokyo1_sds_timestamp] as S, 
  [1057].[Tokyo1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(U.T1) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[Tokyo_2_sds_timestamp.csv] as S, 
  [1057].[Tokyo2_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(U.T1) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[Tokyo_2_sds_timestamp.csv] as S, 
  [1057].[Tokyo2_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(U.T1) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[Tokyo_2_sds_timestamp.csv] as S, 
  [1057].[Tokyo2_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S, 
  [1057].[Tokyo3_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo4_sds_timestamp] as S, 
  [1057].[Tokyo4_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo4_sds_timestamp] as S, 
  [1057].[Tokyo4_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(cast(U.T1 as float)) as [OCEAN.TEMP], AVG(cast(U.S as float)) as SALINITY
  FROM [1057].[Tokyo4_sds_timestamp] as S, 
  [1057].[Tokyo4_uway_timestamp_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp) 
  GROUP BY S.timestamp


________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT,LON, SALINITY,[OCEAN.TEMP],CHL
  FROM [1057].[KiloMoana_1_sds_timestamp]


________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT,LON, SALINITY,[OCEAN.TEMP],CHL,day,[file]
  FROM [1057].[KiloMoana_1_sds_timestamp]


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT SD.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as SD, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= SD.timestamp AND U.timestamp < DATEADD(mi,3,SD.timestamp)  
  GROUP BY SD.timestamp


________________________________________


SELECT max(jday)
  FROM [1057].[KiloMoana1_uway]


________________________________________


SELECT DATEPART(month, jday-1) as month,
  DATEPART(day,jday-1) as day,
  LAT, LONG, T, S, year, hour, minute, second
  FROM [1057].[KiloMoana1_uway]


________________________________________


SELECT 
  DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT,LON, SALINITY,[OCEAN.TEMP],CHL,day,[file]
  FROM [1057].[KiloMoana_1_sds_timestamp]


________________________________________


SELECT 
  DATETIMEFROMPARTS(year,month,day,hour, minute,second,0) as timestamp,
  LAT, LONG, T, S
  FROM [1057].[KiloMoana1_uway_timestamp]


________________________________________


SELECT S.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT max(timestamp)
  FROM [materialized_KiloMoana1_uway_timestamp_1col_snapshot]


________________________________________


SELECT max(timestamp)
  FROM [materialized_KiloMoana1_uway_timestamp_1col_snapshot]


________________________________________


SELECT S.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S, 
  [1057].[KiloMoana1_uway_timestamp_1col_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as S,
  [1057].[KiloMoana1_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day, S.CHL
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as S,
  [1057].[KiloMoana1_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as S,
  [1057].[KiloMoana1_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as S,
  [1057].[KiloMoana1_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as S,
  [1057].[KiloMoana1_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  TimeJ * (60*60*24) as TimeInSec
  FROM [1057].[table_underway_data_MBARI_1.csv]


________________________________________


SELECT 
  TimeJ * (60*60*24) as TimeInSec
  FROM [1057].[table_underway_data_MBARI_1.csv]


________________________________________


SELECT 
  (TimeJ-cast(TimeJ as int)) * (60*60*24) as TimeInSec
  FROM [1057].[table_underway_data_MBARI_1.csv]


________________________________________


SELECT 
  (TimeJ-cast(TimeJ as int)) * (60*60*24) as TimeInSec,
  DATEPART(day,cast(TimeJ as INT)-1) as day
  FROM [1057].[table_underway_data_MBARI_1.csv]


________________________________________


SELECT 
  (TimeJ-cast(TimeJ as int)) * (60*60*24) as TimeInSec,
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month
  FROM [1057].[table_underway_data_MBARI_1.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time
  FROM [1057].[table_underway_data_MBARI_1.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time
  FROM [1057].[table_underway_data_MBARI_1.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time
  FROM [1057].[table_underway_data_MBARI_1.csv]SELECT * FROM [1057].[MBARI1_uway.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time,
  Latitude as LAT, Longitude as LON, Sal00 as S, T090C as T
  FROM [1057].[table_underway_data_MBARI_1.csv]SELECT * FROM [1057].[MBARI1_uway.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time,
  Latitude as LAT, Longitude as LON, Sal00 as S, T090C as T
  FROM [1057].[table_underway_data_MBARI_1.csv]SELECT * FROM [1057].[MBARI1_uway.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  2011 as year,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time,
  Latitude as LAT, Longitude as LON, Sal00 as S, T090C as T
  FROM [1057].[table_underway_data_MBARI_1.csv]SELECT * FROM [1057].[MBARI1_uway.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  2011 as year,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time,
  Latitude as LAT, Longitude as LON, Sal00 as S, T090C as T
  FROM [1057].[table_underway_data_MBARI_1.csv]SELECT * FROM [1057].[MBARI1_uway.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  2011 as year,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time,
  Latitude as LAT, Longitude as LON, Sal00 as S, T090C as T
  FROM [1057].[table_underway_data_MBARI_1.csv]SELECT * FROM [1057].[MBARI1_uway.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  2011 as year,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time,
  Latitude as LAT, Longitude as LON, Sal00 as S, T090C as T
  FROM [1057].[table_underway_data_MBARI_1.csv]SELECT * FROM [1057].[MBARI1_uway.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  2011 as year,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time,
  Latitude as LAT, Longitude as LON, Sal00 as S, T090C as T
  FROM [1057].[table_underway_data_MBARI_1.csv]SELECT * FROM [1057].[MBARI1_uway.csv]


________________________________________


SELECT 
  DATEPART(day,cast(TimeJ as INT)-1) as day,
  DATEPART(month,cast(TimeJ as INT)-1) as month,
  2011 as year,
  CONVERT(varchar, DATEADD(s, (TimeJ-cast(TimeJ as int)) * (60*60*24), 0), 114) as time,
  Latitude as LAT, Longitude as LON, Sal00 as S, T090C as T
  FROM [1057].[table_underway_data_MBARI_1.csv]


________________________________________


SELECT 
  DATETIMEFROMPARTS(year,month,day,
    DATEPART(hour, time), DATEPART(minute, time), DATEPART(second,time),0) as timestamp,
  LAT, LON, T,S
  FROM [1057].[MBARI1_uway_timestamp]


________________________________________


SELECT [DMY]/10000 AS day1,
  ([DMY]%10000)/100 AS month,
  ([DMY]%100) AS year,
  [HMS]/10000 as hour,
  ([HMS]%10000)/100 as minute,
  ([HMS]%100) as second,
  LAT,LON,SALINITY,[OCEAN.TEMP], day, [file]
  FROM [1057].[table_MBARI_1_sds.csv]


________________________________________


SELECT DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT, LON, day, [file]
  FROM [1057].[MBARI1_sds_timestamp]


________________________________________


SELECT (CAST(U.T as FLOAT)) as [OCEAN.TEMP], (CAST(U.S as FLOAT)) as SALINITY
  FROM
  [1057].[MBARI1_uway_timestamp_1col] as U
  WHERE ISNUMERIC(U.T)<>0 AND ISNUMERIC(U.S)<>0
  


________________________________________


SELECT *  FROM
  [1057].[MBARI1_uway_timestamp_1col] 
  WHERE ISNUMERIC(T)<>0 AND ISNUMERIC(S)<>0
  


________________________________________


SELECT * FROM [1057].[MBARI1_uway_timestamp_1col_noNA]
  WHERE ISDATE(timestamp)<>0


________________________________________


SELECT * FROM [1057].[MBARI1_uway_timestamp_1col_noNA]
  WHERE ISDATE(timestamp)<>01


________________________________________


SELECT * FROM [1057].[MBARI1_uway_timestamp_1col_noNA]
  WHERE ISDATE(timestamp)<>01


________________________________________


SELECT DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT, LON, day, [file]
  FROM [1057].[MBARI1_sds_timestamp]


________________________________________


SELECT *  FROM
  [1057].[MBARI1_uway_timestamp_1col] 
  WHERE ISNUMERIC(T)<>0 AND ISNUMERIC(S)<>0
  


________________________________________


SELECT DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT, LON, day, [file]
  FROM [1057].[MBARI1_sds_timestamp]


________________________________________


SELECT DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT, LON, day, [file]
  FROM [1057].[MBARI1_sds_timestamp]
  WHERE ISNUMERIC(year)<>0 
  AND ISNUMERIC(month)<>0
  AND ISNUMERIC(day1)<>0
  AND ISNUMERIC(hour)<>0
  AND ISNUMERIC(minute)<>0
  AND ISNUMERIC(second)<>0 


________________________________________


SELECT DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT, LON, day, [file]
  FROM [1057].[MBARI1_sds_timestamp]
  WHERE ISNUMERIC(year)<>0 
  AND ISNUMERIC(month)<>0
  AND ISNUMERIC(day1)<>0
  AND ISNUMERIC(hour)<>0
  AND ISNUMERIC(minute)<>0
  AND ISNUMERIC(second)<>0 


________________________________________


SELECT DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT, LON, day, [file]
  FROM [1057].[MBARI1_sds_timestamp]
  WHERE ISNUMERIC(year)<>0 
  AND ISNUMERIC(month)<>0
  AND ISNUMERIC(day1)<>0
  AND ISNUMERIC(hour)<>0
  AND ISNUMERIC(minute)<>0
  AND ISNUMERIC(second)<>0 


________________________________________


SELECT DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT, LON, day, [file]
  FROM [1057].[MBARI1_sds_timestamp]



________________________________________


SELECT DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT, LON, day, [file]
  FROM [1057].[MBARI1_sds_timestamp]



________________________________________


SELECT * FROM [1057].[MBARI1_sds_timestamp_1col]
  WHERE ISDATE(timestamp)<>0


________________________________________


SELECT [DMY]/10000 AS day1,
  ([DMY]%10000)/100 AS month,
  ([DMY]%100) AS year,
  [HMS]/10000 as hour,
  ([HMS]%10000)/100 as minute,
  ([HMS]%100) as second,
  LAT,LON,SALINITY,[OCEAN.TEMP], day, [file]
  FROM [1057].[table_MBARI_1_sds.csv]
  WHERE ISNUMERIC(DMY)<>0 AND ISNUMERIC(HMS)<>0


________________________________________


SELECT DATETIMEFROMPARTS(2000+year,month,day1,hour, minute,second,0) as timestamp,
  LAT, LON, day, [file]
  FROM [1057].[MBARI1_sds_timestamp]



________________________________________


SELECT S.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[MBARI1_sds_timestamp_1col_snapshot] as S, 
  [1057].[MBARI1_uway_timestamp_1col_noNA_snapshot] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[MBARI1_sds_timestamp_1col_snapshot] as S,
  [1057].[MBARI1_sds_TS] as T
  WHERE S.timestamp = T.timestamp



________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[MBARI1_sds_timestamp_1col_snapshot] as S,
  [1057].[MBARI1_sds_TS] as T
  WHERE S.timestamp = T.timestamp



________________________________________


SELECT 
 CAST(CAST([GMT date] AS DATE) AS DATETIME) +
    CAST([GMT time] AS TIME)
  FROM [1057].[Thompson0_uway.csv]


________________________________________


SELECT 
 CAST(CAST([GMT date] AS DATE) AS DATETIME) +
    CAST([GMT time] AS TIME),
  LAT, LON, T, S
  FROM [1057].[Thompson0_uway.csv]


________________________________________


SELECT 
  CAST(time as DATETIME) as timestamp
  FROM [1057].[Thompson_0_sds.csv]


________________________________________


SELECT 
  CAST(time as DATETIME) as timestamp, [file], day
  FROM [1057].[Thompson_0_sds.csv]


________________________________________


SELECT 
 CAST(CAST([GMT date] AS DATE) AS DATETIME) +
    CAST([GMT time] AS TIME) as timestamp,
  LAT, LON, T, S
  FROM [1057].[Thompson0_uway.csv]


________________________________________


SELECT S.timestamp, AVG(U.T) as [OCEAN.TEMP], AVG(U.S) as SALINITY
  FROM [1057].[Thompson0_sds_timestamp_1col] as S, 
  [1057].[Thompson0_uway_timestamp_1col] as U
  WHERE U.timestamp >= S.timestamp AND U.timestamp < DATEADD(mi,3,S.timestamp)  
  GROUP BY S.timestamp


________________________________________


SELECT 
  CAST(time as DATETIME) as timestamp, [file], day, LAT, LON
  FROM [1057].[Thompson_0_sds.csv]


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[Thompson0_sds_timestamp_1col] as S,
  [1057].[Thompson0_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT/100 as LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT cast(S.LAT as INT)%100 as LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT cast(S.LAT as INT)/100 as LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT cast(S.LAT as INT)/100 as LATdeg,
  S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 as LATdeg,
  S.LAT - (cast(S.LAT as INT)/100) as LATmin,
  cast(S.LON as INT)/100 as LONdeg,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 as LATdeg,
  S.LAT - (cast(S.LAT as INT)/100)*100 as LATmin,
  cast(S.LON as INT)/100 as LONdeg,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 as LATdeg,
  S.LAT - (cast(S.LAT as INT)/100)*100 as LATmin,
  cast(S.LON as INT)/100 as LONdeg,
  S.LON - (cast(S.LON as INT)/100)*100 as LONmin,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 as LATdeg,
  S.LAT - (cast(S.LAT as INT)/100)*100 as LATmin,
  cast(S.LON as INT)/100 as LONdeg,
  S.LON - (cast(S.LON as INT)/100)*100 as LONmin,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 +((cast(S.LAT as INT)/100)*100/60) as LAT,
  cast(S.LON as INT)/100 as LONdeg,
  S.LON - (cast(S.LON as INT)/100)*100 as LONmin,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(cast(S.LAT as INT)/100 + ((cast(S.LAT as INT)/100)*100/60) as NUMERIC) as LAT,
  cast(S.LON as INT)/100 as LONdeg,
  S.LON - (cast(S.LON as INT)/100)*100 as LONmin,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 as LATdeg, 
  ((cast(S.LAT as INT)/100)*100/60) as LATdec,
  cast(S.LON as INT)/100 as LONdeg,
  S.LON - (cast(S.LON as INT)/100)*100 as LONmin,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 as LATdeg, 
  (cast(S.LAT as INT)/100)*100 as LATdec,
  cast(S.LON as INT)/100 as LONdeg,
  S.LON - (cast(S.LON as INT)/100)*100 as LONmin,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 as LATdeg, 
  S.LAT - (cast(S.LAT as INT)/100)*100 as LATdec,
  cast(S.LON as INT)/100 as LONdeg,
  S.LON - (cast(S.LON as INT)/100)*100 as LONmin,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 as LATdeg, 
  (S.LAT - (cast(S.LAT as INT)/100)*100)/60 as LATdec,
  cast(S.LON as INT)/100 as LONdeg,
  S.LON - (cast(S.LON as INT)/100)*100 as LONmin,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 + (S.LAT - (cast(S.LAT as INT)/100)*100)/60 as LATdec,
  cast(S.LON as INT)/100 as LONdeg,
  S.LON - (cast(S.LON as INT)/100)*100 as LONmin,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT 
  cast(S.LAT as INT)/100 + (S.LAT - (cast(S.LAT as INT)/100)*100)/60 as LAT,
  cast(S.LON as INT)/100 + (S.LON - (cast(S.LON as INT)/100)*100)/60 as LON,
  S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day
  FROM [1057].[KiloMoana_1_sds_timestamp_1col_snapshot] as S,
  [1057].[KiloMoana1_sds_TS_snapshot] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT d.LON, d.LAT, d.richness, o.O2Arbiosat
  FROM [1057].[1308-seaflow-diversity_Tokyo1_TS_1.csv] as d,
  [1057].[table_Tokyo1_O2Ar.csv] as o
  


________________________________________


SELECT d.LON, d.LAT, d.richness, o.O2Arbiosat
  FROM [1057].[1308-seaflow-diversity_Tokyo1_TS_1.csv] as d,
  [1057].[table_Tokyo1_O2Ar.csv] as o
  WHERE  o.day = d.day AND o.[file] = d.[file]
  


________________________________________


SELECT d.LON, d.LAT, d.richness, o.O2Arbiosat
  FROM [1057].[1308-seaflow-diversity_TS_tok2.csv] as d,
  [1057].[table_Tokyo2_O2Ar.csv] as o
  WHERE  o.day = d.day AND o.[file] = d.[file]
  


________________________________________


SELECT d.LON, d.LAT, d.richness, o.O2Arbiosat
  FROM [1057].[1308-seaflow-diversity_TS_tok2.csv] as d,
  [1057].[table_Tokyo2_O2Ar.csv] as o
  WHERE  o.day = d.day AND o.[file] = d.[file]
  


________________________________________


SELECT d.LON, d.LAT, d.richness, o.O2Arbiosat, d.S, d.T
  FROM [1057].[1308-seaflow-diversity_TS_tok2.csv] as d,
  [1057].[table_Tokyo2_O2Ar.csv] as o
  WHERE  o.day = d.day AND o.[file] = d.[file]
  


________________________________________


SELECT LAT, LON, [file], Cruise,
 SUBSTRING(day, CASE CHARINDEX('-', day) WHEN 0 THEN LEN(day)+1 ELSE CHARINDEX('-', day)+1 END, 1000) AS yearday
 FROM [1057].[1308-seaflow-all_sds_v2.csv]


________________________________________


SELECT LAT, LON, [file], Cruise,
 SUBSTRING(day, 5,3) AS yearday
 FROM [1057].[1308-seaflow-all_sds_v2.csv]


________________________________________


SELECT LAT, LON, [file], Cruise,
 SUBSTRING(day, 6,3) AS yearday
 FROM [1057].[1308-seaflow-all_sds_v2.csv]


________________________________________


SELECT LAT, LON, [file], Cruise,
  SUBSTRING(day, 6,3) as yearday,
  SUBSTRING(day,0,4) as year
  
 FROM [1057].[1308-seaflow-all_sds_v2.csv]


________________________________________


SELECT LAT, LON, [file], Cruise,
  SUBSTRING(day, 6,3) as yearday,
  SUBSTRING(day,0,4) as year
  
 FROM [1057].[1308-seaflow-all_sds_v2.csv]


________________________________________


SELECT LAT, LON, [file], Cruise,
  SUBSTRING(day, 6,3) as yearday,
  SUBSTRING(day,1,4) as year
  
 FROM [1057].[1308-seaflow-all_sds_v2.csv]


________________________________________


SELECT LAT, LON, [file], Cruise, day,
  SUBSTRING(day, 6,3) as yearday,
  SUBSTRING(day,1,4) as year
  
 FROM [1057].[1308-seaflow-all_sds_v2.csv]


________________________________________


SELECT LAT, LON, [file], Cruise, day,
  SUBSTRING(day, 6,3) as yearday,
  SUBSTRING(day,1,4) as year
  
 FROM [1057].[1308-seaflow-all_sds_v2.csv]


________________________________________


SELECT 
  opp/evt as opp_evt,
  day as Day, 
  [file] as File_Id
  FROM [1057].[Tokyo1_stats.tab] 

  
  
  


________________________________________


SELECT 
  CAST(opp as FLOAT)/CAST(evt as FLOAT) as opp_evt,
  day as Day, 
  [file] as File_Id
  FROM [1057].[Tokyo1_stats.tab] 

  
  
  


________________________________________


SELECT 
  DISTINCT day as Day, [file] as File_Id,
  (CAST(opp as FLOAT))/(CAST(evt as FLOAT)) as opp_evt
  FROM [1057].[Tokyo1_stats.tab] 

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  D.[STREAM.PRESSURE] as pres
  FROM [1057].[Tokyo1_stats.tab] as T,
  [1057].[Tokyo1_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file]

  
  
  


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo1_sds.tab]
  WHERE ISNUMERIC([STREAM.PRESSURE])<>0


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo1_sds.tab]
  WHERE ISNUMERIC([STREAM.PRESSURE])=0


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo1_sds.tab]
  WHERE ISNUMERIC([STREAM.PRESSURE])<>0


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.2769) as flow_rate
  FROM [1057].[Tokyo1_stats.tab] as T,
  [1057].[Tokyo1_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.2769) as flow_rate
  FROM [1057].[Tokyo1_stats.tab] as T,
  [1057].[Tokyo1_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.2769) as flow_rate
  FROM [1057].[Tokyo1_stats.tab] as T,
  [1057].[Tokyo1_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT * FROM [1057].[table_sds_2.tab]


________________________________________


SELECT 
  DISTINCT T.day as Day, 
  T.[file] as File_Id, 
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.2769) as flow_rate 
  FROM [1057].[Tokyo2_stats.tab] as T, 
  [1057].[Tokyo2_sds.tab] as D 
  WHERE T.day = D.day 
  AND T.[file] = D.[file] 
  AND ISNUMERIC(D.[STREAM.PRESSURE])<>0




________________________________________


SELECT 
  DISTINCT T.day as Day, 
  T.[file] as File_Id, 
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.2769) as flow_rate 
  FROM [1057].[Tokyo2_stats.tab] as T, 
  [1057].[Tokyo2_sds.tab] as D 
  WHERE T.day = D.day 
  AND T.[file] = D.[file] 
  AND ISNUMERIC(D.[STREAM.PRESSURE])<>0




________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.2769) as flow_rate
  FROM [1057].[Tokyo1_stats.tab] as T,
  [1057].[Tokyo1_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.2769) as flow_rate
  FROM [1057].[Tokyo3_stats.tab] as T,
  [1057].[Tokyo3_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.2769) as flow_rate
  FROM [1057].[Tokyo4_stats.tab] as T,
  [1057].[Tokyo4_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo4_sds.tab]
  WHERE ISNUMERIC([STREAM.PRESSURE])<>0


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo4_sds.tab]
  WHERE [STREAM.PRESSURE]>8


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo4_sds.tab]
  WHERE [STREAM.PRESSURE]>2


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo4_sds.tab]
  WHERE [STREAM.PRESSURE]>24


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo4_sds.tab]
  WHERE [STREAM.PRESSURE]>24


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo4_sds.tab]
  WHERE [STREAM.PRESSURE]>4


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo4_sds.tab]
  WHERE [STREAM.PRESSURE]>6


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo4_sds.tab]
  WHERE [STREAM.PRESSURE]>5


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo3_sds.tab]
  WHERE [STREAM.PRESSURE]>5


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo3_sds.tab]
  WHERE [STREAM.PRESSURE]>8


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo3_sds.tab]
  WHERE [STREAM.PRESSURE]>6


________________________________________


SELECT [STREAM.PRESSURE]
  FROM [1057].[Tokyo3_sds.tab]
  WHERE [STREAM.PRESSURE]>7


________________________________________


SELECT avg([STREAM.PRESSURE])
  FROM [1057].[Tokyo3_sds.tab]
  


________________________________________


SELECT avg([STREAM.PRESSURE])
  FROM [1057].[Tokyo4_sds.tab]
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[CMOP3_stats.tab] as T,
  [1057].[CMOP3_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.2769) as flow_rate
  FROM [1057].[KiloMoana_stats.tab] as T,
  [1057].[KiloMoana_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[KiloMoana_stats.tab] as T,
  [1057].[KiloMoana_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[Thompson0_stats.tab] as T,
  [1057].[Thompson_0_sds.csv] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[Thomspon4_stats.tab] as T,
  [1057].[Thompson4_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[Thompson5_stats.tab] as T,
  [1057].[Thompson5_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[Thompson8_stats.tab] as T,
  [1057].[Thompson8_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[Thompson9_stats.tab] as T,
  [1057].[Thompson9_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[Thompson10_stats.tab] as T,
  [1057].[Thompson10_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[Thompson11_stats.tab] as T,
  [1057].[Thompson11_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1738) as flow_rate
  FROM [1057].[Thompson12_stats.tab] as T,
  [1057].[Thompson12_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1800) as flow_rate
  FROM [1057].[MBARI1_stats.tab] as T,
  [1057].[MBARI1_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1800) as flow_rate
  FROM [1057].[MBARI2_stats.tab] as T,
  [1057].[MBARI2_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT 
  DISTINCT T.day as Day, T.[file] as File_Id,
  (CAST(T.opp as FLOAT))/(CAST(T.evt as FLOAT)) as opp_evt,
  (1000*(-9*POWER(10,-5)*POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),4) + 0.0066 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),3) - 0.173 * POWER(CAST(D.[STREAM.PRESSURE] as FLOAT),2) + 2.5013 * CAST(D.[STREAM.PRESSURE] as FLOAT) + 2.1059) * 0.1800) as flow_rate
  FROM [1057].[DeepDOM_stats.tab] as T,
  [1057].[DeepDOM_sds.tab] as D
  WHERE T.day = D.day AND T.[file] = D.[file] AND ISNUMERIC(D.[STREAM.PRESSURE])<>0

  
  
  


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day, S.timestamp
  FROM [1057].[MBARI1_sds_timestamp_1col_snapshot] as S,
  [1057].[MBARI1_sds_TS] as T
  WHERE S.timestamp = T.timestamp



________________________________________


SELECT * FROM [1057].[MBARI1_sds_complete.csv]


________________________________________


SELECT * FROM [1057].[MBARI1_sds_complete.csv]


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day, S.timestamp
  FROM [1057].[Thompson0_sds_timestamp_1col] as S,
  [1057].[Thompson0_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED], S.timestamp
  FROM [1057].[Tokyo1_sds_timestamp] as S,
  [1057].[Tokyo1_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED], S.timestamp
  FROM [1057].[Tokyo_2_sds_timestamp.csv] as S,
  [1057].[Tokyo_2_sds_TS.csv] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED], S.timestamp
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S,
  [1057].[Tokyo3_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED], S.timestamp
  FROM [1057].[Tokyo3_sds_timestamp.csv] as S,
  [1057].[Tokyo3_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT S.LAT, S.LON, S.[file],T.[OCEAN.TEMP],T.SALINITY,S.day,S.[BULK.RED], S.timestamp
  FROM [1057].[Tokyo4_sds_timestamp] as S,
  [1057].[Tokyo4_sds_TS] as T
  WHERE S.timestamp = T.timestamp


________________________________________


SELECT DATEPART(year, DMY)
  FROM [1057].[CMOP3_sds.tab]
  


________________________________________


SELECT DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[CMOP3_sds.tab]
  


________________________________________


SELECT DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp,
  LAT, LON, SALINITY
  FROM [1057].[CMOP3_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  
  


________________________________________


SELECT DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp,
  LAT, LON, SALINITY, [OCEAN.TEMP], [file], day,
  [BULK.RED]
  FROM [1057].[CMOP3_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  
  


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[CMOP3_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  
  


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[CMOP3_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  
  


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  




________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  




________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson5_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  

 


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  




________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  




________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  




________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson8_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson9_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson9_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson9_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT CAST(DMY as CHAR)
  
  FROM [1057].[Thompson10_sds.tab]
  


________________________________________


SELECT REPLACE(CAST(DMY as CHAR),'-','')
  
  FROM [1057].[Thompson10_sds.tab]
  


________________________________________


SELECT REPLACE(CAST(DMY as char),'-','') as tempdate
  
  FROM [1057].[Thompson10_sds.tab]
  


________________________________________


SELECT *,
  REPLACE(CAST(DMY as char),'-','') as tempdate
  
  FROM [1057].[Thompson10_sds.tab]
  


________________________________________


SELECT
  REPLACE(tempdate,'2012','12')
  FROM [1057].[Thompson10_tempdate.csv]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson9_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson5_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson5_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0
  




________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0



________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0



________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0



________________________________________


SELECT *
  FROM [1057].[Thompson4_sds.tab]
  WHERE ISDATE(DMY) = 0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM [1057].[Thompson4_sds.tab]
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0



________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(date, DMY, 103) as DMY, 
           convert(date, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(date, DMY, 101) as DMY, 
           convert(date, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(date, DMY, 101) as DMY, 
           convert(date, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(date, DMY, 103) as DMY, 
           convert(date, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           DMY, convert(date, DMY, 103) as DMY2, 
           convert(date, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           DMY, convert(datetime, DMY, 103) as DMY2, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           DMY, convert(datetime, DMY, 103) as DMY2, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(date, DMY, 101) as DMY, 
           convert(time, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson4_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson5_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson5_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson8_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson8_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMS), DATEPART(minute, HMS),
  DATEPART(second, HMS),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMS, 103) as HMS 
FROM [1057].[Thompson9_sds.tab]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT *,
  convert(datetime, DMY, 103) as tempdate
  
  FROM [1057].[Thompson10_sds.tab]
  


________________________________________


SELECT *,
  convert(datetime, DMY, 103) as DMY
  
  FROM [1057].[Thompson10_sds.tab]
  


________________________________________


SELECT *,
  STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':')
  
  FROM [1057].[Thompson10_sds.tab]
  


________________________________________


SELECT 
  STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as 1358
  
  FROM [1057].[Thompson10_sds.tab]
  


________________________________________


SELECT 
  HMS, STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as 1358
  
  FROM [1057].[Thompson10_sds.tab]
  


________________________________________


SELECT 
  STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as HMS
  
  FROM [1057].[Thompson10_sds.tab]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


SELECT 
  STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as 1358, HMS
  
  FROM [1057].[Thompson10_sds.tab]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


  SELECT STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as HMS
  FROM [1057].[Thompson10_sds.tab]
  
  
  


________________________________________


  SELECT 
  HMS, STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as HMS2
  FROM [1057].[Thompson10_sds.tab]
  
  
  


________________________________________


  SELECT 
  HMS, STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as HMS2
  FROM [1057].[Thompson10_sds.tab]
  
  
  


________________________________________


  SELECT 
  *, STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as HMS2
  FROM [1057].[Thompson10_sds.tab]
  
  
  


________________________________________


SELECT HMS2, HMS2 as HMS
 FROM [1057].[Thompson10_tempdate.csv]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


  SELECT 
  *, HMS2 as HMS
  FROM (
  SELECT 
  *, STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as HMS2
  FROM [1057].[Thompson10_sds.tab]
  ) as x
  WHERE ISNUMERIC(HMS)<>0
  
  
  


________________________________________


SELECT *, HMS2 as HMS
 FROM [1057].[Thompson10_tempdate.csv]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


SELECT *, HMS2 as HMS
 FROM [1057].[Thompson10_tempdate.csv]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


  SELECT 
  *, STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as HMS2
  FROM [1057].[Thompson10_sds.tab]
  
  
  


________________________________________


SELECT *, HMS2 as HMS
 FROM [1057].[Thompson10_tempdate.csv]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED], HMS2 as HMS
 FROM [1057].[Thompson10_tempdate.csv]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED], HMS2 as HMS
 FROM [1057].[Thompson10_tempdate.csv]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


SELECT HMS, HMS2 as HMS
 FROM [1057].[Thompson10_tempdate.csv]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


SELECT HMS, HMS2
 FROM [1057].[Thompson10_tempdate.csv]
  WHERE ISNUMERIC(HMS)<>0


________________________________________


SELECT HMS, HMS2
 FROM [1057].[Thompson10_tempdate.csv]




________________________________________


SELECT (CASE WHEN ISNUMERIC(HMS)<>0 THEN HMS2
  ELSE HMS
  END) as time

 FROM [1057].[Thompson10_tempdate.csv]

  
  




________________________________________


SELECT HMS, HMS2,
  (CASE WHEN ISNUMERIC(HMS)<>0 THEN HMS2
  ELSE HMS
  END) as time

 FROM [1057].[Thompson10_tempdate.csv]

  
  




________________________________________


SELECT *,
  (CASE WHEN ISNUMERIC(HMS)<>0 THEN HMS2
  ELSE HMS
  END) as time

 FROM [1057].[Thompson10_tempdate.csv]

  
  




________________________________________


SELECT *,
  (CASE WHEN ISNUMERIC(HMS)<>0 THEN HMS2
  ELSE HMS
  END) as time

 FROM [1057].[Thompson10_tempdate.csv]


________________________________________


SELECT *,
  (CASE WHEN ISNUMERIC(HMS)<>0 THEN HMS2
  ELSE HMS
  END) as HMStime

 FROM [1057].[Thompson10_tempdate.csv]


________________________________________


SELECT HMStime FROM [1057].[Thompson10_sds_time.csv]


________________________________________


SELECT 
  convert(time,HMStime,103)
  FROM [1057].[Thompson10_sds_time.csv]


________________________________________


SELECT 
  convert(time,HMStime,103) as HMS
  FROM [1057].[Thompson10_sds_time.csv]


________________________________________


SELECT 
  convert(datetime,HMStime,103) as HMS
  FROM [1057].[Thompson10_sds_time.csv]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMStime), DATEPART(minute, HMStime),
  DATEPART(second, HMStime),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMStime, 103) as HMStime 
FROM [1057].[Thompson10_sds_time.csv]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT *,
  convert(datetime,DMY,103) as DMY
   FROM [1057].[Thompson11_sds.tab]


________________________________________


SELECT *,
  convert(datetime,DMY,103) as DMY
   FROM [1057].[Thompson11_sds.tab]


________________________________________


SELECT *,
  convert(datetime,DMY,103) as DMY
   FROM [1057].[Thompson11_sds.tab]


________________________________________


SELECT 
  convert(datetime,DMY,103) as DMY
   FROM [1057].[Thompson11_sds.tab]


________________________________________


SELECT 
  *, STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as HMS2
  FROM [1057].[Thompson11_sds.tab]
  
  


________________________________________


SELECT *,
  (CASE WHEN ISNUMERIC(HMS)<>0 THEN HMS2
  ELSE HMS
  END) as HMStime

 FROM [1057].[Thompson11_tempdate.csv]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMStime), DATEPART(minute, HMStime),
  DATEPART(second, HMStime),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMStime, 103) as HMStime 
FROM [1057].[Thompson11_sds_time.csv]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMStime), DATEPART(minute, HMStime),
  DATEPART(second, HMStime),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMStime, 103) as HMStime 
FROM [1057].[Thompson11_sds_time.csv]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMStime), DATEPART(minute, HMStime),
  DATEPART(second, HMStime),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMStime, 103) as HMStime 
FROM [1057].[Thompson11_sds_time.csv]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT 
  *, STUFF(STUFF(REPLICATE('0',6-LEN(HMS)) + convert(VARCHAR(6),HMS),3,0,':'),6,0,':') as HMS2
  FROM [1057].[Thompson12_sds.tab]


________________________________________


SELECT *,
  (CASE WHEN ISNUMERIC(HMS)<>0 THEN HMS2
  ELSE HMS
  END) as HMStime

 FROM [1057].[Thompson12_tempdate.csv]


________________________________________


SELECT *,
  (CASE WHEN ISNUMERIC(HMS)<>0 THEN HMS2
  ELSE HMS
  END) as HMStime

 FROM [1057].[Thompson12_tempdate.csv]


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  DATETIMEFROMPARTS(DATEPART(year, DMY),
  DATEPART(month, DMY), DATEPART(day, DMY),
  DATEPART(hour, HMStime), DATEPART(minute, HMStime),
  DATEPART(second, HMStime),0) as timestamp
  FROM (
SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
           convert(datetime, DMY, 103) as DMY, 
           convert(datetime, HMStime, 103) as HMStime 
FROM [1057].[Thompson12_sds_time.csv]
) as x
  WHERE DATEPART(year, DMY)>1999
  AND ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  convert(datetime,time,0)  as timestamp

FROM [1057].[Thompson_1_sds.csv]

  WHERE ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  convert(datetime,time,0)  as timestamp

FROM [1057].[Thompson_1_sds.csv]

  WHERE ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  convert(datetime,time,0)  as timestamp

FROM [1057].[Thompson_1_sds.csv]

  WHERE ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  convert(datetime,time,0)  as timestamp

FROM [1057].[MBARI2_sds.tab]

  WHERE ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  convert(datetime,time,0)  as timestamp

FROM [1057].[table_sds_16.tab]

  WHERE ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT LAT, LON, [file], [OCEAN.TEMP], SALINITY, day, [BULK.RED],
  convert(datetime,time,0)  as timestamp

FROM [1057].[table_sds_16.tab]

  WHERE ISNUMERIC(LAT)<>0 AND ISNUMERIC(LON)<>0
  AND ISNUMERIC(SALINITY)<>0 AND ISNUMERIC([OCEAN.TEMP])<>0


________________________________________


SELECT * FROM [684].[inferredVariablesNoVersion.csv]
  where Canopy = 1


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where term LIKE '%growth%'


________________________________________


SELECT * FROM [253].[table_nsfastgrantbib20121130 (1).csv]


________________________________________


SELECT * FROM [253].[table_nsfastgrantbib20121130 (1).csv] WHERE [253].[table_nsfastgrantbib20121130 (1).csv].[Refereed] LIKE '%refereed%"'


________________________________________


SELECT * FROM [253].[table_nsfastgrantbib20121130 (1).csv] WHERE Refereed LIKE '%refereed%"'


________________________________________


SELECT * FROM [253].[table_nsfastgrantbib20121130 (1).csv] WHERE [table_nsfastgrantbib20121130 (1).csv].[Refereed] LIKE '%refereed%"'


________________________________________


SELECT * FROM [253].[table_nsfastgrantbib20121130 (1).csv] WHERE Refereed='refereed'


________________________________________


SELECT * FROM [253].[table_nsfastgrantbib20121130 (1).csv] WHERE Refereed='refereed'


________________________________________


SELECT * FROM [412].[RPKM all oysters.txt]


________________________________________


SELECT authors FROM [541].[pdb_citations]


________________________________________


SELECT * FROM [183].[1388k.csv]
  Where Year = 2000



________________________________________


SELECT top 10 * FROM [183].[1388k.csv]
  Where Year = 2000



________________________________________


SELECT top 1000 * FROM [183].[1388k.csv]
  Where Year = 2000



________________________________________


SELECT top 1000 * FROM [183].[1388k.csv]
  Where Year = 2001



________________________________________


SELECT Column1 FROM [1079].[Analyses_sizevsNumQueries.csv]


________________________________________


SELECT Column1 as [1385name], Column2 as [size], Column3 as [Queries], Column4 as ratio FROM [1079].[Analyses_sizevsNumQueries.csv] 


________________________________________


select * from [1118].[periodic_table]
  


________________________________________


SELECT TOP 5 * FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]


________________________________________


SELECT sum(Total_Amount_of_Payment_USDollars) FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]


________________________________________


SELECT * FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
 order by Total_Amount_of_Payment_USDollars desc


________________________________________


SELECT sum(Dollar_Amount_Invested) FROM [1079].[OPPR_ALL_DTL_OWNRSHP_09302014.csv]


________________________________________


SELECT sum(Total_Amount_of_Payment_USDollars) FROM [1079].[OPPR_ALL_DTL_RSRCH_09302014.csv]


________________________________________


SELECT sum(Total_Amount_of_Payment_USDollars) FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]


________________________________________


SELECT sum(Total_Amount_of_Payment_USDollars) FROM [1079].[OPPR_MASK_DTL_GNRL_20140930.csv]


________________________________________


SELECT Sum(Total_Amount_of_Payment_USDollars), [Applicable_Manufacturer_or_Applicable_GPO_Making_Payment_State] FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
  group by Applicable_Manufacturer_or_Applicable_GPO_Making_Payment_State


________________________________________


SELECT Sum(Total_Amount_of_Payment_USDollars), [Recipient_State] FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
  group by Recipient_State


________________________________________


SELECT Sum(Total_Amount_of_Payment_USDollars), [Recipient_State] FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
  group by Recipient_State order by Recipient_State 


________________________________________


SELECT sum(Total_Amount_of_Payment_USDollars), recipient_state FROM [1079].[OPPR_MASK_DTL_GNRL_20140930.csv]
 group by recipient_state  order by recipient_state


________________________________________


SELECT sum(Total_Amount_of_Payment_USDollars), recipient_state FROM [1079].[OPPR_MASK_DTL_GNRL_20140930.csv]
 group by recipient_state  order by recipient_state


________________________________________


SELECT sum(Total_Amount_of_Payment_USDollars) FROM [1079].[OPPR_MASK_DTL_GNRL_20140930.csv]


________________________________________


SELECT sum(Total_Amount_of_Payment_USDollars) FROM [1079].[table_OPPR_MASK_DTL_RSRCH_20140930.csv]


________________________________________


SELECT count(*) FROM [1079].[view_depth_breadth_per_view.csv]
  where depth = 0


________________________________________


SELECT count(*) FROM [1079].[view_depth_breadth_per_view.csv]
  


________________________________________


SELECT count(*) FROM [1079].[view_depth_breadth_per_view_1.csv]
  
 where depth >0


________________________________________


SELECT count(*) FROM [1079].[view_depth_breadth_per_view_2.csv]
  
 where depth >0


________________________________________


SELECT count(*) FROM [1079].[view_depth_breadth_per_view_2.csv]
  
 


________________________________________


SELECT * FROM [1079].[view_depth_breadth_per_view_2.csv]


________________________________________


SELECT onwer as "1385", max(ViewDepth) as max_depth  FROM [1079].[ViewDepths.csv]
  group by onwer order by max(ViewDepth) desc


________________________________________


SELECT top 100 * FROM [1079].[max_depth] 


________________________________________


SELECT top 100 * FROM [1079].[max_depth] order by max_depth desc 


________________________________________


SELECT top 100 * FROM [1079].[max_depth] order by max_depth desc


________________________________________


SELECT * FROM [materialized_snapshot bact detection average spc]


________________________________________


SELECT Protein, Length, [A1 avg SpC],[A2 avg SpC],[A3 avg SpC],
  [B1 avg SpC],
  [B2 avg SpC],
  [B3 avg SpC],
  [C1 avg SpC],
  [C2 avg SpC],
  [C3 avg SpC],
  [D1 avg SpC],
  [D2 avg SpC],
  [D3 avg SpC],
  [E1 avg SpC],
  [E2 avg SpC],
  [E3 avg SpC],
  [F1 avg SpC],
  [F2 avg SpC],
  [F3 avg SpC],
  [G1 avg SpC],
  [G2 avg SpC],
  [G3 avg SpC],
  [H1 avg SpC],
  [H2 avg SpC],
  [H3 avg SpC],
  [J1 avg SpC],
  [J2 avg SpC],
  [J3 avg SpC],
  [L1 avg SpC],
  [L2 avg SpC],
  [L3 avg SpC],
  [M1 avg SpC],
  [M2 avg SpC],
  [M3 avg SpC],
  [N1 avg SpC],
  [N2 avg SpC],
  [N3 avg SpC],
  CAST([A1 avg SpC] AS FLOAT)/[Length] AS [A1 SpC/L],
  CAST([A2 avg SpC] AS FLOAT)/[Length] AS [A2 SpC/L],
  CAST([A3 avg SpC] AS FLOAT)/[Length] AS [A3 SpC/L],
  CAST([B1 avg SpC] AS FLOAT)/[Length] AS [B1 SpC/L],
  CAST([B2 avg SpC] AS FLOAT)/[Length] AS [B2 SpC/L],
  CAST([B3 avg SpC] AS FLOAT)/[Length] AS [B3 SpC/L],
  CAST([C1 avg SpC] AS FLOAT)/[Length] AS [C1 SpC/L],
  CAST([C2 avg SpC] AS FLOAT)/[Length] AS [C2 SpC/L],
  CAST([C3 avg SpC] AS FLOAT)/[Length] AS [C3 SpC/L],
  CAST([D1 avg SpC] AS FLOAT)/[Length] AS [D1 SpC/L],
  CAST([D2 avg SpC] AS FLOAT)/[Length] AS [D2 SpC/L],
  CAST([D3 avg SpC] AS FLOAT)/[Length] AS [D3 SpC/L],
  CAST([E1 avg SpC] AS FLOAT)/[Length] AS [E1 SpC/L],
  CAST([E2 avg SpC] AS FLOAT)/[Length] AS [E2 SpC/L],
  CAST([E3 avg SpC] AS FLOAT)/[Length] AS [E3 SpC/L],
  CAST([F1 avg SpC] AS FLOAT)/[Length] AS [F1 SpC/L],
  CAST([F2 avg SpC] AS FLOAT)/[Length] AS [F2 SpC/L],
  CAST([F3 avg SpC] AS FLOAT)/[Length] AS [F3 SpC/L],
  CAST([G1 avg SpC] AS FLOAT)/[Length] AS [G1 SpC/L],
  CAST([G2 avg SpC] AS FLOAT)/[Length] AS [G2 SpC/L],
  CAST([G3 avg SpC] AS FLOAT)/[Length] AS [G3 SpC/L],
  CAST([H1 avg SpC] AS FLOAT)/[Length] AS [H1 SpC/L],
  CAST([H2 avg SpC] AS FLOAT)/[Length] AS [H2 SpC/L],
  CAST([H3 avg SpC] AS FLOAT)/[Length] AS [H3 SpC/L],
  CAST([J1 avg SpC] AS FLOAT)/[Length] AS [J1 SpC/L],
  CAST([J2 avg SpC] AS FLOAT)/[Length] AS [J2 SpC/L],
  CAST([J3 avg SpC] AS FLOAT)/[Length] AS [J3 SpC/L],
  CAST([L1 avg SpC] AS FLOAT)/[Length] AS [L1 SpC/L],
  CAST([L2 avg SpC] AS FLOAT)/[Length] AS [L2 SpC/L],
  CAST([L3 avg SpC] AS FLOAT)/[Length] AS [L3 SpC/L],
  CAST([M1 avg SpC] AS FLOAT)/[Length] AS [M1 SpC/L],
  CAST([M2 avg SpC] AS FLOAT)/[Length] AS [M2 SpC/L],
  CAST([M3 avg SpC] AS FLOAT)/[Length] AS [M3 SpC/L],
  CAST([N1 avg SpC] AS FLOAT)/[Length] AS [N1 SpC/L],
  CAST([N2 avg SpC] AS FLOAT)/[Length] AS [N2 SpC/L],
  CAST([N3 avg SpC] AS FLOAT)/[Length] AS [N3 SpC/L]
  FROM [1079].[snapshot bact detection average spc]


________________________________________


SELECT Protein,
  spc.[A1 SpC/L] / allspc.[SUM A1 SpC/L] AS [NSAF A1],
  spc.[A2 SpC/L] / allspc.[SUM A2 SpC/L] AS [NSAF A2],
  spc.[A3 SpC/L] / allspc.[SUM A3 SpC/L] AS [NSAF A3],
  spc.[B1 SpC/L] / allspc.[SUM B1 SpC/L] AS [NSAF B1],
  spc.[B2 SpC/L] / allspc.[SUM B2 SpC/L] AS [NSAF B2],
  spc.[B3 SpC/L] / allspc.[SUM B3 SpC/L] AS [NSAF B3],
  spc.[C1 SpC/L] / allspc.[SUM C1 SpC/L] AS [NSAF C1],
  spc.[C2 SpC/L] / allspc.[SUM C2 SpC/L] AS [NSAF C2],
  spc.[C3 SpC/L] / allspc.[SUM C3 SpC/L] AS [NSAF C3],
  spc.[D1 SpC/L] / allspc.[SUM D1 SpC/L] AS [NSAF D1],
  spc.[D2 SpC/L] / allspc.[SUM D2 SpC/L] AS [NSAF D2],
  spc.[D3 SpC/L] / allspc.[SUM D3 SpC/L] AS [NSAF D3],
  spc.[E1 SpC/L] / allspc.[SUM E1 SpC/L] AS [NSAF E1],
  spc.[E2 SpC/L] / allspc.[SUM E2 SpC/L] AS [NSAF E2],
  spc.[E3 SpC/L] / allspc.[SUM E3 SpC/L] AS [NSAF E3],
  spc.[F1 SpC/L] / allspc.[SUM F1 SpC/L] AS [NSAF F1],
  spc.[F2 SpC/L] / allspc.[SUM F2 SpC/L] AS [NSAF F2],
  spc.[F3 SpC/L] / allspc.[SUM F3 SpC/L] AS [NSAF F3],
  spc.[G1 SpC/L] / allspc.[SUM G1 SpC/L] AS [NSAF G1],
  spc.[G2 SpC/L] / allspc.[SUM G2 SpC/L] AS [NSAF G2],
  spc.[G3 SpC/L] / allspc.[SUM G3 SpC/L] AS [NSAF G3],
  spc.[H1 SpC/L] / allspc.[SUM H1 SpC/L] AS [NSAF H1],
  spc.[H2 SpC/L] / allspc.[SUM H2 SpC/L] AS [NSAF H2],
  spc.[H3 SpC/L] / allspc.[SUM H3 SpC/L] AS [NSAF H3],
  spc.[J1 SpC/L] / allspc.[SUM J1 SpC/L] AS [NSAF J1],
  spc.[J2 SpC/L] / allspc.[SUM J2 SpC/L] AS [NSAF J2],
  spc.[J3 SpC/L] / allspc.[SUM J3 SpC/L] AS [NSAF J3],
  spc.[L1 SpC/L] / allspc.[SUM L1 SpC/L] AS [NSAF L1],
  spc.[L2 SpC/L] / allspc.[SUM L2 SpC/L] AS [NSAF L2],
  spc.[L3 SpC/L] / allspc.[SUM L3 SpC/L] AS [NSAF L3],
  spc.[M1 SpC/L] / allspc.[SUM M1 SpC/L] AS [NSAF M1],
  spc.[M2 SpC/L] / allspc.[SUM M2 SpC/L] AS [NSAF M2],
  spc.[M3 SpC/L] / allspc.[SUM M3 SpC/L] AS [NSAF M3],
  spc.[N1 SpC/L] / allspc.[SUM N1 SpC/L] AS [NSAF N1],
  spc.[N2 SpC/L] / allspc.[SUM N2 SpC/L] AS [NSAF N2],
  spc.[N3 SpC/L] / allspc.[SUM N3 SpC/L] AS [NSAF N3]
  FROM [1079].[best detection SpC-L faster] spc,
  [412].[summed spc-l] allspc


________________________________________


SELECT 
  SUM([A1 SpC/L]) AS [SUM A1 SpC/L],
  SUM([A2 SpC/L]) AS [SUM A2 SpC/L],
  SUM([A3 SpC/L]) AS [SUM A3 SpC/L],
  SUM([B1 SpC/L]) AS [SUM B1 SpC/L],
  SUM([B2 SpC/L]) AS [SUM B2 SpC/L],
  SUM([B3 SpC/L]) AS [SUM B3 SpC/L],
  SUM([C1 SpC/L]) AS [SUM C1 SpC/L],
  SUM([C2 SpC/L]) AS [SUM C2 SpC/L],
  SUM([C3 SpC/L]) AS [SUM C3 SpC/L],
  SUM([D1 SpC/L]) AS [SUM D1 SpC/L],
  SUM([D2 SpC/L]) AS [SUM D2 SpC/L],
  SUM([D3 SpC/L]) AS [SUM D3 SpC/L],
  SUM([E1 SpC/L]) AS [SUM E1 SpC/L],
  SUM([E2 SpC/L]) AS [SUM E2 SpC/L],
  SUM([E3 SpC/L]) AS [SUM E3 SpC/L],
  SUM([F1 SpC/L]) AS [SUM F1 SpC/L],
  SUM([F2 SpC/L]) AS [SUM F2 SpC/L],
  SUM([F3 SpC/L]) AS [SUM F3 SpC/L],
  SUM([G1 SpC/L]) AS [SUM G1 SpC/L],
  SUM([G2 SpC/L]) AS [SUM G2 SpC/L],
  SUM([G3 SpC/L]) AS [SUM G3 SpC/L],
  SUM([H1 SpC/L]) AS [SUM H1 SpC/L],
  SUM([H2 SpC/L]) AS [SUM H2 SpC/L],
  SUM([H3 SpC/L]) AS [SUM H3 SpC/L],
  SUM([J1 SpC/L]) AS [SUM J1 SpC/L],
  SUM([J2 SpC/L]) AS [SUM J2 SpC/L],
  SUM([J3 SpC/L]) AS [SUM J3 SpC/L],
  SUM([L1 SpC/L]) AS [SUM L1 SpC/L],
  SUM([L2 SpC/L]) AS [SUM L2 SpC/L],
  SUM([L3 SpC/L]) AS [SUM L3 SpC/L],
  SUM([M1 SpC/L]) AS [SUM M1 SpC/L],
  SUM([M2 SpC/L]) AS [SUM M2 SpC/L],
  SUM([M3 SpC/L]) AS [SUM M3 SpC/L],
  SUM([N1 SpC/L]) AS [SUM N1 SpC/L],
  SUM([N2 SpC/L]) AS [SUM N2 SpC/L],
  SUM([N3 SpC/L]) AS [SUM N3 SpC/L]
  FROM [1079].[best detection SpC-L faster]


________________________________________


SELECT Protein,
  spc.[A1 SpC/L] / allspc.[SUM A1 SpC/L] AS [NSAF A1],
  spc.[A2 SpC/L] / allspc.[SUM A2 SpC/L] AS [NSAF A2],
  spc.[A3 SpC/L] / allspc.[SUM A3 SpC/L] AS [NSAF A3],
  spc.[B1 SpC/L] / allspc.[SUM B1 SpC/L] AS [NSAF B1],
  spc.[B2 SpC/L] / allspc.[SUM B2 SpC/L] AS [NSAF B2],
  spc.[B3 SpC/L] / allspc.[SUM B3 SpC/L] AS [NSAF B3],
  spc.[C1 SpC/L] / allspc.[SUM C1 SpC/L] AS [NSAF C1],
  spc.[C2 SpC/L] / allspc.[SUM C2 SpC/L] AS [NSAF C2],
  spc.[C3 SpC/L] / allspc.[SUM C3 SpC/L] AS [NSAF C3],
  spc.[D1 SpC/L] / allspc.[SUM D1 SpC/L] AS [NSAF D1],
  spc.[D2 SpC/L] / allspc.[SUM D2 SpC/L] AS [NSAF D2],
  spc.[D3 SpC/L] / allspc.[SUM D3 SpC/L] AS [NSAF D3],
  spc.[E1 SpC/L] / allspc.[SUM E1 SpC/L] AS [NSAF E1],
  spc.[E2 SpC/L] / allspc.[SUM E2 SpC/L] AS [NSAF E2],
  spc.[E3 SpC/L] / allspc.[SUM E3 SpC/L] AS [NSAF E3],
  spc.[F1 SpC/L] / allspc.[SUM F1 SpC/L] AS [NSAF F1],
  spc.[F2 SpC/L] / allspc.[SUM F2 SpC/L] AS [NSAF F2],
  spc.[F3 SpC/L] / allspc.[SUM F3 SpC/L] AS [NSAF F3],
  spc.[G1 SpC/L] / allspc.[SUM G1 SpC/L] AS [NSAF G1],
  spc.[G2 SpC/L] / allspc.[SUM G2 SpC/L] AS [NSAF G2],
  spc.[G3 SpC/L] / allspc.[SUM G3 SpC/L] AS [NSAF G3],
  spc.[H1 SpC/L] / allspc.[SUM H1 SpC/L] AS [NSAF H1],
  spc.[H2 SpC/L] / allspc.[SUM H2 SpC/L] AS [NSAF H2],
  spc.[H3 SpC/L] / allspc.[SUM H3 SpC/L] AS [NSAF H3],
  spc.[J1 SpC/L] / allspc.[SUM J1 SpC/L] AS [NSAF J1],
  spc.[J2 SpC/L] / allspc.[SUM J2 SpC/L] AS [NSAF J2],
  spc.[J3 SpC/L] / allspc.[SUM J3 SpC/L] AS [NSAF J3],
  spc.[L1 SpC/L] / allspc.[SUM L1 SpC/L] AS [NSAF L1],
  spc.[L2 SpC/L] / allspc.[SUM L2 SpC/L] AS [NSAF L2],
  spc.[L3 SpC/L] / allspc.[SUM L3 SpC/L] AS [NSAF L3],
  spc.[M1 SpC/L] / allspc.[SUM M1 SpC/L] AS [NSAF M1],
  spc.[M2 SpC/L] / allspc.[SUM M2 SpC/L] AS [NSAF M2],
  spc.[M3 SpC/L] / allspc.[SUM M3 SpC/L] AS [NSAF M3],
  spc.[N1 SpC/L] / allspc.[SUM N1 SpC/L] AS [NSAF N1],
  spc.[N2 SpC/L] / allspc.[SUM N2 SpC/L] AS [NSAF N2],
  spc.[N3 SpC/L] / allspc.[SUM N3 SpC/L] AS [NSAF N3]
  FROM [1079].[best detection SpC-L faster] spc,
  [1079].[summed spc-l faster] allspc


________________________________________


select * from [1079].[snapshot bact detection average spc]


________________________________________


SELECT * FROM [1079].[view_depth] where max_depth >10


________________________________________


SELECT Date, [Total Calories], [Total Fat] 
  FROM [1314howe].[categorized_fat_with_calories]
    WHERE seafood_calories > nut_calories
    AND vegetable_calories > chocolate_calories


________________________________________


SELECT Date, [Total Calories], [Total Fat] 
  FROM [1314howe].[categorized_fat_with_calories]
    WHERE seafood_calories > nut_calories
    AND vegetable_calories > chocolate_calories


________________________________________


SELECT Species, Oil_Cond, [week.number] FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Dead'


________________________________________


SELECT Species, Oil_Cond, [week.number] FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Dead'
  ORDER BY [week.number]


________________________________________


SELECT * FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Live'
  
  


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number] FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Live'
  ORDER BY [week.number]



________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Live'
  ORDER BY [week.number]



________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Live'
  ORDER BY time_cond_ratio



________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Live'
  ORDER BY time_cond_ratio


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Live'
  ORDER BY time_cond_ratio DESC


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Live'
  ORDER BY time_cond_ratio


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Oiling = 'Visibly Oiled'
  AND Condition = 'Live'
  ORDER BY time_cond_ratio DESC


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  ORDER BY time_cond_ratio DESC


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  ORDER BY time_cond_ratio


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  ORDER BY time_cond_ratio DESC


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  ORDER BY time_cond_ratio


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE [week.number] / Oil_Cond > 15
  AND [week.number] / Oil_Cond < 25
  ORDER BY time_cond_ratio


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE ([week.number] / Oil_Cond) > 15
  AND ([week.number] / Oil_Cond) < 25
  ORDER BY time_cond_ratio


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE ([week.number] / Oil_Cond) > 19
  AND ([week.number] / Oil_Cond) < 21
  ORDER BY time_cond_ratio


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE ([week.number] / Oil_Cond) > 18
  AND ([week.number] / Oil_Cond) < 22
  ORDER BY time_cond_ratio


________________________________________


SELECT * FROM [1010].[birds.csv]
  ORDER BY Latitude


________________________________________


SELECT * FROM [1010].[birds.csv]
  ORDER BY Latitude DESC


________________________________________


SELECT * FROM [1010].[birds.csv]
  ORDER BY Longitude DESC


________________________________________


SELECT * FROM [1010].[birds.csv]
  ORDER BY Longitude


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Longitude < -88.97
  ORDER BY time_cond_ratio


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Longitude < -88.97
  ORDER BY time_cond_ratio DESC


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Longitude < -88.97
  ORDER BY Longitude DESC


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Longitude < -88.97
  ORDER BY Longitude


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Longitude < -88.97
  ORDER BY Longitude


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Longitude < -88.97
  ORDER BY time_cond_ratio


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Longitude < -88.97
  ORDER BY time_cond_ratio DESC


________________________________________


SELECT Species, Latitude, Longitude, Oil_Cond, [week.number],
  [week.number] / Oil_Cond as time_cond_ratio
  FROM [1010].[birds.csv]
  WHERE Longitude < -88.97
  ORDER BY time_cond_ratio


________________________________________


SELECT * FROM [1016].[freeway_loopdata]
  ORDER BY [starttime]


________________________________________


SELECT COUNT(*) FROM [1016].[freeway_loopdata]


________________________________________


SELECT COUNT(*)   AS over_100_speeds
  FROM [1016].[freeway_loopdata]
  WHERE speed > 100




________________________________________


SELECT COUNT(*)   AS over_100_speeds
  FROM [1016].[freeway_loopdata]
  WHERE speed > 100




________________________________________


SELECT COUNT(*)   AS over_100_speeds
  FROM [1016].[freeway_loopdata]
  WHERE speed > 100




________________________________________


SELECT SUM(volume) AS total_volume
  FROM [1016].[freeway_loopdata]
  WHERE starttime LIKE '2011-09-21'


________________________________________


SELECT SUM(volume) AS total_volume
  FROM [1016].[freeway_loopdata]
  WHERE speed > 100


________________________________________


SELECT SUM(volume) AS total_volume
  FROM [1016].[freeway_loopdata]
  WHERE starttime LIKE '2011-09-21'


________________________________________


SELECT SUM(volume) AS total_volume
  FROM [1016].[freeway_loopdata]
  WHERE starttime LIKE '2011-09-21%'


________________________________________


SELECT detectorid, starttime, speed
  FROM [1016].[freeway_loopdata]
  WHERE starttime LIKE '2011-09-21%'


________________________________________


SELECT detectorid, starttime, speed
  FROM [1016].[freeway_loopdata]
  WHERE starttime LIKE '2011-09-21%'
  AND detectorid = 1346


________________________________________


SELECT * FROM [713].[housing.data 2.txt] WHERE Column9<10


________________________________________


SELECT * FROM [713].[housing.data 2.txt] WHERE Column9<15


________________________________________


SELECT * FROM [713].[table_transaction-items.data]


________________________________________


SELECT column5 FROM [713].[table_transaction-items.data]


________________________________________


SELECT sum(column5) FROM [713].[table_transaction-items.data]


________________________________________


SELECT sum(column5) FROM [713].[table_transaction-items.data]


________________________________________


SELECT sum(column5) FROM [713].[table_transaction-items.data]


________________________________________


SELECT * 
  FROM [1201].[xmark_12mb.csv]
 WHERE Column5 = 'location'



________________________________________


SELECT COUNT(*)
  FROM [1201].[table_xmark_12mb.csv]



________________________________________


SELECT COUNT(*) AS count
  FROM [1201].[table_xmark_12mb.csv]



________________________________________


SELECT * FROM [table_orcasound-detections.csv]
  WHERE TRIG = 'PKT'



________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]





________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE DATE LIKE '10/'
  




________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE DATE LIKE '10/30/2009'
  




________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE DATE LIKE 'AM'
  




________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE DATE LIKE '10/%'
  




________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE DATE LIKE '10%'
  




________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE DATE LIKE '10%';
  




________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE DATE LIKE '%10%';
  




________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE DATE LIKE '%10/%';
  




________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE DATE LIKE '%AM%';
  




________________________________________


SELECT DATE, TRIG FROM [table_orcasound-detections.csv]
WHERE CLASS LIKE 's';
  




________________________________________


SELECT * FROM [table_orcasound-detections.csv]
WHERE CLASS LIKE 's';
  




________________________________________


SELECT * FROM [table_orcasound-detections.csv]
WHERE CLASS LIKE 'S';
  




________________________________________


SELECT * FROM [table_orcasound-detections.csv]
WHERE CLASS LIKE '%S%';
  




________________________________________


SELECT DATE, COUNT ([FILE]) as 'blah'FROM [table_orcasound-detections.csv]
group by DATE



________________________________________


SELECT DISTINCT COMMENTER FROM [table_orcasound-classifications.csv]
  


________________________________________


SELECT DISTINCT COMMENTER, COUNT(ID_DETECTION) AS 'COMM' FROM [table_orcasound-classifications.csv]
  GROUP BY COMMENTER


________________________________________


SELECT * FROM [1358sofa.csv]


________________________________________


SELECT * FROM [1117].[table_OrcaMaster2010.csv]


________________________________________


SELECT * FROM [1117].[table_OrcaMaster2010.csv]


________________________________________


SELECT * FROM [1117].[table_OrcaMaster2010.csv]
  SELECT * FROM [1117].[table_OrcaMaster2010.csv] WHERE Pod = 'J'


________________________________________



  SELECT * FROM [1117].[table_OrcaMaster2010.csv] WHERE Pod = 'J'


________________________________________



  SELECT * FROM [1117].[table_OrcaMaster2010.csv] WHERE Direction = 'N'
    


________________________________________


  SELECT * FROM [OrcaMaster2010.csv] WHERE Direction = 'N'


________________________________________


SELECT * FROM [OrcaMaster2010.csv] 


________________________________________


SELECT * FROM [OrcaMaster2010.csv] 


________________________________________


  SELECT * FROM [OrcaMaster2010.csv] WHERE Direction = 'N'


________________________________________


SELECT Direction FROM [1117].[table_OrcaMaster2010.csv]


________________________________________


SELECT * FROM [1117].[table_OrcaMaster2010.csv]
  WHERE Month = 6



________________________________________


SELECT * FROM [1117].[table_OrcaMaster2010.csv]
  WHERE Month BETWEEN 6 AND 9
 




________________________________________


SELECT * FROM [1117].[table_OrcaMaster2010.csv]
 
 




________________________________________


SELECT * FROM [1117].[table_OrcaMaster2010.csv]
 WHERE Month BETWEEN 6 AND 9
 




________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
 WHERE Month BETWEEN 6 AND 8
  



________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
 WHERE Month BETWEEN 6 AND 10
  



________________________________________


SELECT * FROM [1117].[Orcamaster2010_JunetoOct]
  WHERE Year BETWEEN 2006 AND 2010



________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Month BETWEEN 6 AND 10



________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Month BETWEEN 6 AND 10
  ORDER BY Month



________________________________________


SELECT SightDate FROM [1117].[OrcaMaster2010.csv] UNIQ
  
  


________________________________________


SELECT Distinct SightDate FROM [1117].[OrcaMaster2010.csv]
  
  


________________________________________


SELECT Distinct SightDate, Month, Day, [Year] FROM [1117].[OrcaMaster2010.csv]
  
  


________________________________________


SELECT Distinct SightDate, Month, Day, [Year] FROM [1117].[OrcaMaster2010.csv]
  WHERE [Year] BETWEEN 2006 AND 2010
  
  


________________________________________


SELECT Distinct SightDate, Month, Day, [Year] FROM [1117].[OrcaMaster2010.csv]
    WHERE [Year] BETWEEN 2006 AND 2010
  
  


________________________________________


SELECT * FROM [1117].[OrcaMaster_days]
  WHERE Month BETWEEN 4 AND 10



________________________________________


SELECT * FROM [1117].[OrcaMaster_days]
  WHERE Month BETWEEN 4 AND 10
  ORDER BY Year, Month



________________________________________


SELECT * FROM [1117].[OrcaMaster_days]
  WHERE Month BETWEEN 4 AND 10
  ORDER BY Year, Month,day



________________________________________


SELECT Distinct SightDate, Month, Day, [Year] FROM [1117].[OrcaMaster2010.csv]
    WHERE [Year] BETWEEN 2006 AND 2010 AND Pod <> 'Ts?'
 
  
  


________________________________________


SELECT Distinct SightDate, Month, Day, [Year] FROM [1117].[OrcaMaster2010.csv]
    WHERE [Year] BETWEEN 2006 AND 2010 AND Pod <> 'Ts?' AND Month BETWEEN 4 AND 10
 
  
  


________________________________________


SELECT Distinct SightDate, Month, Day, [Year] FROM [1117].[OrcaMaster2010.csv]
    WHERE [Year] BETWEEN 2006 AND 2010 AND Pod <> 'Ts?' AND Month BETWEEN 4 AND 10
    ORDER BY Year, Month, day
 
  
  


________________________________________


SELECT [Year], COUNT(SightDate) as 'count'
  FROM [1117].[OrcaMaster_days]
  GROUP BY [Year] 



________________________________________


SELECT [Year], COUNT(SightDate) as 'count'
  FROM [1117].[table_OrcaMaster2010.csv]
  GROUP BY [Year] 



________________________________________


SELECT [Year], COUNT(SightDate) as 'count'
  FROM [1117].[table_OrcaMaster2010.csv]
  GROUP BY [Year] 
  ORDER BY [Year]



________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Lat BETWEEN 48.2961 AND 48.2817 AND Lat BETWEEN 48.2727 AND 48.2870 AND
  [Long] BETWEEN 123.0701 AND 123.0869 AND [long] BETWEEN 123.0564 AND 123.0399
  


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Lat BETWEEN 48.2961 AND 48.2817 AND Lat BETWEEN 48.2727 AND 48.2870 AND
  [Long] BETWEEN 123.0701 AND 123.0869 AND [long] BETWEEN 123.0564 AND 123.0399
  


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Lat BETWEEN 48.2961 AND 48.2817 


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Lat BETWEEN 48.2727 AND 48.2870 


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Lat BETWEEN 48.2727 AND 48.2870 AND [Long] BETWEEN 123.0701 AND 123.0869


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Lat BETWEEN 48.2727 AND 48.2870 AND [long] BETWEEN 123.0564 AND 123.0399


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Lat BETWEEN 48.2727 AND 48.2870 


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Year BETWEEN 1991 AND 1995
  ORDER BY Year, Month, Day 



________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Year BETWEEN 1991 AND 1992
  ORDER BY Year, Month, Day 



________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Year BETWEEN 1991 AND 1992
  ORDER BY Year, Month, Day 



________________________________________


SELECT * FROM [1117].[OrcaMaster_CJ_9192]
  WHERE Month BETWEEN 4 AND 10



________________________________________


SELECT * FROM [1117].[OrcaMaster_CJ_9192]
  WHERE Month BETWEEN 4 AND 10
  ORDER BY Year, Month, Day



________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  ORDER BY Year, Month, Day



________________________________________


SELECT * FROM [1117].[OrcaMaster_CJ_ordered]
  WHERE Month BETWEEN 7 AND 10
  ORDER BY Year, Month, Day



________________________________________


SELECT Distinct SightDate, Month, Day, [Year] FROM [1117].[OrcaMaster2010.csv]
  WHERE [Year] BETWEEN 1990 AND 1992 AND Pod <> 'Ts?' AND Month BETWEEN 4 AND 10
  ORDER BY Year, Month, Day



________________________________________


SELECT Distinct SightDate, Month, Day, [Year] FROM [1117].[OrcaMaster2010.csv]
  WHERE [Year] BETWEEN 1993 AND 1995 AND Pod <> 'Ts?' AND Month BETWEEN 4 AND 10
  ORDER BY Year, Month, Day



________________________________________


SELECT SightDate FROM [1117].[OrcaMaster2010.csv]
  ORDER BY SightDate Desc



________________________________________


SELECT * FROM [table_orcasound-detections.csv]
  WHERE NODE = 'lk'



________________________________________


SELECT DATE, NODE FROM [table_orcasound-detections.csv]
  WHERE NODE = 'lk'



________________________________________


SELECT * FROM [1117].[orcasound-detections_HMN] x
  JOIN [table_orcasound-classifications.csv] y
  ON x.ID = y.ID
 



________________________________________


SELECT * FROM [1117].[orcasound-detections_HMN] x
  JOIN [table_orcasound-classifications.csv] y
  ON x.ID = y.ID
  WHERE ORCA = 'Resident Call'
 



________________________________________


SELECT Date, [Total Calories], [Total Fat] FROM [1314howe].[categorized_fat_with_calories]
  WHERE seafood_calories > nut_calories
  AND vegetable_calories > chocolate_calories
 


________________________________________


SELECT * FROM [876].[table_NUTR_DEF_1.csv]


________________________________________


SELECT * FROM [876].[table_NUTR_DEF_1.csv]
  where tagname = 'FAT'


________________________________________


SELECT * FROM [876].[table_NUTR_DEF_1.csv]
  where nutrdesc = 'Sucrose'


________________________________________


SELECT DISTINCT [authors] , [title]  FROM [876].[table_DATASRC.csv]


________________________________________


SELECT DISTINCT[authors] , [title]  FROM [876].[table_DATASRC.csv]


________________________________________


SELECT DISTINCT [authors] FROM [876].[table_DATASRC.csv]
  WHERE year = '1992'



________________________________________


SELECT DISTINCT [authors] FROM [876].[table_DATASRC.csv]
  WHERE year = '1992'



________________________________________


SELECT DISTINCT [authors] , [journal] FROM [876].[table_DATASRC.csv]
  WHERE year = '1992'



________________________________________


SELECT DISTINCT [authors] , [journal] FROM [876].[table_DATASRC.csv]
  WHERE year = '1992'



________________________________________


SELECT [authors], count(DISTINCT [title])  FROM [876].[table_DATASRC.csv]
  group by [authors] having count(DISTINCT [title])>2



________________________________________


SELECT DISTINCT[authors] , [title]  FROM [876].[table_DATASRC.csv]


________________________________________


SELECT [nutr_no], [ndb_no], [authors], [journal] FROM [876].[table_DATASRCLN.csv] as dsln, [876].[table_DATASRC.csv] as ds
  WHERE dsln.[datasrc_id] = 'S19'


________________________________________


SELECT [nutr_no], [ndb_no], [authors], [journal] FROM [876].[table_DATASRCLN.csv] as dsln, [876].[table_DATASRC.csv] as ds
  WHERE dsln.[datasrc_id] = 'S19'


________________________________________


SELECT * FROM [876].[table_DATASRC.csv] where [datasrc_id] = 'S19'


________________________________________


SELECT [nutr_no], [ndb_no], [authors], [journal] FROM [876].[table_DATASRCLN.csv] as dsln, [876].[table_DATASRC.csv] as ds
  WHERE dsln.[datasrc_id] = ds.[datasrc_id] and dsln.[datasrc_id] = 'S19'


________________________________________


SELECT [nutr_no], [ndb_no], [authors], [journal] FROM [876].[table_DATASRCLN.csv] as dsln, [876].[table_DATASRC.csv] as ds
  WHERE dsln.[datasrc_id] = ds.[datasrc_id] and dsln.[datasrc_id] = 'S19'


________________________________________


SELECT [nutr_no], [ndb_no], [authors], [journal] FROM [876].[table_DATASRCLN.csv] as dsln, [876].[table_DATASRC.csv] as ds
  WHERE dsln.[datasrc_id] = ds.[datasrc_id] and dsln.[datasrc_id] = 'S19'


________________________________________


SELECT [nutr_no], [ndb_no], [authors], [journal] FROM [876].[table_DATASRCLN.csv] as dsln, [876].[table_DATASRC.csv] as ds
  WHERE dsln.[datasrc_id] = ds.[datasrc_id] and dsln.[datasrc_id] = 'S19'


________________________________________


SELECT [nutr_no], [ndb_no], [authors], [journal] FROM [876].[table_DATASRCLN.csv] as dsln, [876].[table_DATASRC.csv] as ds
  WHERE dsln.[datasrc_id] = ds.[datasrc_id] and dsln.[datasrc_id] = 'S19'


________________________________________


SELECT [nutr_no], [ndb_no], [authors] FROM [876].[table_DATASRCLN.csv] as dsln, [876].[table_DATASRC.csv] as ds
  WHERE dsln.[datasrc_id] = ds.[datasrc_id] and dsln.[datasrc_id] = 'S19'


________________________________________


SELECT [nutr_no], [ndb_no], [authors] FROM [876].[table_DATASRCLN.csv] as dsln, [876].[table_DATASRC.csv] as ds
  WHERE dsln.[datasrc_id] = ds.[datasrc_id] and dsln.[datasrc_id] = 'S19'


________________________________________


SELECT DISTINCT[authors] , [title]  FROM [876].[table_DATASRC.csv]


________________________________________


SELECT DISTINCT[authors] , [title]  FROM [876].[table_DATASRC.csv]


________________________________________


SELECT * FROM [992].[table_newfile.csv]


________________________________________


SELECT * FROM [1078].[table_untitled.csv]
  where [group] = 1


________________________________________


SELECT * FROM [1078].[table_untitled.csv], [1199].[LoanStats3b_securev1.csv]




________________________________________


SELECT Column1 as time,
 Column2 as donor_idx,
 Column3 as acceptor_idx,
 Column4 as donor_resnm,
 Column5 as donor_resid,
 Column6 as donor_atom,
 Column7 as acceptor_resnm,
 Column8 as acceptor_resid,
 Column9 as acceptor_atom,
 Column10 as distance,
 Column11 as angle
  
  FROM [145].[clean_tiny.txt]


________________________________________


select * from tiny_sample



________________________________________


select count(*) from tiny_sample where time = 12.5



________________________________________


select * from tiny_sample where time = 12.5



________________________________________


select distinct(time) from tiny_sample



________________________________________


select max(time) from tiny_sample



________________________________________


SELECT * from tiny_sample where time= 12.5


________________________________________


SELECT * from tiny_sample where time= 250
 


________________________________________


SELECT * from tiny_sample where time= 250 and acceptor_idx=2
 
 


________________________________________


SELECT * from tiny_sample where time= 250 and acceptor_idx=3210
 
 


________________________________________


SELECT * from tiny_sample where time= 250 and acceptor_idx=3211
 
 


________________________________________


SELECT * from tiny_sample where time=12.5 and acceptor_idx=3211
 


________________________________________


SELECT * from tiny_sample where time=250 and acceptor_idx=3211
 


________________________________________


SELECT
  Column1 as Idx,
  Column2 as X,
  Column3 as Y,
  Column4 as Z
  
  FROM [145].[Frame2.txt]


________________________________________


SELECT * FROM [145].[table_Config_2.txt] where Column2=42


________________________________________


SELECT * FROM [145].[table_Config_2.txt] where Column2=6543


________________________________________


SELECT * FROM [145].[table_Config_2.txt] where Column2=653


________________________________________


SELECT * FROM [145].[table_Config_2.txt] where Column2=1653


________________________________________


SELECT * FROM [145].[table_Config_2.txt] where Column2=4142


________________________________________


SELECT * FROM [145].[table_Config_2.txt]
  WHERE Column1 != NULL



________________________________________


SELECT
  Column2 as resid,
  Column3 as atom,
  Column4 as idx,
  Column5 as X,
  Column6 as Y,
  Column7 as Z
  
  FROM [145].[Config.txt]


________________________________________


SELECT X+Y FROM Frame2


________________________________________


SELECT * FROM Frame2 where idx=15
  


________________________________________


SELECT 
  Column1 as idx,
  Column2 as X,
  Column3 as Y,
  Column4 as Z
  FROM [145].[frame1.txt]


________________________________________


select *, (X-Y) as xMinusY from Config_OW


________________________________________


select *, ow.x - hw1.x from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 


________________________________________


select ow.*, ow.x - hw1.x from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 


________________________________________


select ow.*, ow.x - hw1.x as xdiff from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 


________________________________________


select ow.*, ow.x - hw1.x as xdiff, ow.y - hw1.y as ydiff, ow.z - hw1.z as zdiff from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 


________________________________________


select ow.*, ow.x - hw1.x as xdiff, ow.y - hw1.y as ydiff, ow.z - hw1.z as zdiff from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 
  
UNION
  
select ow.*, ow.x - hw2.x as xdiff, ow.y - hw2.y as ydiff, ow.z - hw2.z as zdiff from config_ow ow, config_hw2 hw2 where ow.idx + 2 = hw2.idx 
  
UNION

select ow1.*, ow1.x - ow2.x as xdiff, ow1.y - ow2.y as ydiff, ow1.z - ow2.z as zdiff from config_ow ow1, config_ow ow2 where ow1.idx = ow2.idx 



________________________________________


select hw1.*, ow.x - hw1.x as xdiff, ow.y - hw1.y as ydiff, ow.z - hw1.z as zdiff from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 
  
UNION
  
select hw2.*, ow.x - hw2.x as xdiff, ow.y - hw2.y as ydiff, ow.z - hw2.z as zdiff from config_ow ow, config_hw2 hw2 where ow.idx + 2 = hw2.idx 
  
UNION

select ow1.*, ow1.x as xdiff, ow1.y as ydiff, ow2.z as zdiff from config_ow ow1, config_ow ow2 where ow1.idx = ow2.idx 



________________________________________


select ow1.*, ow1.x as xdiff, ow1.y as ydiff, ow2.z as zdiff from config_ow ow1, config_ow ow2 where ow1.idx = ow2.idx 

UNION
  
select hw1.*, ow.x - hw1.x as xdiff, ow.y - hw1.y as ydiff, ow.z - hw1.z as zdiff from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 
  
UNION
  
select hw2.*, ow.x - hw2.x as xdiff, ow.y - hw2.y as ydiff, ow.z - hw2.z as zdiff from config_ow ow, config_hw2 hw2 where ow.idx + 2 = hw2.idx 




________________________________________


select ow1.*, ow1.x as xdiff, ow1.y as ydiff, ow2.z as zdiff from config_ow ow1, config_ow ow2 where ow1.idx = ow2.idx 

UNION
  
select hw1.*, ow.x - hw1.x as xdiff, ow.y - hw1.y as ydiff, ow.z - hw1.z as zdiff from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 
  
UNION
  
select hw2.*, ow.x - hw2.x as xdiff, ow.y - hw2.y as ydiff, ow.z - hw2.z as zdiff from config_ow ow, config_hw2 hw2 where ow.idx + 2 = hw2.idx 

order by idx


________________________________________


select ow1.*, ow1.x as xdiff, ow1.y as ydiff, ow2.z as zdiff from config_ow ow1, config_ow ow2 where ow1.idx = ow2.idx 

UNION
  
select hw1.*, ow.x - hw1.x as xdiff, ow.y - hw1.y as ydiff, ow.z - hw1.z as zdiff from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 
  
UNION
  
select hw2.*, ow.x - hw2.x as xdiff, ow.y - hw2.y as ydiff, ow.z - hw2.z as zdiff from config_ow ow, config_hw2 hw2 where ow.idx + 2 = hw2.idx 

order by idx


________________________________________


select ow1.*, ow1.x as xdiff, ow1.y as ydiff, ow2.z as zdiff from config_ow ow1, config_ow ow2 where ow1.idx = ow2.idx 

UNION
  
select hw1.*, ow.x - hw1.x as xdiff, ow.y - hw1.y as ydiff, ow.z - hw1.z as zdiff from config_ow ow, config_hw1 hw1 where ow.idx + 1 = hw1.idx 
  
UNION
  
select hw2.*, ow.x - hw2.x as xdiff, ow.y - hw2.y as ydiff, ow.z - hw2.z as zdiff from config_ow ow, config_hw2 hw2 where ow.idx + 2 = hw2.idx 

order by idx


________________________________________


SELECT DISTINCT time FROM tiny_sample
  


________________________________________


SELECT *  
  FROM tiny_sample
  WHERE time=150
  


________________________________________


SELECT
  Column1 as idx,
  Column2 as X,
  Column3 as Y,
  Column4 as Z
  
  FROM [145].[Frame2.txt]


________________________________________


select idx from Frame1 where idx = 1
union
select idx from Frame2 where idx= 21


________________________________________


SELECT ABS(Column2) FROM [frame1_angles.txt] where Column1=3


________________________________________


SELECT ABS(Column2) FROM [145].[table_frame1_angles.txt] where Column1=3


________________________________________


SELECT Column2 FROM [145].[table_frame1_angles.txt] where Column1=3


________________________________________


SELECT Column2 FROM [145].[table_frame1_angles.txt] where Column1=4338


________________________________________


SELECT Column2 FROM [145].[table_frame1_angles.txt] where Column1=43381


________________________________________


SELECT * FROM [145].[table_frame1_angles.txt] where Column1=43381


________________________________________


SELECT * FROM [145].[table_frame1_angles.txt] where Column1=122


________________________________________


SELECT ABS(Column2) FROM [145].[table_frame1_angles.txt] where Column1=122


________________________________________


SELECT ABS(Column2) FROM [145].[table_frame1_angles.txt]
  MINUS
  SELECT donor_idx FROM tiny_sample where time=12.5


________________________________________


SELECT Column1, ABS(Column2) FROM [145].[table_frame1_angles.txt]
  MINUS
  SELECT donor_idx FROM tiny_sample where time=12.5


________________________________________


SELECT Column1, ABS(Column2) FROM [145].[table_frame1_angles.txt]
where Column1 not in (SELECT donor_idx FROM tiny_sample where time=12.5)
  


________________________________________


SELECT Column1, ABS(Column2) FROM [145].[table_frame1_angles.txt]
where Column1 not in (SELECT donor_idx FROM tiny_sample where time=12.5)


________________________________________


SELECT Column1, ABS(Column2) FROM [145].[table_frame1_angles.txt]
where Column1 not in (SELECT donor_idx FROM tiny_sample where time=12.5)


________________________________________


SELECT Column1, ABS(Column2) as abs_angle FROM [145].[table_frame1_angles.txt]
where Column1 not in (SELECT donor_idx FROM tiny_sample where time=12.5)


________________________________________


SELECT count(*) as count, abs_angle 
  FROM [145].[FreeOH]
  group by abs_angle


________________________________________


select sum(count) from (SELECT count(*) as count, abs_angle 
  FROM [145].[FreeOH]
  group by abs_angle) as foo


________________________________________


SELECT count(*) as count, abs_angle 
  FROM [145].[FreeOH]
  group by abs_angle


________________________________________


SELECT count(*) as count, abs_angle 
  FROM [145].[FreeOH]
  group by abs_angle


________________________________________


SELECT * from Frame1 where Z>10


________________________________________


SELECT * from Frame1 where Z<-10


________________________________________


SELECT * from Frame1 where Z>10


________________________________________


SELECT * from Frame1 where Z>15


________________________________________


SELECT MAX(Z) from Frame1


________________________________________


SELECT * from Frame1 WHERE Z=(SELECT MAX(Z) from Frame1)


________________________________________


SELECT * from Frame2 WHERE Z=(SELECT MAX(Z) from Frame2)


________________________________________


SELECT Column1, ABS(Column2) as abs_angle FROM [145].[table_frame2_angles.txt]
where Column1 not in (SELECT donor_idx FROM tiny_sample where time=50)


________________________________________


SELECT * from tiny_sample where time=50
  


________________________________________


SELECT Column1, ABS(Column2) as abs_angle FROM [145].[table_frame2_angles.txt]
where Column1 not in (SELECT donor_idx-1 FROM tiny_sample where time=50)


________________________________________


SELECT Column1 as time,
 Column2-1 as donor_idx,
 Column3 as acceptor_idx,
 Column4 as donor_resnm,
 Column5 as donor_resid,
 Column6 as donor_atom,
 Column7 as acceptor_resnm,
 Column8 as acceptor_resid,
 Column9 as acceptor_atom,
 Column10 as distance,
 Column11 as angle
  
  FROM [145].[clean_tiny.txt]


________________________________________


SELECT count(*) as count, abs_angle 
  FROM [145].[FreeOH]
  group by abs_angle


________________________________________


SELECT count(*) as count, abs_angle 
  FROM [145].[FreeOH]
  group by abs_angle


________________________________________


SELECT count(*) as count, abs_angle 
  FROM [145].[FreeOH]
  group by abs_angle
  order by abs_angle


________________________________________


SELECT count(*)/8284 as P, abs_angle 
  FROM [145].[FreeOH]
  group by abs_angle
  order by abs_angle


________________________________________


SELECT count(*)/8284.0 as P, abs_angle 
  FROM [145].[FreeOH]
  group by abs_angle
  order by abs_angle


________________________________________


SELECT Column1, ABS(Column2) as abs_angle, ABS(Column3) as abs_phi FROM [145].[table_frame1_angles.txt]
where Column1 not in (SELECT donor_idx FROM tiny_sample where time=12.5)


________________________________________


SELECT count(*)/8284, abs_phi from FreeOH
  group by abs_phi
  order by abs_phi


________________________________________


SELECT count(*)/8284.0, abs_phi from FreeOH
  group by abs_phi
  order by abs_phi


________________________________________


SELECT count(*), abs_phi from FreeOH
  group by abs_phi
  order by abs_phi


________________________________________


SELECT * from Frame2 where Z>10
  


________________________________________


SELECT * from Frame2 where Z>9
  


________________________________________


SELECT * from Frame2 where Z<9 and Z>7
  


________________________________________


SELECT * from Frame2 where Z>7
  


________________________________________


SELECT * from Frame2 where Z>7
  order by z


________________________________________


SELECT * from Frame2 where Z>7
  order by idx


________________________________________


SELECT * from Frame2 where Z>7
  order by idx


________________________________________


SELECT * from Frame2 where Z>7
  order by z


________________________________________


SELECT * from Frame2 where Z>7
  order by idx


________________________________________


SELECT Column1 as frame, Column2 as idx, Column3 as X,
  Column4 as Y, Column5 as Z
  FROM [145].[mod_traj1.txt]
  



________________________________________


SELECT * 
  FROM [145].[traj_all]
  where idx%3 = 0



________________________________________


SELECT * 
  FROM [145].[traj_all]
  where idx%3 = 1



________________________________________


SELECT * 
  FROM [145].[traj_all]
  where idx%3 = 2



________________________________________


SELECT DISTINCT ow1.idx, ow2.idx
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND((ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND((ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z)-ROUND((ow1.z-ow2.z)/5.0,0),2))
  < 0.1225 and ow1.idx != ow2.idx



________________________________________


SELECT DISTINCT ow1.idx as ow1_idx, ow2.idx as ow2_idx
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND((ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND((ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z)-ROUND((ow1.z-ow2.z)/5.0,0),2))
  < 0.1225 and ow1.idx != ow2.idx



________________________________________


SELECT DISTINCT ow1.idx as ow1_idx, ow2.idx as ow2_idx
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND((ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND((ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z)-ROUND((ow1.z-ow2.z)/5.0,0),2))
  < 0.1225 and ow1.idx != ow2.idx and ow1.frame = ow2.frame



________________________________________


SELECT ow1.frame, ow1.idx as ow1_idx, ow2.idx as ow2_idx,
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2)) as dist
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2))
  < 0.1225 and ow1.idx != ow2.idx and ow1.frame = ow2.frame
  
  order by ow1.frame


________________________________________


SELECT ow1.frame, ow1.idx as ow1_idx, ow2.idx as ow2_idx,
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2)) as dist
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2))
  < 0.1225 and ow1.idx != ow2.idx and ow1.frame = ow2.frame
  
  order by ow1.frame


________________________________________


SELECT ow1.frame, ow1.idx as ow1_idx, ow2.idx as ow2_idx,
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2)) as dist
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2))
  < 0.1225 and ow1.idx != ow2.idx and ow1.frame = ow2.frame
  
  order by ow1.frame


________________________________________


SELECT TOP 100 * FROM [145].[OO_pairs]


________________________________________


SELECT TOP 1000 * FROM [145].[OO_pairs]


________________________________________


SELECT ow1.idx as ow1_idx, ow2.idx as ow2_idx
  from [145].traj_ow ow1, [145].traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ABS(ROUND((ow1.x-ow2.x)/5.0,0)),2)+
    POWER(ABS(ow1.y-ow2.y)-ABS(ROUND((ow1.y-ow2.y)/5.0,0)),2)+
    POWER(ABS(ow1.z-ow2.z)-ABS(ROUND((ow1.z-ow2.z)/10.0,0)),2))
  < 0.1225 and ow1.idx < ow2.idx


________________________________________


SELECT TOP 100 ow1.idx as ow1_idx, ow2.idx as ow2_idx
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND((ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND((ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z)-ROUND((ow1.z-ow2.z)/5.0,0),2))
  < 0.1225 and ow1.idx < ow2.idx
  and ow1.frame = ow2.frame



________________________________________


SELECT Column1 as frame, Column2 as idx, Column3 as X,
  Column4 as Y, Column5 as Z
  FROM [145].[Snapshot of mod_traj1.txt]
  



________________________________________


SELECT ow1.frame, ow1.idx as ow1_idx, ow2.idx as ow2_idx,
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2)) as dist
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2))
  < 0.1225 and ow1.idx != ow2.idx and ow1.frame = ow2.frame
  
  order by ow1.frame


________________________________________


SELECT ow1.idx as ow1_idx, ow2.idx as ow2_idx
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND((ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND((ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z)-ROUND((ow1.z-ow2.z)/5.0,0),2))
  < 0.1225 and ow1.idx < ow2.idx
  AND ow1.frame = ow2.frame


________________________________________


SELECT * FROM [145].[traj_ow]
  WHERE frame=0


________________________________________


select * from traj_ow
  where frame=0


________________________________________


SELECT * FROM [145].[traj_ow]
  where frame=0


________________________________________


select * from traj_ow where frame=0


________________________________________


SELECT ow1.frame, ow1.idx as ow1_idx, ow2.idx as ow2_idx,
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2)) as dist
  from traj_ow ow1, traj_ow ow2  
  WHERE
  (POWER(ABS(ow1.x-ow2.x)-ROUND(abs(ow1.x-ow2.x)/5.0,0),2)+
  POWER(ABS(ow1.y-ow2.y)-ROUND(abs(ow1.y-ow2.y)/5.0,0),2)+
  POWER(ABS(ow1.z-ow2.z),2))
  < 0.1225 and ow1.idx != ow2.idx and ow1.frame = ow2.frame and ow1.frame =0
  
  order by ow1.frame


________________________________________


SELECT * FROM [145].[Opairs]
  where ow1_idx=153


________________________________________


SELECT * FROM [145].[Opairs]
  where ow1_idx=153


________________________________________


SELECT 1385 FROM [718].[table_checkouts.csv]


________________________________________


SELECT item_number FROM [718].[table_checkouts.csv]


________________________________________


SELECT * FROM [718].[table_1385s_1.csv] WHERE 1385name = 1385name



________________________________________


SELECT 1385name FROM [718].[table_1385s_1.csv] WHERE major = 'history'



________________________________________


SELECT [718].[table_1385s_1.csv].1385name FROM [718].[table_1385s_1.csv] WHERE major = 'history'



________________________________________


SELECT [718].[table_1385s_1.csv].1385name, [718].[table_1385s_1.csv].major FROM [718].[table_1385s_1.csv] WHERE major = 'history'



________________________________________


SELECT [718].[table_1385s_1.csv].1385name, [718].[table_1385s_1.csv].major 
  FROM [718].[table_1385s_1.csv] 
  WHERE major = 'history'


________________________________________


SELECT [718].[table_1385s_1.csv].major, [718].[table_checkouts_1.csv].item_number
  FROM [718].[table_1385s_1.csv], [718].[table_checkouts_1.csv]
  WHERE [718].[table_1385s_1.csv].barcode = [718].[table_checkouts_1.csv].barcode



________________________________________


SELECT [718].[table_1385s_1.csv].major, [718].[table_checkouts_1.csv].item_number
  FROM [718].[table_1385s_1.csv], [718].[table_checkouts_1.csv]
  WHERE [718].[table_1385s_1.csv].barcode = [718].[table_checkouts_1.csv].barcode
  GROUP BY [718].[table_1385s_1.csv].major, [718].[table_checkouts_1.csv].item_number



________________________________________


SELECT [718].[table_1385s_1.csv].major, [718].[table_checkouts_1.csv].item_number
  FROM [718].[table_1385s_1.csv], [718].[table_checkouts_1.csv]
  WHERE [718].[table_1385s_1.csv].barcode = [718].[table_checkouts_1.csv].barcode
  GROUP BY [718].[table_checkouts_1.csv].item_number, [718].[table_1385s_1.csv].major



________________________________________


SELECT count(DISTINCT[718].[table_1385s_1.csv].major) as majors
  FROM [718].[table_1385s_1.csv]
  GROUP BY [718].[table_1385s_1.csv].major



________________________________________


SELECT [718].[table_1385s_1.csv].major, count(DISTINCT[718].[table_1385s_1.csv].major) as majors
  FROM [718].[table_1385s_1.csv]
  GROUP BY [718].[table_1385s_1.csv].major



________________________________________


SELECT [718].[table_1385s_1.csv].major, count([718].[table_1385s_1.csv].major) as majors
  FROM [718].[table_1385s_1.csv]
  GROUP BY [718].[table_1385s_1.csv].major



________________________________________


SELECT [718].[table_1385s_1.csv].major, count([718].[table_1385s_1.csv].major) as number
  FROM [718].[table_1385s_1.csv]
  GROUP BY [718].[table_1385s_1.csv].major



________________________________________


SELECT [718].[table_books.csv].title, COUNT([718].[table_checkouts_1.csv].item_number) as checkouts  
  FROM [718].[table_books.csv] JOIN [718].[table_checkouts_1.csv] 
  ON [718].[table_books.csv].record_number = [718].[table_checkouts_1.csv].item_number
  GROUP BY [718].[table_books.csv].title




________________________________________


SELECT [718].[table_books.csv].title, COUNT([718].[table_checkouts_1.csv].item_number) as checkouts  
  FROM [718].[table_books.csv] JOIN [718].[table_checkouts_1.csv] 
  ON [718].[table_books.csv].record_number = [718].[table_checkouts_1.csv].item_number
  GROUP BY [718].[table_books.csv].title
  ORDER BY checkouts




________________________________________


SELECT [718].[table_books.csv].title, COUNT([718].[table_checkouts_1.csv].item_number) as checkouts  
  FROM [718].[table_books.csv] JOIN [718].[table_checkouts_1.csv] 
  ON [718].[table_books.csv].record_number = [718].[table_checkouts_1.csv].item_number
  GROUP BY [718].[table_books.csv].title
  ORDER BY checkouts DESC




________________________________________


SELECT [718].[table_1385s.csv].major, count([718].[table_1385s.csv].major) as number
  FROM [718].[table_1385s.csv]
  GROUP BY [718].[table_1385s.csv].major




________________________________________


SELECT [718].[table_1385s_1.csv].1385name, [718].[table_1385s_1.csv].major FROM [718].[table_1385s_1.csv] 
WHERE major = 'English'




________________________________________


SELECT Date_Time FROM [461].[table_Sequim_7D_Oxygen.csv]


________________________________________


SELECT Date_Time AS "Date & Time" FROM [461].[table_Sequim_7D_Oxygen.csv]


________________________________________


SELECT Date_Time, O2_Concentration FROM [461].[table_Sequim_7D_Oxygen.csv]


________________________________________


SELECT Date_Time, O2_Level FROM [461].[table_Sequim_7D_Oxygen.csv] WHERE O2_Concentration > 6.5
  


________________________________________


SELECT SUM("O2_Concentration") AS Sum_O2_Concentration FROM [461].[table_Sequim_7D_Oxygen.csv]


________________________________________


SELECT COUNT("O2_Concentration") AS Sum_O2_Concentration FROM [461].[table_Sequim_7D_Oxygen.csv] WHERE O2_Concentration > 6.5 GROUP BY O2_Concentration


________________________________________


SELECT COUNT("O2_Concentration") AS Sum_O2_Concentration FROM [461].[table_Sequim_7D_Oxygen.csv] GROUP BY O2_Level


________________________________________


SELECT O2_Level AS "O2 Level", COUNT("O2_Concentration") AS "O2 Level Counts" FROM [461].[table_Sequim_7D_Oxygen.csv] GROUP BY O2_Level


________________________________________


SELECT SUM("O2_Concentration") AS Sum_O2_Concentration FROM [461].[table_Sequim_7D_Oxygen.csv] GROUP BY O2_Level


________________________________________


SELECT * FROM [461].[table_Sequim_7D_Chlorophyll.csv] C
  JOIN [461].[table_Sequim_7D_Oxygen.csv] O 
  ON C."Date_Time" = O."Date_Time"
  


________________________________________


SELECT C."Date_Time", C."Depth", C."Chlorophyll_Concentration", C."Chlorophyll_Level", O."O2_Concentration", O."O2_Level"
  FROM [461].[table_Sequim_7D_Chlorophyll.csv] C
  JOIN [461].[table_Sequim_7D_Oxygen.csv] O 
  ON C."Date_Time" = O."Date_Time"
  


________________________________________


SELECT * FROM [461].[table_Sequim_7D_Chlorophyll.csv] C
  JOIN [461].[table_Sequim_7D_Oxygen.csv] O 
  ON C.Date_Time = O.Date_Time
  


________________________________________


SELECT C."Date_Time", C."Depth", C."Chlorophyll_Concentration", C."Chlorophyll_Level", O."O2_Concentration", O."O2_Level"
  FROM [461].[table_Sequim_7D_Chlorophyll.csv] C
  JOIN [461].[table_Sequim_7D_Oxygen.csv] O 
  ON C.Date_Time = O.Date_Time
  


________________________________________






________________________________________


SELECT COUNT("Date_Time") FROM [461].[Sequim_7D_Chlorophyll_Oxygen]
  


________________________________________


SELECT COUNT("Date_Time") AS "Occurences" FROM [461].[Sequim_7D_Chlorophyll_Oxygen]
  


________________________________________


SELECT "Chlorophyll_Level", COUNT("Date_Time") AS "Occurences" FROM [461].[Sequim_7D_Chlorophyll_Oxygen] GROUP BY "Chlorophyll_Level"


________________________________________


SELECT AVG("Chlorophyll_Concentration") FROM [461].[Sequim_7D_Chlorophyll_Oxygen] WHERE "Chlorophyll_Level"='High'
  


________________________________________


SELECT "Chlorophyll_Level", AVG("Chlorophyll_Concentration") 
  AS "Average" 
  FROM [461].[Sequim_7D_Chlorophyll_Oxygen] 
  GROUP BY "Chlorophyll_Level"

  


________________________________________


SELECT COUNT("Chlorophyll_Level") 
    FROM [461].[Sequim_7D_Chlorophyll_Oxygen]
  



________________________________________


SELECT COUNT("Chlorophyll_Level") 
    FROM [461].[Sequim_7D_Chlorophyll_Oxygen]
    WHERE "Chlorophyll_Level"='High'
  



________________________________________


SELECT COUNT("Chlorophyll_Level") 
    FROM [461].[Sequim_7D_Chlorophyll_Oxygen]
  WHERE "Chlorophyll_Level"='High'
  



________________________________________


SELECT 3
  



________________________________________


SELECT 3/2
  



________________________________________


SELECT SUM("Chlorophyll_Concentration")/COUNT("Chlorophyll_Concentration") FROM [461].[table_Sequim_7D_Chlorophyll.csv]
  



________________________________________


SELECT SUM("Chlorophyll_Concentration")/COUNT("Chlorophyll_Concentration"), AVG("Chlorophyll_Concentration") FROM [461].[table_Sequim_7D_Chlorophyll.csv]
  



________________________________________


SELECT (SUM("Chlorophyll_Concentration")/COUNT("Chlorophyll_Concentration"))/2, AVG("Chlorophyll_Concentration") FROM [461].[table_Sequim_7D_Chlorophyll.csv]
  



________________________________________


SELECT "Chlorophyll_Concentration"
  FROM [461].[Sequim_7D_Chlorophyll_Oxygen]
  WHERE "Chlorophyll_Level"='High'
  ORDER BY "Chlorophyll_Concentration" ASC

  


________________________________________


SELECT "O2_Level", AVG("O2_Concentration")
  FROM [461].[Sequim_7D_Chlorophyll_Oxygen]
  GROUP BY "O2_Level" 
  


________________________________________


SELECT Count FROM [1199].[Old SPR Data]


________________________________________


SELECT Mode FROM [1199].[Old SPR Data]


________________________________________


SELECT Mode FROM [1199].[Old SPR Data]
  where Mode != 7



________________________________________


SELECT Time,Mode,Count,Total,S41,S42,S43 FROM [1199].[Old SPR Data]
  where Mode != 7



________________________________________


SELECT Time,Mode,Count,Total,S41,S42,S43 FROM [1199].[Old SPR Data]

  



________________________________________


SELECT Time,Mode,Count,Total,S41,S42,S43 
  FROM [1199].[Old SPR Data]
  WHERE S41>0 and S41<1000



________________________________________


SELECT Time,Mode,Count,Total,S41,S42,S43 
  FROM [1199].[Old SPR Data]
  WHERE S41>0 and S41<1000



________________________________________


SELECT Time,Mode,Count,Total,S41,S42,S43 
  FROM [1199].[Old SPR Data]
  WHERE S41>0 and S41<1000 and Count = 300



________________________________________


SELECT Time,Mode,Count,Total,S41,S42,S43 
  FROM [1199].[Old SPR Data]
  WHERE (S41>0 and S41<1000) and Count = 300



________________________________________


SELECT Time,Mode,Count,Total,S41,S42,S43 
  FROM [1199].[Old SPR Data]
  WHERE (S41>0 and S41<500) and Total = 300



________________________________________


SELECT Time,Mode,Count,Total,S41,S42,S43 
  FROM [1199].[Old SPR Data]
  WHERE (S41>0 and S41<500) -- clean out bad data
  and (Count>50 and Count<275) -- grab clean section of measurement range
  and Total = 300  -- window the data to get best section of binding period



________________________________________


SELECT Time,Mode,Count,Total,S41,S42,S43 
  FROM [1199].[Old SPR Data]
  WHERE (S41>0 and S41<500) -- clean out bad data
  and (Count>50 and Count<200) -- grab clean section of measurement range
  and Total = 300  -- window the data to get best section of binding period



________________________________________


SELECT * FROM [1199].[table_LoanStats3b_securev1.csv]
  where loan_amnt>10000



________________________________________


SELECT * FROM [1199].[table_LoanStats3b_securev1.csv]
  where fico_range_high > 700



________________________________________


SELECT * FROM [1199].[LoanStats3b_securev1.csv]
  where addr_state = 'WA'
  
  



________________________________________


SELECT 'purpose' FROM [1199].[table_LoanStats3b_securev1.csv]
where addr_state='WA' AND grade='D'


________________________________________


SELECT purpose FROM [1199].[table_LoanStats3b_securev1.csv]
where addr_state='WA' AND grade='D'


________________________________________


SELECT purpose FROM [1199].[table_LoanStats3b_securev1.csv]
where addr_state='WA' AND grade='D' order by purpose



________________________________________


SELECT purpose,url FROM [1199].[table_LoanStats3b_securev1.csv]
where addr_state='WA' AND grade='D' order by purpose



________________________________________


SELECT purpose,funded_amnt FROM [1199].[table_LoanStats3b_securev1.csv]
where addr_state='WA' AND grade='D' order by purpose



________________________________________


SELECT purpose,funded_amnt FROM [1199].[table_LoanStats3b_securev1.csv]
where addr_state='WA' AND grade='D' order by purpose,funded_amnt



________________________________________


SELECT id,purpose,funded_amnt FROM [1199].[table_LoanStats3b_securev1.csv]
where addr_state='WA' AND grade='D' order by purpose,funded_amnt



________________________________________


SELECT loan_amnt FROM [1199].[LoanStats3b_securev1.csv]


________________________________________


SELECT loan_amnt FROM [1199].[LoanStats3b_securev1.csv]
  order by loan_amnt



________________________________________


SELECT loan_amnt, grade FROM [1199].[LoanStats3b_securev1.csv]
  order by loan_amnt



________________________________________


SELECT loan_amnt, grade FROM [1199].[LoanStats3b_securev1.csv]
  order by loan_amnt,grade
  



________________________________________


SELECT loan_amnt, grade FROM [1199].[LoanStats3b_securev1.csv]
  order by loan_amnt,grade,fico_range_low
  



________________________________________


SELECT loan_amnt, grade, fico_range_low FROM [1199].[LoanStats3b_securev1.csv]
  order by loan_amnt,grade, fico_range_low
  



________________________________________


SELECT loan_amnt, grade, fico_range_low FROM [1199].[LoanStats3b_securev1.csv]
  order by loan_amnt,grade, fico_range_low
  



________________________________________


SELECT loan_amnt, grade, fico_range_low FROM [1199].[LoanStats3b_securev1.csv]
  order by loan_amnt,grade, fico_range_low
  



________________________________________


SELECT loan_amnt, grade, fico_range_low FROM [1199].[LoanStats3b_securev1.csv]
  where grade = 'A'
  order by loan_amnt,grade, fico_range_low 



________________________________________


SELECT loan_amnt, grade, fico_range_low FROM [1199].[LoanStats3b_securev1.csv]
  where grade = 'D'
  order by loan_amnt,grade, fico_range_low 



________________________________________


SELECT * FROM [1199].[LoanStats3b_securev1.csv]


________________________________________


SELECT top 100 
  term_id,sum(frequency) as [word count]
  FROM [1314howe].[reuters_terms.csv]
  group by term_id



________________________________________


SELECT top 100 
  term_id,sum(frequency) as [word count]
  FROM [1314howe].[reuters_terms.csv]
  group by term_id
  order by [word count] desc



________________________________________


SELECT top 100 
  doc_id,sum(frequency) as doc_count
  FROM [1314howe].[reuters_terms.csv]
  group by doc_id
  order by doc_count desc



________________________________________


SELECT top 100 
  doc_id,count(*) as doc_count
  FROM [1314howe].[reuters_terms.csv]
  group by doc_id
  order by doc_count desc



________________________________________


SELECT top 100 
 count(distinct doc_id) as doc_count
  FROM [1314howe].[reuters_terms.csv]




________________________________________


SELECT top 100 
 count(distinct term_id) as term_count
  FROM [1314howe].[reuters_terms.csv]




________________________________________


SELECT top 100 
  count(*) as row_count
  ,count(distinct doc_id) as doc_count
  ,count(distinct term_id) as term_count
  FROM [1314howe].[reuters_terms.csv]




________________________________________


SELECT --top 100 
  count(*) as row_count
  ,count(distinct doc_id) as doc_count
  ,count(distinct term_id) as term_count
  FROM [1314howe].[reuters_terms.csv]




________________________________________


SELECT top 100
  doc_id,term_id
  ,SUM(CASE WHEN frequency>0 then 1 else 0 END) as tf
FROM [1314howe].[reuters_terms.csv]
GROUP BY doc_id,term_id



________________________________________


SELECT top 100
  doc_id,term_id,SUM(frequency) as tf
FROM [1314howe].[reuters_terms.csv]
GROUP BY doc_id,term_id



________________________________________



SELECT top 100
  doc_id,term_id,SUM(frequency) as tf
FROM [1314howe].[reuters_terms.csv]
GROUP BY doc_id,term_id



________________________________________



SELECT top 100
  doc_id,term_id,SUM(frequency) as tf
FROM [1314howe].[reuters_terms.csv]
GROUP BY doc_id,term_id
ORDER BY doc_id,term_id



________________________________________



SELECT top 100
  doc_id,term_id,SUM(frequency) as tf
  ,(SELECT COUNT(DISTINCT doc_id) FROM [1314howe].[reuters_terms.csv]) as D
FROM [1314howe].[reuters_terms.csv]
GROUP BY doc_id,term_id
ORDER BY doc_id,term_id



________________________________________



SELECT top 100
  doc_id,term_id,MIN(frequency) as frequency,SUM(frequency) as tf
  ,(SELECT COUNT(DISTINCT doc_id) FROM [1314howe].[reuters_terms.csv]) as D
FROM [1314howe].[reuters_terms.csv]
GROUP BY doc_id,term_id
ORDER BY doc_id,term_id



________________________________________



SELECT top 100
  doc_id,term_id,frequency
  ,(SELECT COUNT(DISTINCT doc_id) FROM [1314howe].[reuters_terms.csv]) as D
FROM [1314howe].[reuters_terms.csv]
ORDER BY doc_id,term_id



________________________________________



SELECT top 100
  doc_id,term_id,frequency
  ,(SELECT COUNT(doc_id) FROM [1314howe].[reuters_terms.csv]) as D
FROM [1314howe].[reuters_terms.csv]
ORDER BY doc_id,term_id



________________________________________



SELECT top 100
  doc_id,term_id,frequency
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
FROM [1314howe].[reuters_terms.csv]
ORDER BY doc_id,term_id



________________________________________



SELECT top 100
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
ORDER BY term_id



________________________________________


SELECT
  term_id,tf,D,docs_with_T
  ,log(D)-log(docs_with_T) as idf
  ,tf * (log(D)-log(docs_with_T)) as [tf-idf]
FROM
(
SELECT top 100
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
ORDER BY term_id
  ) a


________________________________________


SELECT
  term_id,tf,D,docs_with_T
  ,log(D)-log(docs_with_T) as idf
  ,tf * (log(D)-log(docs_with_T)) as [tf-idf]
FROM
(
SELECT --top 100
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
  ) a


________________________________________


SELECT
  term_id,tf,D,docs_with_T
  ,log(D)-log(docs_with_T) as idf
  ,tf * (log(D)-log(docs_with_T)) as [tf-idf]
FROM
(
SELECT --top 100
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
  ) a
ORDER BY [tf-idf]



________________________________________


SELECT
  term_id,tf,D,docs_with_T
  ,log(D)-log(docs_with_T) as idf
  ,tf * (log(D)-log(docs_with_T)) as [tf-idf]
FROM
(
SELECT 
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
  ) a
ORDER BY [tf-idf]



________________________________________


SELECT
  term_id,tf,D,docs_with_T
  ,log(D)-log(docs_with_T) as idf
  ,tf * (log(D)-log(docs_with_T)) as [tf-idf]
FROM
(
SELECT 
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
  ) a
ORDER BY [tf-idf] desc



________________________________________


SELECT
  term_id,tf,D,docs_with_T
  ,log(D)-log(docs_with_T) as idf
  ,tf * (log(D)-log(docs_with_T)) as [tf-idf]
FROM
(
SELECT 
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
  ) a
ORDER BY [tf-idf] desc



________________________________________


--Assignment #1 Intro to DataSci
--Compute the tf-idf (term frequency - inverse document frequency) 
--in SQL
--Verbose select to show intermediate terms

SELECT
  term_id,tf,D,docs_with_T
  ,log(D/docs_with_T) as idf
  ,tf * (log(D/docs_with_T)) as [tf-idf]
FROM
(
SELECT 
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
  ) a
ORDER BY [tf-idf] desc



________________________________________


--Assignment #1 Intro to DataSci
--Compute the tf-idf (term frequency - inverse document frequency) 
--in SQL
--Verbose select to show intermediate terms

SELECT
  term_id,tf,D,docs_with_T
  ,log(D/docs_with_T) as idf
  ,tf * log(D/docs_with_T) as [tf-idf]
FROM
(
SELECT 
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
  ) a
ORDER BY [tf-idf] desc



________________________________________


--Assignment #1 Intro to DataSci
--Compute the tf-idf (term frequency - inverse document frequency) 
--in SQL
--Verbose select to show intermediate terms

SELECT
  term_id,tf,D,docs_with_T
  ,log(D/docs_with_T) as idf
  ,tf * log(D/docs_with_T) as tfidf
FROM
(
SELECT 
  term_id,SUM(frequency) as tf
  ,(SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
  ,COUNT(*) as docs_with_T
FROM [1314howe].[reuters_terms.csv]
GROUP BY term_id
  ) a
ORDER BY tfidf desc



________________________________________


--DataSci Assignment 2, Question 2
--This query calculates term freq * inverse doc freq.
--3 subqueries create 3 matrices each unique terms long
--by 2 columns wide.
--The outer query selects intermediate terms and
--calculates the tf_idf from the 3 matrices.
--matrix 1: (term_id,tf)
--matrix 2: (term_id,D), where D is the # of docs in the corpus
--matrix 3: (term_id,df), where df is doc freq for a given term

SELECT 
  a.term_id,tf,D,df,
  tf*LOG(D/df) as tf_idf
  FROM
  (
    --This subquery creates the term frequency matrix
    SELECT
    term_id,SUM(frequency) as tf
    FROM [1314howe].[reuters_terms.csv]
    GROUP BY term_id
  ) as a 
  inner join 
  (
    --This subquery creates a matrix for documents D in the corpus
    --The inner subquery calculates D, which is replicated for all term_id
    SELECT
    term_id,
    (SELECT COUNT(distinct doc_id) FROM [1314howe].[reuters_terms.csv]) as D
    FROM [1314howe].[reuters_terms.csv]
    GROUP BY term_id
  ) as b
  on a.term_id=b.term_id
  inner join 
  (
    --This subquery calculated document frequency df
    --where, by virtue of the GROUP BY, tf is not NULL
    SELECT
    term_id,
    COUNT(doc_id) as df
    FROM [1314howe].[reuters_terms.csv]
    GROUP BY term_id
  ) as c
  on a.term_id=c.term_id
  ORDER BY tf_idf desc

  


________________________________________


SELECT 'DEPT' FROM [813].[Collaborators10yrRev.csv]
  


________________________________________


SELECT 'UBC' FROM [813].[Collaborators10yrRev.csv]
  


________________________________________


SELECT DEPT FROM [813].[Collaborators10yrRev.csv]
  


________________________________________


SELECT * FROM [table_Collaborators10yrRev.csv]


________________________________________


SELECT * FROM [table_Collaborators10yrRev.csv] WHERE DEPT='UBC'


________________________________________


SELECT * FROM [table_Collaborators10yrRev.csv] WHERE DEPT='Ocean'


________________________________________


SELECT app_bio_female FROM [813].[oser11.csv] 


________________________________________


SELECT  survey_institution app_bio_female FROM [813].[oser11.csv] 


________________________________________


SELECT  survey_institution,app_bio_female FROM [813].[oser11.csv] 


________________________________________


SELECT  app_bio_male,app_bio_female,app_bio_total FROM [813].[oser11.csv] 


________________________________________


SELECT  survey_institution FROM [813].[oser11.csv] WHERE app_total > 200 


________________________________________


SELECT  survey_institution FROM [813].[oser11.csv] WHERE app_total > 100 


________________________________________


SELECT  survey_institution FROM [813].[oser11.csv] WHERE app_total > 150 


________________________________________


SELECT  survey_institution FROM [813].[oser11.csv] WHERE app_bio_total > 75 


________________________________________


SELECT  survey_institution FROM [813].[oser11.csv] WHERE app_bio_total > 40 


________________________________________


SELECT  survey_institution,app_bio_total FROM [813].[oser11.csv] WHERE app_bio_total > 40 


________________________________________


SELECT * FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_male), SUM(offers_bio_male), SUM(enroll_bio_male) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_female), SUM(offers_bio_female), SUM(enroll_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_male), SUM(offers_bio_male), SUM(enroll_bio_male) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_male), SUM(offers_bio_male), SUM(enroll_bio_male) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_male), SUM(offers_bio_male), SUM(enroll_bio_male) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_bio_male), SUM(offers_bio_male), SUM(enroll_bio_male) FROM [813].[table_oser11.csv]


________________________________________


SELECT * FROM [813].[table_oser11.csv]


________________________________________


SELECT * FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM (app_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 50


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 100


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 200


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 300


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 200


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 200


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 200


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 200


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 200


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 200


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 200


________________________________________


SELECT SUM (app_bio_female), SUM(offers_bio_female) FROM [813].[table_oser11.csv] WHERE app_total > 200


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT * FROM [813].[table_oser11.csv] WHERE survey_institution='University of Rhode Island'


________________________________________


SELECT survey_institution,offers_total/app_total as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,app_total as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,offers_total-app_total as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,(offers_total/app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,offers_total, app_total,(offers_total/app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,offers_total, app_total,(offers_total / app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,offers_total, app_total,(offers_total / app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,offers_total, app_total,(offers_total / app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,offers_total, app_total,(offers_total / app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,offers_total, app_total,(offers_total / app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,offers_total, app_total,(offers_total / app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]



________________________________________


SELECT survey_institution,offers_total, app_total,(offers_total / app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]


________________________________________


SELECT survey_institution,offers_total, app_total,(app_total / offers_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]


________________________________________


SELECT survey_institution,offers_total, app_total,(100*offers_total)/app_total as fraction_offers 
    
  FROM [813].[table_oser11.csv]


________________________________________


SELECT survey_institution,offers_total, app_total,(cast(offers_total as float)/app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]


________________________________________


SELECT survey_institution,offers_total, app_total,(1.0*(offers_total )/app_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]


________________________________________


SELECT survey_institution,1.0*offers_total/app_total FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(app_total) FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(phdgranted_total)
  FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(msgranted_total)
  FROM [813].[table_oser11.csv]


________________________________________


SELECT SUM(allyears_total)
  FROM [813].[table_oser11.csv]


________________________________________


SELECT survey_institution,offers_total, app_total,(app_total / offers_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]


________________________________________


SELECT survey_institution,offers_total, app_total,(app_total / offers_total) as fraction_offers 
    
  FROM [813].[table_oser11.csv]


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT survey_institution FROM [813].[table_oser11.csv] WHERE app_total > 150


________________________________________


SELECT * FROM [1314howe].[3rd_highest_fat]


________________________________________


SELECT * FROM (
SELECT row_number() over (order by [Total Fat] DESC) as row
     , *
  FROM [1314howe].[categorized_fat_with_calories] c
 ) x
 WHERE x.row = 3


________________________________________


SELECT * FROM (
SELECT row_number() over (order by [Total Fat] DESC) as row
     , *
  FROM [1314howe].[categorized_fat_with_calories] c
 ) x


________________________________________



SELECT row_number() over (order by [Total Fat] DESC) as row
     , *
  FROM [1314howe].[categorized_fat_with_calories] c
 


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '8/16/2011'


________________________________________


SELECT avg([Total Fat]) 
FROM [1314howe].[total_fat_6_month_projection] past





________________________________________


SELECT avg([Total Fat]) FROM [1314howe].[total_fat_6_month_projection] past





________________________________________


SELECT avg([Total Fat]) FROM [1314howe].[total_fat_6_month_projection]




________________________________________


SELECT avg([Total Fat]) FROM [1314howe].[total_fat_6_month_projection]
past


________________________________________


SELECT Date, [Total Calories], [Total Fat] FROM [1314howe].[categorized_fat_with_calories]
WHERE seafood_calories > nut_calories
AND vegetable_calories > chocolate_calories


________________________________________


SELECT Date, [Total Calories], [Total Fat] FROM [1314howe].[categorized_fat_with_calories] WHERE seafood_calories > nut_calories AND vegetable_calories > chocolate_calories


________________________________________


SELECT * FROM [532].[schools.csv]


________________________________________


SELECT [school_year] FROM [532].[schools.csv]



________________________________________


SELECT *  FROM [532].[schools.csv]



________________________________________


SELECT * FROM [532].[schools.csv]



________________________________________


SELECT * FROM [532].[schools.csv]



________________________________________


SELECT * FROM [532].[schools.csv] WHERE [zipcode] > 2000



________________________________________


SELECT * FROM [532].[schools.csv] WHERE [zipcode] > 2000



________________________________________


SELECT *
  
FROM [532].[schools.csv]
  
WHERE [zipcode] > 2000



________________________________________


SELECT *
  
FROM [532].[schools.csv]




________________________________________


SELECT CASE WHEN [zipcode] = 'None' THEN 0.0
  ELSE CAST([zipcode] as float) END

  
FROM [532].[schools.csv]
 



________________________________________


SELECT CAST([zipcode] as float)
FROM [532].[schools.csv]



________________________________________


SELECT CAST([zipcode] as float) as [zipcode]
FROM [532].[schools.csv]



________________________________________


SELECT CAST([zipcode] as float) as [zipcode]
FROM [532].[schools.csv]
WHERE [zipcode] > 2000



________________________________________


SELECT CAST([zipcode] as int) as [zipcode]
FROM [532].[schools.csv]
WHERE [zipcode] > 2000



________________________________________


SELECT CAST([zipcode] as int) as [zipcode]
FROM [532].[schools.csv]
  WHERE [zipcode] > 2000



________________________________________


SELECT *
FROM [532].[schools.csv]
  WHERE [zipcode] > 2000



________________________________________


SELECT *
FROM [532].[schools.csv]
  WHERE [lea_code] BETWEEN 100 AND 150



________________________________________


SELECT row_number() over (order by [school_code] DESC) as blabla
  
, * FROM [532].[schools.csv]



________________________________________


SELECT row_number() over (order by [school_code] DESC) as [row]
  
, * FROM [532].[schools.csv]



________________________________________


SELECT * FROM (SELECT row_number() over (order by [school_code] DESC) as [row]
  , * FROM [532].[schools.csv]) c



________________________________________


SELECT * FROM (SELECT row_number() over (order by [school_code] DESC) as [row]
  , * FROM [532].[schools.csv]) c
  
WHERE c.school_code BETWEEN 1000 AND 2000



________________________________________


SELECT * FROM (SELECT row_number() over (order by [school_code] DESC) as [row]
  , * FROM [532].[schools.csv]) c
WHERE c.row BETWEEN 0 AND 10



________________________________________


SELECT * FROM [532].[table_schools.csv] WHERE facebook != NULL



________________________________________


SELECT * FROM [532].[table_schools.csv] WHERE facebook = NULL



________________________________________


SELECT * FROM [532].[table_schools.csv] WHERE facebook = 'NULL'



________________________________________


SELECT * FROM [532].[table_schools.csv] WHERE facebook != 'NULL'



________________________________________


SELECT * FROM [532].[table_schools.csv]
  
WHERE [facebook] != 'NULL' AND [school_type] = 'Regular school'



________________________________________


SELECT [school_name] FROM [532].[table_schools.csv]
  
WHERE [facebook] != 'NULL'
  
AND [school_type] = 'Regular school'



________________________________________


SELECT * FROM [532].[table_schools.csv]
  
WHERE [facebook] != 'NULL'
  
AND [school_type] = 'Regular school'



________________________________________


SELECT * FROM [532].[table_schools.csv]
  
WHERE [facebook] != 'NULL'
  
  AND [school_type] = 'Regular school'



________________________________________


SELECT * FROM [532].[table_schools.csv]
  
WHERE [facebook] != 'NULL'
  
  AND [school_type] = 'Regular school'
  



________________________________________


SELECT [school_name] FROM [532].[table_schools.csv]
  
WHERE [facebook] != 'NULL'
  
  AND [school_type] = 'Regular school'
  



________________________________________


SELECT [school_name], [facebook] FROM [532].[table_schools.csv]
  
WHERE [facebook] != 'NULL'
  
  AND [school_type] = 'Regular school'
  



________________________________________


SELECT * FROM [532].[schools.csv]



________________________________________


SELECT *
FROM [532].[table_schools.csv]  




________________________________________


SELECT * FROM (SELECT row_number() over (order by [school_code] DESC) as [row]
  , * FROM [532].[dc_schools_1.csv]) c
WHERE c.row BETWEEN 0 AND 10


________________________________________


SELECT [school_name], [facebook]
FROM [532].[dc_schools_1.csv]  
WHERE [facebook] != 'NULL'  
  AND [school_type] = 'Regular school'



________________________________________


SELECT * FROM [532].[dc_schools_1.csv] WHERE [closing] != 'NO'



________________________________________


SELECT * FROM [532].[dc_schools_1.csv] WHERE school_type != 'Regular school'



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  ORDER BY [lea_code] DESC



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE [school_type] != 'Regular school'
  ORDER BY [lea_code] DESC



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE [school_type] != 'Regular school'
  AND lea_code < 200
  ORDER BY [lea_code] DESC



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE [school_type] != 'Regular school'
  AND lea_code < 200
  AND zipcode BETWEEN 20000 AND 20003
  ORDER BY [lea_code] DESC



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE [school_type] != 'Regular school'
  AND lea_code < 200
  AND zipcode BETWEEN 20000 AND 20003
  AND charter_status = 'No'
  ORDER BY [lea_code] DESC



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE [school_type] != 'Regular school'
  AND lea_code < 200
  AND zipcode BETWEEN 20000 AND 20003
  AND charter_status = 'No'
  AND closing = 'No'
  ORDER BY [lea_code] DESC



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE [school_type] != 'Regular school'
  AND lea_code < 200
  AND zipcode BETWEEN 20000 AND 20003
  AND charter_status = 'No'
  AND closing = 'No'
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE [school_type] != 'Regular school'
  AND [lea_code] < 200
  AND [zipcode] BETWEEN 20000 AND 20003
  AND [charter_status] = 'No'
  AND [closing] = 'No'
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE [school_type] != 'Regular school'
  AND [lea_code] < 200
  AND [zipcode] BETWEEN 20000 AND 20003
  AND [charter_status] = 'No'
  AND [closing] = 'No'
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE [school_type] != 'Regular school'
  AND [lea_code] < 200
  AND [zipcode] BETWEEN 20000 AND 20003
  AND [charter_status] = 'No'
  AND [closing] = 'No'
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
  AND [lea_code] < 200
  AND [zipcode] BETWEEN 20000 AND 20003
  AND [charter_status] = 'No'
  AND [closing] = 'No')
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE (
    ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No'))
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')
  ORDER BY [lea_code]



________________________________________


SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')



________________________________________


SELECT * FROM (SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')) c
  WHERE c.lea_code > 1



________________________________________


SELECT * FROM (SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')) c
  WHERE c.lea_code = 1



________________________________________


SELECT * FROM (SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')) c
  WHERE c.school_code > 10



________________________________________


SELECT * FROM (SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')) c
  WHERE c.school_code > 10
  ORDER BY [school_code]



________________________________________


SELECT [school_code] FROM (SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')) c
  WHERE c.school_code > 10
  ORDER BY [school_code]



________________________________________


SELECT [school_name], [school_code] FROM (SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')) c
  WHERE c.school_code > 10
  ORDER BY [school_code]



________________________________________


SELECT [school_name], [zipcode], [school_code] FROM (SELECT *
  FROM [532].[dc_schools_1.csv]
  WHERE ([school_type] != 'Regular school'
    AND [lea_code] < 200
    AND [zipcode]
    BETWEEN 20000 AND 20003
    AND [charter_status] = 'No'
    AND [closing] = 'No')) c
  WHERE c.school_code > 10
  ORDER BY [school_code]



________________________________________


SELECT * FROM [187].[table_Matrix B.txt]
  where value = 0


________________________________________


delete 
  FROM [187].[table_Matrix B.txt]
  where value = 0


________________________________________


delete 
  FROM [187].[table_Matrix B.txt]
  where value = 0


________________________________________


SELECT * FROM [187].[table_Matrix B.txt] where value = 0


________________________________________


SELECT * FROM [187].[table_Matrix A.txt] where value = 0


________________________________________


delete FROM [187].[table_Matrix A.txt] where value = 0


________________________________________


SELECT * FROM [187].[table_Matrix A.txt]


________________________________________


SELECT * FROM [187].[table_Matrix A.txt] where value = 0


________________________________________


SELECT * FROM 
  [187].[table_Matrix A.txt]  A
  , [187].[table_Matrix B.txt] B
  where A.row_num = B.row_num and A.column_num = b.column_num


________________________________________


SELECT * FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT A.row_num ,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT iif(A.row_num=0 , b.row_num , a.row_num) row ,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT iif(A.row_num=0 , b.row_num , a.row_num) row ,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT iif(A.row_num=0 , b.row_num , a.row_num) row ,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT iif(A.row_num=0 , b.row_num , a.row_num) row ,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT iif(A.row_num=0 , b.row_num , a.row_num) row ,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT iif(A.row_num=0 , b.row_num , a.row_num) row ,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT iif(A.row_num=0 , b.row_num , a.row_num) row ,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT iif(A.row_num=null , b.row_num , a.row_num) row ,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT a.row_num,a.column_num,b.row_num,b.column_num  , a.value + b.value FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  iif(a.row_num = null and b.row_num <> null ,
    b.row_num , 
    a.row_num) as row ,
  a.row_num,
  a.column_num,
  b.row_num,
  b.column_num  , 
  a.value + b.value 
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  iif(a.row_num = null and b.row_num <> null ,
    b.row_num , 
    a.row_num) as row ,
  a.row_num,
  a.column_num,
  b.row_num,
  b.column_num  , a.value , b.value,
  a.value + b.value 
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  iif(a.row_num = null and b.row_num <> null ,
    b.row_num , 
    a.row_num) as row ,
  a.row_num,
  a.column_num,
  b.row_num,
  b.column_num  , a.value , b.value,
  a.value + b.value sum_value
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  isnull(a.row_num,
    b.row_num ) as row ,
  a.row_num,
  a.column_num,
  b.row_num,
  b.column_num  , a.value , b.value,
  a.value + b.value sum_value
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  isnull(a.row_num,
    isnull(b.row_num,a.row_num) ) as row ,
  a.row_num,
  a.column_num,
  b.row_num,
  b.column_num  , a.value , b.value,
  a.value + b.value sum_value
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  isnull(a.row_num,
    isnull(b.row_num,null) ) as row ,
  a.row_num,
  a.column_num,
  b.row_num,
  b.column_num  , a.value , b.value,
  a.value + b.value sum_value
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  isnull(a.row_num,
    isnull(b.row_num,null) ) as row ,
   isnull(a.column_num,
    isnull(b.column_num,null) ) as row ,
  a.row_num,
  a.column_num,
  b.row_num,
  b.column_num  , a.value , b.value,
  a.value + b.value sum_value
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  isnull(a.row_num,
    isnull(b.row_num,null) ) as row 
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  isnull(a.row_num,
    isnull(b.row_num,null) ) as row ,
  isnull(a.column_num,
    isnull(b.column_num,null) ) as row1 
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  isnull(a.row_num,
    isnull(b.row_num,null) ) as row_num ,
  isnull(a.column_num,
    isnull(b.column_num,null) ) as column_num
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  isnull(a.row_num,isnull(b.row_num,null) ) as row_num ,
  isnull(a.column_num,isnull(b.column_num,null) ) as column_num ,
  isnull(a.value , 0) + isnull(b.value,0) value
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT 
  isnull(a.row_num,isnull(b.row_num,null) ) as row_num ,
  isnull(a.column_num,isnull(b.column_num,null) ) as column_num ,
  isnull(a.value , 0) + isnull(b.value,0) value
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT * FROM [187].[Sparse Matrix addition] where row_num = null and column_num = null


________________________________________


SELECT * FROM [187].[Sparse Matrix addition] where row_num = null 


________________________________________


SELECT * FROM [1314howe].[reuters_terms.csv]


________________________________________


SELECT term_id , doc_id , sum(frequency) 
  FROM [1314howe].[reuters_terms.csv]
  Group by term_id , doc_id



________________________________________


SELECT term_id , doc_id , sum(frequency) ftd , 
  count(distinct doc_id) D
  FROM [1314howe].[reuters_terms.csv]
  Group by term_id , doc_id



________________________________________


SELECT term_id , doc_id ,
  --sum(frequency)  ftd , 
  count( doc_id) over (partition by term_id) D
  FROM [1314howe].[reuters_terms.csv]
--  Group by term_id , doc_id



________________________________________


SELECT 
  isnull(a.row_num,isnull(b.row_num,null) ) as row_num ,
  isnull(a.column_num,isnull(b.column_num,null) ) as column_num ,
  isnull(a.value , 0) + isnull(b.value,0) value
  FROM 
  [187].[table_Matrix A.txt]  A
 full outer join [187].[table_Matrix B.txt] B
  on A.row_num = B.row_num
  and A.column_num  = b.column_num


________________________________________


SELECT term_id , doc_id ,
  --sum(frequency)  ftd , 
  count( doc_id) over (partition by term_id) D
  FROM [1314howe].[reuters_terms.csv]
--  Group by term_id , doc_id



________________________________________


SELECT term_id , doc_id ,
sum(frequency)  ftd , 
count( doc_id) over (partition by term_id) D
  FROM [1314howe].[reuters_terms.csv]
Group by term_id , doc_id



________________________________________


SELECT term_id , doc_id ,
sum(frequency)  ftd , 
count( doc_id) over (partition by term_id) D
  FROM [1314howe].[reuters_terms.csv]
Group by term_id , doc_id



________________________________________


SELECT term_id , doc_id ,
sum(frequency)  ftd , 
count( doc_id) over (partition by term_id) D
  FROM [1314howe].[reuters_terms.csv] where 
  doc_id = '7521_txt_trade'
Group by term_id , doc_id



________________________________________


SELECT count (distinct doc_id)
  FROM [1314howe].[reuters_terms.csv] where 
  doc_id = '7521_txt_trade'




________________________________________


SELECT count (distinct doc_id)
  FROM [1314howe].[reuters_terms.csv] 



________________________________________


SELECT term_id , doc_id ,
  sum(frequency)  ftd , max(dist_doc_cnt.D) D

  FROM [1314howe].[reuters_terms.csv] , 
  (SELECT count (distinct doc_id) D
    FROM [1314howe].[reuters_terms.csv] 
  ) dist_doc_cnt
Group by term_id , doc_id



________________________________________


--TF-IDF = for each term and document 
--[freq of each t within each d = ftd] 
-- * [log (total distinct Documents = D / how many distinct document does the term appear in = ftDocs )]

SELECT term_id , doc_id ,
  sum(frequency)  ftd , max(dist_doc_cnt.D) D
  FROM [1314howe].[reuters_terms.csv] , 
  (SELECT count (distinct doc_id) D
    FROM [1314howe].[reuters_terms.csv] 
  ) dist_doc_cnt
Group by term_id , doc_id



________________________________________


SELECT term_id , doc_id 
  FROM [1314howe].[reuters_terms.csv] 
  group by term_id , doc_id 
  


________________________________________


SELECT term_id , count(doc_id )
  FROM [1314howe].[reuters_terms.csv] 
  group by term_id 


________________________________________


SELECT 
       freq.term_id , 
        doc_id ,
        sum(frequency)  ftd , 
        max(dist_doc_cnt.D) D,
        max(ftDocs.ftDocs) ftDocs
  FROM [1314howe].[reuters_terms.csv] freq, 
              (SELECT count (distinct doc_id) D
                             FROM [1314howe].[reuters_terms.csv] 
               ) dist_doc_cnt
               ,(SELECT term_id , count(doc_id ) ftDocs
                             FROM [1314howe].[reuters_terms.csv] 
              group by term_id ) ftDocs
  where freq.term_id = ftDocs.term_id
Group by freq.term_id , doc_id



________________________________________


SELECT 
       freq.term_id , 
        doc_id ,
        sum(frequency)  ftd , 
        max(dist_doc_cnt.D) D,
        max(ftDocs.ftDocs) ftDocs
  FROM [1314howe].[reuters_terms.csv] freq, 
              (SELECT count (distinct doc_id) D
                             FROM [1314howe].[reuters_terms.csv] 
               ) dist_doc_cnt
               ,(SELECT term_id , count(doc_id ) ftDocs
                             FROM [1314howe].[reuters_terms.csv] 
              group by term_id ) ftDocs
  where freq.term_id = ftDocs.term_id
Group by freq.term_id , doc_id
order by freq.term_id


________________________________________


SELECT term_id , count(doc_id ) ftDocs
  FROM [1314howe].[reuters_terms.csv] 
  group by term_id 
  order by term_id


________________________________________


Select term_id , doc_id , 
  ftd*log(D/ftDocs) TF_IDF from 
(SELECT 
       freq.term_id , 
       doc_id ,
       sum(frequency)  ftd , 
       max(dist_doc_cnt.D) D,
       max(ftDocs.ftDocs) ftDocs
       
  FROM [1314howe].[reuters_terms.csv] freq
      ,(SELECT count (distinct doc_id) D FROM [1314howe].[reuters_terms.csv]) dist_doc_cnt
      ,(SELECT term_id , count(doc_id ) ftDocs FROM [1314howe].[reuters_terms.csv] group by term_id ) ftDocs
  where freq.term_id = ftDocs.term_id
Group by freq.term_id , doc_id) tf_idf_components



________________________________________


Select 
  term_id ,
  doc_id , 
  ftd*log10(D/ftDocs) TF_IDF 
from 
(SELECT 
       freq.term_id , 
       doc_id ,
       sum(frequency)  ftd , 
       max(dist_doc_cnt.D) D,
       max(ftDocs.ftDocs) ftDocs
       
  FROM [1314howe].[reuters_terms.csv] freq
      ,(SELECT count (distinct doc_id) D FROM [1314howe].[reuters_terms.csv]) dist_doc_cnt
      ,(SELECT term_id , count(doc_id ) ftDocs FROM [1314howe].[reuters_terms.csv] group by term_id ) ftDocs
  where freq.term_id = ftDocs.term_id
Group by freq.term_id , doc_id) tf_idf_components



________________________________________


Select 
  term_id ,
  doc_id , 
  ftd*log(D/ftDocs) TF_IDF 
from 
(SELECT 
       freq.term_id , 
       doc_id ,
       sum(frequency)  ftd , 
       max(dist_doc_cnt.D) D,
       max(ftDocs.ftDocs) ftDocs
       
  FROM [1314howe].[reuters_terms.csv] freq
      ,(SELECT count (distinct doc_id) D FROM [1314howe].[reuters_terms.csv]) dist_doc_cnt
      ,(SELECT term_id , count(doc_id ) ftDocs FROM [1314howe].[reuters_terms.csv] group by term_id ) ftDocs
  where freq.term_id = ftDocs.term_id
Group by freq.term_id , doc_id) tf_idf_components



________________________________________


SELECT * FROM [776].[banklist.csv] data where data.City = 'Portland';



________________________________________


SELECT * FROM [776].[banklist.csv] data where data.City = 'Portland';



________________________________________


SELECT * FROM [776].[banklist.csv] data where data.City = 'San Diego';



________________________________________


SELECT * FROM [776].[banklist.csv] data where data.ST = 'OR';



________________________________________


SELECT * FROM [776].[banklist.csv] data where data.ST = 'OR' and data.[Acquiring Institution] = 'Home Federal Bank';



________________________________________


SELECT * FROM [776].[banklist.csv] data where data.ST = 'CA';



________________________________________


SELECT * FROM [776].[banklist.csv] data where data.ST = 'CA' and data.[Acquiring Institution] = 'No Acquirer';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.ST = 'CA';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.ST = 'CA' order by data.[Closing Date];




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.ST = 'CA' and data.City = 'Los Angeles';



________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '11-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '12-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '13-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '14-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '15-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '16-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '17-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '18-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '19-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '20-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '21-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '22-Sep-01';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '11-Sep-08';




________________________________________


SELECT * FROM [776].[banklist.csv] data where data.[Closing Date] = '11-Sep-09';




________________________________________


SELECT * FROM [277].[table_samples.csv63581]


________________________________________


SELECT * FROM allSamples



________________________________________


select * from allSeqs



________________________________________


SELECT * FROM [277].[seq.csv]


________________________________________


SELECT * FROM [277].[hits-with-ids-small.csv]



________________________________________


SELECT * FROM [277].[hits-with-ids-small.csv] h



________________________________________


SELECT * FROM [hits-with-ids-small.csv] h



________________________________________


SELECT * FROM [hits-with-ids-small.csv] h INNER JOIN [samples.csv] s ON h.sample_id = s.sample_id



________________________________________


SELECT * FROM [hits-with-ids-small.csv] h INNER JOIN [samples.csv] s ON h.sample_id = s.sample_id WHERE s.size_fraction = 0.2



________________________________________


SELECT * FROM [hits-with-ids-small.csv] h INNER JOIN [samples.csv] s ON h.sample_id = s.sample_id WHERE s.size_fraction = 2



________________________________________


SELECT * FROM [hits-with-ids-small.csv] h INNER JOIN [samples.csv] s ON h.sample_id = s.sample_id WHERE s.size_fraction = 0.2



________________________________________


SELECT * FROM [m8s-with-ids.csv] h INNER JOIN [samples.csv] s ON h.sample_id = s.sample_id WHERE s.size_fraction = 0.2



________________________________________


SELECT * FROM [m8s-with-ids.csv] h INNER JOIN [samples.csv] s ON h.sample_id = s.sample_id WHERE s.size_fraction = 0.2


________________________________________


select * from [samples.csv] s where s.size_fraction = 2
  



________________________________________


select * from [seq_property.csv];
  



________________________________________


select * from [m8s-with-ids.csv] where sample_id = 3;



________________________________________


select * from [m8s-with-ids.csv] where sample_id = 1;



________________________________________


select * from [m8s-with-ids.csv] where sample_id = 5;



________________________________________


SELECT * FROM [hits_with_sample_ids.csv] h
  INNER JOIN [samples.csv] s ON h.sample_id = s.sample_id
  INNER JOIN [seq_property.csv] sp ON sp.seq_id = h.marineref_seq_id
  INNER JOIN [pfam_anno.csv] pfam ON pfam.pfam_anno_id = sp.pfam_anno_id
  WHERE pfam.pfam_name = 'Pkinase'



________________________________________


SELECT * FROM [hits_with_sample_ids.csv] h
  INNER JOIN [samples.csv] s ON h.sample_id = s.sample_id
  INNER JOIN [seq_property.csv] sp ON sp.seq_id = h.marineref_seq_id
  INNER JOIN [pfam_anno.csv] pfam ON pfam.pfam_anno_id = sp.pfam_anno_id
  WHERE pfam.pfam_name = 'Pkinase' AND s.size_fraction = 0.2



________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:2:2201:11761:62774'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:2:2201:11761:62774:TTAGGC'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:2:2201:11761:62774:TTAGGC'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:2:2201:11761:62774'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:2:2201:11761:62774'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:2:2201:11761:62774'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:2:2201:11761:62774'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:2:2201:11761:62774'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:2:2201:11761:62774:TTAGGC'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:1:1112:5816:35467:GTGAAA'


________________________________________


SELECT * FROM [hits_with_sample_ids_middle4.csv] h WHERE h.read_id = 'HWI-ST1384:264:H7HWBADXX:1:1112:6291:35328:GTGAAA'


________________________________________


SELECT * FROM [1059].[SFL_VIEW]


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [277].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , abundance
     , fsc_small
     , chl_small
     , pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


select * FROM [277].[SFL_VIEW]


________________________________________


WITH UniquePos AS
      (SELECT [time], [LAT], [LON] FROM [277].[SFL_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) * 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


WITH pop
  AS (SELECT [time], [pop], [abundance]
      FROM [277].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([prochloro], [synecho], [picoeuk], [beads])
) as pivot_table


________________________________________


WITH pop
  AS (SELECT [time], [pop], log([fsc_small], 10) as [fsc_small]
      FROM [277].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([fsc_small])
  FOR [pop] in ([prochloro], [synecho],[picoeuk], [beads])
) as pivot_table


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM 
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c,
  [277].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT * FROM [277].[table_stat.csvF7CD8]
  ORDER BY [time] DESC



________________________________________


WITH pop
  AS (SELECT [time], [pop], log([fsc_small], 10) as [fsc_small]
      FROM [277].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([fsc_small])
  FOR [pop] in ([prochloro], [synecho],[picoeuk], [beads])
) as pivot_table


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c,
  [277].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT * FROM [277].[SeaFlow All Data] ORDER BY [time] ASC



________________________________________


WITH UniquePos AS
      (SELECT [time], [LAT], [LON] FROM [277].[SFL_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT b.[DateTime] AS [DateTime]
            , a.[DateTime] AS [DateTime0]
            , b.[DateTime] AS [DateTime1]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) * 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c,
  [277].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


select * from [277].[SeaFlow All Data] ORDER BY [time] DESC


________________________________________


SELECT CAST(SUBSTRING(V2, 1, 23) as datetime) as [time], V7 as attenuation FROM [277].[cstar.csv]



________________________________________


SELECT CAST(SUBSTRING(V2, 1, 23) as datetime) as [time], V7 as attenuation
  FROM [277].[cstar.csv]
  ORDER BY [time] ASC



________________________________________


SELECT MIN([time]) AS [time], AVG(attenuation) AS attenuation
  FROM [277].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
  ORDER BY MIN([time])


________________________________________


SELECT * FROM [CSTAR_VIEW]



________________________________________


SELECT * FROM [CSTAR_VIEW]



________________________________________


SELECT * FROM [CSTAR_VIEW] ORDER BY [time] DESC



________________________________________


SELECT * FROM [CSTAR_VIEW] ORDER BY [time] ASC



________________________________________


SELECT CAST(SUBSTRING(V2, 1, 23) as datetime) as [time], V7 as attenuation
  FROM [277].[cstar.csv]
  ORDER BY [time] ASC



________________________________________


select * from [CSTAR_VIEW]



________________________________________


SELECT MIN([time]) AS [time], AVG(attenuation) AS attenuation
  FROM [277].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
  ORDER BY MIN([time])


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] a
    INNER JOIN
    [277].[SeaFlow: population-wise concentrations] b
    ON a.[time] = b.[time]
    INNER JOIN
    [277].[SeaFlow: population-wise size (fsc_small)] c
    ON a.[time] = b.[time]
    INNER JOIN
    [277].[SeaFlow: velocity] d
    ON a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT COUNT(*) FROM [SeaFlow All Data 2];



________________________________________


SELECT COUNT(*) FROM [SeaFlow All Data];



________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] a
    INNER JOIN
    [277].[SeaFlow: population-wise concentrations] b
    ON a.[time] = b.[time]
    INNER JOIN
    [277].[SeaFlow: population-wise size (fsc_small)] c
    ON a.[time] = c.[time]
    INNER JOIN
    [277].[SeaFlow: velocity] d
    ON a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


select count(*) from [SeaFlow All Data];



________________________________________


select count(*) from [SeaFlow All Data 2];



________________________________________


select * from [SeaFlow All Data 2];



________________________________________


select * from [SeaFlow All Data];


________________________________________


select * from [SeaFlow: 3 minute attenuation];


________________________________________


select * from [277].[SeaFlow: 3 minute attenuation]



________________________________________


select * from [277].[SeaFlow: 3 minute attenuation] ORDER BY [time]



________________________________________


select * from [277].[SeaFlow: 3 minute attenuation] ORDER BY [time] ASC



________________________________________


select *, DATEADD(mm, 3, [time]) from [277].[SeaFlow: 3 minute attenuation] ORDER BY [time] ASC



________________________________________


select *, DATEADD(mm, 3, [time]) AS MIN3 from [277].[SeaFlow: 3 minute attenuation] ORDER BY [time] ASC



________________________________________


select *, DATEADD(minute, 3, [time]) AS MIN3 from [277].[SeaFlow: 3 minute attenuation] ORDER BY [time] ASC



________________________________________


select * from [277].[SeaFlow: 3 minute attenuation] ORDER BY [time] ASC



________________________________________


select * from [SeaFlow: velocity] ORDER BY [DateTime] DESC



________________________________________


select * from [SeaFlow: velocity] ORDER BY [DateTime] ASC



________________________________________


select * from [SeaFlow All Data] ORDER BY [time] ASC



________________________________________


select * from [SFL_VIEW] order by [time] asc



________________________________________


select * from [SeaFlow All DATA] order by [time] asc



________________________________________


select * from [STATS_VIEW] ORDER BY [time] ASC



________________________________________


select * FROM [277].[SeaFlow: 3 minute attenuation] ORDER BY [time] ASC



________________________________________


select * from [277].[SeaFlow: 3 minute attenuation] ORDER BY [time] ASC



________________________________________


SELECT MIN([time]) AS [time], AVG(attenuation) AS attenuation
  FROM [277].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
  ORDER BY MIN([time])


________________________________________


select * from [SeaFlow: 3 minute attenuation] ORDER BY [time] DESC



________________________________________


SELECT
  [time], attenuation, filteredCount, [count],
  (CAST(filteredCount AS float)/CAST([count] AS float)) AS filteredFraction,
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .9 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
ORDER BY [time] ASC


________________________________________


SELECT
  [time], attenuation, filteredCount, [count],
  (CAST(filteredCount AS float)/CAST([count] AS float)) AS filteredFraction,
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .85 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
ORDER BY [time] ASC


________________________________________


SELECT
  [time], attenuation, filteredCount, [count],
  (CAST(filteredCount AS float)/CAST([count] AS float)) AS filteredFraction,
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN filteredCount = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .85 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
ORDER BY [time] ASC


________________________________________


WITH all_tracks AS 
  (SELECT *, ROW_NUMBER() OVER (ORDER BY [time] ASC) AS row FROM [277].[SFL_VIEW]),
track_stats AS (SELECT COUNT(*) as num_tracks, CASE WHEN COUNT(*) < 1000 THEN 1 ELSE convert(int, (COUNT(*)+999)/1000) END AS granularity FROM all_tracks)
SELECT lat, lon, [time]
FROM all_tracks, track_stats
WHERE (num_tracks-row) % granularity = 0 AND (num_tracks - row) > 495
ORDER BY [time] ASC


________________________________________


WITH all_tracks AS 
  (SELECT *, ROW_NUMBER() OVER (ORDER BY [time] ASC) AS row FROM [277].[SFL_VIEW]),
track_stats AS (SELECT COUNT(*) as num_tracks, CASE WHEN COUNT(*) < 1000 THEN 1 ELSE convert(int, (COUNT(*)+999)/1000) END AS granularity FROM all_tracks)
SELECT lat, lon, [time], num_tracks, granularity, row
FROM all_tracks, track_stats
WHERE (num_tracks-row) % granularity = 0 AND (num_tracks - row) > 495
ORDER BY [time] ASC


________________________________________


SELECT * FROM [277].[table_sfl.csvE3CA9]


________________________________________


SELECT [time], attenuation
  FROM [277].[cstar3min.csv]
  ORDER BY [time] ASC



________________________________________


SELECT CAST([time] as datetime), attenuation
  FROM [277].[cstar3min.csv]
  ORDER BY [time] ASC



________________________________________


SELECT CAST([time] as datetime) as [time], attenuation
  FROM [277].[cstar3min.csv]
  ORDER BY [time] ASC



________________________________________


SELECT CAST([time] as datetime) as [time], attenuation
  FROM [277].[cstar3min.csv]
  WHERE attenuation > 0.6
  ORDER BY [time] ASC



________________________________________


SELECT CAST([time] as datetime) as [time], attenuation
  FROM [277].[cstar3min.csv]
  WHERE attenuation > 0.06
  ORDER BY [time] ASC



________________________________________


SELECT CAST([time] as datetime) as [time], attenuation
  FROM [277].[cstar3min.csv]
  WHERE attenuation > 0.07
  ORDER BY [time] ASC



________________________________________


SELECT CAST([time] as datetime) as [time], attenuation
  FROM [277].[cstar3min.csv]
  WHERE attenuation > 0.08
  ORDER BY [time] ASC



________________________________________


SELECT CAST([time] as datetime) as [time], attenuation
  FROM [277].[cstar3min.csv]
  ORDER BY [time] ASC



________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT) as abundance
     , fsc_small
     , chl_small
     , pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT) as abundance
     , fsc_small
     , chl_small
     , pe
FROM [277].[stat.csv]
ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[CSTAR_VIEW] ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[CSTAR_VIEW] ORDER BY [time] DESC


________________________________________


SELECT 
  a.[time], lat, lon, salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c,
  [277].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT cruise
  , isnumeric(cruise) as cruisenum
     , [file]
     , cast([time] as datetime2) as time
     , lat
  , isnumeric(lat) as latnum
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT) as abundance
     , fsc_small
     , chl_small
     , pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
  , CASE WHEN NOT cruise LIKE '%[^0-9]%' THEN 1 ELSE 0 END as cruisenum
     , [file]
     , cast([time] as datetime2) as time
     , lat
  , isnumeric(lat) as latnum
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT) as abundance
     , fsc_small
     , chl_small
     , pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
  , CASE WHEN NOT cruise LIKE '%[^0-9]%' THEN 1 ELSE 0 END as cruisenum
     , [file]
     , cast([time] as datetime2) as time
     , lat
  , CASE WHEN NOT lat LIKE '%[^0-9]%' THEN 1 ELSE 0 END as latnum
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT) as abundance
     , fsc_small
     , chl_small
     , pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
  , CASE WHEN NOT cruise LIKE '%[^0-9]%' THEN 1 ELSE 0 END as cruisenum
     , [file]
     , cast([time] as datetime2) as time
     , lat
  , CASE WHEN NOT lat LIKE '%[^0-9.]%' THEN 1 ELSE 0 END as latnum
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT) as abundance
     , fsc_small
     , chl_small
     , pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
  , CASE WHEN NOT cruise LIKE '%[^0-9.]%' THEN 1 ELSE 0 END as cruisenum
     , [file]
     , cast([time] as datetime2) as time
     , lat
  , CASE WHEN NOT lat LIKE '%[^0-9.]%' THEN 1 ELSE 0 END as latnum
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT) as abundance
     , fsc_small
     , chl_small
     , pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


declare @vchar varchar(50)
set @vchar ='34343';
select case when @vchar not like '%[^0-9]%' then 'Number' else 'Not a Number' end


________________________________________


declare @vchar varchar(50)
set @vchar ='34343.0';
select case when @vchar not like '%[^0-9]%' then 'Number' else 'Not a Number' end


________________________________________


declare @vchar varchar(50)
set @vchar ='34343.0';
select case when @vchar not like '%[^0-9.]%' then 'Number' else 'Not a Number' end


________________________________________


declare @vchar varchar(50)
set @vchar ='34343.0';
select case when @vchar not like '%[^0-9.-]%' then 'Number' else 'Not a Number' end


________________________________________


declare @vchar varchar(50)
set @vchar ='-34343.0';
select case when @vchar not like '%[^0-9.-]%' then 'Number' else 'Not a Number' end


________________________________________


declare @vchar varchar(50)
set @vchar ='-34343.0';
select case when @vchar not like '%[^0-9.]%' then 'Number' else 'Not a Number' end


________________________________________


declare @vchar varchar(50)
set @vchar ='-34343.0';
select case when @vchar not like '%[^0-9.-]%' then 'Number' else 'Not a Number' end


________________________________________


declare @vchar varchar(50)
set @vchar = NULL;
select case when @vchar not like '%[^0-9.-]%' then 'Number' else 'Not a Number' end


________________________________________


declare @vchar varchar(50)
set @vchar = 345;
select case when @vchar not like '%[^0-9.-]%' then 'Number' else 'Not a Number' end


________________________________________


declare @vchar varchar(50)
set @vchar = 345;
select case when @vchar like '%[^0-9.-]%' then 'Not a Number' else 'Number' end


________________________________________


declare @vchar varchar(50)
set @vchar = 33.345;
select case when @vchar like '%[^0-9.-]%' then 'Not a Number' else 'Number' end


________________________________________


declare @vchar varchar(50)
set @vchar = -33.345;
select case when @vchar like '%[^0-9.-]%' then 'Not a Number' else 'Number' end


________________________________________


declare @vchar varchar(50)
set @vchar = -33;
select case when @vchar like '%[^0-9.-]%' then 'Not a Number' else 'Number' end


________________________________________


declare @vchar varchar(50)
set @vchar = 'NA';
select case when @vchar like '%[^0-9.-]%' then 'Not a Number' else 'Number' end


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , CAST(CASE WHEN lat LIKE '%[^0-9.-]%' THEN NULL ELSE lat END as FLOAT) as lat
     , CAST(CASE WHEN lon LIKE '%[^0-9.-]%' THEN NULL ELSE lon END as FLOAT) as lon
     , CAST(CASE WHEN opp_evt_ratio LIKE '%[^0-9.-]%' THEN NULL ELSE opp_evt_ratio END as FLOAT) as opp_evt_ratio
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE flow_rate END as FLOAT) as flow_rate
     , CAST(CASE WHEN file_duration LIKE '%[^0-9.-]%' THEN NULL ELSE file_duration END as FLOAT) as file_duration
     , pop
     , CAST(CASE WHEN n_count LIKE '%[^0-9.-]%' THEN NULL ELSE n_count END as FLOAT) as n_count
     , CAST(CASE WHEN abundance LIKE '%[^0-9.-]%' THEN NULL ELSE abundance END as FLOAT) as abundance
     , CAST(CASE WHEN fsc_small LIKE '%[^0-9.-]%' THEN NULL ELSE fsc_small END as FLOAT) as fsc_small
     , CAST(CASE WHEN chl_small LIKE '%[^0-9.-]%' THEN NULL ELSE chl_small END as FLOAT) as chl_small
     , CAST(CASE WHEN pe LIKE '%[^0-9.-]%' THEN NULL ELSE pe END as FLOAT) as pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , CAST(CASE WHEN lat LIKE '%[^0-9.-]%' THEN NULL ELSE lat END as FLOAT) as lat
     , CAST(CASE WHEN lon LIKE '%[^0-9.-]%' THEN NULL ELSE lon END as FLOAT) as lon
     , CAST(CASE WHEN opp_evt_ratio LIKE '%[^0-9.-]%' THEN NULL ELSE opp_evt_ratio END as FLOAT) as opp_evt_ratio
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE flow_rate END as FLOAT) as flow_rate
     , CAST(CASE WHEN file_duration LIKE '%[^0-9.-]%' THEN NULL ELSE file_duration END as FLOAT) as file_duration
     , pop
     , CAST(CASE WHEN n_count LIKE '%[^0-9.-]%' THEN NULL ELSE n_count END as INT) as n_count
     , CAST(CASE WHEN abundance LIKE '%[^0-9.-]%' THEN NULL ELSE abundance END as FLOAT) as abundance
     , CAST(CASE WHEN fsc_small LIKE '%[^0-9.-]%' THEN NULL ELSE fsc_small END as FLOAT) as fsc_small
     , CAST(CASE WHEN chl_small LIKE '%[^0-9.-]%' THEN NULL ELSE chl_small END as FLOAT) as chl_small
     , CAST(CASE WHEN pe LIKE '%[^0-9.-]%' THEN NULL ELSE pe END as FLOAT) as pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT 
  a.[time], lat, lon, salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c,
  [277].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], lat, lon, salinity, ocean_tmp, par,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], lat, lon, salinity, ocean_tmp, par,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], lat, lon, salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c,
  [277].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], lat, lon, salinity, ocean_tmp, par,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  [time], lat, lon, salinity, ocean_tmp, par
  FROM
  [277].[SFL_VIEW]
  ORDER BY [time] DESC


________________________________________


SELECT 
  a.[time],
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , CAST(CASE WHEN opp_evt_ratio LIKE '%[^0-9.-]%' THEN NULL ELSE opp_evt_ratio END as FLOAT) as opp_evt_ratio
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE flow_rate END as FLOAT) as flow_rate
     , CAST(CASE WHEN file_duration LIKE '%[^0-9.-]%' THEN NULL ELSE file_duration END as FLOAT) as file_duration
     , pop
     , CAST(CASE WHEN n_count LIKE '%[^0-9.-]%' THEN NULL ELSE n_count END as INT) as n_count
     , CAST(CASE WHEN abundance LIKE '%[^0-9.-]%' THEN NULL ELSE abundance END as FLOAT) as abundance
     , CAST(CASE WHEN fsc_small LIKE '%[^0-9.-]%' THEN NULL ELSE fsc_small END as FLOAT) as fsc_small
     , CAST(CASE WHEN chl_small LIKE '%[^0-9.-]%' THEN NULL ELSE chl_small END as FLOAT) as chl_small
     , CAST(CASE WHEN pe LIKE '%[^0-9.-]%' THEN NULL ELSE pe END as FLOAT) as pe
FROM [277].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , CAST([date] as datetime2) as [time]
     , CAST(CASE WHEN lat LIKE '%[^0-9.-]%' THEN NULL ELSE lat END as FLOAT) as lat
     , CAST(CASE WHEN lon LIKE '%[^0-9.-]%' THEN NULL ELSE lon END as FLOAT) as lon
     , CAST(CASE WHEN conductivity LIKE '%[^0-9.-]%' THEN NULL ELSE conductivity END as FLOAT) as conductivity
     , CAST(CASE WHEN salinity LIKE '%[^0-9.-]%' THEN NULL ELSE salinity END as FLOAT) as salinity
     , CAST(CASE WHEN ocean_tmp LIKE '%[^0-9.-]%' THEN NULL ELSE ocean_tmp END as FLOAT) as ocean_tmp
     , CAST(CASE WHEN par LIKE '%[^0-9.-]%' THEN NULL ELSE par END as FLOAT) as par
     , CAST(CASE WHEN bulk_red LIKE '%[^0-9.-]%' THEN NULL ELSE bulk_red END as FLOAT) as bulk_red
     , CAST(CASE WHEN stream_pressure LIKE '%[^0-9.-]%' THEN NULL ELSE stream_pressure END as FLOAT) as stream_pressure
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE  flow_rate END as FLOAT) as  flow_rate
     , CAST(CASE WHEN event_rate LIKE '%[^0-9.-]%' THEN NULL ELSE  event_rate END as FLOAT) as  event_rate
FROM [277].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , CAST([date] as datetime2) as [time]
     , CAST(CASE WHEN lat LIKE '%[^0-9.-]%' THEN NULL ELSE lat END as FLOAT) as lat
     , CAST(CASE WHEN lon LIKE '%[^0-9.-]%' THEN NULL ELSE lon END as FLOAT) as lon
     , CAST(CASE WHEN conductivity LIKE '%[^0-9.-]%' THEN NULL ELSE conductivity END as FLOAT) as conductivity
     , CAST(CASE WHEN salinity LIKE '%[^0-9.-]%' THEN NULL ELSE salinity END as FLOAT) as salinity
     , CAST(CASE WHEN ocean_tmp LIKE '%[^0-9.-]%' THEN NULL ELSE ocean_tmp END as FLOAT) as ocean_tmp
     , CAST(CASE WHEN par LIKE '%[^0-9.-]%' THEN NULL ELSE par END as FLOAT) as par
     , CAST(CASE WHEN bulk_red LIKE '%[^0-9.-]%' THEN NULL ELSE bulk_red END as FLOAT) as bulk_red
     , CAST(CASE WHEN stream_pressure LIKE '%[^0-9.-]%' THEN NULL ELSE stream_pressure END as FLOAT) as stream_pressure
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE  flow_rate END as FLOAT) as  flow_rate
     , CAST(CASE WHEN event_rate LIKE '%[^0-9.-]%' THEN NULL ELSE  event_rate END as FLOAT) as  event_rate
FROM [277].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT 
  a.[time],
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] ASC


________________________________________


SELECT 
  [time], lat, lon, salinity, ocean_tmp, par
  FROM
  [277].[SFL_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT cruise
     , [file]
     , CAST([date] as datetime2) as [time]
     , CAST(CASE WHEN lat LIKE '%[^0-9.-]%' THEN NULL ELSE lat END as FLOAT) as lat
     , CAST(CASE WHEN lon LIKE '%[^0-9.-]%' THEN NULL ELSE lon END as FLOAT) as lon
     , CAST(CASE WHEN conductivity LIKE '%[^0-9.-]%' THEN NULL ELSE conductivity END as FLOAT) as conductivity
     , CAST(CASE WHEN salinity LIKE '%[^0-9.-]%' THEN NULL ELSE salinity END as FLOAT) as salinity
     , CAST(CASE WHEN ocean_tmp LIKE '%[^0-9.-]%' THEN NULL ELSE ocean_tmp END as FLOAT) as ocean_tmp
     , CAST(CASE WHEN par LIKE '%[^0-9.-]%' THEN NULL ELSE par END as FLOAT) as par
     , CAST(CASE WHEN bulk_red LIKE '%[^0-9.-]%' THEN NULL ELSE bulk_red END as FLOAT) as bulk_red
     , CAST(CASE WHEN stream_pressure LIKE '%[^0-9.-]%' THEN NULL ELSE stream_pressure END as FLOAT) as stream_pressure
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE  flow_rate END as FLOAT) as  flow_rate
     , CAST(CASE WHEN event_rate LIKE '%[^0-9.-]%' THEN NULL ELSE  event_rate END as FLOAT) as  event_rate
FROM [277].[sfl.csv]
ORDER BY [time] ASC


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , CAST(CASE WHEN opp_evt_ratio LIKE '%[^0-9.-]%' THEN NULL ELSE opp_evt_ratio END as FLOAT) as opp_evt_ratio
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE flow_rate END as FLOAT) as flow_rate
     , CAST(CASE WHEN file_duration LIKE '%[^0-9.-]%' THEN NULL ELSE file_duration END as FLOAT) as file_duration
     , pop
     , CAST(CASE WHEN n_count LIKE '%[^0-9.-]%' THEN NULL ELSE n_count END as INT) as n_count
     , CAST(CASE WHEN abundance LIKE '%[^0-9.-]%' THEN NULL ELSE abundance END as FLOAT) as abundance
     , CAST(CASE WHEN fsc_small LIKE '%[^0-9.-]%' THEN NULL ELSE fsc_small END as FLOAT) as fsc_small
     , CAST(CASE WHEN chl_small LIKE '%[^0-9.-]%' THEN NULL ELSE chl_small END as FLOAT) as chl_small
     , CAST(CASE WHEN pe LIKE '%[^0-9.-]%' THEN NULL ELSE pe END as FLOAT) as pe
FROM [277].[stat.csv]
ORDER BY [time] ASC


________________________________________


select * from [1059].[cstar.csv]


________________________________________


select * from [1059].[cstar.csv] order by [V2] desc


________________________________________


SELECT 
  CONVERT(CHAR(23), [time], 126), lat, lon, salinity, ocean_tmp, par
  FROM
  [277].[SFL_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT 
  CONVERT(CHAR(23), [time], 127), lat, lon, salinity, ocean_tmp, par
  FROM
  [277].[SFL_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT 
  CONVERT(CHAR(33), [time], 127), lat, lon, salinity, ocean_tmp, par
  FROM
  [277].[SFL_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT 
  CONVERT(VARCHAR, [time], 127), lat, lon, salinity, ocean_tmp, par
  FROM
  [277].[SFL_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT 
  CONVERT(VARCHAR, [time], 126), lat, lon, salinity, ocean_tmp, par
  FROM
  [277].[SFL_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT 
  [time], lat, lon, salinity, ocean_tmp, par
  FROM
  [277].[SFL_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT 
  CONVERT(VARCHAR, [time], 126) as [time], lat, lon, salinity, ocean_tmp, par
  FROM
  [277].[SFL_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT 
  CONVERT(VARCHAR, a.[time], 126) as [time],
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [277].[SFL_VIEW] as a,
  [277].[SeaFlow: population-wise concentrations] as b,
  [277].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] ASC


________________________________________


select * from [SeaFlow SFL Data] where [time] > '2015-07-27T23:23:00' ORDER BY [time]


________________________________________


WITH pop
  AS (SELECT [time], [pop], log([fsc_small], 10) as [fsc_small]
      FROM [277].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([fsc_small])
  FOR [pop] in ([prochloro], [synecho],[picoeuk], [beads])
) as pivot_table


________________________________________


WITH pop
  AS (SELECT [time], [pop], [abundance]
      FROM [277].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([prochloro], [synecho], [picoeuk], [beads])
) as pivot_table


________________________________________


SELECT TOP 5 * FROM [1059].[SeaFlow Sfl Data] ORDER BY [time] ASC


________________________________________


SELECT TOP(5) * FROM [1059].[SeaFlow Sfl Data] ORDER BY [time] ASC


________________________________________


SELECT TOP(1) * FROM [1059].[SeaFlow Pop Data] WHERE [time] > '2015-07-25T00:19:45.000Z' ORDER BY [time] ASC


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as [time]
     , CAST(CASE WHEN opp_evt_ratio LIKE '%[^0-9.-]%' THEN NULL ELSE opp_evt_ratio END as FLOAT) as opp_evt_ratio
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE flow_rate END as FLOAT) as flow_rate
     , CAST(CASE WHEN file_duration LIKE '%[^0-9.-]%' THEN NULL ELSE file_duration END as FLOAT) as file_duration
     , pop
     , CAST(CASE WHEN n_count LIKE '%[^0-9.-]%' THEN NULL ELSE n_count END as INT) as n_count
     , CAST(CASE WHEN abundance LIKE '%[^0-9.-]%' THEN NULL ELSE abundance END as FLOAT) as abundance
     , CAST(CASE WHEN fsc_small LIKE '%[^0-9.-]%' THEN NULL ELSE fsc_small END as FLOAT) as fsc_small
     , CAST(CASE WHEN chl_small LIKE '%[^0-9.-]%' THEN NULL ELSE chl_small END as FLOAT) as chl_small
     , CAST(CASE WHEN pe LIKE '%[^0-9.-]%' THEN NULL ELSE pe END as FLOAT) as pe
FROM [277].[stat.csv]
ORDER BY [time] ASC


________________________________________


SELECT cruise
     , [file]
     , CONVERT(VARCHAR, CAST([time] as datetime2), 126) as [time]
     , CAST(CASE WHEN opp_evt_ratio LIKE '%[^0-9.-]%' THEN NULL ELSE opp_evt_ratio END as FLOAT) as opp_evt_ratio
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE flow_rate END as FLOAT) as flow_rate
     , CAST(CASE WHEN file_duration LIKE '%[^0-9.-]%' THEN NULL ELSE file_duration END as FLOAT) as file_duration
     , pop
     , CAST(CASE WHEN n_count LIKE '%[^0-9.-]%' THEN NULL ELSE n_count END as INT) as n_count
     , CAST(CASE WHEN abundance LIKE '%[^0-9.-]%' THEN NULL ELSE abundance END as FLOAT) as abundance
     , CAST(CASE WHEN fsc_small LIKE '%[^0-9.-]%' THEN NULL ELSE fsc_small END as FLOAT) as fsc_small
     , CAST(CASE WHEN chl_small LIKE '%[^0-9.-]%' THEN NULL ELSE chl_small END as FLOAT) as chl_small
     , CAST(CASE WHEN pe LIKE '%[^0-9.-]%' THEN NULL ELSE pe END as FLOAT) as pe
FROM [277].[stat.csv]
ORDER BY [time] ASC


________________________________________


SELECT cruise
     , [file]
     , CONVERT(VARCHAR, CAST([time] as datetime2), 126) as [time]
     , CAST(CASE WHEN opp_evt_ratio LIKE '%[^0-9.-]%' THEN NULL ELSE opp_evt_ratio END as FLOAT) as opp_evt_ratio
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE flow_rate END as FLOAT) as flow_rate
     , CAST(CASE WHEN file_duration LIKE '%[^0-9.-]%' THEN NULL ELSE file_duration END as FLOAT) as file_duration
     , pop
     , CAST(CASE WHEN n_count LIKE '%[^0-9.-]%' THEN NULL ELSE n_count END as INT) as n_count
     , CAST(CASE WHEN abundance LIKE '%[^0-9.-]%' THEN NULL ELSE abundance END as FLOAT) as abundance
     , CAST(CASE WHEN fsc_small LIKE '%[^0-9.-]%' THEN NULL ELSE fsc_small END as FLOAT) as fsc_small
     , CAST(CASE WHEN chl_small LIKE '%[^0-9.-]%' THEN NULL ELSE chl_small END as FLOAT) as chl_small
     , CAST(CASE WHEN pe LIKE '%[^0-9.-]%' THEN NULL ELSE pe END as FLOAT) as pe
FROM [277].[stat.csv]
ORDER BY [time] ASC


________________________________________


SELECT cruise
     , [file]
     , CAST([time] as datetime2) as [time]
     , CAST(CASE WHEN opp_evt_ratio LIKE '%[^0-9.-]%' THEN NULL ELSE opp_evt_ratio END as FLOAT) as opp_evt_ratio
     , CAST(CASE WHEN flow_rate LIKE '%[^0-9.-]%' THEN NULL ELSE flow_rate END as FLOAT) as flow_rate
     , CAST(CASE WHEN file_duration LIKE '%[^0-9.-]%' THEN NULL ELSE file_duration END as FLOAT) as file_duration
     , pop
     , CAST(CASE WHEN n_count LIKE '%[^0-9.-]%' THEN NULL ELSE n_count END as INT) as n_count
     , CAST(CASE WHEN abundance LIKE '%[^0-9.-]%' THEN NULL ELSE abundance END as FLOAT) as abundance
     , CAST(CASE WHEN fsc_small LIKE '%[^0-9.-]%' THEN NULL ELSE fsc_small END as FLOAT) as fsc_small
     , CAST(CASE WHEN chl_small LIKE '%[^0-9.-]%' THEN NULL ELSE chl_small END as FLOAT) as chl_small
     , CAST(CASE WHEN pe LIKE '%[^0-9.-]%' THEN NULL ELSE pe END as FLOAT) as pe
FROM [277].[stat.csv]
ORDER BY [time] ASC


________________________________________


SELECT CONVERT(VARCHAR, [time], 126) as [time], fsc_small, abundance, pop
  FROM [277].[STATS_VIEW]
  ORDER BY [time] ASC


________________________________________


select * from [SeaFlow SFL Data]
  


________________________________________


select * from [SeaFlow SFL Data] WHERE [time] > '2015-07-25T06:10:00' 
  


________________________________________


select * from [SeaFlow SFL Data]  


________________________________________


SELECT * FROM [1059].[CSTAR3MIN_VIEW] WHERE [time] >= '2015-07-25T01:40:43.000Z' AND [time] < '2015-07-25T02:34:43.000Z' ORDER BY [time] ASC


________________________________________


SELECT CONVERT(VARCHAR, [time], 126) as [time], attenuation FROM [277].[CSTAR3MIN_VIEW] ORDER BY [time] ASC


________________________________________


SELECT CONVERT(VARCHAR, [time], 126) as [time], attenuation FROM [277].[CSTAR3MIN_VIEW] ORDER BY [time] ASC


________________________________________


SELECT * FROM [51].[table_manualsRNA20130319.txt] where 'cis/trans' = 'cis'


________________________________________


SELECT * FROM [521].[table_JKTable.txt]


________________________________________


SELECT * FROM [521].[FIRST LINE.csv]


________________________________________


SELECT * FROM [786].[S1_ally.txt]
  where Date like('2011-05-10')



________________________________________


SELECT Poet FROM [521].[table_FIRST LINE.csv]


________________________________________


SELECT FirstLine FROM [521].[table_FIRST_LINE.csv]


________________________________________


SELECT FirstLine 
  FROM [521].[table_FIRST_LINE.csv]
  WHERE FirstLine Like 'Before'



________________________________________


SELECT FirstLine 
  FROM [521].[table_FIRST_LINE.csv]
  WHERE FirstLine='Before'



________________________________________


SELECT DISTINCT Poet
  FROM [521].[table_FIRST_LINE.csv]




________________________________________


SELECT FirstLine
  FROM [521].[table_FIRST_LINE.csv]
  WHERE FirstLine='Before the ice is in the pools'




________________________________________


SELECT FirstLine
  FROM [521].[table_FIRST_LINE.csv]
  WHERE FirstLine='Before'




________________________________________


SELECT FirstLine
  FROM [521].[table_FIRST_LINE.csv]
  WHERE FirstLine LIKE 'Before I'




________________________________________


SELECT Time FROM [786].[S1_ally.txt]
  where Time='14:25:00'



________________________________________


SELECT S1 FROM [786].[S1_ally.txt]
  where S1='7'



________________________________________


SELECT FirstLine 
  FROM [521].[FIRST LINE 1.csv]
  WHERE FirstLine LIKE 'Be%'



________________________________________


SELECT FirstLine 
  FROM [521].[FIRST LINE 1.csv]
  WHERE FirstLine LIKE 'B%'



________________________________________


SELECT FirstLine 
  FROM [521].[FIRST LINE 1.csv]
  WHERE FirstLine LIKE 'Be%'



________________________________________


SELECT FirstLine 
  FROM [521].[FIRST LINE 1.csv]
  WHERE FirstLine LIKE 'Death'



________________________________________


SELECT FirstLine 
  FROM [521].[FIRST LINE 1.csv]
  WHERE FirstLine LIKE 'Death%'



________________________________________


SELECT FirstLine 
  FROM [521].[FIRST LINE 1.csv]
  WHERE FirstLine LIKE 'B%'



________________________________________


SELECT FirstLine 
  FROM [521].[table_FIRST LINE 1.csv]
  WHERE FirstLine LIKE '%death%'



________________________________________


SELECT FirstLine 
  FROM [521].[FIRST LINE 1.csv]
  WHERE FirstLine LIKE 'A%'



________________________________________


SELECT FirstLine 
  FROM [521].[FIRST LINE 1.csv]
  WHERE FirstLine LIKE '%A%'



________________________________________


SELECT Poet
  FROM [521].[table_FirstLinePoetTitle.csv]
  WHERE Poet LIKE 'B%'
  



________________________________________


SELECT * 
  FROM [521].[table_FirstLinePoetTitle.csv]
  WHERE Poet LIKE 'B%'
  



________________________________________


SELECT * 
  FROM [521].[table_FirstLinePoetTitle.csv]
  WHERE FirstLine LIKE 'B%'
  



________________________________________


SELECT Poet
  FROM [521].[table_FirstLinePoetTitle.csv]
  WHERE Poet LIKE 'B%'


________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle.csv]
  WHERE FirstLine LIKE 'B%'


________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'A%'


________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'I%'


________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE '%I%'


________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'I%'


________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'I%'
  AND Poet='Emily Bronte'



________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'I%'
  AND Poet='Lord%'



________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'I%'
  AND Poet='Charlotte Bronte'



________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'I%'
  AND Poet='Emily Dickinson'



________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'A%'
  AND Poet='Emily Dickinson'



________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'B%'
  AND Poet='Emily Dickinson'



________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE 'B%'
  AND Poet='William Butler Yeats'



________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE Poet='William Butler Yeats'



________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE '%cell%'



________________________________________


SELECT FirstLine
  FROM [521].[table_FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE '%and%'



________________________________________


SELECT FirstLine
  FROM [521].[FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE '%hast%'



________________________________________


SELECT *
  FROM [521].[FirstLinePoetTitle2.csv]
  WHERE FirstLine LIKE '%hast%'




________________________________________


SELECT *
  FROM [521].[FIRST LINE 1.csv]
  WHERE FirstLine LIKE 'B%'



________________________________________


SELECT * 
  FROM [521].[FirstLinePoetTitle2.csv]
  WHERE Title LIKE '%the%'



________________________________________


SELECT * 
  FROM [521].[FirstLinePoetTitle2.csv]
  WHERE Title LIKE 'the%'



________________________________________


SELECT Poet 
  FROM [521].[FirstLinePoetTitle2.csv]
  ORDER BY Poet ASC



________________________________________


SELECT *
  FROM [521].[FirstLinePoetTitle2.csv]
  ORDER BY Poet ASC



________________________________________


SELECT *
  FROM [521].[FirstLinePoetTitle2.csv]
  ORDER BY Title ASC



________________________________________


SELECT *
  FROM [521].[FirstLinePoetTitle2.csv]
  ORDER BY Title ASC
  



________________________________________


SELECT*
  FROM [521].[FirstLinePoetTitle2.csv]
  WHERE Poet='William Butler Yeats'
  ORDER BY Title ASC
  



________________________________________


SELECT *
  FROM [521].[FirstLinePoetTitle2.csv]
  WHERE Poet='William Butler Yeats'
  AND FirstLine LIKE '%I%'
  ORDER BY Title ASC
  
  



________________________________________


SELECT * FROM [521].[C25K.csv]


________________________________________


SELECT * 
  FROM [521].[C25K.csv]
  WHERE [Run Pace] BETWEEN '10' AND '13'




________________________________________


SELECT *
  FROM [521].[C25K.csv]
  WHERE [Run Pace] BETWEEN '10' AND '13'
  AND [Distance] > 2.0 



________________________________________


SELECT * FROM [521].[C25K.csv]
  WHERE [Calories Burned] > 250
  



________________________________________


SELECT * FROM [521].[C25K.csv]
  WHERE [Calories Burned] > 250
  



________________________________________



  SELECT *
  FROM [521].[C25K.csv]
  WHERE [Calories Burned]>250
  ORDER BY [Date] 



________________________________________



  SELECT *
  FROM [521].[C25K.csv]
  WHERE [Calories Burned]>250
  ORDER BY [Distance] 



________________________________________


SELECT * FROM [521].[C25K.csv]
  WHERE [Distance]<2.0
  



________________________________________


SELECT * FROM [521].[table_C25K.csv]


________________________________________


  SELECT *
  FROM [521].[C25K.csv]
  WHERE [Calories Burned]>200
  ORDER BY [Distance] 



________________________________________


 SELECT *
  FROM [521].[C25K.csv]
  WHERE [Calories Burned]>200
  ORDER BY [Walk Pace] 


________________________________________


 SELECT *
  FROM [521].[C25K.csv]
  WHERE [Calories Burned]>200
  ORDER BY [Run Pace] 


________________________________________


 SELECT *
  FROM [521].[C25K.csv]
  WHERE [Calories Burned]>200
  ORDER BY [Week] 


________________________________________


 SELECT *
  FROM [521].[C25K.csv]
  WHERE [Run Pace]>'14:00'
  ORDER BY [Week] 


________________________________________


create table Author (id int primary key, name text, homepage text);
create table Publication (pubid int primary key, pubkey text, title text, year int);
create table Article (pubid int primary key, journal text, month text, volume text, number text);
create table Book (pubid int primary key, publisher text, isbn text);
create table Incollection (pubid int primary key, booktitle text, publisher text, isbn text);
create table Inproceedings (pubid int primary key, booktitle text, editor text);
create table Authored (id int, pubid int);



________________________________________


select count(*) from author;


________________________________________


select * from author;


________________________________________


create table hp(name text, homepage text);


________________________________________


SELECT author.v as author
     , title.v as title
     , journal.v as journal
     , url.v as url 
  FROM [1143].[field] as author
     , [1143].[field] as title
     , [1143].[field] as journal
     , [1143].[field] as url
 WHERE author.k = title.k
   AND author.k = journal.k
   AND author.k = url.k 



________________________________________


SELECT author.v as author
     , title.v as title
     , journal.v as journal
     , url.v as url 
  FROM [1143].[field] as author
     , [1143].[field] as title
     , [1143].[field] as journal
     , [1143].[field] as url
 WHERE author.k = title.k
   AND author.k = journal.k
   AND author.k = url.k 
   AND author.p = 'author'
   AND title.p = 'title'
   AND url.p = 'url'
   AND journal.p = 'journal'



________________________________________


SELECT author.k as id
     , author.v as author
     , title.v as title
     , journal.v as journal
     , url.v as url 
  FROM [1143].[field] as author
     , [1143].[field] as title
     , [1143].[field] as journal
     , [1143].[field] as url
 WHERE author.k = title.k
   AND author.k = journal.k
   AND author.k = url.k 
   AND author.p = 'author'
   AND title.p = 'title'
   AND url.p = 'url'
   AND journal.p = 'journal'



________________________________________


select * from pub


________________________________________


SELECT distinct title.k as id
     , title.v as title
     , journal.v as journal
     , url.v as url 
  FROM [1143].[field] as title
     , [1143].[field] as journal
     , [1143].[field] as url
 WHERE title.k = journal.k
   AND title.k = url.k 
   AND title.p = 'title'
   AND url.p = 'url'
   AND journal.p = 'journal'


________________________________________


select y.v as name, min(z.v) as homepage
    from Pub x, Field y, Field z 
    where x.k=y.k and y.k=z.k and x.p='www' and y.p='author' and z.p='url' and x.k like 'homepage%'
    group by y.v;


________________________________________


SELECT distinct author.k as pubid
     , author.v as author
  FROM [1143].[field] as author
 WHERE author.p = 'author'



________________________________________


SELECT distinct journal.v as journal
  FROM [1143].[field] as journal
 WHERE journal.p = 'journal'



________________________________________


select y.v as name, min(z.v) as homepage
    from Pub x, Field y, Field z 
    where x.k=y.k and y.k=z.k and x.p='www' and y.p='author' and z.p='url' and x.k like 'homepage%'
    group by y.v;


________________________________________


SELECT journal, count(*) 
  FROM [1143].[unique publications]
  GROUP BY journal
  order by count(*) desc



________________________________________


select y.v as name, min(z.v) as homepage
    from Pub x, Field y, Field z 
    where x.k=y.k and y.k=z.k and x.p='www' and y.p='author' and z.p='url' and x.k like 'homepage%'
    group by y.v;


________________________________________


select y.v as name, min(z.v) as homepage
    from Pub x, Field y, Field z 
    where x.k=y.k and y.k=z.k and x.p='www' and y.p='author' and z.p='url' and x.k like 'homepage%'
    group by y.v


________________________________________


select y.v as author, min(z.v) as homepage
    from pub x, field y, field z 
    where x.k=y.k and y.k=z.k 
  and x.p='www' 
  and y.p='author' and z.p='url' 
  and x.k like 'homepage%'
   group by y.v


________________________________________


select x.name, y.homepage
  from (select distinct f.v as name 
        from Field f 
        where f.p='author') as x
   left outer join homepage y on x.name=y.author


________________________________________


select y.v as fullname, min(z.v) as homepage
from Pub x, Field y, Field z 
where x.k=y.k and y.k=z.k and x.p='www' and y.p='author' and z.p='url' and x.k like 'homepage%'
group by y.v



________________________________________


select y.v as fullname, min(z.v) as homepage
from Pub x, Field y, Field z 
where x.k=y.k and y.k=z.k and x.p='www' and y.p='author' and z.p='url' and x.k like 'homepage%'
group by y.v



________________________________________


select y.v as fullname, min(z.v) as homepage
from Pub x, Field y, Field z 
where x.k=y.k and y.k=z.k and x.p='www' and y.p='author' and z.p='url' and x.k like 'homepage%'
group by y.v


________________________________________


select x.fullname, y.homepage
  from (select distinct f.v as fullname from Field f where f.p='author') as x
   left outer join hp_view y on x.fullname=y.fullname



________________________________________


select * from sys.tables


________________________________________


select y.homepage
  from hp_view y 


________________________________________


select *
from tbl_organizer
where conf_id not in (select conf_id from tbl_conference);



________________________________________


select *
from tbl_organizer
where organizer_type not in (select organizer_type from tbl_organizer_type);



________________________________________


select *
from tbl_organizer
where organizer_type not in (select organizer_type from tbl_organizer_type);



________________________________________


select *
from tbl_organizer
where fullname not in (select fullname from tbl_person);



________________________________________


select * from tbl_person where fullname like '%Halevy%'


________________________________________


select *
from tbl_revenue
where revenue_type not in (select revenue_type from tbl_revenue_type);



________________________________________


-- every expense_type is a correct expense_type
select *
from tbl_expense
where expense_type not in (select expense_type from tbl_expense_type);




________________________________________


select *
from tbl_expense
where expense_type not in (select expense_type from tbl_expense_type);



________________________________________


select *
from tbl_revenue
where treasurer_fullname not in (select fullname from tbl_person);



________________________________________


select *
  from tbl_person
  where fullname like '%Carey%'



________________________________________


-- every treasurer is a person in DBLP
select *
from tbl_revenue
where treasurer_fullname not in (select fullname from tbl_person);



________________________________________


select *
from tbl_expense
where treasurer_fullname not in (select fullname from tbl_person);



________________________________________


select conf_id, sum(revenue_amount) from tbl_revenue group by conf_id;


________________________________________


select x.conf_id, revenue_total, expense_total
  from (select conf_id, sum(revenue_amount) as revenue_total from tbl_revenue group by conf_id) x, 
  (select conf_id, sum(expense_amount) as expense_total from tbl_expense group by conf_id) y
  where x.conf_id = y.conf_id


________________________________________


select x.conf_id, revenue_total, expense_total, revenue_total - expense_total as net_income
  from (select conf_id, sum(revenue_amount) as revenue_total from tbl_revenue group by conf_id) x, 
  (select conf_id, sum(expense_amount) as expense_total from tbl_expense group by conf_id) y
  where x.conf_id = y.conf_id


________________________________________


select x.conf_id, z.city, z.country, z.year, revenue_total, expense_total, revenue_total - expense_total as net_income
  from (select conf_id, sum(revenue_amount) as revenue_total from tbl_revenue group by conf_id) x, 
  (select conf_id, sum(expense_amount) as expense_total from tbl_expense group by conf_id) y,
  tbl_conference z
  where x.conf_id = y.conf_id and y.conf_id =z.conf_id


________________________________________


select z.year, z.city, z.country,  revenue_total, expense_total, revenue_total - expense_total as net_income
  from (select conf_id, sum(revenue_amount) as revenue_total from tbl_revenue group by conf_id) x, 
  (select conf_id, sum(expense_amount) as expense_total from tbl_expense group by conf_id) y,
  tbl_conference z
  where x.conf_id = y.conf_id and y.conf_id =z.conf_id
  order by z.year



________________________________________


select z.year, z.city, z.country,  revenue_total, expense_total, revenue_total - expense_total as net_income
from (select conf_id, sum(revenue_amount) as revenue_total from tbl_revenue group by conf_id) x, 
     (select conf_id, sum(expense_amount) as expense_total from tbl_expense group by conf_id) y,
     tbl_conference z
where x.conf_id = y.conf_id and y.conf_id =z.conf_id
order by z.year;



________________________________________


select x.fullname, y.homepage
  from (select distinct f.v as fullname from field f where f.p='author') as x
   left outer join hp_view y on x.fullname=y.fullname



________________________________________


SELECT * FROM [1143].[author_view]


________________________________________


SELECT top 20 * FROM [1143].[author_view]


________________________________________


SELECT top 20 *  FROM [1143].[author_view]


________________________________________


select x.fullname, y.homepage
  from (select f.v as fullname from field f where f.p='author') as x
   left outer join hp_view y on x.fullname=y.fullname



________________________________________


SELECT * FROM [1143].[tbl_expense_type]


________________________________________


select *
  from  field  x
   


________________________________________


select x.fullname, y.homepage
  from (select f.v as fullname from field f where f.p='author') as x
   left outer join hp_view y on x.fullname=y.fullname



________________________________________


select x.fullname, y.homepage
  from (select distinct f.v as fullname from field f where f.p='author') as x
   left outer join hp_view y on x.fullname=y.fullname



________________________________________


SELECT * FROM [1143].[1354authorsnapshot]


________________________________________


select x.fullname, y.homepage
  from (select distinct f.v as fullname from field f where f.p='author') as x
   left outer join hp_view y on x.fullname=y.fullname


________________________________________


select *
from tbl_organizer
where fullname not in (select fullname from tbl_person);



________________________________________


select *
from tbl_organizer
where conf_id not in (select conf_id from tbl_conference);


________________________________________


select *
from tbl_organizer
where organizer_type not in (select organizer_type from tbl_organizer_type);



________________________________________


select *
from tbl_revenue
where revenue_type not in (select revenue_type from tbl_revenue_type);



________________________________________


select *
from tbl_expense
where expense_type not in (select expense_type from tbl_expense_type);



________________________________________


select *
from tbl_revenue
where treasurer_fullname not in (select fullname from tbl_person);


________________________________________


select *
from tbl_expense
where treasurer_fullname not in (select fullname from tbl_person);



________________________________________


select *
from tbl_conference x, tbl_organizer y, tbl_organizer_type z
where x.conf_id = y.conf_id
  and y.organizer_type = z.organizer_type;


________________________________________


select *
from tbl_conference x, tbl_organizer y, tbl_organizer_type z
where x.conf_id = y.conf_id
  and y.organizer_type = z.organizer_type
  and z.description like '%Chair%';


________________________________________


select *
from tbl_conference x, tbl_organizer y, tbl_organizer_type z
where x.conf_id = y.conf_id
  and y.organizer_type = z.organizer_type
  and z.description like '%Chair%'
order by x.year, z.organizer_type;


________________________________________


select * from tbl_organizer;


________________________________________


select count(*) from tbl_organizer;


________________________________________


select * from tbl_organizer order by fullname desc;


________________________________________


(select p.k as id, f1.v as title, f2.v as year, f3.v as venue, p.p as type
from pub p, field f1, field f2, field f3
where p.k = f1.k and p.k = f2.k  and p.k = f3.k 
and f1.p = 'title' and f2.p = 'year' and f3.p = 'booktitle' and p.p='inproceedings')
UNION
(select p.k as id, f1.v as title, f2.v as year, f3.v as venue, p.p as type
from pub p, field f1, field f2, field f3
where p.k = f1.k and p.k = f2.k  and p.k = f3.k 
and f1.p = 'title' and f2.p = 'year' and f3.p = 'journal' and p.p='article')
UNION
(select p.k as id, f1.v as title, f2.v as year, null as venue, p.p as type
from pub p, field f1, field f2
where p.k = f1.k and p.k = f2.k  
and f1.p = 'title' and f2.p = 'year' and p.p='book')
UNION
(select p.k as id, f1.v as title, f2.v as year, null as venue, p.p as type
from pub p, field f1, field f2
where p.k = f1.k and p.k = f2.k  
and f1.p = 'title' and f2.p = 'year' and p.p like '%thesis');




________________________________________


(select p.k as id, f1.v as title, f2.v as year, f3.v as venue, p.p as type
from pub p, field f1, field f2, field f3
where p.k = f1.k and p.k = f2.k  and p.k = f3.k 
and f1.p = 'title' and f2.p = 'year' and f3.p = 'booktitle' and p.p='inproceedings')
UNION
(select p.k as id, f1.v as title, f2.v as year, f3.v as venue, p.p as type
from pub p, field f1, field f2, field f3
where p.k = f1.k and p.k = f2.k  and p.k = f3.k 
and f1.p = 'title' and f2.p = 'year' and f3.p = 'journal' and p.p='article')
UNION
(select p.k as id, f1.v as title, f2.v as year, null as venue, p.p as type
from pub p, field f1, field f2
where p.k = f1.k and p.k = f2.k  
and f1.p = 'title' and f2.p = 'year' and p.p='book')
UNION
(select p.k as id, f1.v as title, f2.v as year, null as venue, p.p as type
from pub p, field f1, field f2
where p.k = f1.k and p.k = f2.k  
and f1.p = 'title' and f2.p = 'year' and p.p like '%thesis');



________________________________________


select count(*) from publication;


________________________________________


(select p.k as id, f1.v as title, f2.v as year, f3.v as venue, p.p as type
from pub p, field f1, field f2, field f3
where p.k = f1.k and p.k = f2.k  and p.k = f3.k 
and f1.p = 'title' and f2.p = 'year' and f3.p = 'booktitle' and p.p='inproceedings')
UNION
(select p.k as id, f1.v as title, f2.v as year, f3.v as venue, p.p as type
from pub p, field f1, field f2, field f3
where p.k = f1.k and p.k = f2.k  and p.k = f3.k 
and f1.p = 'title' and f2.p = 'year' and f3.p = 'journal' and p.p='article')
UNION
(select p.k as id, f1.v as title, f2.v as year, null as venue, p.p as type
from pub p, field f1, field f2
where p.k = f1.k and p.k = f2.k  
and f1.p = 'title' and f2.p = 'year' and p.p='book')
UNION
(select p.k as id, f1.v as title, f2.v as year, null as venue, p.p as type
from pub p, field f1, field f2
where p.k = f1.k and p.k = f2.k  
and f1.p = 'title' and f2.p = 'year' and p.p like '%thesis');



________________________________________


select a.fullname, p.id as pubID
from field f, author a, publication p
where f.p='author' and f.k=p.id and f.v=a.fullname


________________________________________


select * from author


________________________________________


select * from field f where f.p='author' 


________________________________________


select * from publication;


________________________________________


select distinct a.fullname, p.id as pubID
from field f, author a, publication p
where f.p='author' and f.k=p.id and f.v=a.fullname


________________________________________


select x.id as id, min(u.v) as publisher, min(v.v) as isbn
from Publication x join Pub y
  on x.id = y.k and y.p = 'book'
        left outer join Field u
  on x.id = u.k and u.p='publisher'
        left outer join Field v
  on x.id = v.k and v.p='isbn'
group by x.id;


________________________________________


select x.id, min(u.v) as booktitle, min(v.v) as publisher, min(w.v) as isbn
from Publication x join Pub y
  on x.id = y.k and y.p = 'incollection'
        left outer join Field u
  on x.id = u.k and u.p='booktitle'
        left outer join Field v
  on x.id = v.k and v.p='publisher'
        left outer join Field w
  on x.id = w.k and w.p='isbn'
group by x.id;



________________________________________


select x.id, min(u.v) as booktitle, min(v.v) as editor
from Publication x join Pub y
  on x.id = y.k and y.p = 'inproceedings'
        left outer join Field u
  on x.id = u.k and u.p='booktitle'
        left outer join Field v
  on x.id = v.k and v.p='editor'
group by x.id;



________________________________________


select x.id as id, u.v as journal, v.v as month, w.v as volume, t.v as number
from Publication x join Pub y
  on x.id = y.k and y.p = 'article'
        left outer join Field u
  on x.id = u.k and u.p='journal'
        left outer join Field v
  on x.id = v.k and v.p='month'
        left outer join Field w
  on x.id = w.k and w.p='volume'
        left outer join Field t
  on x.id = t.k and t.p='number';




________________________________________


select a.fullname, count(*) as totalPUBS
from author a, authored b, inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle = 'SIGMOD Conference'
group by a.fullname
order by count(*) desc;



________________________________________


-- top PODS authors
select a.fullname, count(*) as totalPUBS
from author a, authored b, inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle = 'PODS'
group by a.fullname
order by count(*) desc;




________________________________________


select distinct *
from inproceedings
where booktitle like '%VLDB%'


________________________________________


select distinct booktitle
from inproceedings
where booktitle like '%VLDB%'


________________________________________


-- top VLDB authors
select a.fullname, count(*) as totalPUBS
from author a, authored b, inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle = 'VLDB'
group by a.fullname
order by count(*) desc;


________________________________________


select a.fullname, count(*) as totalPUBS
from author a, authored b, inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle = 'PODS'
 and not exists
   (select * from authored b2, inproceedings p2
   where a.fullname=b2.fullname and b2.pubID = p2.id 
     and p2.booktitle in ('SIGMOD Conference', 'VLDB'))
group by a.fullname
order by count(*) desc;


________________________________________


select a.fullname, count(*) as totalPUBS
from author a, authored b, inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle in ('SIGMOD Conference', 'VLDB')
 and not exists
   (select * from authored b2, inproceedings p2
   where a.fullname=b2.fullname and b2.pubID = p2.id 
     and p2.booktitle = 'PODS')
group by a.fullname
order by count(*) desc;


________________________________________


select count(*) from author;


________________________________________


select count(*) from tbl_organizer;


________________________________________


select count(*) from tbl_person;


________________________________________


select *
from tbl_organizer
where fullname not in (select fullname from tbl_person);


________________________________________


SELECT x % 10 AS bucket, SUM(sumdegree) AS edges
FROM [354].[twitter_rv.6200000.sumdegree]
GROUP BY (x % 10)
ORDER BY edges DESC  


________________________________________


SELECT x % 10 AS bucket, SUM(sumdegree) AS edges
FROM [354].[twitter_rv.6200000.sumdegree]
GROUP BY (x % 10)
ORDER BY bucket  


________________________________________


SELECT x % 11 AS bucket, SUM(sumdegree) AS edges
FROM [354].[twitter_rv.6200000.sumdegree]
GROUP BY (x % 11)
ORDER BY bucket  


________________________________________


SELECT x % 13 AS bucket, SUM(sumdegree) AS edges
FROM [354].[twitter_rv.6200000.sumdegree]
GROUP BY (x % 13)
ORDER BY bucket  


________________________________________


SELECT x % 103 AS bucket, SUM(sumdegree) AS edges
FROM [354].[twitter_rv.6200000.sumdegree]
GROUP BY (x % 103)
ORDER BY edges desc  


________________________________________


SELECT top 20 x  AS bucket, SUM(sumdegree) AS edges
FROM [354].[twitter_rv.6200000.sumdegree]
GROUP BY x
order by edges desc




________________________________________


-- warmup: just getting the coference names right
-- top SIGMOD authors
select a.fullname, count(*) as totalPUBS
from author a, authored b, inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle = 'SIGMOD Conference'
group by a.fullname
order by count(*) desc;




________________________________________


select count(*) from author;


________________________________________


select top 10 * from author;


________________________________________


select top 20 * from author;



________________________________________


select count(*) from publication;


________________________________________


select * from publication where year = 1970


________________________________________


select year, count(*) from publication group by year;


________________________________________


select year, count(*) from publication group by year order by year;


________________________________________


select * from tbl_expense;


________________________________________


select conf_id, sum(expense_amount) from tbl_expense group by conf_id;


________________________________________


SELECT * FROM [354].[twitter_rv.6200000]


________________________________________


select count(*)
from twitter x, twitter y
where x.follower = y.followee


________________________________________


select count(*)
from twitter x


________________________________________


select followee, count(*)
  from twitter x
  group by followee
  order by count(*) desc



________________________________________


select avg(x.c)
  from (select  count(*) as c
  from twitter x
    group by followee) as x
  



________________________________________


select count(distinct followee)
  from twitter



________________________________________


select count(distinct follower)
  from twitter



________________________________________


SELECT count(*) FROM [1143].[twitter]


________________________________________


SELECT count(distinct followee) FROM [1143].[twitter]


________________________________________


SELECT count(distinct follower) FROM [1143].[twitter]


________________________________________


SELECT followee, count(*)
  FROM [1143].[twitter]
  group by followee



________________________________________


select avg(x.c)
  from (SELECT followee, count(*) as c
  FROM [1143].[twitter]
    group by followee) as x



________________________________________


select avg(x.c)
  from (SELECT follower, count(*) as c
  FROM [1143].[twitter]
    group by follower) as x



________________________________________


select max(x.c)
  from (SELECT follower, count(*) as c
  FROM [1143].[twitter]
    group by follower) as x



________________________________________


SELECT follower, count(*) as c
FROM [1143].[twitter]
group by follower
  order by c desc



________________________________________


SELECT followee, count(*) as c
FROM [1143].[twitter]
group by followee
order by c desc



________________________________________


select distinct x.followee, y.follower
  from twitter x, twitter y
  where x.follower=y.followee


________________________________________


select distinct x.followee, y.follower
  from twittermat x, twittermat y
  where x.follower=y.followee


________________________________________


SELECT distinct x.followee, y.follower
  FROM twittermat x, twittermat y
  where x.follower = y.followee


________________________________________


SELECT * 
FROM [1143].[inproceedings]
WHERE booktitle='NSDI';



________________________________________


SELECT TOP 30 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id and booktitle='NSDI'
GROUP BY a.fullname
ORDER BY c DESC;



________________________________________


SELECT TOP 30 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id and booktitle='SOSP'
GROUP BY a.fullname
ORDER BY c DESC;



________________________________________


SELECT TOP 30 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='SOSP'
GROUP BY a.fullname
ORDER BY c DESC;



________________________________________


--
SELECT TOP 30 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='SIGCOMM'
GROUP BY a.fullname
ORDER BY c DESC;




________________________________________


--
SELECT TOP 15 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='SIGCOMM'
GROUP BY a.fullname
ORDER BY c DESC;




________________________________________


--
SELECT TOP 15 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='SIGGRAPH'
GROUP BY a.fullname
ORDER BY c DESC;



________________________________________


-- top SIGCOMM authors
SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='SIGCOMM'
GROUP BY a.fullname
ORDER BY c DESC;



________________________________________


-- top SIGGRAPH authors
SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='SIGGRAPH'
GROUP BY a.fullname
ORDER BY c DESC;



________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='NSDI'
  and not exists
       (SELECT * 
        FROM [1143].[authored] b2,
             [1143].[inproceedings] p2
        WHERE a.fullname = b2.fullname and b2.pubID = p2.id
          and p2.booktitle='SIGCOMM')
GROUP BY a.fullname
ORDER BY c DESC;



________________________________________


-- NSDI authors who never published in SIGCOMM
SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='NSDI'
  and not exists
       (SELECT * 
        FROM [1143].[authored] b2,
             [1143].[inproceedings] p2
        WHERE a.fullname = b2.fullname and b2.pubID = p2.id
          and p2.booktitle='SIGCOMM')
GROUP BY a.fullname
ORDER BY c DESC;



________________________________________


-- papers by Fredo Durand
SELECT TOP 10 p.booktitle, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and a.fullname = 'Fredo Durand'
GROUP BY p.booktitle
ORDER BY c DESC;




________________________________________


-- papers by Fredo Durand
SELECT TOP 10 p.booktitle, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and a.fullname = 'Frédo Durand'
GROUP BY p.booktitle
ORDER BY c DESC;




________________________________________


-- papers by Fredo Durand
SELECT p.booktitle, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and a.fullname = 'Frédo Durand'
GROUP BY p.booktitle
ORDER BY c DESC;




________________________________________


-- papers by Fredo Durand
SELECT * from      [1143].[inproceedings] p




________________________________________



-- papers by Fredo Durand
SELECT x.year, x.title, p.booktitle
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p,
      [1143].[publication] x
WHERE a.fullname = b.fullname and b.pubID = p.id and p.id = x.id
  and a.fullname = 'Frédo Durand'
ORDER BY x.year desc



________________________________________



select count(*) from author



________________________________________



select count(*) from publication



________________________________________


-- papers by Fredo Durand
SELECT x.year, x.title
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[publication] x
WHERE a.fullname = b.fullname and b.pubID = x.id
  and a.fullname = 'Frédo Durand'
ORDER BY x.year desc



________________________________________


SELECT x.year, x.title, p.booktitle
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p,
      [1143].[publication] x
WHERE a.fullname = b.fullname and b.pubID = p.id and p.id = x.id
  and a.fullname = 'Frédo Durand'
ORDER BY x.year desc


________________________________________


SELECT x.year, x.title
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[publication] x
WHERE a.fullname = b.fullname and b.pubID = x.id
  and a.fullname = 'Frédo Durand'
ORDER BY x.year desc



________________________________________


SELECT x.year, x.title, p.booktitle
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p,
      [1143].[publication] x
WHERE a.fullname = b.fullname and b.pubID = p.id and p.id = x.id
  and a.fullname = 'Frédo Durand'
ORDER BY x.year desc



________________________________________


select top 10 * from article


________________________________________


-- journal papers by Fredo Durand
SELECT x.year, x.title, p.journal
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[article] p,
      [1143].[publication] x
WHERE a.fullname = b.fullname and b.pubID = p.id and p.id = x.id
  and a.fullname = 'Frédo Durand'
ORDER BY x.year desc
 



________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[article] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.journal='ACM Trans. Graph.'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 50 x.fullname, x.c as SiggraphCnt, y.c as AcmTogCnt, x.c+y.c as Total
FROM (SELECT a.fullname, count(*) as c
      FROM  [1143].[author] a,
            [1143].[authored] b,
            [1143].[inproceedings] p
      WHERE a.fullname = b.fullname and b.pubID = p.id
        and p.booktitle='SIGGRAPH'
      GROUP BY a.fullname) x,
      (SELECT TOP 10 a.fullname, count(*) as c
      FROM  [1143].[author] a,
            [1143].[authored] b,
            [1143].[article] p
      WHERE a.fullname = b.fullname and b.pubID = p.id
        and p.journal='ACM Trans. Graph.'
      GROUP BY a.fullname) y
WHERE x.fullname = y.fullname
ORDER BY Total DESC;


________________________________________


SELECT TOP 50 x.fullname, x.c as SiggraphCnt, y.c as AcmTogCnt, x.c+y.c as Total
FROM (SELECT a1.fullname, count(*) as c
      FROM  [1143].[author] a1,
            [1143].[authored] b1,
            [1143].[inproceedings] p1
      WHERE a1.fullname = b1.fullname and b1.pubID = p1.id
        and p1.booktitle='SIGGRAPH'
      GROUP BY a1.fullname) x,
      (SELECT TOP 10 a2.fullname, count(*) as c
      FROM  [1143].[author] a2,
            [1143].[authored] b2,
            [1143].[article] p2
      WHERE a2.fullname = b2.fullname and b2.pubID = p2.id
        and p2.journal='ACM Trans. Graph.'
      GROUP BY a2.fullname) y
WHERE x.fullname = y.fullname
ORDER BY Total DESC;



________________________________________


SELECT a1.fullname, count(*) as c
      FROM  [1143].[author] a1,
            [1143].[authored] b1,
            [1143].[inproceedings] p1
      WHERE a1.fullname = b1.fullname and b1.pubID = p1.id
        and p1.booktitle='SIGGRAPH'
      GROUP BY a1.fullname


________________________________________


select count(*)
  from (SELECT a1.fullname, count(*) as c
      FROM  [1143].[author] a1,
            [1143].[authored] b1,
            [1143].[inproceedings] p1
      WHERE a1.fullname = b1.fullname and b1.pubID = p1.id
        and p1.booktitle='SIGGRAPH'
    GROUP BY a1.fullname) zzz


________________________________________


SELECT TOP 50 x.fullname, x.c as SiggraphCnt, y.c as AcmTogCnt, x.c+y.c as Total
FROM (SELECT a1.fullname, count(*) as c
      FROM  [1143].[author] a1,
            [1143].[authored] b1,
            [1143].[inproceedings] p1
      WHERE a1.fullname = b1.fullname and b1.pubID = p1.id
        and p1.booktitle='SIGGRAPH'
      GROUP BY a1.fullname) x,
      (SELECT a2.fullname, count(*) as c
       FROM  [1143].[author] a2,
             [1143].[authored] b2,
             [1143].[article] p2
       WHERE a2.fullname = b2.fullname and b2.pubID = p2.id
         and p2.journal='ACM Trans. Graph.'
       GROUP BY a2.fullname) y
WHERE x.fullname = y.fullname
ORDER BY Total DESC;




________________________________________


select top 10 * from inproceedings


________________________________________


select top 10 * from publication


________________________________________


SELECT * FROM [1317].[coffee prices.csv]


________________________________________


SELECT * FROM [1317].[coffee prices.csv] order by year


________________________________________


SELECT year, sum(pounds) FROM [1317].[coffee prices.csv] group by year  order by year


________________________________________


SELECT year, sum(pounds) as sum FROM [1317].[coffee prices.csv] group by year  order by year


________________________________________


SELECT year, sum(pounds) as totalpounds FROM [1317].[coffee prices.csv] group by year  order by year


________________________________________


select p.booktitle, count(*)
from [1143].[authored] b, [1143].[inproceedings] p
where b.pubID = p.id and b.fullname='Michael D. Ernst'
group by p.booktitle
order by count(*) desc;


________________________________________


select p.journal, count(*)
from [1143].[authored] b, [1143].[article] p
where b.pubID = p.id and b.fullname='Michael D. Ernst'
group by p.journal
order by count(*) desc;


________________________________________


select count(*)  FROM [354].[twitter_rv.6200000]


________________________________________


select top 20 * FROM [354].[twitter_rv.6200000];


________________________________________


select followee, count(*) as cnt FROM [354].[twitter_rv.6200000] group by followee order by cnt desc;


________________________________________


select count(distinct followee) FROM [354].[twitter_rv.6200000];


________________________________________


select count(*) FROM [354].[twitter_rv.6200000];


________________________________________


select count(*) FROM [354].[twitter_rv.6200000] x, [354].[twitter_rv.6200000] y where x.followee = y.follower;


________________________________________


select distinct organizer_type from tbl_organizer_type;


________________________________________


select count(*) from tbl_person;


________________________________________


select * from tbl_conference;


________________________________________


select * from tbl_conference order by year;


________________________________________


select count(*) from [1143].tbl_person;


________________________________________


-- every organizer is a person in DBLP.
select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);



________________________________________


-- every organizer refers to a correct conference id
select *
from [1143].tbl_organizer
where conf_id not in (select conf_id from [1143].tbl_conference);



________________________________________


-- every organizer has a correct type
select *
from [1143].tbl_organizer
where organizer_type not in (select organizer_type from [1143].tbl_organizer_type);




________________________________________


-- every revenue_type is a correct revenue_type
select *
from [1143].tbl_vldb_bot_revenue
where revenue_type not in (select revenue_type from [1143].tbl_vldb_bot_revenue_type);




________________________________________


-- every expense_type is a correct expense_type
select *
from [1143].tbl_vldb_bot_expense
where expense_type not in (select expense_type from [1143].tbl_vldb_bot_expense_type);




________________________________________


-- every treasurer is a person in DBLP
select *
from [1143].tbl_vldb_bot_revenue
where treasurer_fullname not in (select fullname from [1143].tbl_person);



________________________________________


select *
from [1143].tbl_vldb_bot_expense
where treasurer_fullname not in (select fullname from [1143].tbl_person);



________________________________________


select *
from [1143].tbl_organizer_type;


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type='9'   -- 9 means PC Member; see tbl_organizer_type
group by x.year, x.city, x.country;


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id 
group by x.year, x.city, x.country;


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x
group by x.year, x.city, x.country;


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id
group by x.year, x.city, x.country
order by x.year;


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;



________________________________________


select distinct conf_id from [1143].tbl_organizer;




________________________________________


select distinct conf_id from [1143].tbl_organizer order by conf_id;




________________________________________


select distinct x.year, x.conf_id from tbl_conference x, [1143].tbl_organizer y where x.conf_id = y.conf_id order by x.year;




________________________________________


select distinct x.year, x.conf_id from tbl_conference x order by year


________________________________________


-- every organizer is a person in DBLP.
select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);



________________________________________


-- every organizer is a person in DBLP.
select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);



________________________________________


-- every organizer is a person in DBLP.
select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);



________________________________________


-- every organizer refers to a correct conference id
select *
from [1143].tbl_organizer
where conf_id not in (select conf_id from [1143].tbl_conference);



________________________________________


-- every organizer has a correct type
select *
from [1143].tbl_organizer
where organizer_type not in (select organizer_type from [1143].tbl_organizer_type);



________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;




________________________________________


select *
from [1143].tbl_conference
order by year;


________________________________________


select x.fullname, count(*) as cnt_service
from [1143].tbl_organizer x
group by x.fullname
order by cnt_service;


________________________________________


select x.fullname, count(*) as cnt_service
from [1143].tbl_organizer x
group by x.fullname
order by cnt_service desc;


________________________________________


select a.fullname, count(*) as totalPUBS
from author a, authored b, inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle = 'SIGMOD Conference'
group by a.fullname
order by count(*) desc;



________________________________________


select a.fullname, count(*) as totalPUBS
from author a, authored b, inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle = 'ICDE'
group by a.fullname
order by count(*) desc;



________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a, [1143].authored b, [1143].inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle in ('SIGMOD Conference','VLDB','ICDE','PODS')
group by a.fullname
order by count(*) desc;



________________________________________


select a.fullname, count(*) as totalPUBS
from author a, authored b, inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle = 'ICDT'
group by a.fullname
order by count(*) desc;



________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a, [1143].authored b, [1143].inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle in ('SIGMOD Conference','VLDB','ICDE','PODS','ICDT')
group by a.fullname
order by count(*) desc;


________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a, 
     [1143].authored b,
     [1143].publication q,
     [1143].inproceedings p
where a.fullname = b.fullname 
  and b.pubID = q.id
  and q.year >= 1995 and q.year <= 2005
  and q.id = p.id
  and p.booktitle in ('SIGMOD Conference','VLDB','ICDE','PODS','ICDT')
group by a.fullname
order by count(*) desc;



________________________________________


select * from article;


________________________________________


select * from article
  where journal like '%VLDB%';


________________________________________


select distinct journal from article
  where journal like '%VLDB%';


________________________________________


select distinct journal from article
  where journal in ('PVLDB', 'VLDB J.')


________________________________________


select distinct journal from article
  where journal like '%TODS%'


________________________________________


select distinct journal from article
  where journal like '%Database%'


________________________________________


select distinct journal from article
  where journal in ('PVLDB', 'VLDB J.','ACM Trans. Database Syst.','IEEE Database Eng. Bull.')


________________________________________


select distinct journal from article
  where journal in ('PVLDB', 'VLDB J.','ACM Trans. Database Syst.','IEEE Database Eng. Bull.')select a.fullname, count(*) as totalPUBS
from [1143].author a,
     [1143].authored b,
     [1143].publication q,
     [1143].article p
where a.fullname = b.fullname 
  and b.pubID = q.id
  and q.year >= 1995 and q.year <= 2005
  and q.id = p.id
  and p.journal in ('PVLDB', 'VLDB J.','ACM Trans. Database Syst.','IEEE Database Eng. Bull.')
group by a.fullname
order by count(*) desc;


________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a,
     [1143].authored b,
     [1143].publication q,
     [1143].article p
where a.fullname = b.fullname 
  and b.pubID = q.id
  and q.year >= 1995 and q.year <= 2005
  and q.id = p.id
  and p.journal in ('PVLDB', 'VLDB J.','ACM Trans. Database Syst.','IEEE Database Eng. Bull.')
group by a.fullname
order by count(*) desc;


________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a, 
     [1143].authored b,
     [1143].inproceedings p
where a.fullname = b.fullname 
  and b.pubID = p.id
  and p.booktitle in ('SIGMOD Conference','VLDB','ICDE','PODS','ICDT')
  and a.fullname not in
        (select fullname
         from [1143].tbl_conference x, [1143].tbl_organizer y
         where x.conf_id = y.conf_id and x.year >=2000)
group by a.fullname
order by count(*) desc;



________________________________________


-- find all the chairs, orderd by the year when they served
select *
from [1143].tbl_conference x, [1143].tbl_organizer y, [1143].tbl_organizer_type z
where x.conf_id = y.conf_id
  and y.organizer_type = z.organizer_type
  and z.description like '%Chair%'
order by x.year, z.organizer_type;



________________________________________


select z.year, z.city, z.country,  revenue_total, expense_total, revenue_total - expense_total as net_income
from (select conf_id, sum(revenue_amount) as revenue_total from [1143].tbl_vldb_revenue group by conf_id) x, 
     (select conf_id, sum(expense_amount) as expense_total from [1143].tbl_vldb_expense group by conf_id) y,
     [1143].tbl_conference z
where x.conf_id = y.conf_id and y.conf_id =z.conf_id
order by z.year;



________________________________________


select * from  [1143].tbl_vldb_revenue;


________________________________________


select z.year, z.city, z.country,  revenue_total, expense_total, revenue_total - expense_total as net_income
from (select conf_id, sum(revenue_amount) as revenue_total from [1143].tbl_vldb_revenue where currency='USD' group by conf_id) x, 
     (select conf_id, sum(expense_amount) as expense_total from [1143].tbl_vldb_expense where currency='USD' group by conf_id) y,
     [1143].tbl_conference z
where x.conf_id = y.conf_id and y.conf_id =z.conf_id
order by z.year;



________________________________________


select x.year, y.*
from [1143].tbl_conference x, [1143].tbl_vldb_revenue y
where x.conf_id = y.conf_id
order by x.year


________________________________________


select x.year, y.*
from [1143].tbl_conference x, [1143].tbl_vldb_revenue y
where x.conf_id = y.conf_id
order by x.year;


________________________________________


select x.year, y.*
from [1143].tbl_conference x, [1143].tbl_vldb_expense y
where x.conf_id = y.conf_id
order by x.year;




________________________________________


select x.year, x.country, y.*
from [1143].tbl_conference x, [1143].tbl_vldb_revenue y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from [1143].tbl_conference x, [1143].tbl_vldb_revenue y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from [1143].tbl_conference x, [1143].tbl_vldb_expense y
where x.conf_id = y.conf_id
order by x.year;


________________________________________


select x.year, y.*, z.*
from [1143].tbl_conference x, [1143].tbl_vldb_bot_revenue y, [1143].tbl_vldb_bot_revenue_type z
where x.conf_id = y.conf_id and y.revenue_type = z.revenue_type
order by x.year;


________________________________________


select x.year, x.city, x.country, y.*, z.*
from [1143].tbl_conference x, [1143].tbl_vldb_bot_expense y, [1143].tbl_vldb_bot_expense_type z
where x.conf_id = y.conf_id and y.expense_type = z.expense_type
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x, [1143].tbl_attendence y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y,
      [1143].tbl_registration_type u, 
      [1143].tbl_registration_time v
where x.conf_id = y.conf_id
  and y.registration_type_id = u.registration_type_id
  and y.registration_time_id = v.registration_time_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*, u.*, v.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y,
      [1143].tbl_registration_type u, 
      [1143].tbl_registration_time v
where x.conf_id = y.conf_id
  and y.registration_type_id = u.registration_type_id
  and y.registration_time_id = v.registration_time_id
order by x.year;


________________________________________


select x.year, x.city, x.country, y.*, u.*, v.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y,
      [1143].tbl_registration_type u, 
      [1143].tbl_registration_time v
where x.conf_id = y.conf_id
  and y.registration_type_id = u.registration_type_id
  and y.registration_time_id = v.registration_time_id
order by x.year;


________________________________________


select x.year, x.city, x.country, y.*, u.*, v.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y,
      [1143].tbl_registration_type u, 
      [1143].tbl_registration_time v
where x.conf_id = y.conf_id
  and y.registration_type_id = u.registration_type_id
  and y.registration_time_id = v.registration_time_id
order by x.year;


________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_paper_stats y,
      [1143].tbl_track_type z
where x.conf_id = y.conf_id and y.track_type_id = z.track_type_id
order by x.year;


________________________________________


select x.year, x.city, x.country, y.*
from [1143].tbl_conference x, [1143].tbl_vldb_expense y
where x.conf_id = y.conf_id
order by x.year;


________________________________________


-- PC size for each year
select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;



________________________________________


select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;



________________________________________


select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);



________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a, 
     [1143].authored b,
     [1143].inproceedings p
where a.fullname = b.fullname 
  and b.pubID = p.id
  and p.booktitle in ('SIGMOD Conference','VLDB','ICDE','PODS','ICDT')
  and a.fullname not in
        (select fullname
         from [1143].tbl_conference x, [1143].tbl_organizer y
         where x.conf_id = y.conf_id and x.year >=2000)
group by a.fullname
order by count(*) desc;


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;



________________________________________


select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);



________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a, 
     [1143].authored b,
     [1143].inproceedings p
where a.fullname = b.fullname 
  and b.pubID = p.id
  and p.booktitle in ('SIGMOD Conference','VLDB','ICDE','PODS','ICDT')
  and a.fullname not in
        (select fullname
         from [1143].tbl_conference x, [1143].tbl_organizer y
         where x.conf_id = y.conf_id and x.year >=2000)
group by a.fullname
order by count(*) desc;



________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;


________________________________________


select x.conf_id, x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.conf_id, x.year, x.city, x.country
order by x.year;


________________________________________


select x.conf_id, x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.conf_id, x.year, x.city, x.country
order by x.year;


________________________________________


select count(*) from tbl_organizer;


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;


________________________________________


select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*, u.*, v.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y,
      [1143].tbl_registration_type u, 
      [1143].tbl_registration_time v
where x.conf_id = y.conf_id
  and y.registration_type_id = u.registration_type_id
  and y.registration_time_id = v.registration_time_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_paper_stats y,
      [1143].tbl_track_type z
where x.conf_id = y.conf_id and y.track_type_id = z.track_type_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*, z.*
from [1143].tbl_conference x, [1143].tbl_vldb_bot_expense y, [1143].tbl_vldb_bot_expense_type z
where x.conf_id = y.conf_id and y.expense_type = z.expense_type
order by x.year;



________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;


________________________________________


SELECT * FROM [1143].[Free Riders]


________________________________________


SELECT * FROM [1143].[Free Riders]
  order by totalPUBS desc



________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a,
     [1143].authored b,
     [1143].inproceedings p
where a.fullname = b.fullname
  and b.pubID = p.id
  and p.booktitle in ('VLDB')
  and a.fullname not in
        (select fullname
         from [1143].tbl_conference x, [1143].tbl_organizer y
         where x.conf_id = y.conf_id and x.year >=2000)
group by a.fullname
order by count(*) desc;


________________________________________


select *
from [1143].tbl_conference
order by year;



________________________________________


select x.fullname, count(*) as cnt_service
from [1143].tbl_organizer x
group by x.fullname
order by cnt_service desc;


________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;


________________________________________


select x.year, x.city, x.country, y.*, u.*, v.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y,
      [1143].tbl_registration_type u, 
      [1143].tbl_registration_time v
where x.conf_id = y.conf_id
  and y.registration_type_id = u.registration_type_id
  and y.registration_time_id = v.registration_time_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*, u.*, v.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y,
      [1143].tbl_registration_type u, 
      [1143].tbl_registration_time v
where x.conf_id = y.conf_id
  and y.registration_type_id = u.registration_type_id
  and y.registration_time_id = v.registration_time_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select top 2 x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select top 2 x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_attendence y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from  [1143].tbl_conference x,
      [1143].tbl_paper_stats y,
      [1143].tbl_track_type z
where x.conf_id = y.conf_id and y.track_type_id = z.track_type_id
order by x.year;



________________________________________


select x.year, x.city, x.country, y.*
from [1143].tbl_conference x, [1143].tbl_vldb_revenue y
where x.conf_id = y.conf_id
order by x.year;



________________________________________


select followee, count(*) from twittermat group by followee;


________________________________________


select  count(*) from twittermat group by followee order by count(*) desc;


________________________________________


select  count(*) from twittermat group by follower order by count(*) desc;


________________________________________


select *
from [1143].tbl_conference
order by year;



________________________________________


select x.fullname, count(*) as cnt_service
from [1143].tbl_organizer x
group by x.fullname
order by cnt_service desc;


________________________________________


select *
from [1143].tbl_organizer x;



________________________________________


select distinct conf_id
from [1143].tbl_organizer x
order by conf_id



________________________________________


select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);



________________________________________


select distinct fullname
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);



________________________________________


select distinct fullname
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person)
  order by fullname



________________________________________


select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person)
  order by fullname



________________________________________


select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person)
  order by fullname


________________________________________


select *
from [1143].tbl_organizer
where fullname not in (select fullname from [1143].tbl_person);



________________________________________


select *
from [1143].tbl_organizer
where conf_id not in (select conf_id from [1143].tbl_conference);



________________________________________


select *
from [1143].tbl_organizer
where organizer_type not in (select organizer_type from [1143].tbl_organizer_type);



________________________________________


select fullname, conf_id, organizer_type, count(*) as c
from [1143].tbl_organizer y
group by fullname, conf_id, organizer_type
order by c desc


________________________________________


select fullname, conf_id, organizer_type, count(*) as c
from [1143].tbl_organizer y
group by fullname, conf_id, organizer_type
having count(*) >= 2;



________________________________________


select fullname, conf_id, organizer_type, count(*) as c
from [1143].tbl_organizer y
group by fullname, conf_id, organizer_type
having count(*) >= 2;



________________________________________


select description, count(*) as c
from [1143].tbl_organizer_type y
group by description;



________________________________________


select description, count(*) as c
from [1143].tbl_organizer_type y
group by description
order by c desc;



________________________________________


select *
from [1143].tbl_organizer



________________________________________


select distinct conf_id
from [1143].tbl_organizer
order by conf_id


________________________________________


select *
from [1143].tbl_conference
order by year


________________________________________


select *
from [1143].tbl_conference
order by year desc;



________________________________________


select *
from [1143].tbl_conference
order by year desc;




________________________________________


select *
from [1143].tbl_organizer;




________________________________________


select distinct conf_id
from [1143].tbl_organizer
  order by conf_id;




________________________________________


select *
from [1143].tbl_conference
  order by conf_id;




________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;



________________________________________


select *
from [1143].tbl_organizer
where organizer_type not in (select organizer_type from [1143].tbl_organizer_type);



________________________________________


select *
from [1143].tbl_organizer_type



________________________________________


select *
from [1143].tbl_organizer_type
order by organizer_type;


________________________________________


select *
from [1143].tbl_organizer_type
order by track_type_id, organizer_type;


________________________________________


select organizer_type, count(*) as c
from [1143].tbl_organizer_type
group by organizer_type;


________________________________________


select *
from [1143].tbl_organizer
where conf_id not in (select conf_id from [1143].tbl_conference);



________________________________________


select *
from [1143].tbl_organizer
where organizer_type not in (select organizer_type from [1143].tbl_organizer_type);



________________________________________


select fullname, conf_id, organizer_type, count(*) as c
from [1143].tbl_organizer y
group by fullname, conf_id, organizer_type
having count(*) >= 2;



________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and y.organizer_type = 'PCMember'
group by x.year, x.city, x.country
order by x.year;



________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
  where x.conf_id = y.conf_id and (y.organizer_type = 'PCMember' or y.organizer_type = 'ReviewBoardMember')
group by x.year, x.city, x.country
order by x.year;



________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
  where x.conf_id = y.conf_id and (y.organizer_type = 'PCMember' or y.organizer_type = 'ReviewBoardMember')
group by x.year, x.city, x.country
order by x.year;



________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and (y.organizer_type = 'PCMember' or y.organizer_type = 'ReviewBoardMember')
group by x.year, x.city, x.country
order by x.year;



________________________________________


select distinct fullname
from [1143].tbl_organizer;



________________________________________


select count(distinct fullname)
from [1143].tbl_organizer;



________________________________________


select *
from [1143].tbl_organizer
where conf_id not in (select conf_id from [1143].tbl_conference);



________________________________________


select *
from [1143].tbl_organizer
where organizer_type not in (select organizer_type from [1143].tbl_organizer_type);



________________________________________


select *
from [1143].tbl_organizer
where organizer_type not in (select organizer_type from [1143].tbl_organizer_type);



________________________________________


select fullname, conf_id, organizer_type, count(*) as c
from [1143].tbl_organizer y
group by fullname, conf_id, organizer_type
having count(*) >= 2;



________________________________________


select *
from [1143].tbl_organizer
where conf_id not in (select conf_id from [1143].tbl_conference);



________________________________________


-- every organizer has a correct type
select *
from [1143].tbl_organizer
where organizer_type not in (select organizer_type from [1143].tbl_organizer_type);



________________________________________


-- every organizer has a single role during each conference
select fullname, conf_id, organizer_type, count(*) as c
from [1143].tbl_organizer y
group by fullname, conf_id, organizer_type
having count(*) >= 2;




________________________________________


-- every organizer has a single role during each conference
select fullname, conf_id, organizer_type, count(*) as c
from [1143].tbl_organizer y
group by fullname, conf_id, organizer_type
having count(*) >= 2;




________________________________________


select x.year, x.city, x.country, count(*) as pc_size
from [1143].tbl_conference x, [1143].tbl_organizer y
where x.conf_id = y.conf_id and (y.organizer_type = 'PCMember' or y.organizer_type = 'ReviewBoardMember')
group by x.year, x.city, x.country
order by x.year;



________________________________________


select x.fullname, count(*) as cnt_service
from [1143].tbl_organizer x
group by x.fullname
order by cnt_service desc;



________________________________________


select *
from [1143].tbl_conference x, [1143].tbl_organizer y, [1143].tbl_organizer_type z
where x.conf_id = y.conf_id
  and y.organizer_type = z.organizer_type
  and z.description like '%Chair%'
order by x.year, z.organizer_type;



________________________________________


select x.year, x.city, x.country, y.fullname, z.description
from [1143].tbl_conference x, [1143].tbl_organizer y, [1143].tbl_organizer_type z
where x.conf_id = y.conf_id
  and y.organizer_type = z.organizer_type
  and z.description like '%Chair%'
order by x.year, z.organizer_type;



________________________________________


select x.year, x.city, x.country, y.fullname, z.description
from [1143].tbl_conference x, [1143].tbl_organizer y, [1143].tbl_organizer_type z
where x.conf_id = y.conf_id
  and y.organizer_type = z.organizer_type
  and z.description like '%Chair%'
order by x.year, z.organizer_type;



________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a, 
     [1143].authored b,
     [1143].inproceedings p
where a.fullname = b.fullname 
  and b.pubID = p.id
  and p.booktitle in ('SIGMOD Conference','VLDB','ICDE','PODS','ICDT')
  and a.fullname not in
        (select fullname
         from [1143].tbl_conference x, [1143].tbl_organizer y
         where x.conf_id = y.conf_id and x.year >=2000)
group by a.fullname
order by count(*) desc;



________________________________________


select x.fullname, count(*) as cnt_service
from [1143].tbl_organizer x
group by x.fullname
order by cnt_service desc;



________________________________________



select cnt_service, count(*)
from (select x.fullname, count(*) as cnt_service
      from [1143].tbl_organizer x
      group by x.fullname) y
group by cnt_service
order by count(*) desc;



________________________________________


select cnt_service, count(*)
from (select x.fullname, count(*) as cnt_service
      from [1143].tbl_organizer x
      group by x.fullname) y
group by cnt_service
order by count(*) desc;



________________________________________


select *
from [1143].tbl_organizer
where conf_id not in (select conf_id from [1143].tbl_conference);



________________________________________


select *
from [1143].tbl_organizer
where organizer_type not in (select organizer_type from [1143].tbl_organizer_type);



________________________________________


select fullname, conf_id, organizer_type, count(*) as c
from [1143].tbl_organizer y
group by fullname, conf_id, organizer_type
having count(*) >= 2;



________________________________________


SELECT x FROM [1267].[table_1A17_3.csv]


________________________________________


SELECT x,y,z FROM [1267].[table_1A17_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT x,y,z,res_surface_area_ratio FROM [1267].[table_1A17_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT x,y,z,res_surface_area_ratio FROM [1267].[table_1A17_3.csv] WHERE res_surface_area_ratio > 0.2


________________________________________


SELECT DISTINCT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT DISTINCT pdb_id FROM [1267].[CPH1_2] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT DISTINCT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT DISTINCT pdb_id FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT COUNT(res_type) FROM [1267].[table_cph1_2.csv]


________________________________________


SELECT * FROM [1267].[table_cph1_2.csv] WHERE res_type='LYS'


________________________________________


SELECT res_surface_area_ratio FROM [1267].[table_cph1_3.csv]


________________________________________


SELECT * FROM [1267].[table_comb_3.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT * FROM [1267].[table_cph1_3.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_3.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_3.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_3.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT min(res_surface_area_ratio) FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT min(res_surface_area_ratio) FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT min(res_surface_area_ratio) FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio <> 'NA'


________________________________________


SELECT * FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio != 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio != 'NA'


________________________________________


SELECT max(res_surface_area_ratio) FROM [1267].[table_cph1_3.csv] WHERE res_surface_area_ratio != 'NA'


________________________________________


SELECT * FROM [1267].[table_cph1_2.csv]


________________________________________


SELECT * FROM [1267].[table_cph1_2.csv] WHERE res_type='ALA'


________________________________________


SELECT * FROM [1267].[table_cph1_2.csv] WHERE phi != 'NA' AND phi < -1.0


________________________________________


SELECT * FROM [1267].[table_cph1_2.csv] WHERE phi != 'NA' AND phi < -1.0 AND res_type_sh='A'


________________________________________


SELECT * FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio != 'NA' and res_surface_area > 0.4


________________________________________


SELECT res_surface_area_ratio FROM [1267].[table_cph1_2.csv] WHERE res_surface_area_ratio != 'NA'


________________________________________



SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     -- on the next line, replace NA with NULL, and CAST the result as a number
     , CASE WHEN res_surface_area_ratio = 'NA' THEN NULL ELSE CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , phi, psi
  FROM [1267].[table_cph1_2.csv] 


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     -- on the next line, replace NA with NULL, and CAST the result as a number
     , CASE WHEN res_surface_area_ratio = 'NA' THEN NULL ELSE
CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , phi, psi
  FROM [1267].[table_cph1_2.csv]


________________________________________


SELECT * FROM [1267].[cph1_2.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id, atom_index, atom_type, res_type, res_type_sh,
  chain, res_index, x,y,z,occupancy,beta, atom_surface_area,
  res_surface_area, CASE WHEN res_surface_area_ratio='NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
  FROM [1267].[table_h1_3.csv]



________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , phi, psi
  FROM [1267].[table_h1_2.csv]


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_h1_2.csv]


________________________________________


SELECT pdb_id,
  CASE WHEN charge = 'NULL' THEN NULL ELSE
  CAST(charge as float) END charge,
  surface_area, res_num, gaps, ALA, ARG, ASN, ASP, CYS, GLN
  GLU, GLY, HIS, ILE, LEU, LYS, MET, PHE, PRO, SER, THR, 
  TRP, TYR, VAL
FROM [1267].[table_h1_1.csv]


________________________________________


SELECT res_type FROM [1267].[h1_2.csv] WHERE pdb_id ='1A17' AND res_surface_area_ratio > 0.3


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_cph1_2.csv]


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_eh1_2.csv]


________________________________________


SELECT pdb_id, atom_index, atom_type, res_type, res_type_sh,
  chain, res_index, x,y,z,occupancy,beta, atom_surface_area,
  res_surface_area, CASE WHEN res_surface_area_ratio='NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
  FROM [1267].[table_cph1_3.csv]


________________________________________


SELECT pdb_id, atom_index, atom_type, res_type, res_type_sh,
  chain, res_index, x,y,z,occupancy,beta, atom_surface_area,
  res_surface_area, CASE WHEN res_surface_area_ratio='NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
  FROM [1267].[table_eh1_3.csv]


________________________________________


SELECT pdb_id,
  CASE WHEN charge = 'NULL' THEN NULL ELSE
  CAST(charge as float) END charge,
  surface_area, res_num, gaps, ALA, ARG, ASN, ASP, CYS, GLN
  GLU, GLY, HIS, ILE, LEU, LYS, MET, PHE, PRO, SER, THR, 
  TRP, TYR, VAL
FROM [1267].[table_cph1_1.csv]


________________________________________


SELECT pdb_id,
  CASE WHEN charge = 'NULL' THEN NULL ELSE
  CAST(charge as float) END charge,
  surface_area, res_num, gaps, ALA, ARG, ASN, ASP, CYS, GLN
  GLU, GLY, HIS, ILE, LEU, LYS, MET, PHE, PRO, SER, THR, 
  TRP, TYR, VAL
FROM [1267].[table_eh1_1.csv]


________________________________________


SELECT * FROM [1267].[h1_2.csv] WHERE res_surface_area_ratio > 0.4 AND res_surface_area_ratio != NULL


________________________________________


SELECT * FROM [1267].[h1_2.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT * FROM [1267].[h1_2.csv] WHERE res_surface_area_ratio > 0.4 AND res_surface_area_ratio IS NOT NULL


________________________________________


SELECT count(pdb_id) FROM [1267].[h1_2.csv] WHERE res_surface_area_ratio > 0.4 AND res_surface_area_ratio IS NOT NULL


________________________________________


SELECT count(pdb_id) FROM [1267].[h1_2.csv] WHERE res_surface_area_ratio > 0.4


________________________________________


SELECT count(pdb_id) FROM [1267].[h1_1.csv] WHERE charge IS NOT NULL


________________________________________


SELECT count(pdb_id) FROM [1267].[h1_1.csv]


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_h1_w_2.csv]


________________________________________


SELECT * FROM [1267].[h1_1.csv]


________________________________________


SELECT * FROM [1267].[h1_1.csv]


________________________________________



SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_h1_w_2.csv]



________________________________________


SELECT * FROM [1267].[h1_w_2.csv]


________________________________________


SELECT *
  -- Joining three copies of the same table
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two, [1267].[h1_w_2.csv] three
WHERE one.res_index = two.res_index + 1
    AND two.res_index = three.res_index + 1
    AND two.res_surface_area_ratio > 0.3


________________________________________


SELECT one.res_type
  -- Joining three copies of the same table
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two, [1267].[h1_w_2.csv] three
WHERE one.res_index = two.res_index + 1
    AND two.res_index = three.res_index + 1
    AND two.res_surface_area_ratio > 0.3


________________________________________


SELECT one.res_type, two.res_type, three.res_type
  -- Joining three copies of the same table
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two, [1267].[h1_w_2.csv] three
WHERE one.res_index = two.res_index + 1
    AND two.res_index = three.res_index + 1
    AND two.res_surface_area_ratio > 0.3


________________________________________


SELECT one.res_type, two.res_type, three.res_type
  -- Joining three copies of the same table
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two, [1267].[h1_w_2.csv] three
WHERE one.pdb_id = two.pdb_id
  AND two.pdb_id = three.pdb_id
  AND one.chain = two.chain
  AND two.chain = three.chain
  AND one.res_index = two.res_index + 1
  AND two.res_index = three.res_index + 1
  AND two.res_surface_area_ratio > 0.3  
  


________________________________________


SELECT count(*)
  -- Joining three copies of the same table
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two, [1267].[h1_w_2.csv] three
WHERE one.pdb_id = two.pdb_id
  AND two.pdb_id = three.pdb_id
  AND one.chain = two.chain
  AND two.chain = three.chain
  AND one.res_index = two.res_index + 1
  AND two.res_index = three.res_index + 1
  AND two.res_surface_area_ratio > 0.3  
  


________________________________________


SELECT one.res_type, two.res_type, three.res_type 
  -- Joining three copies of the same table 
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two, [1267].[h1_w_2.csv] three 
  WHERE one.pdb_id = two.pdb_id 
  AND two.pdb_id = three.pdb_id 
  AND one.chain = two.chain 
  AND two.chain = three.chain 
  AND one.res_index = two.res_index + 1 
  AND two.res_index = three.res_index + 1 
  AND two.res_surface_area_ratio > 0.3


________________________________________


SELECT *
  -- Joining three copies of the same table 
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two, [1267].[h1_w_2.csv] three 
  WHERE one.pdb_id = two.pdb_id 
  AND two.pdb_id = three.pdb_id 
  AND one.chain = two.chain 
  AND two.chain = three.chain 
  AND one.res_index = two.res_index + 1 
  AND two.res_index = three.res_index + 1 
  AND two.res_surface_area_ratio > 0.3


________________________________________


SELECT *
  -- Joining three copies of the same table 
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two, [1267].[h1_w_2.csv] three 
  WHERE one.pdb_id = two.pdb_id 
  AND two.pdb_id = three.pdb_id 
  AND one.chain = two.chain 
  AND two.chain = three.chain 
  AND one.res_index = two.res_index + 1 
  AND two.res_index = three.res_index + 1 
  AND two.res_surface_area_ratio > 0.3


________________________________________


SELECT count(*)
  -- Joining three copies of the same table
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two
WHERE one.pdb_id = two.pdb_id
  AND one.chain = two.chain
  AND one.res_index = two.res_index + 1
  AND two.res_surface_area_ratio > 0.3
  AND one.res_surface_area_ratio > 0.3


________________________________________


SELECT one.res_type, two.res_type
  -- Joining three copies of the same table
  FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two
WHERE one.pdb_id = two.pdb_id
  AND one.chain = two.chain
  AND one.res_index = two.res_index + 1
  AND two.res_surface_area_ratio > 0.3
  AND one.res_surface_area_ratio > 0.3


________________________________________


SELECT one.res_type, two.res_type FROM [1267].[eh1_2.csv] one, [1267].[eh1_2.csv] two WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   AND one.res_index = two.res_index + 1   
  AND two.res_surface_area_ratio > 0.3   AND one.res_surface_area_ratio > 0.3


________________________________________


SELECT one.res_type, two.res_type FROM [1267].[eh1_2.csv] one, [1267].[eh1_2.csv] two WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   AND one.res_index = two.res_index + 1   AND two.res_surface_area_ratio > 0.3   AND one.res_surface_area_ratio > 0.3


________________________________________


SELECT one.res_type, two.res_type FROM [1267].[eh1_2.csv] one, [1267].[eh1_2.csv] two WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   AND one.res_index = two.res_index + 1   AND two.res_surface_area_ratio > 0.4   AND one.res_surface_area_ratio > 0.4


________________________________________


SELECT one.res_type, two.res_type FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   AND one.res_index = two.res_index + 1   AND two.res_surface_area_ratio > 0.4   AND one.res_surface_area_ratio > 0.4


________________________________________


SELECT one.res_type, two.res_type FROM [1267].[cph1_2.csv] one, [1267].[cph1_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   AND one.res_index = two.res_index + 1   
  AND two.res_surface_area_ratio > 0.4   AND one.res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_cph1_2.csv]


________________________________________


SELECT one.pdb_id, one.res_type, two.res_type FROM [1267].[cph1_2.csv] one, [1267].[cph1_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   AND one.res_index = two.res_index + 1   
  AND two.res_surface_area_ratio > 0.4   AND one.res_surface_area_ratio > 0.4


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN ps = 'NULL' THEN NULL ELSE
  CAST(ps as float) END ps
  FROM [1267].[table_eh1_2.csv]


________________________________________


SELECT one.res_type, two.res_type FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   AND one.res_index = two.res_index + 1   AND (two.res_surface_area_ratio > 0.4   OR one.res_surface_area_ratio > 0.4)


________________________________________


SELECT one.pdb_id, one.res_type, two.res_type FROM [1267].[h1_w_2.csv] one, [1267].[h1_w_2.csv] two WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   AND one.res_index = two.res_index + 1   AND (two.res_surface_area_ratio > 0.4   OR one.res_surface_area_ratio > 0.4)


________________________________________


select * FROM [1259].[ecoli_2.csv]


________________________________________


select * FROM [1259].[ecoli_2.csv] 



________________________________________


select * FROM [1259].[ecoli_2.csv] 



________________________________________


select one.pdb_id FROM [1259].[ecoli_2.csv] one, [1259].[assist_2.csv] two  WHERE one.pdb_id = two.pdb_id



________________________________________


select * FROM [1259].[ecoli_2.csv] three WHERE three.pdb_id NOT IN (select one.pdb_id FROM [1259].[ecoli_2.csv] one, [1259].[assist_2.csv] two  WHERE one.pdb_id = two.pdb_id)



________________________________________


select * FROM [1259].[ecoli_1.csv] three WHERE three.pdb_id NOT IN (select one.pdb_id FROM [1259].[ecoli_1.csv] one, [1259].[assist_1.csv] two  WHERE one.pdb_id = two.pdb_id)


________________________________________


SELECT DISTINCT name FROM [1259].[chaperon_res.csv]


________________________________________


SELECT DISTINCT name,pdb_id FROM [1259].[chaperon_res.csv]


________________________________________


SELECT * FROM [1267].[h1_2.csv]


________________________________________


SELECT * FROM [1267].[h1_2.csv]


________________________________________


SELECT * FROM [1267].[h1_1.csv] WHERE gaps = 0


________________________________________


SELECT one.pdb_id FROM [1267].[h1_2.csv] one,
  [1267].[h1_1.csv] two
  WHERE one.pdb_id = two.pdb_id



________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type FROM [1267].[h1_2.csv] residues
  FULL JOIN [1267].[h1_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  ORDER BY residues.pdb_id


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type FROM [1267].[h1_2.csv] residues
  FULL JOIN [1267].[h1_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[h1_2.csv] residues
  FULL JOIN [1267].[h1_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[h1_w_2.csv] residues
  FULL JOIN [1267].[h1_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT * FROM [1267].[h1_w_1.csv] WHERE gaps = 0


________________________________________


SELECT * FROM [1267].[cph1_1.csv] WHERE gaps = 0


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[cph1_2.csv] residues
  FULL JOIN [1267].[cph1_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT * FROM [1267].[eh1_1.csv] WHERE gaps = 0


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.ps FROM [1267].[eh1_2.csv] residues
  FULL JOIN [1267].[eh1_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_h2_2.csv]


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[h2_w_2.csv] residues
  FULL JOIN [1267].[h2_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[h2_w_2.csv] residues
  FULL JOIN [1267].[h2_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[h2_w_2.csv] residues
  FULL JOIN [1267].[h2_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT * FROM [1267].[h1_w_1.csv] WHERE gaps = 0


________________________________________


SELECT * FROM [1267].[h2_1.csv] WHERE gaps = 0


________________________________________


SELECT pdb_id FROM [1267].[h2_1.csv] WHERE gaps = 0


________________________________________


SELECT count(pdb_id) FROM [1267].[h2_1.csv] WHERE gaps = 0


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] WHERE gaps = 0


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_cph2_2.csv]


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[cph2_w_2.csv] residues
  FULL JOIN [1267].[cph2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] WHERE gaps = 0


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[cph2_w_2.csv] residues
  FULL JOIN [1267].[cph2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_H2_w_2.csv]



________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[H2_w_2.csv] residues
  FULL JOIN [1267].[h2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT pdb_id, res_type_sh, chain, res_surface_area
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_cph2_w_2.csv]


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_cph2_2.csv]


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] WHERE gaps = 0


________________________________________


SELECT * FROM [1267].[table_h2_w_1.csv] where gaps = 0
  


________________________________________


SELECT * FROM [1267].[table_eh2_w_1.csv] where gaps=0


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_H2_w_2.csv]


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[H2_w_2.csv] residues
  FULL JOIN [1267].[h2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[eh2_w_2.csv] residues
  FULL JOIN [1267].[eh2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_eh2_w_2.csv]


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1267].[eh2_w_2.csv] residues
  FULL JOIN [1267].[eh2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT * FROM [1267].[h2_w_1.csv] WHERE gaps=0


________________________________________


SELECT * FROM [1267].[h2_w_1.csv] WHERE gaps=0 AND pdb_id='3GHG"'


________________________________________


SELECT * FROM [1267].[h2_w_1.csv] WHERE gaps=0 AND pdb_id='3GHG'


________________________________________


SELECT * FROM [1267].[h2_w_1.csv] WHERE gaps=0


________________________________________


SELECT * FROM [1267].[h2_w_1.csv] WHERE gaps=0 and pdb_id='1A12';


________________________________________


SELECT * FROM [1267].[h1_w_1.csv] WHERE gaps=0 and pdb_id='3GHG';


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area, structure
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_eh2_w_2.csv]



________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_h2_w_2.csv]


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area, structure
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_h2_w_2.csv]


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi, residues.structure FROM [1267].[H2_w_2.csv] residues
  FULL JOIN [1267].[h2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0
  ORDER BY residues.pdb_id


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi, residues.structure FROM [1267].[H2_w_2.csv] residues
  FULL JOIN [1267].[h2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0  AND residues.pdb_id IS NOT NULL
  ORDER BY residues.pdb_id


________________________________________


SELECT * FROM [1267].[h2_w_nogaps_2.csv]


________________________________________


SELECT * FROM [1267].[h2_w_nogaps_2.csv] WHERE structure='C'


________________________________________


SELECT * FROM [1267].[table_h2_w_1.csv] where gaps = 0 AND pdb_id IS NOT NULL


________________________________________


SELECT len(charge) FROM [1267].[table_h2_w_1.csv] where gaps = 0 AND pdb_id IS NOT NULL


________________________________________


SELECT count(charge) FROM [1267].[table_h2_w_1.csv] where gaps = 0 AND pdb_id IS NOT NULL


________________________________________


SELECT count(charge) FROM [1267].[table_h2_w_1.csv] where gaps = 0


________________________________________


SELECT * FROM [1267].[h2_w_nogaps_2.csv] WHERE pdb_id = '1HMC'


________________________________________


SELECT * FROM [1267].[h2_w_nogaps_1.csv] WHERE pdb_id = '1HMC'


________________________________________


SELECT * FROM [1267].[table_h2_w_1.csv] where gaps = 0
  


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi, residues.structure FROM [1267].[H2_w_2.csv] residues
  FULL JOIN [1267].[h2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0  AND residues.pdb_id IS NOT NULL
  ORDER BY residues.pdb_id


________________________________________


SELECT one.pdb_id, one.res_type, two.res_type 
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   
  AND one.res_index = two.res_index + 1   
  AND (two.res_surface_area_ratio > 0.3   OR one.res_surface_area_ratio > 0.3)


________________________________________


SELECT one.pdb_id, one.res_type, two.res_type 
  FROM [1267].[h2_w_nogaps_2.csv] one, [1267].[h2_w_nogaps_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   
  AND one.res_index = two.res_index + 1   
  AND (two.res_surface_area_ratio > 0.3   OR one.res_surface_area_ratio > 0.3)


________________________________________


SELECT count(pdb_id) FROM [1259].[ecoli40_1.csv]


________________________________________


SELECT count(pdb_id) FROM [1259].[ecoli40_2.csv]


________________________________________


SELECT count(distinct(pdb_id)) FROM [1259].[ecoli40_2.csv]


________________________________________


SELECT count(*) FROM [1267].[h2_w_2.csv] WHERE pdb_id='1A12'


________________________________________


SELECT gaps FROM [1259].[ecoli_1.csv]


________________________________________


SELECT count(gaps) FROM [1259].[ecoli_1.csv]


________________________________________


SELECT * FROM [1259].[ecoli_1.csv] where gaps=0


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1259].[ecoli_2.csv] residues
  FULL JOIN [1259].[ecoli_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0  AND residues.pdb_id IS NOT NULL
  ORDER BY residues.pdb_id


________________________________________


SELECT count(*) FROM [1267].[ecoli_nogaps_1.csv]


________________________________________


SELECT * FROM [1259].[assist_1.csv] WHERE gaps = 0;


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1259].[assist_2.csv] residues
  FULL JOIN [1259].[assist_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0  AND residues.pdb_id IS NOT NULL
  ORDER BY residues.pdb_id


________________________________________


SELECT pdb_id, res_num FROM [1267].[assist_nogaps_1.csv]


________________________________________


SELECT residues.pdb_id, proteins.gaps, residues.res_type, residues.res_index, residues.res_type
     , residues.res_type_sh, residues.chain, residues.res_surface_area, residues.res_surface_area_ratio,
 residues.phi, residues.psi FROM [1259].[assist_2.csv] residues
  FULL JOIN [1259].[assist_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0  AND residues.pdb_id IS NOT NULL
  ORDER BY residues.pdb_id


________________________________________


SELECT * FROM [1259].[ecoli_1.csv]


________________________________________


SELECT pdb_id FROM [1259].[ecoli_1.csv]


________________________________________


SELECT pdb_id FROM [1259].[ecoli_1.csv] WHERE pdb_id = '1B5T'


________________________________________


SELECT pdb_id FROM [1259].[ecoli_1.csv] WHERE pdb_id = '1GVF'


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_AS2_2.csv]


________________________________________


SELECT pdb_id, res_index, res_type
     , res_type_sh, chain, res_surface_area
     , CASE WHEN res_surface_area_ratio = 'NULL' THEN NULL ELSE
  CAST(res_surface_area_ratio as float) END res_surface_area_ratio
     , CASE WHEN phi = 'NULL' THEN NULL ELSE
  CAST(phi as float) END phi
     , CASE WHEN psi = 'NULL' THEN NULL ELSE
  CAST(psi as float) END psi
  FROM [1267].[table_AS2_2.csv]


________________________________________


SELECT count(*) FROM [1259].[ecoli_nogaps_2.csv]


________________________________________


SELECT count(*) FROM [1259].[ecoli_nogaps_1.csv]


________________________________________


SELECT count(*) FROM [1267].[h2_w_1.csv]


________________________________________


SELECT count(*) FROM [1267].[h2_w_nogaps_1.csv]


________________________________________


SELECT count(*) FROM [1267].[cph2_w_nogaps_1.csv]


________________________________________


SELECT count(*) FROM [1267].[eh2_w_nogaps_1.csv]


________________________________________


SELECT COUNT(*) FROM [1259].[ecoli_1.csv] where gaps=0


________________________________________


SELECT COUNT(*) FROM [1259].[ecoli_1.csv] where gaps=0


________________________________________


SELECT COUNT(residues.pdb_id) FROM [1267].[H2_w_2.csv] residues
  FULL JOIN [1267].[h2_w_1.csv] proteins
  ON proteins.pdb_id=residues.pdb_id
  WHERE proteins.gaps = 0  AND residues.pdb_id IS NOT NULL



________________________________________


SELECT COUNT(*) FROM [1267].[table_eh2_w_1.csv] where gaps=0


________________________________________


SELECT min(res_num) FROM [1259].[ecoli_1.csv]


________________________________________


SELECT * FROM [1267].[H2_w_2.csv] proteins;


________________________________________


SELECT * FROM [1267].[H2_w_2.csv] residues WHERE residues.chain IS NOT NULL


________________________________________


SELECT * FROM [1267].[H2_w_2.csv] residues WHERE residues.pdb_id IS NOT NULL AND residues.pdb_id = '1A12'


________________________________________


SELECT * FROM [1267].[H2_w_2.csv] residues WHERE residues.pdb_id IS NOT NULL AND residues.pdb_id = '3JYR'


________________________________________


SELECT * FROM [1267].[H2_w_2.csv] residues WHERE residues.pdb_id IS NOT NULL AND residues.pdb_id = '3JRY'


________________________________________


SELECT * FROM [1267].[H2_w_2.csv] residues WHERE residues.pdb_id IS NOT NULL AND residues.pdb_id = '3JRY'


________________________________________


SELECT * FROM [1267].[cph2_w_nogaps_2.csv]



________________________________________


SELECT res_index, res_type_sh FROM [1267].[cph2_w_nogaps_2.csv] WHERE res_surface_area_ratio >= 0.3 



________________________________________


SELECT res_index, pdb_id, res_type_sh FROM [1267].[cph2_w_nogaps_2.csv] WHERE res_surface_area_ratio >= 0.3 



________________________________________


SELECT count(*) FROM [1267].[cph2_w_nogaps_2.csv] WHERE res_surface_area_ratio >= 0.3 



________________________________________


select res_index, pdb_id, res_type_sh FROM [1267].[h2_w_nogaps_2.csv] WHERE res_surface_area_ratio > 0.3


________________________________________


select count(res_index) FROM [1267].[h2_w_nogaps_2.csv] WHERE res_surface_area_ratio > 0.3


________________________________________


select res_index, pdb_id, res_type_sh FROM [1267].[h2_w_nogaps_2.csv] WHERE res_surface_area_ratio > 0.3


________________________________________


SELECT * FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, WeightDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, WeightDescriptor_0, RuleOfFiveDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, WeightDescriptor_0, ALogPDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, WeightDescriptor_0, ALogPDescriptor_0, BasicGroupCountDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, WeightDescriptor_0, ALogPDescriptor_0, BasicGroupCountDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv] WHERE BasicGRoupCountDescriptor_0 > 0


________________________________________


SELECT sequence, WeightDescriptor_0, ALogPDescriptor_0, BasicGroupCountDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, WeightDescriptor_0, ALogPDescriptor_0,HBondAcceptorCountDescriptor_0, HBondDonorCountDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, WeightDescriptor_0, ALogPDescriptor_0,HBondAcceptorCountDescriptor_0, HBondDonorCountDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, WeightDescriptor_0, ALogPDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, ALogPDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, ALOGPDescriptor_0, WeightDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT sequence, WeightDescriptor_0 FROM [1267].[table_SHP_Peptide_QSAR.csv]


________________________________________


SELECT ALogP FROM [1267].[table_h2_fragment_qsar.csv] ORDER BY ALogP


________________________________________


SELECT Count(*) FROM [1267].[table_h2_fragment_qsar.csv]


________________________________________


SELECT Distinct(Column1) FROM [1267].[table_h2_fragment_qsar.csv]


________________________________________


SELECT Count(Distinct(Column1)) FROM [1267].[table_h2_fragment_qsar.csv]


________________________________________


SELECT Count(Distinct(Column1)) FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5


________________________________________


SELECT Count(Distinct(Column1)) FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5


________________________________________


SELECT Distinct(Column1) FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5


________________________________________


SELECT * FROM [1267].[table_h2_fragment_qsar.csv] AS h2 
  INNER JOIN (SELECT Distinct(Column1) FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5) AS h2_frag
  ON h2_frag.Column1=h2.Column1 



________________________________________


SELECT COUNT(*) FROM [1267].[table_h2_fragment_qsar.csv] AS h2 
  INNER JOIN (SELECT Distinct(Column1) FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5) AS h2_frag
  ON h2_frag.Column1=h2.Column1 



________________________________________


SELECT * FROM [1267].[table_h2_fragment_qsar.csv] AS h2 
  INNER JOIN (SELECT Distinct(Column1) FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5) AS h2_frag
  ON h2_frag.Column1=h2.Column1 



________________________________________


SELECT * FROM [1267].[table_h2_fragment_qsar.csv] AS h2 
  INNER JOIN (SELECT Distinct(Column1) FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5 AND length <= 11) AS h2_frag
  ON h2_frag.Column1=h2.Column1 



________________________________________


SELECT Count(*) FROM [1267].[table_h2_fragment_qsar.csv] AS h2 
  INNER JOIN (SELECT Distinct(Column1) FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5 AND length <= 11) AS h2_frag
  ON h2_frag.Column1=h2.Column1 



________________________________________


SELECT Distinct(Column1), *  FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5 AND length <= 11



________________________________________


SELECT Distinct(Column1) AS sequence, *  FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5 AND length <= 11



________________________________________


SELECT Distinct(Column1) AS sequence, length,
ALogP,
MW,
nHBAcc,
nHBDon,
nAcidicGroup,
nBasicGroup,
nAromAtom,
nChargedGroup,
nPolarGroups,
nNonPolarGroups,
nAromaticGroups,
netCharge FROM [1267].[table_h2_fragment_qsar.csv] WHERE length >= 5 AND length <= 11



________________________________________


SELECT * FROM [1267].[h2_fragment_qsar_unique]


________________________________________


SELECT Count(*) FROM [1267].[table_APDHelix_qsar.csv]


________________________________________


SELECT sequence FROM [1267].[h2_fragment_qsar_unique] WHERE length > 4


________________________________________


SELECT sequence FROM [1267].[h2_fragment_qsar_unique] WHERE length > 4


________________________________________


SELECT res_type_sh, pdb_id FROM [1267].[h2_w_2.csv]


________________________________________


SELECT res_type_sh, pdb_id, res_index FROM [1267].[h2_w_2.csv]


________________________________________


SELECT res_type_sh, pdb_id as ID, res_index AS ind FROM [1267].[h2_w_2.csv] 


________________________________________


SELECT res_type_sh, pdb_id as ID, res_index AS ind FROM [1267].[h2_w_2.csv] AS R1


________________________________________


SELECT ind from (SELECT res_type_sh, pdb_id, res_index AS ind FROM [1267].[h2_w_2.csv]) AS R1


________________________________________


SELECT ind from (SELECT res_type_sh, pdb_id, res_index AS ind FROM [1267].[h2_w_2.csv] AS R0) AS R1


________________________________________


SELECT ind from (SELECT res_type_sh, pdb_id, res_index AS ind FROM [1267].[h2_w_2.csv]) AS R1


________________________________________


SELECT ind from (SELECT res_type_sh, pdb_id, res_index AS ind FROM [1267].[h2_w_2.csv] AS r0) AS r1


________________________________________


SELECT * from (SELECT res_type_sh, pdb_id, res_index AS ind FROM [1267].[h2_w_2.csv] AS r0) AS r1 


________________________________________


SELECT * from (SELECT res_type_sh AS res, pdb_id AS pdb, res_index AS idx FROM [1267].[h2_w_2.csv] AS r0) AS r1 


________________________________________


SELECT res_type_sh AS r0, pdb_id AS p0, res_index AS i0 FROM [1267].[h2_w_2.csv] AS t0 



________________________________________


SELECT res_type_sh AS r0, pdb_id AS p0, res_index AS i0 FROM [1267].[h2_w_2.csv] AS t0 



________________________________________


SELECT res_type_sh AS r0, pdb_id AS p0, res_index AS i0 FROM [1267].[h2_w_2.csv] AS t0


________________________________________


SELECT res_type_sh AS r0, pdb_id AS p0, res_index AS i0 FROM [1267].[h2_w_2.csv] WHERE res_type_sh='K'


________________________________________


SELECT res_type_sh AS r0, pdb_id AS p0, res_index AS i0 FROM [1267].[h2_w_2.csv] WHERE res_type_sh='K' 


________________________________________


SELECT res_type_sh AS r0, pdb_id AS p0, res_index AS i0 FROM [1267].[h2_w_2.csv] WHERE res_type_sh='K' 


________________________________________


SELECT res_type_sh AS r0, pdb_id AS p0, res_index AS i0 FROM [1267].[h2_w_2.csv] 


________________________________________


SELECT res_type_sh AS r0, pdb_id AS p0, res_index AS i0 FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K'


________________________________________


SELECT res_type_sh AS r0, pdb_id AS p0, res_index AS i0 FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K'  OR res_type_sh='F' 


________________________________________


SELECT res_type_sh, pdb_id, res_index FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K' OR res_type_sh='F' 


________________________________________


SELECT res_type_sh, pdb_id, res_index FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K' 


________________________________________


SELECT res_type_sh, pdb_id, res_index AS K FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K' 


________________________________________


SELECT res_type_sh, pdb_id, res_index AS K FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K';
SELECT res_type_sh, pdb_id, res_index AS R FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='R';



________________________________________


SELECT res_type_sh, pdb_id, res_index AS k FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K';
SELECT res_type_sh, pdb_id, res_index AS r FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='R';
SELECT * FROM k, r WHERE k.res_index = r.res_index-1;



________________________________________


SELECT res_type_sh, pdb_id, res_index AS k FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K';
SELECT res_type_sh, pdb_id, res_index AS r FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='R';
SELECT * FROM k, r WHERE k.res_index = r.res_index-1;



________________________________________



SELECT res_type_sh, pdb_id, res_index AS r FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='R';
SELECT res_type_sh, pdb_id, res_index AS k FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K';
SELECT * FROM k, r WHERE k.res_index = r.res_index-1;



________________________________________


SELECT res_type_sh, pdb_id, res_index AS f FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='F';
SELECT res_type_sh, pdb_id, res_index AS k FROM [1267].[h2_w_2.csv] WHERE res_type_sh ='K';
SELECT * FROM k, f WHERE k.res_index = f.res_index-1;



________________________________________


SELECT max(length) FROM [1267].[table_ADP_qsar.csv]


________________________________________


SELECT min(length) FROM [1267].[table_ADP_qsar.csv]


________________________________________


SELECT count(*) FROM [1267].[table_APDHelix_qsar.csv]


________________________________________


SELECT COUNT(*) FROM [1267].[table_ADP_qsar.csv] WHERE length >= 3


________________________________________


SELECT COUNT(*) FROM [1267].[table_APDHelix_qsar.csv] WHERE length >= 3


________________________________________


SELECT count(*) FROM [1267].[table_ADP_qsar.csv]


________________________________________


SELECT count(*) FROM [1267].[table_ADP_qsar.csv] WHERE length >= 3


________________________________________


SELECT count(*) FROM [1267].[table_ADP_qsar.csv] WHERE length > 3


________________________________________


SELECT sequence FROM [1267].[table_ADP_qsar.csv] WHERE length > 3


________________________________________


SELECT * FROM [1267].[table_ADP_qsar.csv] WHERE length > 3


________________________________________


SELECT * FROM [1267].[table_ADP_qsar.csv] WHERE length > 3


________________________________________


SELECT                                                                                                                                                                                                  
nNonPolarGroups,                                                                                                                                                                                             
nChargedGroup,                                                                                                                                                                                               
netCharge FROM [1267].[APDHelix_qsar.csv]


________________________________________


SELECT sequence,                                                                                                                                                                                               
nNonPolarGroups,                                                                                                                                                                                             
nChargedGroup,                                                                                                                                                                                               
netCharge FROM [1267].[APDHelix_qsar.csv]


________________________________________


SELECT sequence,                                                                                                                                                                                               
nNonPolarGroups,                                                                                                                                                                                             
nChargedGroup,                                                                                                                                                                                               
netCharge FROM [1267].[APD_qsar]


________________________________________


SELECT                                                                                                                                                                                             
nNonPolarGroups,                                                                                                                                                                                             
nChargedGroup,                                                                                                                                                                                               
sequence
netCharge FROM [1267].[APD_qsar]


________________________________________


SELECT                                                                                                                                                                                             
nNonPolarGroups,                                                                                                                                                                                             
nChargedGroup,                                                                                                                                                                                               
sequence
netCharge FROM [1267].[APD_qsar] WHERE sequence = 'DDDDDD';


________________________________________


SELECT                                                                                                                                                                                             
nNonPolarGroups,                                                                                                                                                                                             
nChargedGroup,                                                                                                                                                                                               
sequence,
netCharge FROM [1267].[APD_qsar] WHERE sequence = 'DDDDDD';


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] WHERE res_num > 100


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] WHERE GLU / res_num > 100


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] WHERE GLU / res_num > 100


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] WHERE GLU / res_num > 0.1


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] WHERE GLU / res_num > 0


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] WHERE Cast(GLU as float) / Cast(res_num as float) > 0


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] ORDER BY (Cast(GLU as float) / Cast(res_num as float))


________________________________________


SELECT * FROM [1267].[cph2_w_1.csv] ORDER BY (Cast(GLU as float) / Cast(res_num as float)) DESC
  


________________________________________


SELECT PHI,PSI  FROM [1267].[h2_w_2.csv]


________________________________________


SELECT one.pdb_id, one.res_type, two.res_type 
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   
  AND one.res_index = two.res_index + 1  AND one.res_type='A' AND two.res_type='A'


________________________________________


SELECT one.pdb_id, one.res_type, two.res_type 
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   
  AND one.res_index = two.res_index + 1  AND one.res_type='A' AND two.res_type='A'


________________________________________


SELECT one.pdb_id, one.res_type, two.res_type 
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   
  AND one.res_index = two.res_index + 1  AND one.res_type='ALA' AND two.res_type='ALA'


________________________________________


SELECT one.pdb_id, one.res_index, two.res_index, one.PHI, one.PSI
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   AND one.chain = two.chain   
  AND one.res_index = two.res_index + 1  AND one.res_type='ALA' AND two.res_type='ALA'


________________________________________


SELECT one.pdb_id, one.res_index, two.res_index, one.PHI, one.PSI
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   
  AND one.chain = two.chain   
  AND one.res_index = two.res_index + 1 
  AND one.res_type='ALA' 
  AND two.res_type='ALA'
  AND one.res_index < two.res_index


________________________________________


SELECT one.pdb_id, one.res_index, two.res_index, one.PHI, one.PSI
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   
  AND one.chain = two.chain   
  AND one.res_index = two.res_index + 1 
  AND one.res_type='ALA' 
  AND two.res_type='ALA'
  AND CAST(one.res_index as int) < CAST(two.res_index as int)


________________________________________


SELECT one.pdb_id, one.res_index, two.res_index, one.PHI, one.PSI
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   
  AND one.chain = two.chain   
  AND one.res_index = two.res_index + 1 
  AND one.res_type='ALA' 
  AND two.res_type='ALA'



________________________________________


SELECT one.pdb_id, one.res_index, two.res_index, one.PHI, one.PSI
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   
  AND one.chain = two.chain   
  AND one.res_index = two.res_index - 1 
  AND one.res_type='ALA' 
  AND two.res_type='ALA'



________________________________________


select * from [1267].[h2_w_2_alanine_dipeptide]



________________________________________


SELECT one.pdb_id, one.res_index, two.res_index, one.PHI, one.PSI
  FROM [1267].[h2_w_2.csv] one, [1267].[h2_w_2.csv] two 
  WHERE one.pdb_id = two.pdb_id   
  AND one.chain = two.chain   
  AND one.res_index = two.res_index - 1 



________________________________________


SELECT COUNT(*) FROM [1267].[table_ADP_qsar.csv]


________________________________________


SELECT * FROM [1267].[APD_GPos]


________________________________________


SELECT * FROM [823].[table_methylation_data.txt]


________________________________________


SELECT * FROM [823].[table_methylation_data.txt]


________________________________________


SELECT * FROM [823].[table_CDS_andmCG.txt]

INNER JOIN [823].[table_mRNA_andmCG.txt]

ON [823].[table_CDS_andmCG.txt].Column9=[823].[table_mRNA_andmCG.txt].Column9


________________________________________


SELECT * FROM [823].[Mod6_output.txt]
  Where num_mCG_mRNA > 10



________________________________________


SELECT * FROM [1123].[Gill_Done_2]
  



________________________________________


SELECT * FROM [1123].[Gill_Done_2]
  where cv>100
  



________________________________________


SELECT * FROM [1123].[Gill_Done_2]
  


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT * FROM [1123].[BiGill_methratio_v9_A.txt] bigill where context like '__CG_'


________________________________________


SELECT count (*)
  FROM [823].[BiGill_CG]


________________________________________


SELECT * FROM [823].[BiGill_CG] where CT_count >=5
  


________________________________________


select count (*) from (SELECT * FROM [823].[BiGill_CG] where CT_count >=5) x
  


________________________________________


SELECT * FROM [823].[BiGill_CG] where CT_count >=5
  


________________________________________


SELECT * ,cast (ratio as float) FROM [823].[CGbigill5x] c


________________________________________


SELECT * ,cast (ratio as float) FROM [823].[CGbigill5x]


________________________________________


SELECT * ,cast (ratio as float) FROM [823].[CGbigill5x]


________________________________________


SELECT * FROM [823].[CGbigill5x] where ratio = 'NA'


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute 
FROM [823].[CGbigill5x]


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 2 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute 
FROM [823].[CGbigill5x]


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute 
FROM [823].[CGbigill5x]


________________________________________


SELECT * FROM [823].[CGbigill5x_asgff]
  where score not like 'NA'


________________________________________


SELECT * FROM [823].[CGbigill5x_asgff]
  where score not like 'NA'



________________________________________


SELECT  
  chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute
  
  FROM [823].[CGbigill5x]
  where ratio not like 'NA'



________________________________________


SELECT 
  (CAST([score] AS FLOAT))
  FROM [823].[CGbigill5x_asgff]



________________________________________


SELECT
  Cast ([score] as float)
  FROM [823].[CGbigill5x_asgff]


________________________________________


SELECT * FROM [823].[CGbigill5x_asgff]
  where score ='NA'


________________________________________


SELECT * FROM [823].[CGbigill5x_asgff]
  where score like 'NA'



________________________________________


SELECT * FROM [823].[CGbigill5x_asgff]
  where score like '_'



________________________________________


SELECT * FROM [823].[CGbigill5x_asgff]
  where score like '__'



________________________________________


SELECT  
  chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,  
strand,  
'.' as frame,  
'.' as attribute
  
  
  FROM [823].[CGbigill5x]
  where ratio <> 'NA'



________________________________________


SELECT * FROM [823].[CGbigill5x_asgff]
  where score >= 0.25



________________________________________


SELECT * FROM [823].[CGbigill5x_asgff]
  WHERE score >= 0.25
  ORDER by score



________________________________________


SELECT 
  count (*) 
  FROM [823].[CGbigill5x_asgff]


________________________________________


SELECT 
  count (*) 
  FROM [823].[CGbigill5x_asgff]
  where score >=0.50


________________________________________


SELECT 
  count (*) 
  FROM [823].[CGbigill5x_asgff]
  where score >=0.5


________________________________________


SELECT 
  count (*) 
  FROM [823].[CGbigill5x_asgff]
  where score >=0.8


________________________________________


SELECT * 
  FROM [823].[CGbigill5x_asgff]
  WHERE score >= 0.250



________________________________________


SELECT * 
  FROM [823].[CGbigill5x_asgff]
  WHERE score >= 0.250
  ORDER BY score



________________________________________


SELECT * FROM [823].[CGbigill5x_gt25_gff]
  WHERE score >= 0.500
  ORDER BY score



________________________________________


SELECT * FROM [823].[CGbigill5x_gt50_gff]
  WHERE score >= 0.750
  ORDER BY score
  



________________________________________


SELECT AVG(score)
  FROM [823].[CGbigill5x_asgff]


________________________________________


SELECT STDEV(score)
  FROM [823].[CGbigill5x_asgff]


________________________________________


SELECT COUNT(*) 
  FROM [823].[CGbigill5x_gt75_gff]


________________________________________


SELECT count(*)
  FROM [823].[CGbigill5x_asgff]
  WHERE score <= 0.25



________________________________________


SELECT count(*)
  FROM [823].[CGbigill5x_asgff]
  WHERE score >= 0.75



________________________________________


SELECT 
  COUNT (*)
  FROM [823].[CGbigill5x_asgff]
  WHERE score = 0



________________________________________


SELECT * FROM 
  [823].[BiGill_methratio_TEonly_A.txt]
  where context like '__CG_' --_=single character wildcard


________________________________________


SELECT  
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [823].[CG_biGill_TEonly]
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5



________________________________________


SELECT  
  count (*) 
FROM [823].[CG_biGill_TEonly]
where 
context like '__CG_' --_=single character wildcard




________________________________________


SELECT eff_CT_count
  avg 
  FROM [823].[CG_biGill_TEonly]


________________________________________


SELECT * 
  FROM [823].[BiGill_methratio_TEonly_A.txt]
  where context like '__CA_'



________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[BiGill_methratio_v9_A.txt] 
where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,   
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[BiGill_methratio_v9_A.txt] 
where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


SELECT * FROM [823].[BiGill_methratio_v9_filtered_asgff]
  WHERE score >= 0.500
  ORDER BY score



________________________________________


SELECT  
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,  
strand,  
'.' as frame,  
'.' as attribute
FROM [1123].     
[BiGill_methratio_v9_A.txt] 

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'




________________________________________


SELECT  
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,  
strand,  
'.' as frame,  
'.' as attribute
FROM [1123].     
[BiGill_methratio_v9_A.txt] 

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'





________________________________________


SELECT  
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,  
strand,  
'butt' as frame,  
'.' as attribute
FROM [1123].     
[BiGill_methratio_v9_A.txt] 

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'





________________________________________


SELECT  
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,  
strand,  
'.' as frame,  
'.' as attribute
FROM [1123].     
[BiGill_methratio_v9_A.txt] 

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'





________________________________________


SELECT  
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,  
strand,  
'.' as frame,  
'.' as attribute
FROM [1123].     
[BiGill_methratio_v9_A.txt] 

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'
and cast(ratio as float) >= 0.500




________________________________________


SELECT  
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,  
strand,  
'.' as frame,  
'.' as attribute
FROM [1123].     
[BiGill_methratio_v9_A.txt] 

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'
and cast(ratio as float) >= 0.500
  order by score




________________________________________


SELECT count (*)
  FROM [823].[BiGill_methratio_v9_filtered_MethylatedOnly_asgff]
  where score >=0.750


________________________________________


SELECT count (*) FROM [823].[BiGill_methratio_v9_filtered_MethylatedOnly_asgff]


________________________________________


SELECT count(*)
  FROM [823].[BiGill_methratio_v9_filtered_asgff]


________________________________________


SELECT 
  
  SeqID as seqname  

  
  FROM [823].[qDOD_RepeatProteinMask_v9.txt]


________________________________________


SELECT 
  
  SeqID as seqname,  
Method as source,  
Type as feature


  
  FROM [823].[qDOD_RepeatProteinMask_v9.txt]


________________________________________


SELECT 
  
  SeqID as seqname,  
Method as source,  
Type as feature, 
Score as score,  
sym as strand,  
'.' as frame,  
'.' as attribute
  
  FROM [823].[qDOD_RepeatProteinMask_v9.txt]


________________________________________


SELECT 
  
  SeqID as seqname,  
Method as source,  
Type as feature, 
Score as score,
'Begin' as start,
'End' as [end],
Score as score,  
sym as strand,  
'.' as frame,  
'.' as attribute
  
  FROM [823].[qDOD_RepeatProteinMask_v9.txt]


________________________________________


SELECT 
  
  SeqID as seqname,  
Method as source,  
Type as feature, 
Score as score,

Score as score,  
sym as strand,  
'.' as frame,  
'.' as attribute
  
  FROM [823].[qDOD_RepeatProteinMask_v9.txt]


________________________________________


SELECT 
  
  SeqID as seqname,  
Method as source,  
Type as feature, 
[Begin] as [start],
[End] as [end],
Score as score,  
sym as strand,  
'.' as frame,  
'.' as attribute
  
  FROM [823].[qDOD_RepeatProteinMask_v9.txt]


________________________________________


SELECT 
  [ID] AS [geneID]
  FROM [823].[table_methylation_promoter.csv]


________________________________________


SELECT * 
  FROM [methylation_promoter_gill_v9]
  left join [ExpressedGeneStats_gill_v9]
  on [methylation_promoter_gill_v9].[ID]=[ExpressedGeneStats_gill_v9].[ID]



________________________________________


SELECT * 
  from [methylation_promoter_gill_v9]
  left join [ExpressedGeneStats_gill_v9]
  on [ExpressedGeneStats_gill_v9].[ID]=[methylation_promoter_gill_v9].[geneID] 



________________________________________


SELECT * 
  from [meth_pro_v9_0828]
  left join [ExpressedGeneStats_gill_v9]
  on [ExpressedGeneStats_gill_v9].[ID]=[meth_pro_v9_0828].[geneID]


________________________________________


SELECT [C_count], [CT_count], [C_count]/[CT_count] AS [freqC]
FROM [1123].[BiGill_methratio_v9_A.txt]


________________________________________


SELECT 
  chr as chr,
  [C_count], [CT_count], [C_count]/[CT_count] AS [freqC]
FROM [1123].[BiGill_methratio_v9_A.txt]


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  CT_count as coverage,
  [C_count], [CT_count], [C_count]/[CT_count] AS [freqC]
FROM [1123].[BiGill_methratio_v9_A.txt]


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  CT_count as coverage,
  [C_count], [CT_count], [C_count]/[CT_count] AS [freqC]

FROM [1123].[BiGill_methratio_v9_A.txt]


________________________________________


SELECT 
  chr as chr,
  start as start,
  '+' as strand,
  CT_count as coverage,
 freqC as freqC,
  1-[freqC] as [freqT]
FROM [823].[BiGill_v9_A_step1of2MethylKit]


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  CT_count as coverage,
  [C_count], [CT_count], [C_count]/[CT_count] AS [freqC]
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  CT_count as coverage,
  [C_count]/[CT_count] AS [freqC]
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  CT_count as coverage,
  C_count as C_count,
  [C_count]/[CT_count] AS [freqC]
  
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  CT_count as CT_count,
  C_count as C_count,
  [C_count]/[CT_count] AS [freqC]
  
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  CT_count as CT_count,
  C_count as C_count,
  cast([C_count]/[CT_count] as float) AS [freqC]
  
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
[C_count]/[CT_count] AS [freqC]
  
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast ([C_count]/[CT_count] as float) AS [freqC]
  
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________



  SELECT 
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
 C_count as C_count,
  C_count/CT_count as freqC
FROM [823].[1358]


________________________________________



  SELECT 
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
 C_count as C_count,
  freqC as freqC,
    1-freqC as freqT
FROM [823].[13582]


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  CT_count as coverage,
  [C_count], [CT_count], [C_count]/[CT_count] AS [freqC]

FROM [1123].[BiGill_methratio_v9_A.txt]


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  CT_count as coverage,
  [C_count], [CT_count], [C_count]/[CT_count] AS [freqC]

FROM [1123].[BiGill_methratio_v9_A.txt]


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count
FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'




________________________________________


  SELECT 
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
 C_count as C_count,
  C_count/CT_count as freqC
FROM [823].[1358_GO]


________________________________________


  SELECT 
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
  freqC as freqC,
    1-freqC as freqT
FROM [823].[13582]


________________________________________


  SELECT 
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
  freqC as freqC,
    1-freqC as freqT
    FROM [823].[13582_GO]


________________________________________


  SELECT 
  chr as chr,
  start as start,
  strand as strand,
    cast (CT_count as float) as coverage,
  freqC as freqC
FROM [823].[13582]


________________________________________


  SELECT 
  chr as chr,
  start as start,
  strand as strand,
    cast (CT_count as float) as coverage,
  freqC as freqC
FROM [823].[13582]


________________________________________


 SELECT 
  chr as chr,
  start as start,
  strand as strand,
   cast (CT_count as float) as coverage,
  freqC as freqC
  FROM [823].[MethylKit_BiGO]


________________________________________


SELECT * FROM [823].[diffmeth_gillVgonad_v9]
  where ["id"]='C10137.13'



________________________________________


SELECT * FROM [823].[gonad_methylkit_floated]
  where [chr]='C10137'




________________________________________


SELECT * FROM [823].[BiGill_v9_A_MethylKit_floated]
   where [chr]='C10137'


________________________________________


SELECT * 
  from [cnt_hyperingill.txt]
  left join [ExpressedGeneStats_gill_v9]
  on [ExpressedGeneStats_gill_v9].[ID]=[cnt_hyperingill.txt].[ID]



________________________________________


SELECT * 
  from [methylation_countOFdiffmeth_hyperingill]
  left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[methylation_countOFdiffmeth_hyperingill].[ID]


________________________________________


SELECT * FROM [823].[diffmeth_gillVgonad_v9]
  where ["meth.diff"]=0
  and ["qvalue"] <0.01



________________________________________


SELECT * FROM [823].[arrayRegions_CDS.txt] 
  left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[arrayRegions_CDS.txt].[Column9]


________________________________________


SELECT * FROM [823].[arrayRegions_CDS.txt] 
  left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[arrayRegions_CDS.txt].[Column9]


________________________________________


SELECT * FROM [823].[arrayRegions_mRNA.txt] 
  left join [1123].[TJGR_Gene_SPID_evalue_GO_bigfile]
  on [1123].[TJGR_Gene_SPID_evalue_GO_bigfile].[Column1]=[arrayRegions_mRNA.txt].[Column9]


________________________________________


SELECT * FROM [823].[arrayRegions_mRNA.txt] 
  left join [1123].[TJGR_Gene_SPID_evalue_GO_bigfile]
  on [1123].[TJGR_Gene_SPID_evalue_GO_bigfile].[Column1]=[arrayRegions_mRNA.txt].[Column9]


________________________________________


SELECT * FROM [823].[genesID_DAVIDenrichment_mRNA.txt]
left join [1123].[SPID and GO Numbers]
  on [1123].[SPID and GO Numbers].[SPID]=[genesID_DAVIDenrichment_mRNA.txt].[SP_ACCESSION]




________________________________________


SELECT * FROM [823].[GenesOnArray.csv] left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[TJGR_Gene_SPID_evalue_Description.txt].[Column1]


________________________________________


SELECT * FROM [823].[GenesOnArray.csv] left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[TJGR_Gene_SPID_evalue_Description.txt].[Column1]


________________________________________


SELECT * FROM [823].[GenesOnArray.csv] left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[TJGR_Gene_SPID_evalue_Description.txt].[Column1]


________________________________________


SELECT * FROM [823].[GenesOnArray.csv] left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[TJGR_Gene_SPID_evalue_Description.txt].[Column1]


________________________________________


SELECT * FROM [823].[GenesOnArray.csv] 
  left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[GenesOnArray.csv].[Column1]


________________________________________


SELECT * FROM [823].[GenesOnArray.csv] 
  left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[GenesOnArray.csv].[Column1]


________________________________________


SELECT * FROM [823].[GeneID_ProbesOnArray.txt]
  left join [TJGR_Gene_SPID_evalue_Description.txt]
  on [TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[GeneID_ProbesOnArray.txt].[Column1]


________________________________________


SELECT * FROM [823].[allgenestats.txt]
  left join [BiGill_RNAseq_gene.txt]
  on [BiGill_RNAseq_gene.txt].["Feature ID"]=[allgenestats.txt].[ID]



________________________________________


SELECT * FROM [823].[allgenestats_BiGill_RNAseq_gene]
  left join [table_CG_C_G_oysterv9_mRNA.txt]
  on [table_CG_C_G_oysterv9_mRNA.txt].[CGI]=[allgenestats_BiGill_RNAseq_gene].[ID]


________________________________________


SELECT 
   Column1,
  len(Column2)- len(REPLACE(Column2, 'C', '')) as Ccount,
  len(Column2)- len(REPLACE(Column2, 'G', '')) as Gcount,
  (len(Column2)- len(REPLACE(Column2, 'G', ''))) + (len(Column2)- len(REPLACE(Column2, 'C', ''))) as C_Gcount,
  len(Column2)- len(REPLACE(Column2, 'CG', ' ')) as CpGcount,
  len(Column2) as Column2_len,
 Column2
  FROM [823].[TJGR_genomic_genes_fastatabular.txt]


________________________________________


SELECT * FROM [823].[allgenestats_BiGill_RNAseq_gene]
    left join [table_TGRJ_genomic_gene_CGstats.csv]
  on [table_TGRJ_genomic_gene_CGstats.csv].[Column1]=[allgenestats_BiGill_RNAseq_gene].[ID]


________________________________________


SELECT * FROM [823].[TJGR_genomic_genes_fastatabular.txt]
  where Column2 like 'N'


________________________________________


SELECT 
   Column1,
  len(Column2)- len(REPLACE(Column2, 'N', '')) as Ncount
  FROM [823].[TJGR_genomic_genes_fastatabular.txt]
  


________________________________________


SELECT 
  
chr as seqname,
pos as [start], 
pos + 1 as [end], 
'CpG' as feature, 
cast(ratio as float) as score 
FROM [1123].[clean_BiGill_methratio_v9_A]
  where
 context like '__CG_'



________________________________________


SELECT 
  
chr as [Column1],
pos as [Column2], 
pos + 1 as [Column3], 
'CpG' as [Column4], 
cast(ratio as float) as [Column5] 
FROM [1123].[clean_BiGill_methratio_v9_A]
  where
 context like '__CG_'



________________________________________


SELECT 
  
chr as [Column1],
pos as [Column2], 
pos + 1 as [Column3], 
'CpG' as [Column4], 
cast(ratio as float) as [Column5] 
FROM [1123].[clean_BiGill_methratio_v9_A]
  where
 context like '__CG_'
  and
 CT_Count >= 5


________________________________________


SELECT 
  
chr as [Column1],
pos as [Column2], 
pos + 1 as [Column3], 
'CpG' as [Column4], 
cast(ratio as float) as [Column5] 
FROM [1123].[clean_BiGill_methratio_v9_A]
  where
 context like '__CG_'
  and
 CT_Count >= 5


________________________________________


SELECT 
  
chr as [Column1],
pos as [Column2], 
pos + 1 as [Column3], 
'CpG' as [Column4], 
cast(ratio as float) as [Column5] 
FROM [1123].[clean_BiGill_methratio_v9_A]
  where
 context like '__CG_'
  and
 CT_Count >= 5


________________________________________


SELECT 
  
chr as [Column1],
pos as [Column2], 
pos + 1 as [Column3], 
'CpG' as [Column4], 
cast(ratio as float) as [Column5] 
FROM [1123].[clean_BiGill_methratio_v9_A]
  where
 context like '__CG_'
  and
 CT_Count >= 5


________________________________________


SELECT   
chr as [Column1],
pos as [Column2], 
pos + 1 as [Column3], 
'CpG' as [Column4], 
cast(ratio as float) as [Column5] 
FROM [1123].[clean_BiGill_methratio_v9_A]
  where
 context like '__CG_'

and CT_Count >= 5





________________________________________


SELECT * FROM [823].[allgenestats.txt] 
  left join [BiGill_RNAseq_gene_v4_cut.txt]
  on [BiGill_RNAseq_gene_v4_cut.txt].[Feature ID]=[allgenestats.txt].[ID]



________________________________________


SELECT * FROM [823].[intersectGene_hypo.txt]
  left join [1123].[TJGR_Gene_SPID_evalue_GO_bigfile]
  on [1123].[TJGR_Gene_SPID_evalue_GO_bigfile].[Column1]=[intersectGene_hypo.txt].[Column9]


________________________________________


SELECT * FROM [823].[uniqueSPIDs_fromDAVIDEnrichmentoutput.txt]


________________________________________


SELECT * FROM [823].[uniqueSPIDs_fromDAVIDEnrichmentoutput.txt]
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  on [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)].[SPID]=[uniqueSPIDs_fromDAVIDEnrichmentoutput.txt].[Column1]


________________________________________


SELECT * FROM [1123].[clean_BiGill_methratio_v9_A]
  where context like '__CG_'



________________________________________


SELECT * FROM [1123].[clean_BiGill_methratio_v9_A]
  where context like '__CG_'
  and chr like 'scaffold1'
  



________________________________________


SELECT * FROM [823].[hyperarray_CG.txt]
    left join [823].[table_hyperarray_CG.txt]
  on [823].[table_hyperarray_CG.txt].[Column1]=[hyperarray_CG.txt].[Column1]


________________________________________


SELECT * FROM [823].[hyperarray_mRNA.txt]
  left join [823].[table_hyperarray_CG.txt]
  on [823].[table_hyperarray_CG.txt].[Column1]=[hyperarray_mRNA.txt].[Column1]


________________________________________


SELECT * FROM [823].[hyper_CG_mRNA_combined]
  left join [823].[table_TJGR_Gene_SPID_evalue_Description.txt]
  on [823].[table_TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[hyper_CG_mRNA_combined].[Column13]


________________________________________


SELECT * FROM [823].[DMRmgavery_mRNA_1.txt]
    left join [823].[table_TJGR_Gene_SPID_evalue_Description.txt]
  on [823].[table_TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[DMRmgavery_mRNA_1.txt].[Column15]


________________________________________


SELECT * FROM [823].[2013.11.22.mgaveryDMRs_visannotated_1.csv]
  left join [CGI_stats.txt]
  on [CGI_stats.txt].[ID]=[2013.11.22.mgaveryDMRs_visannotated_1.csv].[gene_ID]


________________________________________


SELECT * FROM [823].[2013.11.22.mgaveryDMRs_visannotated_1.csv]
  left join [CGI_stats.txt]
  on [CGI_stats.txt].[ID]=[2013.11.22.mgaveryDMRs_visannotated_1.csv].[gene_ID]


________________________________________


SELECT * FROM [823].[arrayDMRvisannotated_CGIgenestats]
  left join [table_TJGR_Gene_SPID_evalue_Description.txt]
  on [table_TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[arrayDMRvisannotated_CGIgenestats].[gene_ID]


________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [PSSM-ID]=236140
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [CD accession] like 'cd05047'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [CD accession] like 'cd05047'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [CD accession] like 'cd05047'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [CD accession] like 'cd05047'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [CD accession] like 'cd05047'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [PSSM-ID] like '236140'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [PSSM-ID] like '236140'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [PSSM-ID] like '88330'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [PSSM-ID] like '236140'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [PSSM-ID] like '221770'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [PSSM-ID] like '233829'
  
  
  



________________________________________


SELECT * FROM [412].[cddannot.txt]
  where [PSSM-ID] like '221770'
  
  
  



________________________________________


SELECT * FROM [823].[CGI_DMR.txt]
  left join [823].[table_TJGR_genomic_genes_fastatabular.txt]
on [823].[table_TJGR_genomic_genes_fastatabular.txt].Column1=[823].[CGI_DMR.txt].gene_ID


________________________________________


SELECT 
  Column1
  Column2
  
  FROM [823].[MG_DMRgenes_031114]


________________________________________


SELECT 
  Column1,
  Column2
  
  FROM [823].[MG_DMRgenes_031114]


________________________________________


SELECT * FROM [823].[CGI_DMR.txt]
  left join [1123].[qDOD_Cgigas_GO_GOslim]
  on [823].[CGI_DMR.txt].[gene_ID]=[1123].[qDOD_Cgigas_GO_GOslim].[CGI_ID]



________________________________________


SELECT * FROM [823].[GenesOnArray_SPIDs_only_1.csv]
    left join [823].[table_TJGR_Gene_SPID_evalue_Description.txt]
  on [823].[table_TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[GenesOnArray_SPIDs_only_1.csv].[Column1]


________________________________________


SELECT * FROM [823].[GenesOnArray_SPIDs_only_1.csv]
    left join [823].[TJGR_Gene_SPID_evalue_Description.txt]
  on [823].[TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[GenesOnArray_SPIDs_only_1.csv].[Column1]


________________________________________


SELECT * FROM [823].[GenesOnArray_SPIDs_only_1.csv]
    left join [823].[table_TJGR_Gene_SPID_evalue_Description.txt]
  on [823].[table_TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[GenesOnArray_SPIDs_only_1.csv].[Column1]


________________________________________


SELECT * FROM [823].[DMRoverlapWithGenes.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMRoverlapWithGenes.txt].[Column19]=[823].[all.swiss.out.tab].[Sequence]


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]



________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]



________________________________________


SELECT * FROM [823].[table_DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[table_DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]



________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]
  


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]
  


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[RADTag]=[823].[all.swiss.out.tab].[Sequence]
  


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]
  


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]
  


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]
  


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[ScaffoldID]=[823].[all.swiss.out.tab].[Sequence]
  


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]
  


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.txt]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.txt].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]
  


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.csv]
   left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.csv].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.csv]
   left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.csv].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.csv]
   left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.csv].[RADTag]=[823].[all.swiss.out.tab].[Sequence]


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.csv]
   left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.csv].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.csv]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.csv].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.csv]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.csv].[ScaffoldID]=[823].[all.swiss.out.tab].[Sequence]


________________________________________


SELECT * FROM [823].[DMR_Sp_geneID.csv]
  left join [823].[all.swiss.out.tab]
  on [823].[DMR_Sp_geneID.csv].[TranscriptID]=[823].[all.swiss.out.tab].[Sequence]


________________________________________


SELECT * FROM [412].[table_library reads mapped to isotigs.txt]
INNER JOIN [412].[table_isotig blastn sigenae v8.txt]
ON [412].[table_library reads mapped to isotigs.txt].[Feature ID]=[412].[table_isotig blastn sigenae v8.txt].Contig


________________________________________


SELECT * FROM [412].[isotig reads joined to sigenae contigs]
INNER JOIN [412].[table_sigenae blastp.txt]
ON [412].[isotig reads joined to sigenae contigs].Accession=[412].[table_sigenae blastp.txt].Protein


________________________________________


SELECT * FROM [412].[isotig reads with SPID]
INNER JOIN [354].[SPID_GOnumber.txt]
ON [412].[isotig reads with SPID].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[isotig reads with SPID]
INNER JOIN [354].[SPID_GOnumber.txt]
ON [412].[isotig reads with SPID].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[isotig reads with SPID]
INNER JOIN [354].[SPID_GOnumber.txt]
ON [412].[isotig reads with SPID].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[isotig with GO Annotation]
INNER JOIN [1123].[GO_to_GOslim]
ON [412].[isotig with GO Annotation].[GO:0003824]=[1123].[GO_to_GOslim].GO_id


________________________________________


SELECT * FROM [412].[table_proteomics all spec counts.txt]
INNER JOIN [412].[table_Cg proteome db evalue -10.txt]
ON [412].[table_proteomics all spec counts.txt].protein=[412].[table_Cg proteome db evalue -10.txt].Protein


________________________________________


SELECT * FROM [412].[proteome spec counts joined to SPID blastx]
INNER JOIN [354].[SPID_GOnumber.txt]
ON [412].[proteome spec counts joined to SPID blastx].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[proteome with GO annotation]
INNER JOIN [1123].[GO_to_GOslim]
ON [412].[proteome with GO annotation].[GO:0003824]=[1123].[GO_to_GOslim].GO_id


________________________________________


SELECT * FROM [412].[table_no low abundance sig loadings.csv]
INNER JOIN [412].[table_proteomics all spec counts.txt]
ON [412].[table_no low abundance sig loadings.csv].protein=[412].[table_proteomics all spec counts.txt].protein


________________________________________


SELECT * FROM [412].[table_DESeq results for module 4.csv]
INNER JOIN [412].[table_blastx results module 4.txt]
ON [412].[table_DESeq results for module 4.csv].id=[412].[table_blastx results module 4.txt].Contig


________________________________________


SELECT * FROM [412].[table_no low abundance sig loadings.csv]
INNER JOIN [412].[table_Cg proteome db evalue -10.txt]
ON [412].[table_no low abundance sig loadings.csv].protein=[412].[table_Cg proteome db evalue -10.txt].Protein


________________________________________


SELECT * FROM [412].[table_NMDS no low abundance proteins enriched loadings.csv]
INNER JOIN [1123].[GO_to_GOslim]
ON [412].[table_NMDS no low abundance proteins enriched loadings.csv].[GO Number]=[1123].[GO_to_GOslim].[GO_id]


________________________________________


SELECT * FROM [412].[table_lowco2 spec counts background.txt]
INNER JOIN [412].[table_Cg proteome db evalue -10.txt]
ON [412].[table_lowco2 spec counts background.txt].protein=[412].[table_Cg proteome db evalue -10.txt].Protein


________________________________________


SELECT * FROM [412].[table_eigen loadings lowpCO2 MS.txt]
INNER JOIN [412].[table_Cg proteome db evalue -10.txt]
ON [412].[table_eigen loadings lowpCO2 MS.txt].Protein=[412].[table_Cg proteome db evalue -10.txt].Protein


________________________________________


SELECT * FROM [412].[table_eigen loadings highpCO2 MS.txt]
INNER JOIN [412].[table_Cg proteome db evalue -10.txt]
ON [412].[table_eigen loadings highpCO2 MS.txt].Protein=[412].[table_Cg proteome db evalue -10.txt].Protein


________________________________________


SELECT * FROM [412].[table_enriched from MS.txt]
INNER JOIN [1123].[GO_to_GOslim]
ON [412].[table_enriched from MS.txt].Term=[1123].[GO_to_GOslim].[GO_id]


________________________________________


SELECT * FROM [412].[table_DEG contig list.txt]
INNER JOIN [412].[table_total reads module 4.csv]
ON [412].[table_DEG contig list.txt].[DEG Contig]=[412].[table_total reads module 4.csv].[FeatureID]


________________________________________


SELECT * FROM [412].[table_DEG with SPID.txt]
INNER JOIN [354].[SPID_GOnumber.txt]
ON [412].[table_DEG with SPID.txt].[SPID]=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[DEG with GO]
INNER JOIN [1123].[GO_to_GOslim]
ON [412].[DEG with GO].[GO:0003824]=[1123].[GO_to_GOslim].[GO_id]


________________________________________


SELECT * FROM [412].[table_average areas for lowpCO2 and MS.csv]
INNER JOIN [412].[table_average areas for highpCO2MS.csv]
ON [412].[table_average areas for lowpCO2 and MS.csv].ProtPep=[412].[table_average areas for highpCO2MS.csv].ProtPep


________________________________________


SELECT * FROM [412].[skyline joining 1]
INNER JOIN [412].[table_average areas for highpCO2.csv]
ON [412].[skyline joining 1].ProtPep=[412].[table_average areas for highpCO2.csv].ProtPep


________________________________________


SELECT * FROM [412].[table_loadings from skyline nmds.txt]
INNER JOIN [412].[table_Cg proteome db evalue -10.txt]
ON [412].[table_loadings from skyline nmds.txt].Protein=[412].[table_Cg proteome db evalue -10.txt].Protein


________________________________________


SELECT * FROM [412].[table_loadings from skyline nmds.txt]

INNER JOIN [412].[table_Cg proteome db evalue -10.txt]

ON [412].[table_loadings from skyline nmds.txt].Protein=[412].[table_Cg proteome db evalue -10.txt].Protein


________________________________________


SELECT * FROM [412].[table_loadings from skyline nmds.txt]
INNER JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
ON [412].[table_loadings from skyline nmds.txt].Protein=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[table_Annotated ProtPep.txt]
INNER JOIN [412].[Skyline average peptide areas]
ON [412].[table_Annotated ProtPep.txt].[Prot_Pep]=[412].[Skyline average peptide areas].[ProtPep]


________________________________________


SELECT * FROM [412].[table_All_CGs_MethylatedCG]
INNER JOIN [412].[table_All_CGs_NonMethCG]
ON [412].[table_All_CGs_MethylatedCG].Column9=[412].[table_All_CGs_NonMethCG].Column9


________________________________________


SELECT * FROM [412].[Methylated and Nonmethylated CGs]
INNER JOIN [412].[table_CG_Exons]
ON [412].[Methylated and Nonmethylated CGs].Column9=[412].[table_CG_Exons].Column9


________________________________________


SELECT * FROM [412].[skyline joining 1]
INNER JOIN [412].[table_average areas for highpCO2.csv]
ON [412].[skyline joining 1].ProtPep=[412].[table_average areas for highpCO2.csv].ProtPep


________________________________________


SELECT * FROM [412].[table_RPKM all oysters.csv]
INNER JOIN [412].[table_isotig blastn sigenae v8.txt]
ON [412].[table_RPKM all oysters.csv].[Feature ID]=[412].[table_isotig blastn sigenae v8.txt].Contig


________________________________________


SELECT * FROM [412].[isotig expression with sigenae]
INNER JOIN [412].[table_sigenae blastp.txt]
ON [412].[isotig expression with sigenae].Accession=[412].[table_sigenae blastp.txt].Protein


________________________________________


Select Protein, sum(Low1), sum(Low2), sum(Low3), sum(Low4), sum(LowMS1), sum(LowMS2), sum(LowMS3), sum(LowMS4), sum(HighMS1), sum(HighMS2), sum(HighMS3), sum(HighMS4), sum(High1), sum(High2), sum(High3), sum(High4) FROM [412].[table_Skyline peptide areas for sql.txt]
Group by Protein


________________________________________


SELECT * FROM [412].[table_Workbook2.txt]
INNER JOIN [412].[table_Cg proteome db evalue -10.txt]
ON [412].[table_Workbook2.txt].ProteinID=[412].[table_Cg proteome db evalue -10.txt].Protein


________________________________________


SELECT * FROM [412].[table_Workbook2.txt]
INNER JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
ON [412].[table_Workbook2.txt].ProteinID=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[meth CGs nonmeth CGs exons]
INNER JOIN [412].[table_allCGs_joined_to_mRNA]
ON [412].[meth CGs nonmeth CGs exons].Column9=[412].[table_allCGs_joined_to_mRNA].Column9


________________________________________


SELECT * FROM [412].[meth CGs nonmeth CGs exons]
INNER JOIN [412].[table_allCGs_joined_to_mRNA]
ON [412].[meth CGs nonmeth CGs exons].Column9=[412].[table_allCGs_joined_to_mRNA].Column9


________________________________________


SELECT * FROM [412].[table_NMDS peptide sig loadings.txt]
INNER JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
ON [412].[table_NMDS peptide sig loadings.txt].Protein=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[NMDS peptide sig loadings with SPID]
INNER JOIN [354].[SPID_GOnumber.txt]
ON [412].[NMDS peptide sig loadings with SPID].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[table_Peptides responsible for MS response.txt]
INNER JOIN [412].[table_lowMS sig loadings with SPID.txt]
ON [412].[table_Peptides responsible for MS response.txt].[Prot_Pep]=[412].[table_lowMS sig loadings with SPID.txt].[Prot_Pep]


________________________________________


SELECT * FROM [412].[Significant MS loadings with Low pCO2]
INNER JOIN [412].[table_highMS sig loadings with SPID.txt]
ON [412].[Significant MS loadings with Low pCO2].[Prot_Pep]=[412].[table_highMS sig loadings with SPID.txt].[Prot_Pep]


________________________________________


SELECT * FROM [412].[table_Peptides responsible for MS response.txt]
FULL JOIN [412].[table_lowMS sig loadings with SPID.txt]
ON [412].[table_Peptides responsible for MS response.txt].[Prot_Pep]=[412].[table_lowMS sig loadings with SPID.txt].[Prot_Pep]


________________________________________


SELECT * FROM [412].[Sig peptides for MS NMDS]
FULL JOIN [412].[table_highMS sig loadings with SPID.txt]
ON [412].[Sig peptides for MS NMDS].[Prot_Pep]=[412].[table_highMS sig loadings with SPID.txt].[Prot_Pep]


________________________________________


SELECT * FROM [412].[table_Proteins unique to low or high MS repsonse.txt]
FULL JOIN [354].[SPID_GOnumber.txt]
ON [412].[table_Proteins unique to low or high MS repsonse.txt].Protein=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[table_Proteins unique to low or high MS repsonse.txt]
INNER JOIN [354].[SPID_GOnumber.txt]
ON [412].[table_Proteins unique to low or high MS repsonse.txt].Protein=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[table_Proteins unique to low or high MS repsonse.txt]
INNER JOIN [354].[SPID_GOnumber.txt]
ON [412].[table_Proteins unique to low or high MS repsonse.txt].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[Proteins for MS response with GO]
INNER JOIN [1123].[GO_to_GOslim]
ON [412].[Proteins for MS response with GO].[GO:0003824]=[1123].[GO_to_GOslim].[GO_id]


________________________________________


SELECT * FROM [412].[table_1341gen_blastx.txt]
INNER JOIN [354].[SPID_GOnumber.txt]
ON  [412].[table_1341gen_blastx.txt].Column3=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[1341genomics with GO]
INNER JOIN [1123].[GO_to_GOslim]
ON [412].[1341genomics with GO].[GO:0003824]=[1123].[GO_to_GOslim].[GO_id]


________________________________________


Select [GO:0003824], count(Column1) FROM [412].[1341genomics with GO]
Group by [GO:0003824]


________________________________________


Select term, count(Column1) FROM [412].[1341genomics GO Slim]
Group by term


________________________________________


Select [GOSlim_bin], count(Column1) FROM [412].[1341genomics GO Slim]
Group by [GOSlim_bin]


________________________________________


SELECT * FROM [412].[table_proteins unique to highMS response.txt]
INNER JOIN [412].[table_Skyline peptide areas for sql.txt]
ON [412].[table_proteins unique to highMS response.txt].Column1=[412].[table_Skyline peptide areas for sql.txt].Protein


________________________________________


Select [ProtPep], sum(11), sum(2), sum(5), sum(8) FROM [412].[table_skyline high pco2 for sql.txt]
Group by ProtPep


________________________________________


Select Protein, avg(Low1), avg(Low2), avg(Low3), avg(Low4) FROM [412].[table_Skyline peptide areas for sql.txt]
Group by Protein


________________________________________


Select ProtPep, avg(oyster11), avg(oyster2), avg(oyster5), avg(oyster8) FROM [412].[table_skyline high pco2 for sql.txt]
Group by ProtPep


________________________________________


SELECT * FROM [412].[table_101B2_01_skyline.txt]
INNER JOIN [412].[table_101B2_01_speccounts.txt]
ON [412].[table_101B2_01_skyline.txt].[Prot-Pep]=[412].[table_101B2_01_speccounts.txt].ProtPep


________________________________________


SELECT * FROM [412].[table_101B26_02_skyline.txt]
INNER JOIN [412].[table_101B26_02_speccounts.txt]
ON [412].[table_101B26_02_skyline.txt].[Prot-Pep]=[412].[table_101B26_02_speccounts.txt].ProtPep


________________________________________


SELECT [412].[table_peptide IDs for low and high pco2.txt].Column1, [412].[table_101B2_01_speccounts.txt].ProtPep, [412].[table_101B2_02_speccounts.txt].ProtPep, [412].[table_101B2_03_speccounts.txt].ProtPep
FROM [412].[table_peptide IDs for low and high pco2.txt], [412].[table_101B2_01_speccounts.txt], [412].[table_101B2_02_speccounts.txt], [412].[table_101B2_03_speccounts.txt]



________________________________________


SELECT [table_peptide IDs for low and high pco2.txt].*,[table_101B2_01_speccounts.txt].*,[table_101B2_02_speccounts.txt].*
FROM [table_peptide IDs for low and high pco2.txt]
LEFT JOIN [table_101B2_01_speccounts.txt]
ON [table_101B2_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B2_02_speccounts.txt]
ON [table_101B2_02_speccounts.txt].ProtPep=[table_101B2_01_speccounts.txt].ProtPep


________________________________________


SELECT [table_peptide IDs for low and high pco2.txt].*,[table_101B2_01_speccounts.txt].*,[table_101B2_02_speccounts.txt].*
FROM [table_peptide IDs for low and high pco2.txt]
LEFT JOIN [table_101B2_01_speccounts.txt]
ON [table_101B2_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B2_02_speccounts.txt]
ON [table_101B2_02_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1


________________________________________


SELECT ProteinName + '_' + PeptideSequence
  FROM [412].[table_skyline unique pep prot low pco2.txt]


________________________________________


SELECT ProtPep, avg(221), avg(224), avg(227), avg(23) FROM [412].[table_skyline unique pep prot low pco2.txt]
Group by ProtPep


________________________________________


SELECT ProtPep, avg(221), avg(224), avg(227), avg(23) FROM [412].[table_skyline unique pep prot low pco2.txt]
Group by ProtPep


________________________________________


SELECT ProtPep, avg(oyster221), avg(oyster224), avg(oyster227), avg(oyster230) FROM [412].[table_skyline unique pep prot low pco2.txt]
Group by ProtPep


________________________________________


SELECT [table_peptide IDs for low and high pco2.txt].*,[table_101B2_01_speccounts.txt].*,[table_101B2_02_speccounts.txt].*, [table_101B2_03_speccounts.txt].*, [table_101B5_01_speccounts.txt].*, [table_101B5_02_speccounts.txt].*, [table_101B5_03_speccounts.txt].*, [table_101B8_01_speccounts.txt].*, [table_101B8_02_speccounts.txt].*, [table_101B8_03_speccounts.txt].*, [table_101B11_01_speccounts.txt].*, [table_101B11_02_speccounts.txt].*, [table_101B11_03_speccounts.txt].*, [table_103B221_01_speccounts.txt].*, [table_103B221_02_speccounts.txt].*, [table_103B221_03_speccounts.txt].*, [table_103B224_01_speccounts.txt].*, [table_103B224_02_speccounts.txt].*, [table_103B224_03_speccounts.txt].*, [table_103B227_01_speccounts.txt].*, [table_103B227_02_speccounts.txt].*, [table_103B227_03_speccounts.txt].*, [table_103B230_01_speccounts.txt].*, [table_103B230_02_speccounts.txt].*, [table_103B230_03_speccounts.txt].*
FROM [table_peptide IDs for low and high pco2.txt]
LEFT JOIN [table_101B2_01_speccounts.txt]
ON [table_101B2_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B2_02_speccounts.txt]
ON [table_101B2_02_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B2_03_speccounts.txt]
ON [table_101B2_03_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B5_01_speccounts.txt]
ON [table_101B5_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B5_02_speccounts.txt]
ON [table_101B5_02_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B5_03_speccounts.txt]
ON [table_101B5_03_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B8_01_speccounts.txt]
ON [table_101B8_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B8_02_speccounts.txt]
ON [table_101B8_02_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B8_03_speccounts.txt]
ON [table_101B8_03_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B11_01_speccounts.txt]
ON [table_101B11_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B11_02_speccounts.txt]
ON [table_101B11_02_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_101B11_03_speccounts.txt]
ON [table_101B11_03_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B221_01_speccounts.txt]
ON [table_103B221_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B221_02_speccounts.txt]
ON [table_103B221_02_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B221_03_speccounts.txt]
ON [table_103B221_03_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B224_01_speccounts.txt]
ON [table_103B224_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B224_02_speccounts.txt]
ON [table_103B224_02_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B224_03_speccounts.txt]
ON [table_103B224_03_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B227_01_speccounts.txt]
ON [table_103B227_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B227_02_speccounts.txt]
ON [table_103B227_02_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B227_03_speccounts.txt]
ON [table_103B227_03_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B230_01_speccounts.txt]
ON [table_103B230_01_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B230_02_speccounts.txt]
ON [table_103B230_02_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1
LEFT JOIN [table_103B230_03_speccounts.txt]
ON [table_103B230_03_speccounts.txt].ProtPep=[table_peptide IDs for low and high pco2.txt].Column1


________________________________________


SELECT * FROM [table_high pco2 for ipath.txt]
INNER JOIN [table_Cgigas_proteomev9_kegg_match]
ON [table_high pco2 for ipath.txt].Protein=[table_Cgigas_proteomev9_kegg_match].Column1


________________________________________


SELECT * FROM [table_high pco2 for ipath.txt]
LEFT JOIN [table_Cgigas_proteomev9_kegg_match]
ON [table_high pco2 for ipath.txt].Protein=[table_Cgigas_proteomev9_kegg_match].Column1


________________________________________


SELECT * FROM [table_low pco2 for ipath.txt]
LEFT JOIN [table_Cgigas_proteomev9_kegg_match]
ON [table_low pco2 for ipath.txt].Protein=[table_Cgigas_proteomev9_kegg_match].Column1


________________________________________


SELECT * FROM [table_high pco2 avg exp.txt]
LEFT JOIN [table_low pco2 avg exp.txt]
ON [table_high pco2 avg exp.txt].Peptide=[table_low pco2 avg exp.txt].Peptide


________________________________________


SELECT * FROM [table_low pco2 avg exp.txt]
LEFT JOIN [table_high pco2 avg exp.txt]
ON [table_low pco2 avg exp.txt].Peptide=[table_high pco2 avg exp.txt].Peptide


________________________________________


SELECT Protein, avg(AvgExpHigh), avg(AvgExpLow) FROM [412].[table_Combined pCO2 avg exp.txt]
Group by Protein


________________________________________


SELECT * FROM [Skyline high and low pCO2 avgd by protein]
LEFT JOIN [table_Combined pCO2 avg exp with Kegg.txt]
ON[Skyline high and low pCO2 avgd by protein].Protein=[table_Combined pCO2 avg exp with Kegg.txt].Protein



________________________________________


SELECT * FROM [Skyline high and low pCO2 avgd by protein]
LEFT JOIN [Cg proteome db evalue -10.txt]
ON [Skyline high and low pCO2 avgd by protein].Protein=[Cg proteome db evalue -10.txt].Protein


________________________________________


select object_name(major_id) as object,
 1385_name(grantee_principal_id) as grantee,
 1385_name(grantor_principal_id) as grantor,
 permission_name,
 state_desc
from sys.database_permissions
 where major_id = object_id('Users')
 and class = 1


________________________________________


select object_name(major_id) as object,
 1385_name(grantee_principal_id) as grantee,
 1385_name(grantor_principal_id) as grantor,
 permission_name,
 state_desc
from sys.database_permissions
 WHERE state_desc = 'DENY'


________________________________________


SELECT * FROM [412].[1341genomics with GO]
INNER JOIN [1123].[GO_to_GOslim]
ON [412].[1341genomics with GO].[GO:0003824]=[1123].[GO_to_GOslim].[GO_id]


________________________________________


SELECT * FROM [1123].[ETS_Enriched_DAVID_GO]
LEFT JOIN [1123].[GO_to_GOslim]
ON [1123].[ETS_Enriched_DAVID_GO].Number=[1123].[GO_to_GOslim].[GO_id]


________________________________________


SELECT * FROM [1123].[ETS_NSAF_oysters]
LEFT JOIN [354].[SPID_GOnumber.txt]
ON [1123].[ETS_NSAF_oysters].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [Cgigas proteins NSAF with GO]
LEFT JOIN [1123].[GO_to_GOslim]
ON [Cgigas proteins NSAF with GO].[GO:0003824]=[1123].[GO_to_GOslim].[GO_id]


________________________________________


SELECT * FROM [table_Cg proteome db evalue -10.txt]
LEFT JOIN [table_Enrichment contributing proteins.csv]
ON [table_Cg proteome db evalue -10.txt].SPID=[table_Enrichment contributing proteins.csv].SPID


________________________________________


SELECT * FROM [Enrichment SPIDs joined to CGI]
LEFT JOIN [354].[SPID_GOnumber.txt]
ON [Enrichment SPIDs joined to CGI].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [Enriched gill proteins with GO]
LEFT JOIN [1123].[GO_to_GOslim]
ON [Enriched gill proteins with GO].[GO:0003824]=[1123].[GO_to_GOslim].[GO_id]


________________________________________


SELECT * FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [table_101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_2_01.txt].protein


________________________________________


SELECT * FROM [412].[join1]
  LEFT JOIN [table_101B_2_02.txt]
  ON [join1].[All Proteins]=[table_101B_2_02.txt].protein



________________________________________


SELECT * FROM [412].[join2]
  LEFT JOIN [table_101B_2_03.txt]
  ON [join2].[All Proteins]=[table_101B_2_03.txt].protein



________________________________________


SELECT * FROM [412].[join3]
  LEFT JOIN [table_101B_5_01.txt]
  ON [join3].[All Proteins]=[table_101B_5_01.txt].protein



________________________________________


SELECT * FROM [412].[join4]
  LEFT JOIN [table_101B_5_02.txt]
  ON [join4].[All Proteins]=[table_101B_5_02.txt].protein



________________________________________


SELECT * FROM [412].[join5]
  LEFT JOIN [table_101B_5_03.txt]
  ON [join5].[All Proteins]=[table_101B_5_03.txt].protein



________________________________________


SELECT * FROM [412].[join6]
  LEFT JOIN [table_101B_8_01.txt]
  ON [join6].[All Proteins]=[table_101B_8_01.txt].protein



________________________________________


SELECT * FROM [412].[join7]
  LEFT JOIN [table_101B_8_02.txt]
  ON [join7].[All Proteins]=[table_101B_8_02.txt].protein



________________________________________


SELECT * FROM [412].[join8]
  LEFT JOIN [table_101B_8_03.txt]
  ON [join8].[All Proteins]=[table_101B_8_03.txt].protein



________________________________________


SELECT * FROM [412].[join9]
  LEFT JOIN [table_101B_11_01.txt]
  ON [join9].[All Proteins]=[table_101B_11_01.txt].protein



________________________________________


SELECT * FROM [412].[join10]
  LEFT JOIN [table_101B_11_02.txt]
  ON [join10].[All Proteins]=[table_101B_11_02.txt].protein



________________________________________


SELECT * FROM [412].[join11]
  LEFT JOIN [table_101B_11_03.txt]
  ON [join11].[All Proteins]=[table_101B_11_03.txt].protein



________________________________________


SELECT * FROM [412].[join12]
  LEFT JOIN [table_101B_26_01.txt]
  ON [join12].[All Proteins]=[table_101B_26_01.txt].protein



________________________________________


SELECT * FROM [412].[join13]
  LEFT JOIN [table_101B_26_02.txt]
  ON [join13].[All Proteins]=[table_101B_26_02.txt].protein



________________________________________


SELECT * FROM [412].[join14]
  LEFT JOIN [table_101B_26_03.txt]
  ON [join14].[All Proteins]=[table_101B_26_03.txt].protein



________________________________________


SELECT * FROM [412].[join15]
  LEFT JOIN [table_101B_29_01.txt]
  ON [join15].[All Proteins]=[table_101B_29_01.txt].protein



________________________________________


SELECT * FROM [412].[join16]
  LEFT JOIN [table_101B_29_02.txt]
  ON [join16].[All Proteins]=[table_101B_29_02.txt].protein



________________________________________


SELECT * FROM [412].[join17]
  LEFT JOIN [table_101B_29_03.txt]
  ON [join17].[All Proteins]=[table_101B_29_03.txt].protein



________________________________________


SELECT * FROM [412].[join18]
  LEFT JOIN [table_101B_32_01.txt]
  ON [join18].[All Proteins]=[table_101B_32_01.txt].protein



________________________________________


SELECT * FROM [412].[join19]
  LEFT JOIN [table_101B_32_02.txt]
  ON [join19].[All Proteins]=[table_101B_32_02.txt].protein



________________________________________


SELECT * FROM [412].[join20]
  LEFT JOIN [table_101B_32_03.txt]
  ON [join20].[All Proteins]=[table_101B_32_03.txt].protein



________________________________________


SELECT * FROM [412].[join21]
  LEFT JOIN [table_101B_35_01.txt]
  ON [join21].[All Proteins]=[table_101B_35_01.txt].protein



________________________________________


SELECT * FROM [412].[join22]
  LEFT JOIN [table_101B_35_02.txt]
  ON [join22].[All Proteins]=[table_101B_35_02.txt].protein



________________________________________


SELECT * FROM [412].[join23]
  LEFT JOIN [table_101B_35_03.txt]
  ON [join23].[All Proteins]=[table_101B_35_03.txt].protein



________________________________________


SELECT * FROM [412].[join24]
  LEFT JOIN [table_103B_221_01.txt]
  ON [join24].[All Proteins]=[table_103B_221_01.txt].protein



________________________________________


SELECT * FROM [412].[join24]
  LEFT JOIN [table_103B_221_01.txt]
  ON [join24].[All Proteins]=[table_103B_221_01.txt].protein



________________________________________


SELECT * FROM [412].[join25]
  LEFT JOIN [table_103B_221_02.txt]
  ON [join25].[All Proteins]=[table_103B_221_02.txt].protein



________________________________________


SELECT * FROM [412].[join25]
  LEFT JOIN [table_103B_221_02.txt]
  ON [join25].[All Proteins]=[table_103B_221_02.txt].protein



________________________________________


SELECT * FROM [412].[join26]
  LEFT JOIN [table_103B_221_03.txt]
  ON [join26].[All Proteins]=[table_103B_221_03.txt].protein



________________________________________


SELECT * FROM [412].[join27]
  LEFT JOIN [table_103B_224_01.txt]
  ON [join27].[All Proteins]=[table_103B_224_01.txt].protein



________________________________________


SELECT * FROM [412].[join28]
  LEFT JOIN [table_103B_224_02.txt]
  ON [join28].[All Proteins]=[table_103B_224_02.txt].protein



________________________________________


SELECT * FROM [412].[join29]
  LEFT JOIN [table_103B_224_03.txt]
  ON [join29].[All Proteins]=[table_103B_224_03.txt].protein



________________________________________


SELECT * FROM [412].[join30]
  LEFT JOIN [table_103B_227_01.txt]
  ON [join30].[All Proteins]=[table_103B_227_01.txt].protein



________________________________________


SELECT * FROM [412].[join31]
  LEFT JOIN [table_103B_227_02.txt]
  ON [join31].[All Proteins]=[table_103B_227_02.txt].protein



________________________________________


SELECT * FROM [412].[join31]
  LEFT JOIN [table_103B_227_02.txt]
  ON [join31].[All Proteins]=[table_103B_227_02.txt].protein



________________________________________


SELECT * FROM [412].[join31]
  LEFT JOIN [table_103B_227_02.txt]
  ON [join31].[All Proteins]=[table_103B_227_02.txt].protein


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [table_101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_2_01.txt].protein
  LEFT JOIN [table_101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_2_02.txt].protein
  LEFT JOIN [table_101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_2_03.txt].protein




________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [table_101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_2_01.txt].protein
  LEFT JOIN [table_101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_2_02.txt].protein
  LEFT JOIN [table_101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_2_03.txt].protein
  LEFT JOIN [table_101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_5_01.txt].protein
  LEFT JOIN [table_101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_5_02.txt].protein
  LEFT JOIN [table_101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_5_03.txt].protein
  LEFT JOIN [table_101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_8_01.txt].protein
  LEFT JOIN [table_101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_8_02.txt].protein
  LEFT JOIN [table_101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_8_03.txt].protein
  LEFT JOIN [table_101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_11_01.txt].protein
  LEFT JOIN [table_101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_11_02.txt].protein
  LEFT JOIN [table_101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_11_03.txt].protein
  LEFT JOIN [table_101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_26_01.txt].protein
  LEFT JOIN [table_101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_26_02.txt].protein
  LEFT JOIN [table_101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_26_03.txt].protein
  LEFT JOIN [table_101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_29_01.txt].protein
  LEFT JOIN [table_101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_29_02.txt].protein
  LEFT JOIN [table_101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_29_03.txt].protein
  LEFT JOIN [table_101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_32_01.txt].protein
  LEFT JOIN [table_101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_32_02.txt].protein
  LEFT JOIN [table_101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_32_03.txt].protein
  LEFT JOIN [table_101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_35_01.txt].protein
  LEFT JOIN [table_101B_35_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_35_02.txt].protein
  LEFT JOIN [table_101B_35_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_35_03.txt].protein
  LEFT JOIN [table_103B_221_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_221_01.txt].protein
  LEFT JOIN [table_103B_221_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_221_02.txt].protein
  LEFT JOIN [table_103B_221_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_221_03.txt].protein
  LEFT JOIN [table_103B_224_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_224_01.txt].protein
  LEFT JOIN [table_103B_224_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_224_02.txt].protein
  LEFT JOIN [table_103B_224_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_224_03.txt].protein
  LEFT JOIN [table_103B_227_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_227_01.txt].protein
  LEFT JOIN [table_103B_227_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_227_02.txt].protein
  LEFT JOIN [table_103B_227_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_227_03.txt].protein
  LEFT JOIN [table_103B_230_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_230_01.txt].protein
  LEFT JOIN [table_103B_230_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_230_02.txt].protein
  LEFT JOIN [table_103B_230_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_230_03.txt].protein
  LEFT JOIN [table_103B_242_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_242_01.txt].protein
  LEFT JOIN [table_103B_242_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_242_02.txt].protein
  LEFT JOIN [table_103B_242_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_242_03.txt].protein
  LEFT JOIN [table_103B_245_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_245_01.txt].protein
  LEFT JOIN [table_103B_245_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_245_02.txt].protein
  LEFT JOIN [table_103B_245_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_245_03.txt].protein
  LEFT JOIN [table_103B_248_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_248_01.txt].protein
  LEFT JOIN [table_103B_248_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_248_02.txt].protein
  LEFT JOIN [table_103B_248_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_248_03.txt].protein
  LEFT JOIN [table_103B_251_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_251_01.txt].protein
  LEFT JOIN [table_103B_251_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_251_02.txt].protein
  LEFT JOIN [table_103B_251_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_251_03.txt].protein



________________________________________


SELECT * FROM [412].[all oysters SpC.txt]
  LEFT JOIN [protein length.txt]
  ON [all oysters SpC.txt].Protein=[protein length.txt].protein



________________________________________


SELECT * FROM [412].[ProtPep for all oysters.txt]
  LEFT JOIN [pep peak areas all oysters.txt]
  ON [ProtPep for all oysters.txt].[peptide sequence]=[pep peak areas all oysters.txt].PeptideSequence



________________________________________


SELECT protein, avg([11_01 TotalArea]), avg([11_02 TotalArea]), avg([11_03 TotalArea]), avg([2_01 TotalArea]), avg([2_02 TotalArea]), avg([2_03 TotalArea]), avg([5_01 TotalArea]), avg([5_02 TotalArea]), avg([5_03 TotalArea]), avg([8_01 TotalArea]), avg([8_02 TotalArea]), avg([8_03 TotalArea]), avg([26_01 TotalArea]), avg([26_02 TotalArea]), avg([26_02 TotalArea]), avg([26_03 TotalArea]), avg([29_01 TotalArea]), avg([29_02 TotalArea]), avg([29_03 TotalArea]), avg([32_01 TotalArea]), avg([32_02 TotalArea]), avg([32_03 TotalArea]), avg([35_01 TotalArea]), avg([35_02 TotalArea]), avg([35_03 TotalArea]), avg([221_01 TotalArea]), avg([221_02 TotalArea]), avg([221_03 TotalArea]), avg([224_01 TotalArea]), avg([224_02 TotalArea]), avg([224_03 TotalArea]), avg([227_01 TotalArea]), avg([227_02 TotalArea]), avg([227_03 TotalArea]), avg([230_01 TotalArea]), avg([230_02 TotalArea]), avg([230_02 TotalArea]), avg([242_01 TotalArea]), avg([242_02 TotalArea]), avg([242_03 TotalArea]), avg([245_01 TotalArea]), avg([245_02 TotalArea]), avg([245_03 TotalArea]), avg([248_01 TotalArea]), avg([248_02 TotalArea]), avg([248_03 TotalArea]), avg([251_01 TotalArea]), avg([251_02 TotalArea]), avg([251_03 TotalArea]) FROM [267].[3 peps per protein.txt]
  Group by protein



________________________________________


SELECT protein
     , avg(CAST([11_01 TotalArea] AS FLOAT))
     , avg(CAST([11_02 TotalArea] AS FLOAT))
     , avg(CAST([11_03 TotalArea] AS FLOAT))
     , avg(CAST([2_01 TotalArea] AS FLOAT))
     , avg(CAST([2_02 TotalArea] AS FLOAT))
     , avg(CAST([2_03 TotalArea] AS FLOAT))
     , avg(CAST([5_01 TotalArea] AS FLOAT))
     , avg(CAST([5_02 TotalArea] AS FLOAT))
     , avg(CAST([5_03 TotalArea] AS FLOAT))
     , avg(CAST([8_01 TotalArea] AS FLOAT))
     , avg(CAST([8_02 TotalArea] AS FLOAT))
     , avg(CAST([8_03 TotalArea] AS FLOAT))
     , avg(CAST([26_01 TotalArea] AS FLOAT))
     , avg(CAST([26_02 TotalArea] AS FLOAT))
     , avg(CAST([26_02 TotalArea] AS FLOAT))
     , avg(CAST([26_03 TotalArea] AS FLOAT))
     , avg(CAST([29_01 TotalArea] AS FLOAT))
     , avg(CAST([29_02 TotalArea] AS FLOAT))
     , avg(CAST([29_03 TotalArea] AS FLOAT))
     , avg(CAST([32_01 TotalArea] AS FLOAT))
     , avg(CAST([32_02 TotalArea] AS FLOAT))
     , avg(CAST([32_03 TotalArea] AS FLOAT))
     , avg(CAST([35_01 TotalArea] AS FLOAT))
     , avg(CAST([35_02 TotalArea] AS FLOAT))
     , avg(CAST([35_03 TotalArea] AS FLOAT))
     , avg(CAST([221_01 TotalArea] AS FLOAT))
     , avg(CAST([221_02 TotalArea] AS FLOAT))
     , avg(CAST([221_03 TotalArea] AS FLOAT))
     , avg(CAST([224_01 TotalArea] AS FLOAT))
     , avg(CAST([224_02 TotalArea] AS FLOAT))
     , avg(CAST([224_03 TotalArea] AS FLOAT))
     , avg(CAST([227_01 TotalArea] AS FLOAT))
     , avg(CAST([227_02 TotalArea] AS FLOAT))
     , avg(CAST([227_03 TotalArea] AS FLOAT))
     , avg(CAST([230_01 TotalArea] AS FLOAT))
     , avg(CAST([230_02 TotalArea] AS FLOAT))
     , avg(CAST([230_02 TotalArea] AS FLOAT))
     , avg(CAST([242_01 TotalArea] AS FLOAT))
     , avg(CAST([242_02 TotalArea] AS FLOAT))
     , avg(CAST([242_03 TotalArea] AS FLOAT))
     , avg(CAST([245_01 TotalArea] AS FLOAT))
     , avg(CAST([245_02 TotalArea] AS FLOAT))
     , avg(CAST([245_03 TotalArea] AS FLOAT))
     , avg(CAST([248_01 TotalArea] AS FLOAT))
     , avg(CAST([248_02 TotalArea] AS FLOAT))
     , avg(CAST([248_03 TotalArea] AS FLOAT))
     , avg(CAST([251_01 TotalArea] AS FLOAT))
     , avg(CAST([251_02 TotalArea] AS FLOAT))
     , avg(CAST([251_03 TotalArea] AS FLOAT))
FROM [267].[3 peps per protein.txt]
GROUP BY protein



________________________________________


SELECT * FROM [412].[3 peps per protein area avgd]
  LEFT JOIN [Cg proteome db evalue -10.txt]
  ON [3 peps per protein area avgd].protein=[Cg proteome db evalue -10.txt].Protein



________________________________________


SELECT * FROM [412].[gill proteome with SPID.txt]
  LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [gill proteome with SPID.txt].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[gill proteome with GO]
  LEFT JOIN [1123].[GO_to_GOslim]
  ON [gill proteome with GO].A0A000=[1123].[GO_to_GOslim].GO_id


________________________________________


SELECT * FROM [412].[gill proteome with GO]
  LEFT JOIN [1123].[GO_to_GOslim]
  ON [gill proteome with GO].[GO:0003824]=[1123].[GO_to_GOslim].GO_id


________________________________________


SELECT * FROM [412].[sig eigenvectors pCO2.txt]
  LEFT JOIN [Cg proteome db evalue -10.txt]
  ON [sig eigenvectors pCO2.txt].CGID=[Cg proteome db evalue -10.txt].Protein



________________________________________


SELECT * FROM [412].[sig eigenvectors pCO2 SPID]
  LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [sig eigenvectors pCO2 SPID].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[proteins unique to high pCO2-MS response.txt]
  LEFT JOIN [Cg proteome db evalue -10.txt]
  ON [proteins unique to high pCO2-MS response.txt].[unique to High MS]=[Cg proteome db evalue -10.txt].Protein



________________________________________


SELECT * FROM [412].[unique proteins to High-MS with SPID]
  LEFT JOIN [table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [unique proteins to High-MS with SPID].SPID=[table_TJGR_Gene_SPID_evalue_Description.txt].SPID



________________________________________


SELECT * FROM [412].[sig eigenvectors pCO2 SPID]
  LEFT JOIN [table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [sig eigenvectors pCO2 SPID].SPID=[table_TJGR_Gene_SPID_evalue_Description.txt].SPID



________________________________________


SELECT * FROM [412].[sig eigenvectors pCO2 SPID]
  LEFT JOIN [table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [sig eigenvectors pCO2 SPID].SPID=[table_TJGR_Gene_SPID_evalue_Description.txt].SPID


________________________________________


SELECT * FROM [412].[sig eigenvectors pCO2 SPID]
  LEFT JOIN [table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [sig eigenvectors pCO2 SPID].CGID=[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[Skyline daily with SPID]
  LEFT JOIN [table_Cgigas_proteomev9_kegg_match]
  ON [Skyline daily with SPID].protein=[table_Cgigas_proteomev9_kegg_match].[Column1]


________________________________________


SELECT * FROM [412].[highly significant NMDS loadings.txt]
  LEFT JOIN [table_Cg proteome db evalue -10.txt]
  ON [highly significant NMDS loadings.txt].Protein=[table_Cg proteome db evalue -10.txt].Protein



________________________________________


SELECT * FROM [412].[highly sig loadings with SPID]
  LEFT JOIN [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  ON [highly sig loadings with SPID].SPID=[qDOD Cgigas Gene Descriptions (Swiss-prot)].SPID



________________________________________


SELECT * FROM [412].[highly sig loadings with gene descriptions]
  LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [highly sig loadings with gene descriptions].SPID=[354].[SPID_GOnumber.txt].A0A000



________________________________________


SELECT * FROM [412].[highly sig loadings with GO]
  LEFT JOIN [1123].[GO_to_GOslim]
  ON [highly sig loadings with GO].A0A000=[1123].[GO_to_GOslim].GO_id



________________________________________


SELECT * FROM [412].[highly sig loadings with GO]
  LEFT JOIN [1123].[GO_to_GOslim]
  ON [highly sig loadings with GO].[GO:0003824]=[1123].[GO_to_GOslim].GO_id



________________________________________


SELECT * FROM [412].[highly significant proteins for anosim.csv]
  LEFT JOIN [table_Cgigas_proteomev9_kegg_match]
  ON [highly significant proteins for anosim.csv].Protein=[table_Cgigas_proteomev9_kegg_match].Column1


________________________________________


SELECT * 
  FROM [412].[prot data sample 2.txt]
  UNION ALL
  SELECT * 
  FROM [412].[prot data sample 1.txt]



________________________________________


SELECT COUNT (*) FROM
(SELECT * 
  FROM [412].[prot data sample 2.txt]
  UNION ALL
  SELECT * 
  FROM [412].[prot data sample 1.txt])x



________________________________________


SELECT 
 1 AS fileID, * 
  FROM [412].[prot data sample 1.txt]
  UNION ALL
  SELECT 
 2 AS fileID, * 
  FROM [412].[prot data sample 2.txt]



________________________________________


SELECT protein, [peptide sequence]
  FROM [412].[prot data all]


________________________________________


SELECT DISTINCT protein, [peptide sequence]
  FROM [412].[prot data all]


________________________________________


SELECT COUNT (*) FROM
  (select 
    DISTINCT protein, [peptide sequence]
    FROM [412].[prot data all])x


________________________________________


SELECT COUNT (*) FROM
  (select 
    protein, [peptide sequence]
    FROM [412].[prot data all])x


________________________________________


SELECT DISTINCT protein, [peptide sequence]
    FROM [412].[prot data all]


________________________________________


SELECT DISTINCT protein, [peptide sequence]
    FROM [412].[prot data all]


________________________________________


SELECT [peptide sequence], count (*) 
  FROM [412].[TEST prot pep IDs]
  GROUP BY [peptide sequence]



________________________________________


SELECT [peptide sequence], count (*) 
  FROM [412].[TEST prot pep IDs]
  GROUP BY [peptide sequence]
  HAVING COUNT (*) < 2



________________________________________


SELECT [peptide sequence] 
  FROM [412].[TEST prot pep IDs]
  GROUP BY [peptide sequence]
  HAVING COUNT (*) < 2



________________________________________


SELECT * FROM
(SELECT [peptide sequence] 
  FROM [412].[TEST prot pep IDs]
  GROUP BY [peptide sequence]
  HAVING COUNT (*) < 2)uniquepeps
  LEFT JOIN [TEST prot pep IDs]
  ON uniquepeps.[peptide sequence]=[TEST prot pep IDs].[peptide sequence]
  



________________________________________


SELECT * FROM [TEST prot pep IDs] WHERE [peptide sequence] IN 
(SELECT [peptide sequence] 
  FROM [412].[TEST prot pep IDs]
  GROUP BY [peptide sequence]
  HAVING COUNT (*) < 2)
  
  



________________________________________


SELECT * FROM [412].[protpeps]
  LEFT JOIN [prot data all] --could use join
  ON [protpeps].[peptide sequence]=[prot data all].[peptide sequence]



________________________________________


SELECT [prot data all].* FROM [412].[protpeps]
  LEFT JOIN [prot data all] --could use join
  ON [protpeps].[peptide sequence]=[prot data all].[peptide sequence]



________________________________________


SELECT protein,[peptide sequence],
  SUM (CASE WHEN fileID=1 then [tot indep spectra] else 0 end)
  AS data1
  FROM (
SELECT  [prot data all].* FROM [412].[protpeps]
  LEFT JOIN [prot data all]
    ON [protpeps].[peptide sequence]=[prot data all].[peptide sequence])X
 GROUP BY protein,[peptide sequence]



________________________________________


SELECT protein,[peptide sequence],
  SUM (CASE WHEN fileID=1 then [tot indep spectra] else 0 end)
  AS data1,
  SUM (CASE WHEN fileID=2 then [tot indep spectra] else 0 end)
  AS data2
  FROM (
SELECT  [prot data all].* FROM [412].[protpeps]
  LEFT JOIN [prot data all]
    ON [protpeps].[peptide sequence]=[prot data all].[peptide sequence])X
 GROUP BY protein,[peptide sequence]



________________________________________


SELECT protein, [peptide sequence], data1+data2
  FROM [412].[joined prot data]


________________________________________


SELECT protein, [peptide sequence], data1+data2 AS sumallspec
  FROM [412].[joined prot data]


________________________________________


SELECT protein, max (sumallspec) over (partition by protein)
  FROM [412].[sum spec counts]




________________________________________


SELECT *, ROW_NUMBER () 
  OVER (ORDER BY sumallspec DESC)
  FROM [412].[sum spec counts]




________________________________________


SELECT *, ROW_NUMBER () 
  OVER (PARTITION BY protein ORDER BY sumallspec DESC)
  FROM [412].[sum spec counts]




________________________________________


SELECT *, ROW_NUMBER () 
  OVER (PARTITION BY protein ORDER BY sumallspec DESC) AS pepabundance
  FROM [412].[sum spec counts]




________________________________________


SELECT * FROM 
(SELECT *, ROW_NUMBER () 
  OVER (PARTITION BY protein ORDER BY sumallspec DESC) AS pepabundance
  FROM [412].[sum spec counts])x
  WHERE pepabundance <= 3




________________________________________


SELECT * FROM [412].[isotig blastx against CGID 060713.txt]
  LEFT JOIN [RPKM all oysters.txt]
  ON [412].[isotig blastx against CGID 060713.txt].[Isotig]=[RPKM all oysters.txt].[Feature ID]



________________________________________


SELECT CGID
  ,avg(CAST([RPKM A] AS FLOAT))
  ,avg(CAST([RPKM B] AS FLOAT))
  ,avg(CAST([RPKM C] AS FLOAT))
  ,avg(CAST([RPKM D] AS FLOAT))
  ,avg(CAST([RPKM E] AS FLOAT))
  ,avg(CAST([RPKM F] AS FLOAT))
  ,avg(CAST([RPKM G] AS FLOAT))
  ,avg(CAST([RPKM H] AS FLOAT))
  FROM [412].[isotigs with CGIDs and RPKM]
  GROUP BY CGID



________________________________________


SELECT CGID
  ,sum([RPKM A])
  ,sum([RPKM B])
  ,sum([RPKM C])
  ,sum([RPKM D])
  ,sum([RPKM E])
  ,sum([RPKM F])
  ,sum([RPKM G])
  ,sum([RPKM H])
  FROM [412].[isotigs with CGIDs and RPKM]
  GROUP BY CGID




________________________________________


SELECT * FROM [412].[highly significant NMDS loadings.txt]
  LEFT JOIN [cgid with RPKM summed]
  ON [412].[highly significant NMDS loadings.txt].Protein=[cgid with RPKM summed].CGID



________________________________________


SELECT * FROM [412].[isotig blastx against CGID 060713.txt]
  LEFT JOIN [library reads mapped to isotigs.txt]
  ON [412].[isotig blastx against CGID 060713.txt].Isotig=[library reads mapped to isotigs.txt].[Feature ID]


________________________________________


SELECT *
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE [Isotig] = 'Contig62418'


________________________________________


SELECT *
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE [Isotig] = 'Contig66789'


________________________________________


SELECT *
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE [Isotig] = 'Contig66789'


________________________________________


SELECT *
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE [Isotig] = 'Contig59055'


________________________________________


SELECT *
FROM  [412].[isotigs with CGIDs and total reads mapped]
WHERE [Isotig] = 'Contig87031'


________________________________________


SELECT *
FROM  [412].[library reads mapped to isotigs.txt]
WHERE [Feature ID] = 'Contig62418'


________________________________________


SELECT * FROM [412].[isotig blastx against CGID 060713.txt]

LEFT JOIN [library reads mapped to isotigs.txt]

ON [412].[isotig blastx against CGID 060713.txt].Isotig=[library reads mapped to isotigs.txt].[Feature ID]


________________________________________


SELECT CGID
  ,sum([EM2A])
  ,sum([EM2B])
  ,sum([EM2C])
  ,sum([EM2D])
  ,sum([EM2E])
  ,sum([EM2F])
  ,sum([EM2G])
  ,sum([EM2H])
  FROM [412].[isotigs with CGIDs and total reads mapped]
  GROUP BY CGID



________________________________________


SELECT * FROM [412].[highly significant NMDS loadings.txt]
  LEFT JOIN [CGIDs with summed total reads]
  ON [412].[highly significant NMDS loadings.txt].Protein=[CGIDs with summed total reads].CGID



________________________________________


SELECT Allele1,
  CASE WHEN Allele1>0 THEN 1 ELSE 0 END
  FROM [table_Primer 1 data.txt]



________________________________________


SELECT Allele1,Allele2,
  CASE WHEN Allele1>0 then 1 ELSE 0 END,
CASE WHEN Allele2>0 then 1 ELSE 0 END
FROM [table_Primer 1 data.txt]



________________________________________


SELECT Allele1,Allele2,
  CASE WHEN Allele1>0 then 1 ELSE 0 END
  AS Al1,
CASE WHEN Allele2>0 then 1 ELSE 0 END
  AS Al2
FROM [table_Primer 1 data.txt]



________________________________________


SELECT [Allele1], [Allele2], [Allele3], [Allele4], [Allele5],[Allele6], [Allele7], [Allele8], [Allele9], [Allele10],[Allele11], [Allele12], [Allele13], [Allele14], [Allele15],[Allele16], [Allele17], [Allele18], [Allele19], [Allele20],[Allele21], [Allele22], [Allele23], [Allele24], [Allele25],[Allele26], [Allele27], [Allele28], [Allele29], [Allele30],[Allele31], [Allele32], [Allele33], [Allele34], [Allele35],[Allele36], [Allele37], [Allele38], [Allele39], [Allele40],[Allele41], [Allele42], [Allele43], [Allele44], [Allele45],[Allele46], [Allele47], [Allele48], [Allele49], [Allele50],[Allele51], [Allele52], [Allele53], [Allele54], [Allele55],[Allele56], [Allele57], [Allele58], [Allele59], [Allele60],[Allele61], [Allele62], [Allele63], [Allele64], [Allele65],[Allele66], [Allele67], [Allele68], [Allele69], [Allele70],[Allele71], [Allele72], [Allele73], [Allele74], [Allele75],[Allele76], [Allele77], [Allele78], [Allele79], [Allele80],[Allele81], [Allele82], [Allele83], [Allele84], [Allele85],[Allele86], [Allele87], [Allele88], [Allele89], [Allele90],[Allele91], [Allele92], [Allele93], [Allele94], [Allele95],[Allele96], [Allele97], [Allele98], [Allele99], [Allele100],[Allele101], [Allele102], [Allele103], [Allele104], [Allele105],[Allele106], [Allele107], [Allele108], [Allele109], [Allele110],[Allele111], [Allele112], [Allele113], [Allele114], [Allele115],[Allele116], [Allele117], [Allele118], [Allele119], [Allele120],[Allele121], [Allele122], [Allele123], [Allele124], [Allele125],
CASE WHEN Allele1>0 then 1 ELSE 0 END
AS Al1,
CASE WHEN Allele2>0 then 1 ELSE 0 END
AS Al2,
CASE WHEN Allele3>0 then 1 ELSE 0 END
AS Al3,
CASE WHEN Allele4>0 then 1 ELSE 0 END
AS Al4,
CASE WHEN Allele5>0 then 1 ELSE 0 END
AS Al5,
CASE WHEN Allele6>0 then 1 ELSE 0 END
AS Al6,
CASE WHEN Allele7>0 then 1 ELSE 0 END
AS Al7,
CASE WHEN Allele8>0 then 1 ELSE 0 END
AS Al8,
CASE WHEN Allele9>0 then 1 ELSE 0 END
AS Al9,
CASE WHEN Allele10>0 then 1 ELSE 0 END
AS Al10,
CASE WHEN Allele11>0 then 1 ELSE 0 END
AS Al11,
CASE WHEN Allele12>0 then 1 ELSE 0 END
AS Al12,
CASE WHEN Allele13>0 then 1 ELSE 0 END
AS Al13,
CASE WHEN Allele14>0 then 1 ELSE 0 END
AS Al14,
CASE WHEN Allele15>0 then 1 ELSE 0 END
AS Al15,
CASE WHEN Allele16>0 then 1 ELSE 0 END
AS Al16,
CASE WHEN Allele17>0 then 1 ELSE 0 END
AS Al17,
CASE WHEN Allele18>0 then 1 ELSE 0 END
AS Al18,
CASE WHEN Allele19>0 then 1 ELSE 0 END
AS Al19,
CASE WHEN Allele20>0 then 1 ELSE 0 END
AS Al20,
CASE WHEN Allele21>0 then 1 ELSE 0 END
AS Al21,
CASE WHEN Allele22>0 then 1 ELSE 0 END
AS Al22,
CASE WHEN Allele23>0 then 1 ELSE 0 END
AS Al23,
CASE WHEN Allele24>0 then 1 ELSE 0 END
AS Al24,
CASE WHEN Allele25>0 then 1 ELSE 0 END
AS Al25,
CASE WHEN Allele26>0 then 1 ELSE 0 END
AS Al26,
CASE WHEN Allele27>0 then 1 ELSE 0 END
AS Al27,
CASE WHEN Allele28>0 then 1 ELSE 0 END
AS Al28,
CASE WHEN Allele29>0 then 1 ELSE 0 END
AS Al29,
CASE WHEN Allele30>0 then 1 ELSE 0 END
AS Al30,
CASE WHEN Allele31>0 then 1 ELSE 0 END
AS Al31,
CASE WHEN Allele32>0 then 1 ELSE 0 END
AS Al32,
CASE WHEN Allele33>0 then 1 ELSE 0 END
AS Al33,
CASE WHEN Allele34>0 then 1 ELSE 0 END
AS Al34,
CASE WHEN Allele35>0 then 1 ELSE 0 END
AS Al35,
CASE WHEN Allele36>0 then 1 ELSE 0 END
AS Al36,
CASE WHEN Allele37>0 then 1 ELSE 0 END
AS Al37,
CASE WHEN Allele38>0 then 1 ELSE 0 END
AS Al38,
CASE WHEN Allele39>0 then 1 ELSE 0 END
AS Al39,
CASE WHEN Allele40>0 then 1 ELSE 0 END
AS Al40,
CASE WHEN Allele41>0 then 1 ELSE 0 END
AS Al41,
CASE WHEN Allele42>0 then 1 ELSE 0 END
AS Al42,
CASE WHEN Allele43>0 then 1 ELSE 0 END
AS Al43,
CASE WHEN Allele44>0 then 1 ELSE 0 END
AS Al44,
CASE WHEN Allele45>0 then 1 ELSE 0 END
AS Al45,
CASE WHEN Allele46>0 then 1 ELSE 0 END
AS Al46,
CASE WHEN Allele47>0 then 1 ELSE 0 END
AS Al47,
CASE WHEN Allele48>0 then 1 ELSE 0 END
AS Al48,
CASE WHEN Allele49>0 then 1 ELSE 0 END
AS Al49,
CASE WHEN Allele50>0 then 1 ELSE 0 END
AS Al50,
CASE WHEN Allele51>0 then 1 ELSE 0 END
AS Al51,
CASE WHEN Allele52>0 then 1 ELSE 0 END
AS Al52,
CASE WHEN Allele53>0 then 1 ELSE 0 END
AS Al53,
CASE WHEN Allele54>0 then 1 ELSE 0 END
AS Al54,
CASE WHEN Allele55>0 then 1 ELSE 0 END
AS Al55,
CASE WHEN Allele56>0 then 1 ELSE 0 END
AS Al56,
CASE WHEN Allele57>0 then 1 ELSE 0 END
AS Al57,
CASE WHEN Allele58>0 then 1 ELSE 0 END
AS Al58,
CASE WHEN Allele59>0 then 1 ELSE 0 END
AS Al59,
CASE WHEN Allele60>0 then 1 ELSE 0 END
AS Al60,
CASE WHEN Allele61>0 then 1 ELSE 0 END
AS Al61,
CASE WHEN Allele62>0 then 1 ELSE 0 END
AS Al62,
CASE WHEN Allele63>0 then 1 ELSE 0 END
AS Al63,
CASE WHEN Allele64>0 then 1 ELSE 0 END
AS Al64,
CASE WHEN Allele65>0 then 1 ELSE 0 END
AS Al65,
CASE WHEN Allele66>0 then 1 ELSE 0 END
AS Al66,
CASE WHEN Allele67>0 then 1 ELSE 0 END
AS Al67,
CASE WHEN Allele68>0 then 1 ELSE 0 END
AS Al68,
CASE WHEN Allele69>0 then 1 ELSE 0 END
AS Al69,
CASE WHEN Allele70>0 then 1 ELSE 0 END
AS Al70,
CASE WHEN Allele71>0 then 1 ELSE 0 END
AS Al71,
CASE WHEN Allele72>0 then 1 ELSE 0 END
AS Al72,
CASE WHEN Allele73>0 then 1 ELSE 0 END
AS Al73,
CASE WHEN Allele74>0 then 1 ELSE 0 END
AS Al74,
CASE WHEN Allele75>0 then 1 ELSE 0 END
AS Al75,
CASE WHEN Allele76>0 then 1 ELSE 0 END
AS Al76,
CASE WHEN Allele77>0 then 1 ELSE 0 END
AS Al77,
CASE WHEN Allele78>0 then 1 ELSE 0 END
AS Al78,
CASE WHEN Allele79>0 then 1 ELSE 0 END
AS Al79,
CASE WHEN Allele80>0 then 1 ELSE 0 END
AS Al80,
CASE WHEN Allele81>0 then 1 ELSE 0 END
AS Al81,
CASE WHEN Allele82>0 then 1 ELSE 0 END
AS Al82,
CASE WHEN Allele83>0 then 1 ELSE 0 END
AS Al83,
CASE WHEN Allele84>0 then 1 ELSE 0 END
AS Al84,
CASE WHEN Allele85>0 then 1 ELSE 0 END
AS Al85,
CASE WHEN Allele86>0 then 1 ELSE 0 END
AS Al86,
CASE WHEN Allele87>0 then 1 ELSE 0 END
AS Al87,
CASE WHEN Allele88>0 then 1 ELSE 0 END
AS Al88,
CASE WHEN Allele89>0 then 1 ELSE 0 END
AS Al89,
CASE WHEN Allele90>0 then 1 ELSE 0 END
AS Al90,
CASE WHEN Allele91>0 then 1 ELSE 0 END
AS Al91,
CASE WHEN Allele92>0 then 1 ELSE 0 END
AS Al92,
CASE WHEN Allele93>0 then 1 ELSE 0 END
AS Al93,
CASE WHEN Allele94>0 then 1 ELSE 0 END
AS Al94,
CASE WHEN Allele95>0 then 1 ELSE 0 END
AS Al95,
CASE WHEN Allele96>0 then 1 ELSE 0 END
AS Al96,
CASE WHEN Allele97>0 then 1 ELSE 0 END
AS Al97,
CASE WHEN Allele98>0 then 1 ELSE 0 END
AS Al98,
CASE WHEN Allele99>0 then 1 ELSE 0 END
AS Al99,
CASE WHEN Allele100>0 then 1 ELSE 0 END
AS Al100,
CASE WHEN Allele101>0 then 1 ELSE 0 END
AS Al101,
CASE WHEN Allele102>0 then 1 ELSE 0 END
AS Al102,
CASE WHEN Allele103>0 then 1 ELSE 0 END
AS Al103,
CASE WHEN Allele104>0 then 1 ELSE 0 END
AS Al104,
CASE WHEN Allele105>0 then 1 ELSE 0 END
AS Al105,
CASE WHEN Allele106>0 then 1 ELSE 0 END
AS Al106,
CASE WHEN Allele107>0 then 1 ELSE 0 END
AS Al107,
CASE WHEN Allele108>0 then 1 ELSE 0 END
AS Al108,
CASE WHEN Allele109>0 then 1 ELSE 0 END
AS Al109,
CASE WHEN Allele110>0 then 1 ELSE 0 END
AS Al110,
CASE WHEN Allele111>0 then 1 ELSE 0 END
AS Al111,
CASE WHEN Allele112>0 then 1 ELSE 0 END
AS Al112,
CASE WHEN Allele113>0 then 1 ELSE 0 END
AS Al113,
CASE WHEN Allele114>0 then 1 ELSE 0 END
AS Al114,
CASE WHEN Allele115>0 then 1 ELSE 0 END
AS Al115,
CASE WHEN Allele116>0 then 1 ELSE 0 END
AS Al116,
CASE WHEN Allele117>0 then 1 ELSE 0 END
AS Al117,
CASE WHEN Allele118>0 then 1 ELSE 0 END
AS Al118,
CASE WHEN Allele119>0 then 1 ELSE 0 END
AS Al119,
CASE WHEN Allele120>0 then 1 ELSE 0 END
AS Al120,
CASE WHEN Allele121>0 then 1 ELSE 0 END
AS Al121,
CASE WHEN Allele122>0 then 1 ELSE 0 END
AS Al122,
CASE WHEN Allele123>0 then 1 ELSE 0 END
AS Al123,
CASE WHEN Allele124>0 then 1 ELSE 0 END
AS Al124,
CASE WHEN Allele125>0 then 1 ELSE 0 END
AS Al125
FROM [table_Primer 1 data.txt]


________________________________________


SELECT [CAS001Hpa1], [CAS001Msp1], [CAS001Hpa1]+[CAS001Msp1] AS [CAS001],
[CAS002Hpa1], [CAS002Msp1], [CAS002Hpa1]+[CAS002Msp1] AS [CAS002]
FROM [primer 1 data binary oysters in col.txt]


________________________________________


SELECT [CAS001Hpa1], [CAS001Msp1], [CAS001Hpa1]+[CAS001Msp1] AS [CAS001],
[CAS002Hpa1], [CAS002Msp1], [CAS002Hpa1]+[CAS002Msp1] AS [CAS002],
[CAS003Hpa1], [CAS003Msp1], [CAS003Hpa1]+[CAS003Msp1] AS [CAS003],
[CAS004Hpa1], [CAS004Msp1], [CAS004Hpa1]+[CAS004Msp1] AS [CAS004],
[CAS005Hpa1], [CAS005Msp1], [CAS005Hpa1]+[CAS005Msp1] AS [CAS005],
[CAS008Hpa1], [CAS008Msp1], [CAS008Hpa1]+[CAS008Msp1] AS [CAS008],
[CAS009Hpa1], [CAS009Msp1], [CAS009Hpa1]+[CAS009Msp1] AS [CAS009],
[CAS010Hap1], [CAS010Msp1], [CAS010Hap1]+[CAS010Msp1] AS [CAS010],
[DAB087Hpa1], [DAB087Msp1], [DAB087Hpa1]+[DAB087Msp1] AS [DAB087],
[DAB088Hpa1], [DAB088Msp1], [DAB088Hpa1]+[DAB088Msp1] AS [DAB088],
[DAB089Hpa1], [DAB089Msp1], [DAB089Hpa1]+[DAB089Msp1] AS [DAB089],
[DAB090Hpa1], [DAB090Msp1], [DAB090Hpa1]+[DAB090Msp1] AS [DAB090],
[DAB091Hpa1], [DAB091Msp1], [DAB091Hpa1]+[DAB091Msp1] AS [DAB091],
[DAB093Hpa1], [DAB093Msp1], [DAB093Hpa1]+[DAB093Msp1] AS [DAB093],
[DAB095Hpa1], [DAB095Msp1], [DAB095Hpa1]+[DAB095Msp1] AS [DAB095],
[DAB096Hpa1], [DAB096Msp1], [DAB096Hpa1]+[DAB096Msp1] AS [DAB096],
[FID091Hpa1], [FID091Msp1], [FID091Hpa1]+[FID091Msp1] AS [FID091],
[FID092Hpa1], [FID092Msp1], [FID092Hpa1]+[FID092Msp1] AS [FID092],
[FID094Hpa1], [FID094Msp1], [FID094Hpa1]+[FID094Msp1] AS [FID094],
[FID095Hpa1], [FID095Msp1], [FID095Hpa1]+[FID095Msp1] AS [FID095],
[FID096Hpa1], [FID096Msp1], [FID096Hpa1]+[FID096Msp1] AS [FID096],
[FID097Hpa1], [FID097Msp1], [FID097Hpa1]+[FID097Msp1] AS [FID097],
[FID098Hpa1], [FID098Msp1], [FID098Hpa1]+[FID098Msp1] AS [FID098],
[FID099Hpa1], [FID099Msp1], [FID099Hpa1]+[FID099Msp1] AS [FID099],
[FID100Hpa1], [FID100Msp1], [FID100Hpa1]+[FID100Msp1] AS [FID100]
FROM [primer 1 data binary oysters in col.txt]



________________________________________


SELECT CAS001,
  CASE WHEN CAS001=2 then 'NM' WHEN CAS001=1 then 'M' else 'U' END
  AS CAS001MethStat
  FROM [412].[summed presence absence fragment peaks]


________________________________________


SELECT CAS001,
  CASE WHEN CAS001=2 then 'NM' WHEN CAS001=1 then 'M' else 'U' END
  AS CAS001MethStat,
CASE WHEN CAS002=2 then 'NM' WHEN CAS002=1 then 'M' else 'U' END
  AS CAS002MethStat,
CASE WHEN CAS003=2 then 'NM' WHEN CAS003=1 then 'M' else 'U' END
  AS CAS003MethStat,
CASE WHEN CAS004=2 then 'NM' WHEN CAS004=1 then 'M' else 'U' END
  AS CAS004MethStat,
CASE WHEN CAS005=2 then 'NM' WHEN CAS005=1 then 'M' else 'U' END
  AS CAS005MethStat,
CASE WHEN CAS008=2 then 'NM' WHEN CAS008=1 then 'M' else 'U' END
  AS CAS008MethStat,
CASE WHEN CAS009=2 then 'NM' WHEN CAS009=1 then 'M' else 'U' END
  AS CAS009MethStat,
CASE WHEN CAS010=2 then 'NM' WHEN CAS010=1 then 'M' else 'U' END
  AS CAS010MethStat,
CASE WHEN DAB087=2 then 'NM' WHEN DAB087=1 then 'M' else 'U' END
  AS DAB087MethStat,
CASE WHEN DAB088=2 then 'NM' WHEN DAB088=1 then 'M' else 'U' END
  AS DAB088MethStat,
CASE WHEN DAB089=2 then 'NM' WHEN DAB089=1 then 'M' else 'U' END
  AS DAB089MethStat,
CASE WHEN DAB090=2 then 'NM' WHEN DAB090=1 then 'M' else 'U' END
  AS DAB090MethStat,
CASE WHEN DAB091=2 then 'NM' WHEN DAB091=1 then 'M' else 'U' END
  AS DAB091MethStat,
CASE WHEN DAB093=2 then 'NM' WHEN DAB093=1 then 'M' else 'U' END
  AS DAB093MethStat,
CASE WHEN DAB095=2 then 'NM' WHEN DAB095=1 then 'M' else 'U' END
  AS DAB095MethStat,
CASE WHEN DAB096=2 then 'NM' WHEN DAB096=1 then 'M' else 'U' END
  AS DAB096MethStat,
CASE WHEN FID091=2 then 'NM' WHEN FID091=1 then 'M' else 'U' END
  AS FID091MethStat,
CASE WHEN FID092=2 then 'NM' WHEN FID092=1 then 'M' else 'U' END
  AS FID092MethStat,
CASE WHEN FID094=2 then 'NM' WHEN FID094=1 then 'M' else 'U' END
  AS FID094MethStat,
CASE WHEN FID095=2 then 'NM' WHEN FID095=1 then 'M' else 'U' END
  AS FID095MethStat,
CASE WHEN FID096=2 then 'NM' WHEN FID096=1 then 'M' else 'U' END
  AS FID096MethStat,
CASE WHEN FID097=2 then 'NM' WHEN FID097=1 then 'M' else 'U' END
  AS FID097MethStat,
CASE WHEN FID098=2 then 'NM' WHEN FID098=1 then 'M' else 'U' END
  AS FID098MethStat,
CASE WHEN FID099=2 then 'NM' WHEN FID099=1 then 'M' else 'U' END
  AS FID099MethStat,
CASE WHEN FID100=2 then 'NM' WHEN FID100=1 then 'M' else 'U' END
  AS FID100MethStat
  FROM [412].[summed presence absence fragment peaks]



________________________________________


SELECT * FROM [412].[differential expression pCO2 and lowMS skyline.txt]
  LEFT JOIN [gill proteome with GO]
  ON [412].[differential expression pCO2 and lowMS skyline.txt].protein=[gill proteome with GO].protein



________________________________________


SELECT * FROM [412].[differential expression with GO]


________________________________________


SELECT * FROM [412].[differential expression with GO]


________________________________________


SELECT * FROM [412].[differential expression pCO2 and lowMS skyline.txt]
  LEFT JOIN [gill proteome with GO Slim]
  ON [differential expression pCO2 and lowMS skyline.txt].protein=[gill proteome with GO Slim].protein



________________________________________


SELECT * FROM [412].[Zhang Supp 24 shell proteins.txt]
  LEFT JOIN [table_differential expression pCO2 and lowMS skyline.txt]
  ON [Zhang Supp 24 shell proteins.txt].[Shell Protein]=[table_differential expression pCO2 and lowMS skyline.txt].protein



________________________________________


SELECT * FROM [412].[shell proteins with pCO2 lowMS diff exp]
  LEFT JOIN [table_differential expression high MS.txt]
  ON [shell proteins with pCO2 lowMS diff exp].[Shell Protein]=[table_differential expression high MS.txt].protein



________________________________________


SELECT * FROM [412].[proteins significant by qvalue.txt]
  LEFT JOIN [table_Cg proteome db evalue -10.txt]
  ON [proteins significant by qvalue.txt].protein=[table_Cg proteome db evalue -10.txt].Protein



________________________________________


SELECT * FROM [412].[proteins sig by qvalue with SPID]
  LEFT JOIN [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
ON [proteins sig by qvalue with SPID].SPID=[qDOD Cgigas Gene Descriptions (Swiss-prot)].SPID



________________________________________


SELECT * FROM [412].[peptide peak areas with protein associations] WHERE [peptide sequence] IN
  (SELECT [peptide sequence]
    FROM [412].[peptide peak areas with protein associations]
    GROUP BY [peptide sequence]
    HAVING COUNT (*) <2)



________________________________________


SELECT protein
  FROM [412].[unique protein associations]


________________________________________


SELECT protein, [peptide sequence]
  FROM [412].[unique protein associations]
  


________________________________________


SELECT protein, [peptide sequence], [2_01 TotalArea], [2_02 TotalArea], [2_03 TotalArea], [5_01 TotalArea], [5_02 TotalArea], [5_03 TotalArea], [8_01 TotalArea],[8_02 TotalArea], [8_03 TotalArea],[11_01 TotalArea], [11_02 TotalArea], [11_03 TotalArea],   [26_01 TotalArea], [26_02 TotalArea], [26_03 TotalArea], [29_01 TotalArea], [29_02 TotalArea], [29_03 TotalArea], [32_01 TotalArea], [32_02 TotalArea], [32_03 TotalArea], [35_01 TotalArea], [35_02 TotalArea], [35_03 TotalArea], [221_01 TotalArea], [221_02 TotalArea], [221_03 TotalArea], [224_01 TotalArea], [224_02 TotalArea], [224_03 TotalArea], [227_01 TotalArea], [227_02 TotalArea], [227_03 TotalArea], [230_01 TotalArea], [230_02 TotalArea], [230_02 TotalArea], [242_01 TotalArea], [242_02 TotalArea], [242_03 TotalArea], [245_01 TotalArea], [245_02 TotalArea], [245_03 TotalArea], [248_01 TotalArea], [248_02 TotalArea], [248_03 TotalArea], [251_01 TotalArea], [251_02 TotalArea], [251_03 TotalArea]
  FROM [412].[unique protein associations]
 



________________________________________


SELECT protein, [peptide sequence], ([2_01 TotalArea]+[2_02 TotalArea]+[2_03 TotalArea])/3 AS CG2
  FROM [412].[Peptide peak areas for unique peptides]


________________________________________


SELECT protein, [peptide sequence], ([2_01 TotalArea]+[2_02 TotalArea]+[2_03 TotalArea])/3 AS CG2, ([5_01 TotalArea]+[5_02 TotalArea]+[5_03 TotalArea])/3 AS CG5, ([8_01 TotalArea]+[8_02 TotalArea]+[8_03 TotalArea])/3 AS CG8,([11_01 TotalArea]+[11_02 TotalArea]+[11_03 TotalArea])/3 AS CG11,   ([26_01 TotalArea]+[26_02 TotalArea]+[26_03 TotalArea])/3 AS CG26, ([29_01 TotalArea]+[29_02 TotalArea]+[29_03 TotalArea])/3 AS CG29, ([32_01 TotalArea]+[32_02 TotalArea]+[32_03 TotalArea])/3 AS CG32, ([35_01 TotalArea]+[35_02 TotalArea]+[35_03 TotalArea])/3 AS CG35, ([221_01 TotalArea]+[221_02 TotalArea]+[221_03 TotalArea])/3 AS CG221, ([224_01 TotalArea]+[224_02 TotalArea]+[224_03 TotalArea])/3 AS CG224, ([227_01 TotalArea]+[227_02 TotalArea]+[227_03 TotalArea])/3 AS CG227, ([230_01 TotalArea]+[230_02 TotalArea]+[230_02 TotalArea])/3 AS CG230, ([242_01 TotalArea]+[242_02 TotalArea]+[242_03 TotalArea])/3 AS CG242, ([245_01 TotalArea]+[245_02 TotalArea]+[245_03 TotalArea])/3 AS CG245, ([248_01 TotalArea]+[248_02 TotalArea]+[248_03 TotalArea])/3 AS CG248, ([251_01 TotalArea]+[251_02 TotalArea]+[251_03 TotalArea])/3 AS CG251
  FROM [412].[unique protein associations]



________________________________________


SELECT protein, [peptide sequence], (CG2+CG5+CG8+CG11+CG26+CG29+CG32+CG35+CG221+CG224+CG227+CG230+CG242+CG245+CG248+CG251)/16 AS avgallpeps
  FROM [412].[Average peptide expression]


________________________________________


SELECT * FROM 
  (SELECT *, ROW_NUMBER ()
    OVER (PARTITION BY protein ORDER BY avgallpeps DESC) AS pepabundance
    FROM [412].[Average expression across all oysters])X
  WHERE pepabundance <=3



________________________________________


SELECT * FROM [412].[3 peps per protein]
  LEFT JOIN [412].[Average peptide expression]
  ON [412].[3 peps per protein].[peptide sequence]=[412].[Average peptide expression].[peptide sequence]



________________________________________


SELECT * FROM [412].[3 peps per protein with expression]


________________________________________


SELECT protein
  ,avg(CAST(CG2 AS FLOAT))
    ,avg(CAST(CG5 AS FLOAT))
      ,avg(CAST(CG8 AS FLOAT))
        ,avg(CAST(CG11 AS FLOAT))
          ,avg(CAST(CG26 AS FLOAT))
            ,avg(CAST(CG29 AS FLOAT))
              ,avg(CAST(CG32 AS FLOAT))
                ,avg(CAST(CG35 AS FLOAT))
                  ,avg(CAST(CG221 AS FLOAT))
                    ,avg(CAST(CG224 AS FLOAT))
                      ,avg(CAST(CG227 AS FLOAT))
                        ,avg(CAST(CG230 AS FLOAT))
                          ,avg(CAST(CG242 AS FLOAT))
                            ,avg(CAST(CG245 AS FLOAT))
                              ,avg(CAST(CG248 AS FLOAT))
                                ,avg(CAST(CG251 AS FLOAT))
  FROM [412].[3 peps per protein with expression]
  GROUP BY protein


________________________________________


SELECT * FROM [412].[ProtPep for all oysters.txt]
  LEFT JOIN [412].[pep peak areas all oysters.txt]
  ON [412].[ProtPep for all oysters.txt].[peptide sequence]=[412].[pep peak areas all oysters.txt].PeptideSequence



________________________________________


SELECT protein
  ,avg(CAST(CG2 AS FLOAT)) as CG2
    ,avg(CAST(CG5 AS FLOAT))
      ,avg(CAST(CG8 AS FLOAT))
        ,avg(CAST(CG11 AS FLOAT))
          ,avg(CAST(CG26 AS FLOAT))
            ,avg(CAST(CG29 AS FLOAT))
              ,avg(CAST(CG32 AS FLOAT))
                ,avg(CAST(CG35 AS FLOAT))
                  ,avg(CAST(CG221 AS FLOAT))
                    ,avg(CAST(CG224 AS FLOAT))
                      ,avg(CAST(CG227 AS FLOAT))
                        ,avg(CAST(CG230 AS FLOAT))
                          ,avg(CAST(CG242 AS FLOAT))
                            ,avg(CAST(CG245 AS FLOAT))
                              ,avg(CAST(CG248 AS FLOAT))
                                ,avg(CAST(CG251 AS FLOAT))
  FROM [412].[3 peps per protein with expression]
  GROUP BY protein


________________________________________


SELECT protein
  ,avg(CAST(CG2 AS FLOAT)) as CG2
    ,avg(CAST(CG5 AS FLOAT)) as CG5
      ,avg(CAST(CG8 AS FLOAT)) as CG8
        ,avg(CAST(CG11 AS FLOAT)) as CG11
          ,avg(CAST(CG26 AS FLOAT)) as CG26
            ,avg(CAST(CG29 AS FLOAT)) as CG29
              ,avg(CAST(CG32 AS FLOAT)) as CG32
                ,avg(CAST(CG35 AS FLOAT)) as CG35
                  ,avg(CAST(CG221 AS FLOAT)) as CG221
                    ,avg(CAST(CG224 AS FLOAT)) as CG224
                      ,avg(CAST(CG227 AS FLOAT)) as CG227
                        ,avg(CAST(CG230 AS FLOAT)) as CG230
                          ,avg(CAST(CG242 AS FLOAT)) as CG242
                            ,avg(CAST(CG245 AS FLOAT)) as CG245
                              ,avg(CAST(CG248 AS FLOAT)) as CG248
                                ,avg(CAST(CG251 AS FLOAT)) as CG251
  FROM [412].[3 peps per protein with expression]
  GROUP BY protein


________________________________________


SELECT [peptide sequence], SUM([11_01 TotalArea])
  FROM [412].[unique protein associations]
 GROUP BY [peptide sequence] 
 


________________________________________


SELECT [peptide sequence], SUM([11_01 TotalArea]) AS CG11
  FROM [412].[unique protein associations]
 GROUP BY [peptide sequence] 
 


________________________________________


SELECT [peptide sequence], SUM([2_01 TotalArea]) AS CG2_01, SUM([2_02 TotalArea]) AS CG2_02, SUM([2_03 TotalArea]) AS CG2_03, SUM([5_01 TotalArea]) AS CG5_01, SUM([5_02 TotalArea]) AS CG5_02, SUM([5_03 TotalArea]) AS CG5_03, SUM([8_01 TotalArea]) AS CG8_01, SUM([8_02 TotalArea]) AS CG8_02, SUM([8_03 TotalArea]) AS CG8_03, SUM([11_01 TotalArea]) AS CG11_01, SUM([11_02 TotalArea]) AS CG11_02, SUM([11_03 TotalArea]) AS CG11_03,  SUM([26_01 TotalArea]) AS CG26_01, SUM([26_02 TotalArea]) AS CG26_02, SUM([26_03 TotalArea]) AS CG26_03, SUM([29_01 TotalArea]) AS CG29_01, SUM([29_02 TotalArea]) AS CG29_02, SUM([29_03 TotalArea]) AS CG29_03, SUM([32_01 TotalArea]) AS CG32_01, SUM([32_02 TotalArea]) AS CG32_02, SUM([32_03 TotalArea]) AS CG32_03, SUM([35_01 TotalArea]) AS CG35_01, SUM([35_02 TotalArea]) AS CG35_02, SUM([35_03 TotalArea]) AS CG35_03, SUM([221_01 TotalArea]) AS CG221_01, SUM([221_02 TotalArea]) AS CG221_02, SUM([221_03 TotalArea]) AS CG221_03, SUM([224_01 TotalArea]) AS CG224_01, SUM([224_02 TotalArea]) AS CG224_02, SUM([224_03 TotalArea]) AS CG224_03, SUM([227_01 TotalArea]) AS CG227_01, SUM([227_02 TotalArea]) AS CG227_02, SUM([227_03 TotalArea]) AS CG227_03, SUM([230_01 TotalArea]) AS CG230_01, SUM([230_02 TotalArea]) AS CG230_02, SUM([230_03 TotalArea]) AS CG230_03,
SUM([242_01 TotalArea]) AS CG242_01, SUM([242_02 TotalArea]) AS CG242_02, SUM([242_03 TotalArea]) AS CG242_03, SUM([245_01 TotalArea]) AS CG245_01, SUM([245_02 TotalArea]) AS CG245_02, SUM([245_03 TotalArea]) AS CG245_03, SUM([248_01 TotalArea]) AS CG248_01, SUM([248_02 TotalArea]) AS CG248_02, SUM([248_03 TotalArea]) AS CG248_03, SUM([251_01 TotalArea]) AS CG251_01, SUM([251_02 TotalArea]) AS CG251_02, SUM([251_03 TotalArea]) AS CG251_03
  FROM [412].[unique protein associations]
 GROUP BY [peptide sequence] 
 


________________________________________


SELECT * FROM [412].[Total peptide areas]
  LEFT JOIN (SELECT protein, [peptide sequence] FROM [412].[unique protein associations])X
  ON [412].[Total peptide areas].[peptide sequence]= X.[peptide sequence]



________________________________________


SELECT protein, [peptide sequence], ([CG2_01]+[CG2_02]+[CG2_03])/3 AS CG2, ([CG5_01]+[CG5_02]+[CG5_03])/3 AS CG5, ([CG8_01]+[CG8_02]+[CG8_03])/3 AS CG8,([CG11_01]+[CG11_02]+[CG11_03])/3 AS CG11,   ([CG26_01]+[CG26_02]+[CG26_03])/3 AS CG26, ([CG29_01]+[CG29_02]+[CG29_03])/3 AS CG29, ([CG32_01]+[CG32_02]+[CG32_03])/3 AS CG32, ([CG35_01]+[CG35_02]+[CG35_03])/3 AS CG35, ([CG221_01]+[CG221_02]+[CG221_03])/3 AS CG221, ([CG224_01]+[CG224_02]+[CG224_03])/3 AS CG224, ([CG227_01]+[CG227_02]+[CG227_03])/3 AS CG227, ([CG230_01]+[CG230_02]+[CG230_02])/3 AS CG230, ([CG242_01]+[CG242_02]+[CG242_03])/3 AS CG242, ([CG245_01]+[CG245_02]+[CG245_03])/3 AS CG245, ([CG248_01]+[CG248_02]+[CG248_03])/3 AS CG248, ([CG251_01]+[CG251_02]+[CG251_03])/3 AS CG251
  FROM [412].[Total peptide areas with protein associations]



________________________________________


SELECT protein, [peptide sequence], (CG2+CG5+CG8+CG11+CG26+CG29+CG32+CG35+CG221+CG224+CG227+CG230+CG242+CG245+CG248+CG251)/16 AS avgallpeps
  FROM [412].[Average peptide expression]


________________________________________


SELECT * FROM 
  (SELECT *, ROW_NUMBER ()
    OVER (PARTITION BY protein ORDER BY avgallpeps DESC) AS pepabundance
    FROM [412].[Average expression across all oysters])X
  WHERE pepabundance <=3


________________________________________


SELECT * FROM [412].[3 peps per protein]
  LEFT JOIN [412].[Average peptide expression]
  ON [412].[3 peps per protein].[peptide sequence]=[412].[Average peptide expression].[peptide sequence]


________________________________________


SELECT * FROM [412].[3 peps per protein]
LEFT JOIN [412].[Average peptide expression]
ON [412].[3 peps per protein].[peptide sequence]=[412].[Average peptide expression].[peptide sequence]


________________________________________


SELECT protein
  ,avg(CAST(CG2 AS FLOAT)) as CG2
    ,avg(CAST(CG5 AS FLOAT)) as CG5
      ,avg(CAST(CG8 AS FLOAT)) as CG8
        ,avg(CAST(CG11 AS FLOAT)) as CG11
          ,avg(CAST(CG26 AS FLOAT)) as CG26
            ,avg(CAST(CG29 AS FLOAT)) as CG29
              ,avg(CAST(CG32 AS FLOAT)) as CG32
                ,avg(CAST(CG35 AS FLOAT)) as CG35
                  ,avg(CAST(CG221 AS FLOAT)) as CG221
                    ,avg(CAST(CG224 AS FLOAT)) as CG224
                      ,avg(CAST(CG227 AS FLOAT)) as CG227
                        ,avg(CAST(CG230 AS FLOAT)) as CG230
                          ,avg(CAST(CG242 AS FLOAT)) as CG242
                            ,avg(CAST(CG245 AS FLOAT)) as CG245
                              ,avg(CAST(CG248 AS FLOAT)) as CG248
                                ,avg(CAST(CG251 AS FLOAT)) as CG251
  FROM [412].[3 peps per protein with expression]
  GROUP BY protein


________________________________________


SELECT * FROM [412].[sig qvalues OA and lowMS.txt]
  LEFT JOIN [table_TJGR_Gene_SPID_evalue_Description.txt]
ON [412].[sig qvalues OA and lowMS.txt].protein=[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[sig proteins from NMDS.csv]
  LEFT JOIN [table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[sig proteins from NMDS.csv].protein=[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI protein]



________________________________________


SELECT * FROM [412].[sig NMDS proteins with SPID]
  LEFT JOIN [3 peps per protein area avgd]
  ON [sig NMDS proteins with SPID].protein=[3 peps per protein area avgd].protein


________________________________________


SELECT * FROM [412].[ProtPep for all oysters.txt]
  LEFT JOIN [412].[table_pep peak areas all oysters2.txt]
  ON [412].[ProtPep for all oysters.txt].[peptide sequence]=[412].[table_pep peak areas all oysters2.txt].PeptideSequence



________________________________________


SELECT * FROM [412].[sig qvalues OA and lowMS.txt]

LEFT JOIN [table_TJGR_Gene_SPID_evalue_Description.txt]

ON [412].[sig qvalues OA and lowMS.txt].protein=[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[sig proteins from NMDS.csv]
  LEFT JOIN [table_TJGR_Gene_SPID_evalue_Description.txt]
ON [412].[sig proteins from NMDS.csv].protein=[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI protein]


________________________________________


SELECT * FROM [412].[sig NMDS proteins with SPID]
  LEFT JOIN [3 peps per protein area avgd]
 
ON [sig NMDS proteins with SPID].protein=[3 peps per protein area avgd].protein


________________________________________


SELECT [PeptideSequence], SUM([2_01 TotalArea]) AS CG2_01, SUM([2_02 TotalArea]) AS CG2_02, SUM([2_03 TotalArea]) AS CG2_03, SUM([5_01 TotalArea]) AS CG5_01, SUM([5_02 TotalArea]) AS CG5_02, SUM([5_03 TotalArea]) AS CG5_03, SUM([8_01 TotalArea]) AS CG8_01, SUM([8_02 TotalArea]) AS CG8_02, SUM([8_03 TotalArea]) AS CG8_03, SUM([11_01 TotalArea]) AS CG11_01, SUM([11_02 TotalArea]) AS CG11_02, SUM([11_03 TotalArea]) AS CG11_03,  SUM([26_01 TotalArea]) AS CG26_01, SUM([26_02 TotalArea]) AS CG26_02, SUM([26_03 TotalArea]) AS CG26_03, SUM([29_01 TotalArea]) AS CG29_01, SUM([29_02 TotalArea]) AS CG29_02, SUM([29_03 TotalArea]) AS CG29_03, SUM([32_01 TotalArea]) AS CG32_01, SUM([32_02 TotalArea]) AS CG32_02, SUM([32_03 TotalArea]) AS CG32_03, SUM([35_01 TotalArea]) AS CG35_01, SUM([35_02 TotalArea]) AS CG35_02, SUM([35_03 TotalArea]) AS CG35_03, SUM([221_01 TotalArea]) AS CG221_01, SUM([221_02 TotalArea]) AS CG221_02, SUM([221_03 TotalArea]) AS CG221_03, SUM([224_01 TotalArea]) AS CG224_01, SUM([224_02 TotalArea]) AS CG224_02, SUM([224_03 TotalArea]) AS CG224_03, SUM([227_01 TotalArea]) AS CG227_01, SUM([227_02 TotalArea]) AS CG227_02, SUM([227_03 TotalArea]) AS CG227_03, SUM([230_01 TotalArea]) AS CG230_01, SUM([230_02 TotalArea]) AS CG230_02, SUM([230_03 TotalArea]) AS CG230_03,
SUM([242_01 TotalArea]) AS CG242_01, SUM([242_02 TotalArea]) AS CG242_02, SUM([242_03 TotalArea]) AS CG242_03, SUM([245_01 TotalArea]) AS CG245_01, SUM([245_02 TotalArea]) AS CG245_02, SUM([245_03 TotalArea]) AS CG245_03, SUM([248_01 TotalArea]) AS CG248_01, SUM([248_02 TotalArea]) AS CG248_02, SUM([248_03 TotalArea]) AS CG248_03, SUM([251_01 TotalArea]) AS CG251_01, SUM([251_02 TotalArea]) AS CG251_02, SUM([251_03 TotalArea]) AS CG251_03
  FROM [412].[pep peak areas all oysters2.txt]
 GROUP BY [PeptideSequence]
  


________________________________________


SELECT * FROM [1123].[OAMS_SkylineData.csv]
  WHERE PrecursorCharge <3


________________________________________


SELECT 
  [protein] AS [proteinCG2_01],
  [num unique peps] AS [numuniquepepsCG2_01],
  [tot indep spectra] AS [totspecCG2_01]
  FROM [412].[table_101B_2_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG2_02],
  [num unique peps] AS [numuniquepepsCG2_02],
  [tot indep spectra] AS [totspecCG2_02]
  FROM [412].[table_101B_2_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG2_03],
  [num unique peps] AS [numuniquepepsCG2_03],
  [tot indep spectra] AS [totspecCG2_03]
  FROM [412].[table_101B_2_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG5_01],
  [num unique peps] AS [numuniquepepsCG5_01],
  [tot indep spectra] AS [totspecCG5_01]
  FROM [412].[table_101B_5_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG5_02],
  [num unique peps] AS [numuniquepepsCG5_02],
  [tot indep spectra] AS [totspecCG5_02]
  FROM [412].[table_101B_5_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG5_03],
  [num unique peps] AS [numuniquepepsCG5_03],
  [tot indep spectra] AS [totspecCG5_03]
  FROM [412].[table_101B_5_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG8_01],
  [num unique peps] AS [numuniquepepsCG8_01],
  [tot indep spectra] AS [totspecCG8_01]
  FROM [412].[table_101B_8_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG8_02],
  [num unique peps] AS [numuniquepepsCG8_02],
  [tot indep spectra] AS [totspecCG8_02]
  FROM [412].[table_101B_8_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG8_02],
  [num unique peps] AS [numuniquepepsCG8_02],
  [tot indep spectra] AS [totspecCG8_02]
  FROM [412].[table_101B_8_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG8_03],
  [num unique peps] AS [numuniquepepsCG8_03],
  [tot indep spectra] AS [totspecCG8_03]
  FROM [412].[table_101B_8_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG11_01],
  [num unique peps] AS [numuniquepepsCG11_01],
  [tot indep spectra] AS [totspecCG11_01]
  FROM [412].[table_101B_11_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG11_02],
  [num unique peps] AS [numuniquepepsCG11_02],
  [tot indep spectra] AS [totspecCG11_02]
  FROM [412].[table_101B_11_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG11_03],
  [num unique peps] AS [numuniquepepsCG11_03],
  [tot indep spectra] AS [totspecCG11_03]
  FROM [412].[table_101B_11_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG26_01],
  [num unique peps] AS [numuniquepepsCG26_01],
  [tot indep spectra] AS [totspecCG26_01]
  FROM [412].[table_101B_26_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG26_02],
  [num unique peps] AS [numuniquepepsCG26_02],
  [tot indep spectra] AS [totspecCG26_02]
  FROM [412].[table_101B_26_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG26_03],
  [num unique peps] AS [numuniquepepsCG26_03],
  [tot indep spectra] AS [totspecCG26_03]
  FROM [412].[table_101B_26_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG29_01],
  [num unique peps] AS [numuniquepepsCG29_01],
  [tot indep spectra] AS [totspecCG29_01]
  FROM [412].[table_101B_29_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG29_02],
  [num unique peps] AS [numuniquepepsCG29_02],
  [tot indep spectra] AS [totspecCG29_02]
  FROM [412].[table_101B_29_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG29_03],
  [num unique peps] AS [numuniquepepsCG29_03],
  [tot indep spectra] AS [totspecCG29_03]
  FROM [412].[table_101B_29_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG32_01],
  [num unique peps] AS [numuniquepepsCG32_01],
  [tot indep spectra] AS [totspecCG32_01]
  FROM [412].[table_101B_32_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG32_02],
  [num unique peps] AS [numuniquepepsCG32_02],
  [tot indep spectra] AS [totspecCG32_02]
  FROM [412].[table_101B_32_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG32_03],
  [num unique peps] AS [numuniquepepsCG32_03],
  [tot indep spectra] AS [totspecCG32_03]
  FROM [412].[table_101B_32_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG35_01],
  [num unique peps] AS [numuniquepepsCG35_01],
  [tot indep spectra] AS [totspecCG35_01]
  FROM [412].[table_101B_35_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG35_02],
  [num unique peps] AS [numuniquepepsCG35_02],
  [tot indep spectra] AS [totspecCG35_02]
  FROM [412].[table_101B_35_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG35_03],
  [num unique peps] AS [numuniquepepsCG35_03],
  [tot indep spectra] AS [totspecCG35_03]
  FROM [412].[table_101B_35_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG221_01],
  [num unique peps] AS [numuniquepepsCG221_01],
  [tot indep spectra] AS [totspecCG221_01]
  FROM [412].[table_103B_221_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG221_02],
  [num unique peps] AS [numuniquepepsCG221_02],
  [tot indep spectra] AS [totspecCG221_02]
  FROM [412].[table_103B_221_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG221_03],
  [num unique peps] AS [numuniquepepsCG221_03],
  [tot indep spectra] AS [totspecCG221_03]
  FROM [412].[table_103B_221_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG224_01],
  [num unique peps] AS [numuniquepepsCG224_01],
  [tot indep spectra] AS [totspecCG224_01]
  FROM [412].[table_103B_224_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG224_02],
  [num unique peps] AS [numuniquepepsCG224_02],
  [tot indep spectra] AS [totspecCG224_02]
  FROM [412].[table_103B_224_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG224_03],
  [num unique peps] AS [numuniquepepsCG224_03],
  [tot indep spectra] AS [totspecCG224_03]
  FROM [412].[table_103B_224_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG227_01],
  [num unique peps] AS [numuniquepepsCG227_01],
  [tot indep spectra] AS [totspecCG227_01]
  FROM [412].[table_103B_227_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG227_02],
  [num unique peps] AS [numuniquepepsCG227_02],
  [tot indep spectra] AS [totspecCG227_02]
  FROM [412].[table_103B_227_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG227_03],
  [num unique peps] AS [numuniquepepsCG227_03],
  [tot indep spectra] AS [totspecCG227_03]
  FROM [412].[table_103B_227_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG230_01],
  [num unique peps] AS [numuniquepepsCG230_01],
  [tot indep spectra] AS [totspecCG230_01]
  FROM [412].[table_103B_230_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG230_02],
  [num unique peps] AS [numuniquepepsCG230_02],
  [tot indep spectra] AS [totspecCG230_02]
  FROM [412].[table_103B_230_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG230_03],
  [num unique peps] AS [numuniquepepsCG230_03],
  [tot indep spectra] AS [totspecCG230_03]
  FROM [412].[table_103B_230_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG242_01],
  [num unique peps] AS [numuniquepepsCG242_01],
  [tot indep spectra] AS [totspecCG242_01]
  FROM [412].[table_103B_242_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG242_02],
  [num unique peps] AS [numuniquepepsCG242_02],
  [tot indep spectra] AS [totspecCG242_02]
  FROM [412].[table_103B_242_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG242_03],
  [num unique peps] AS [numuniquepepsCG242_03],
  [tot indep spectra] AS [totspecCG242_03]
  FROM [412].[table_103B_242_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG245_01],
  [num unique peps] AS [numuniquepepsCG245_01],
  [tot indep spectra] AS [totspecCG245_01]
  FROM [412].[table_103B_245_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG245_02],
  [num unique peps] AS [numuniquepepsCG245_02],
  [tot indep spectra] AS [totspecCG245_02]
  FROM [412].[table_103B_245_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG245_03],
  [num unique peps] AS [numuniquepepsCG245_03],
  [tot indep spectra] AS [totspecCG245_03]
  FROM [412].[table_103B_245_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG248_01],
  [num unique peps] AS [numuniquepepsCG248_01],
  [tot indep spectra] AS [totspecCG248_01]
  FROM [412].[table_103B_248_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG248_02],
  [num unique peps] AS [numuniquepepsCG248_02],
  [tot indep spectra] AS [totspecCG248_02]
  FROM [412].[table_103B_248_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG248_03],
  [num unique peps] AS [numuniquepepsCG248_03],
  [tot indep spectra] AS [totspecCG248_03]
  FROM [412].[table_103B_248_03.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG251_01],
  [num unique peps] AS [numuniquepepsCG251_01],
  [tot indep spectra] AS [totspecCG251_01]
  FROM [412].[table_103B_251_01.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG251_02],
  [num unique peps] AS [numuniquepepsCG251_02],
  [tot indep spectra] AS [totspecCG251_02]
  FROM [412].[table_103B_251_02.txt]


________________________________________


SELECT 
  [protein] AS [proteinCG251_03],
  [num unique peps] AS [numuniquepepsCG251_03],
  [tot indep spectra] AS [totspecCG251_03]
  FROM [412].[table_103B_251_03.txt]


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].[proteinCG2_01]
  LEFT JOIN [table_101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_2_02.txt].protein
  LEFT JOIN [table_101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_2_03.txt].protein
  LEFT JOIN [table_101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_5_01.txt].protein
  LEFT JOIN [table_101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_5_02.txt].protein
  LEFT JOIN [table_101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_5_03.txt].protein
  LEFT JOIN [table_101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_8_01.txt].protein
  LEFT JOIN [table_101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_8_02.txt].protein
  LEFT JOIN [table_101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_8_03.txt].protein
  LEFT JOIN [table_101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_11_01.txt].protein
  LEFT JOIN [table_101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_11_02.txt].protein
  LEFT JOIN [table_101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_11_03.txt].protein
  LEFT JOIN [table_101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_26_01.txt].protein
  LEFT JOIN [table_101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_26_02.txt].protein
  LEFT JOIN [table_101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_26_03.txt].protein
  LEFT JOIN [table_101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_29_01.txt].protein
  LEFT JOIN [table_101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_29_02.txt].protein
  LEFT JOIN [table_101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_29_03.txt].protein
  LEFT JOIN [table_101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_32_01.txt].protein
  LEFT JOIN [table_101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_32_02.txt].protein
  LEFT JOIN [table_101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_32_03.txt].protein
  LEFT JOIN [table_101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_35_01.txt].protein
  LEFT JOIN [table_101B_35_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_35_02.txt].protein
  LEFT JOIN [table_101B_35_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_101B_35_03.txt].protein
  LEFT JOIN [table_103B_221_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_221_01.txt].protein
  LEFT JOIN [table_103B_221_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_221_02.txt].protein
  LEFT JOIN [table_103B_221_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_221_03.txt].protein
  LEFT JOIN [table_103B_224_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_224_01.txt].protein
  LEFT JOIN [table_103B_224_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_224_02.txt].protein
  LEFT JOIN [table_103B_224_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_224_03.txt].protein
  LEFT JOIN [table_103B_227_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_227_01.txt].protein
  LEFT JOIN [table_103B_227_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_227_02.txt].protein
  LEFT JOIN [table_103B_227_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_227_03.txt].protein
  LEFT JOIN [table_103B_230_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_230_01.txt].protein
  LEFT JOIN [table_103B_230_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_230_02.txt].protein
  LEFT JOIN [table_103B_230_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_230_03.txt].protein
  LEFT JOIN [table_103B_242_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_242_01.txt].protein
  LEFT JOIN [table_103B_242_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_242_02.txt].protein
  LEFT JOIN [table_103B_242_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_242_03.txt].protein
  LEFT JOIN [table_103B_245_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_245_01.txt].protein
  LEFT JOIN [table_103B_245_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_245_02.txt].protein
  LEFT JOIN [table_103B_245_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_245_03.txt].protein
  LEFT JOIN [table_103B_248_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_248_01.txt].protein
  LEFT JOIN [table_103B_248_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_248_02.txt].protein
  LEFT JOIN [table_103B_248_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_248_03.txt].protein
  LEFT JOIN [table_103B_251_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_251_01.txt].protein
  LEFT JOIN [table_103B_251_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_251_02.txt].protein
  LEFT JOIN [table_103B_251_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[table_103B_251_03.txt].protein



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
  LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
  LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
  LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
  LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
  LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
  LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
  LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
  LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
  LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
  LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
  LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
  LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02
  LEFT JOIN [101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_03.txt].proteinCG32_03
  LEFT JOIN [101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_01.txt].proteinCG35_01
  LEFT JOIN [101B_35_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_02.txt].proteinCG35_02
  LEFT JOIN [101B_35_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_03.txt].proteinCG35_03
  LEFT JOIN [103B_221_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_01.txt].proteinCG221_01
  LEFT JOIN [103B_221_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_02.txt].proteinCG221_02
  LEFT JOIN [103B_221_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_03.txt].proteinCG221_03
  LEFT JOIN [103B_224_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_224_01.txt].proteinCG224_01
  LEFT JOIN [103B_224_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_224_02.txt].proteinCG224_02
  LEFT JOIN [103B_224_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_224_03.txt].proteinCG224_03
  LEFT JOIN [103B_227_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_227_01.txt].proteinCG227_01
  LEFT JOIN [103B_227_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_227_02.txt].proteinCG227_02
  LEFT JOIN [103B_227_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_227_03.txt].proteinCG227_03
  LEFT JOIN [103B_230_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_230_01.txt].proteinCG230_01
  LEFT JOIN [103B_230_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_230_02.txt].proteinCG230_02
  LEFT JOIN [103B_230_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_230_03.txt].proteinCG230_03
  LEFT JOIN [103B_242_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_242_01.txt].proteinCG242_01
  LEFT JOIN [103B_242_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_242_02.txt].proteinCG242_02
  LEFT JOIN [103B_242_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_242_03.txt].proteinCG242_03
  LEFT JOIN [103B_245_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_245_01.txt].proteinCG245_01
  LEFT JOIN [103B_245_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_245_02.txt].proteinCG245_02
  LEFT JOIN [103B_245_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_245_03.txt].proteinCG245_03
  LEFT JOIN [103B_248_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_248_01.txt].proteinCG248_01
  LEFT JOIN [103B_248_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_248_02.txt].proteinCG248_02
  LEFT JOIN [103B_248_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_248_03.txt].proteinCG248_03
  LEFT JOIN [103B_251_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_251_01.txt].proteinCG251_01
  LEFT JOIN [103B_251_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_251_02.txt].proteinCG251_02
  LEFT JOIN [103B_251_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_251_03.txt].proteinCG251_03


________________________________________


SELECT 
  SUM (numuniquepepsCG2_01+numuniquepepsCG2_02+numuniquepepsCG2_03) AS [CG2 unique peps sum]
  FROM [412].[All SpC joined for 16 oysters]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG2_01+numuniquepepsCG2_02+numuniquepepsCG2_03) AS [CG2 unique peps sum]
  FROM [412].[All SpC joined for 16 oysters]
  GROUP BY [All Proteins]



________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG2_01+numuniquepepsCG2_02+numuniquepepsCG2_03) AS [CG2 unique peps sum],
  SUM (numuniquepepsCG5_01+numuniquepepsCG5_02+numuniquepepsCG5_03) AS [CG5 unique peps sum],
  SUM (numuniquepepsCG8_01+numuniquepepsCG8_02+numuniquepepsCG8_03) AS [CG8 unique peps sum],
  SUM (numuniquepepsCG11_01+numuniquepepsCG11_02+numuniquepepsCG11_03) AS [CG11 unique peps sum],
  SUM (numuniquepepsCG26_01+numuniquepepsCG26_02+numuniquepepsCG26_03) AS [CG26 unique peps sum],
  SUM (numuniquepepsCG29_01+numuniquepepsCG29_02+numuniquepepsCG29_03) AS [CG29 unique peps sum],
  SUM (numuniquepepsCG32_01+numuniquepepsCG32_02+numuniquepepsCG32_03) AS [CG32 unique peps sum],
  SUM (numuniquepepsCG35_01+numuniquepepsCG35_02+numuniquepepsCG35_03) AS [CG35 unique peps sum],
  SUM (numuniquepepsCG221_01+numuniquepepsCG221_02+numuniquepepsCG221_03) AS [CG221 unique peps sum],
  SUM (numuniquepepsCG224_01+numuniquepepsCG224_02+numuniquepepsCG224_03) AS [CG224 unique peps sum],
  SUM (numuniquepepsCG227_01+numuniquepepsCG227_02+numuniquepepsCG227_03) AS [CG227 unique peps sum],
  SUM (numuniquepepsCG230_01+numuniquepepsCG230_02+numuniquepepsCG230_03) AS [CG230 unique peps sum],
  SUM (numuniquepepsCG242_01+numuniquepepsCG242_02+numuniquepepsCG242_03) AS [CG242 unique peps sum],
  SUM (numuniquepepsCG245_01+numuniquepepsCG245_02+numuniquepepsCG245_03) AS [CG245 unique peps sum],
  SUM (numuniquepepsCG248_01+numuniquepepsCG248_02+numuniquepepsCG248_03) AS [CG248 unique peps sum],
  SUM (numuniquepepsCG251_01+numuniquepepsCG251_02+numuniquepepsCG251_03) AS [CG251 unique peps sum]
  FROM [412].[All SpC joined for 16 oysters]
  GROUP BY [All Proteins]




________________________________________


SELECT proteinCG2_01,
  SUM (numuniquepepsCG2_01+numuniquepepsCG2_02+numuniquepepsCG2_03) AS [CG2 unique peps sum]
  FROM [412].[All SpC joined for 16 oysters]
   GROUP BY proteinCG2_01



________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG5_01+numuniquepepsCG5_02+numuniquepepsCG5_03) AS [CG5 unique peps sum],
  SUM (numuniquepepsCG8_01+numuniquepepsCG8_02+numuniquepepsCG8_03) AS [CG8 unique peps sum],
  SUM (numuniquepepsCG11_01+numuniquepepsCG11_02+numuniquepepsCG11_03) AS [CG11 unique peps sum],
  SUM (numuniquepepsCG26_01+numuniquepepsCG26_02+numuniquepepsCG26_03) AS [CG26 unique peps sum],
  SUM (numuniquepepsCG29_01+numuniquepepsCG29_02+numuniquepepsCG29_03) AS [CG29 unique peps sum],
  SUM (numuniquepepsCG32_01+numuniquepepsCG32_02+numuniquepepsCG32_03) AS [CG32 unique peps sum],
  SUM (numuniquepepsCG35_01+numuniquepepsCG35_02+numuniquepepsCG35_03) AS [CG35 unique peps sum],
  SUM (numuniquepepsCG221_01+numuniquepepsCG221_02+numuniquepepsCG221_03) AS [CG221 unique peps sum],
  SUM (numuniquepepsCG224_01+numuniquepepsCG224_02+numuniquepepsCG224_03) AS [CG224 unique peps sum],
  SUM (numuniquepepsCG227_01+numuniquepepsCG227_02+numuniquepepsCG227_03) AS [CG227 unique peps sum],
SUM (numuniquepepsCG230_01+numuniquepepsCG230_02+numuniquepepsCG230_03) AS [CG230 unique peps sum],
SUM (numuniquepepsCG242_01+numuniquepepsCG242_02+numuniquepepsCG242_03) AS [CG242 unique peps sum],
  SUM (numuniquepepsCG245_01+numuniquepepsCG245_02+numuniquepepsCG245_03) AS [CG245 unique peps sum],
  SUM (numuniquepepsCG248_01+numuniquepepsCG248_02+numuniquepepsCG248_03) AS [CG248 unique peps sum],
  SUM (numuniquepepsCG251_01+numuniquepepsCG251_02+numuniquepepsCG251_03) AS [CG251 unique peps sum]
  FROM [412].[All SpC joined for 16 oysters]
GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
SUM(totspecCG2_01+ totspecCG2_02+ totspecCG2_03+ totspecCG5_01+ totspecCG5_02+ totspecCG5_03+ totspecCG8_01+ totspecCG8_02+ totspecCG8_03+ totspecCG11_01+ totspecCG11_02+ totspecCG11_03+ totspecCG26_01+ totspecCG26_02+ totspecCG26_03+ totspecCG29_01+ totspecCG29_02+ totspecCG29_03+ totspecCG32_01+ totspecCG32_02+ totspecCG32_03+ totspecCG35_01+ totspecCG35_02+ totspecCG35_03+ totspecCG221_01+ totspecCG221_02+ totspecCG221_03+ totspecCG224_01+ totspecCG224_02+ totspecCG224_03+ totspecCG227_01+ totspecCG227_02+ totspecCG227_03+ totspecCG230_01+ totspecCG230_02+ totspecCG230_03+ totspecCG242_01+ totspecCG242_02+ totspecCG242_03+ totspecCG245_01+ totspecCG245_02+ totspecCG245_03+ totspecCG248_01+ totspecCG248_02+ totspecCG248_03+ totspecCG251_01+ totspecCG251_02+ totspecCG251_03)
FROM [412].[All SpC joined for 16 oysters]
  GROUP BY [All Proteins]



________________________________________


SELECT * FROM [412].[All SpC joined for 16 oysters]
  LEFT JOIN [412].[Sum of unique peptides across replicates]
  ON [412].[All SpC joined for 16 oysters].[All Proteins]=[412].[Sum of unique peptides across replicates].[All Proteins]
  LEFT JOIN [412].[Sum of spec counts across all oysters]
  ON [412].[All SpC joined for 16 oysters].[All Proteins]=[412].[Sum of spec counts across all oysters].[All Proteins]
  



________________________________________


SELECT * FROM [412].[All SpC with totals] WHERE [CG5 unique peps sum] > 1


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG2_01+numuniquepepsCG2_02+numuniquepepsCG2_03) AS [CG5 unique peps sum],
  SUM (numuniquepepsCG5_01+numuniquepepsCG5_02+numuniquepepsCG5_03) AS [CG5 unique peps sum],
  SUM (numuniquepepsCG8_01+numuniquepepsCG8_02+numuniquepepsCG8_03) AS [CG8 unique peps sum],
  SUM (numuniquepepsCG11_01+numuniquepepsCG11_02+numuniquepepsCG11_03) AS [CG11 unique peps sum],
  SUM (numuniquepepsCG26_01+numuniquepepsCG26_02+numuniquepepsCG26_03) AS [CG26 unique peps sum],
  SUM (numuniquepepsCG29_01+numuniquepepsCG29_02+numuniquepepsCG29_03) AS [CG29 unique peps sum],
  SUM (numuniquepepsCG32_01+numuniquepepsCG32_02+numuniquepepsCG32_03) AS [CG32 unique peps sum],
  SUM (numuniquepepsCG35_01+numuniquepepsCG35_02+numuniquepepsCG35_03) AS [CG35 unique peps sum],
  SUM (numuniquepepsCG221_01+numuniquepepsCG221_02+numuniquepepsCG221_03) AS [CG221 unique peps sum],
  SUM (numuniquepepsCG224_01+numuniquepepsCG224_02+numuniquepepsCG224_03) AS [CG224 unique peps sum],
  SUM (numuniquepepsCG227_01+numuniquepepsCG227_02+numuniquepepsCG227_03) AS [CG227 unique peps sum],
SUM (numuniquepepsCG230_01+numuniquepepsCG230_02+numuniquepepsCG230_03) AS [CG230 unique peps sum],
SUM (numuniquepepsCG242_01+numuniquepepsCG242_02+numuniquepepsCG242_03) AS [CG242 unique peps sum],
  SUM (numuniquepepsCG245_01+numuniquepepsCG245_02+numuniquepepsCG245_03) AS [CG245 unique peps sum],
  SUM (numuniquepepsCG248_01+numuniquepepsCG248_02+numuniquepepsCG248_03) AS [CG248 unique peps sum],
  SUM (numuniquepepsCG251_01+numuniquepepsCG251_02+numuniquepepsCG251_03) AS [CG251 unique peps sum]
  FROM [412].[All SpC joined for 16 oysters]
GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG2_01+numuniquepepsCG2_02+numuniquepepsCG2_03) AS [CG2 unique peps sum],
  SUM (numuniquepepsCG5_01+numuniquepepsCG5_02+numuniquepepsCG5_03) AS [CG5 unique peps sum],
  SUM (numuniquepepsCG8_01+numuniquepepsCG8_02+numuniquepepsCG8_03) AS [CG8 unique peps sum],
  SUM (numuniquepepsCG11_01+numuniquepepsCG11_02+numuniquepepsCG11_03) AS [CG11 unique peps sum],
  SUM (numuniquepepsCG26_01+numuniquepepsCG26_02+numuniquepepsCG26_03) AS [CG26 unique peps sum],
  SUM (numuniquepepsCG29_01+numuniquepepsCG29_02+numuniquepepsCG29_03) AS [CG29 unique peps sum],
  SUM (numuniquepepsCG32_01+numuniquepepsCG32_02+numuniquepepsCG32_03) AS [CG32 unique peps sum],
  SUM (numuniquepepsCG35_01+numuniquepepsCG35_02+numuniquepepsCG35_03) AS [CG35 unique peps sum],
  SUM (numuniquepepsCG221_01+numuniquepepsCG221_02+numuniquepepsCG221_03) AS [CG221 unique peps sum],
  SUM (numuniquepepsCG224_01+numuniquepepsCG224_02+numuniquepepsCG224_03) AS [CG224 unique peps sum],
  SUM (numuniquepepsCG227_01+numuniquepepsCG227_02+numuniquepepsCG227_03) AS [CG227 unique peps sum],
SUM (numuniquepepsCG230_01+numuniquepepsCG230_02+numuniquepepsCG230_03) AS [CG230 unique peps sum],
SUM (numuniquepepsCG242_01+numuniquepepsCG242_02+numuniquepepsCG242_03) AS [CG242 unique peps sum],
  SUM (numuniquepepsCG245_01+numuniquepepsCG245_02+numuniquepepsCG245_03) AS [CG245 unique peps sum],
  SUM (numuniquepepsCG248_01+numuniquepepsCG248_02+numuniquepepsCG248_03) AS [CG248 unique peps sum],
  SUM (numuniquepepsCG251_01+numuniquepepsCG251_02+numuniquepepsCG251_03) AS [CG251 unique peps sum]
  FROM [412].[All SpC joined for 16 oysters]
GROUP BY [All Proteins]


________________________________________



SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
  LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
  LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
  LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03



________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG2_01+numuniquepepsCG2_02+numuniquepepsCG2_03) AS [CG2 unique peps sum]
  FROM [412].[Oyster 2 spec counts]
  GROUP BY [All Proteins]



________________________________________


SELECT * FROM [412].[CG2 unique peps sum]
  WHERE [CG2 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG2 unique peps sum]
  WHERE [CG2 unique peps sum] > 1


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG5_01+numuniquepepsCG5_02+numuniquepepsCG5_03) AS [CG5 unique peps sum]
  FROM [412].[Oyster 5 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT * FROM [412].[CG5 unique peps sum]
  WHERE [CG5 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[CG2 unique peps > 1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG2 unique peps > 1].[All Proteins]
LEFT JOIN [412].[CG5 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG5 unique peps >1].[All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (totspecCG2_01+totspecCG2_02+totspecCG2_03) AS [CG2 total SpC],
  SUM (totspecCG5_01+totspecCG5_02+totspecCG5_03) AS [CG5 total SpC],
  SUM (totspecCG8_01+totspecCG8_02+totspecCG8_03) AS [CG8 total SpC],
  SUM (totspecCG11_01+totspecCG11_02+totspecCG11_03) AS [CG11 total SpC],
  SUM (totspecCG26_01+totspecCG26_02+totspecCG26_03) AS [CG26 total SpC],
  SUM (totspecCG29_01+totspecCG29_02+totspecCG29_03) AS [CG29 total SpC],
  SUM (totspecCG32_01+totspecCG32_02+totspecCG32_03) AS [CG32 total SpC],
  SUM (totspecCG35_01+totspecCG35_02+totspecCG35_03) AS [CG35 total SpC],
  SUM (totspecCG221_01+totspecCG221_02+totspecCG221_03) AS [CG221 total SpC],
  SUM (totspecCG224_01+totspecCG224_02+totspecCG224_03) AS [CG224 total SpC],
  SUM (totspecCG227_01+totspecCG227_02+totspecCG227_03) AS [CG227 total SpC],
SUM (totspecCG230_01+totspecCG230_02+totspecCG230_03) AS [CG230 total SpC],
SUM (totspecCG242_01+totspecCG242_02+totspecCG242_03) AS [CG242 total SpC],
  SUM (totspecCG245_01+totspecCG245_02+totspecCG245_03) AS [CG245 total SpC],
  SUM (totspecCG248_01+totspecCG248_02+totspecCG248_03) AS [CG248 total SpC],
  SUM (totspecCG251_01+totspecCG251_02+totspecCG251_03) AS [CG251 total SpC]
  FROM [412].[All SpC joined for 16 oysters]
  GROUP BY [All Proteins]



________________________________________


SELECT [All Proteins],
  SUM (totspecCG2_01+totspecCG2_02+totspecCG2_03) AS [CG2 total SpC],
  SUM (totspecCG5_01+totspecCG5_02+totspecCG5_03) AS [CG5 total SpC],
  SUM (totspecCG8_01+totspecCG8_02+totspecCG8_03) AS [CG8 total SpC],
  SUM (totspecCG11_01+totspecCG11_02+totspecCG11_03) AS [CG11 total SpC],
  SUM (totspecCG26_01+totspecCG26_02+totspecCG26_03) AS [CG26 total SpC],
  SUM (totspecCG29_01+totspecCG29_02+totspecCG29_03) AS [CG29 total SpC],
  SUM (totspecCG32_01+totspecCG32_02+totspecCG32_03) AS [CG32 total SpC],
  SUM (totspecCG35_01+totspecCG35_02+totspecCG35_03) AS [CG35 total SpC],
  SUM (totspecCG221_01+totspecCG221_02+totspecCG221_03) AS [CG221 total SpC],
  SUM (totspecCG224_01+totspecCG224_02+totspecCG224_03) AS [CG224 total SpC],
  SUM (totspecCG227_01+totspecCG227_02+totspecCG227_03) AS [CG227 total SpC],
SUM (totspecCG230_01+totspecCG230_02+totspecCG230_03) AS [CG230 total SpC],
SUM (totspecCG242_01+totspecCG242_02+totspecCG242_03) AS [CG242 total SpC],
  SUM (totspecCG245_01+totspecCG245_02+totspecCG245_03) AS [CG245 total SpC],
  SUM (totspecCG248_01+totspecCG248_02+totspecCG248_03) AS [CG248 total SpC],
  SUM (totspecCG251_01+totspecCG251_02+totspecCG251_03) AS [CG251 total SpC],
  SUM(totspecCG2_01+ totspecCG2_02+ totspecCG2_03+ totspecCG5_01+ totspecCG5_02+ totspecCG5_03+ totspecCG8_01+ totspecCG8_02+ totspecCG8_03+ totspecCG11_01+ totspecCG11_02+ totspecCG11_03+ totspecCG26_01+ totspecCG26_02+ totspecCG26_03+ totspecCG29_01+ totspecCG29_02+ totspecCG29_03+ totspecCG32_01+ totspecCG32_02+ totspecCG32_03+ totspecCG35_01+ totspecCG35_02+ totspecCG35_03+ totspecCG221_01+ totspecCG221_02+ totspecCG221_03+ totspecCG224_01+ totspecCG224_02+ totspecCG224_03+ totspecCG227_01+ totspecCG227_02+ totspecCG227_03+ totspecCG230_01+ totspecCG230_02+ totspecCG230_03+ totspecCG242_01+ totspecCG242_02+ totspecCG242_03+ totspecCG245_01+ totspecCG245_02+ totspecCG245_03+ totspecCG248_01+ totspecCG248_02+ totspecCG248_03+ totspecCG251_01+ totspecCG251_02+ totspecCG251_03) AS [Total SpC]
  FROM [412].[All SpC joined for 16 oysters]
  GROUP BY [All Proteins]



________________________________________


SELECT * FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[CG2 unique peps > 1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG2 unique peps > 1].[All Proteins]
LEFT JOIN [412].[CG5 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG5 unique peps >1].[All Proteins]
  LEFT JOIN [412].[Total SpC per oyster]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[Total SpC per oyster].[All Proteins]



________________________________________


SELECT * FROM [412].[Total SpC per oyster]
  WHERE [Total SpC] >7



________________________________________


SELECT * FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[CG2 unique peps > 1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG2 unique peps > 1].[All Proteins]
LEFT JOIN [412].[CG5 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG5 unique peps >1].[All Proteins]
  LEFT JOIN [412].[All reps SpC > 7]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[All reps SpC > 7].[All Proteins]



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
  LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
  LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
  LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
  LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
  LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
  LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02
  LEFT JOIN [101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_03.txt].proteinCG32_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_01.txt].proteinCG35_01
  LEFT JOIN [101B_35_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_02.txt].proteinCG35_02
  LEFT JOIN [101B_35_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_03.txt].proteinCG35_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [103B_221_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_01.txt].proteinCG221_01
  LEFT JOIN [103B_221_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_02.txt].proteinCG221_02
  LEFT JOIN [103B_221_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_03.txt].proteinCG221_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [103B_224_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_224_01.txt].proteinCG224_01
  LEFT JOIN [103B_224_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_224_02.txt].proteinCG224_02
  LEFT JOIN [103B_224_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_224_03.txt].proteinCG224_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [103B_227_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_227_01.txt].proteinCG227_01
  LEFT JOIN [103B_227_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_227_02.txt].proteinCG227_02
  LEFT JOIN [103B_227_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_227_03.txt].proteinCG227_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [103B_230_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_230_01.txt].proteinCG230_01
  LEFT JOIN [103B_230_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_230_02.txt].proteinCG230_02
  LEFT JOIN [103B_230_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_230_03.txt].proteinCG230_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [103B_242_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_242_01.txt].proteinCG242_01
  LEFT JOIN [103B_242_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_242_02.txt].proteinCG242_02
  LEFT JOIN [103B_242_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_242_03.txt].proteinCG242_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [103B_245_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_245_01.txt].proteinCG245_01
  LEFT JOIN [103B_245_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_245_02.txt].proteinCG245_02
  LEFT JOIN [103B_245_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_245_03.txt].proteinCG245_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [103B_248_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_248_01.txt].proteinCG248_01
  LEFT JOIN [103B_248_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_248_02.txt].proteinCG248_02
  LEFT JOIN [103B_248_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_248_03.txt].proteinCG248_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [103B_251_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_251_01.txt].proteinCG251_01
  LEFT JOIN [103B_251_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_251_02.txt].proteinCG251_02
  LEFT JOIN [103B_251_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_251_03.txt].proteinCG251_03


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG5_01+numuniquepepsCG5_02+numuniquepepsCG5_03) AS [CG5 unique peps sum]
  FROM [412].[Oyster 5 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG8_01+numuniquepepsCG8_02+numuniquepepsCG8_03) AS [CG8 unique peps sum]
  FROM [412].[Oyster 8 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG11_01+numuniquepepsCG11_02+numuniquepepsCG11_03) AS [CG11 unique peps sum]
  FROM [412].[Oyster 11 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG26_01+numuniquepepsCG26_02+numuniquepepsCG26_03) AS [CG26 unique peps sum]
  FROM [412].[Oyster 26 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG29_01+numuniquepepsCG29_02+numuniquepepsCG29_03) AS [CG29 unique peps sum]
  FROM [412].[Oyster 29 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG32_01+numuniquepepsCG32_02+numuniquepepsCG32_03) AS [CG32 unique peps sum]
  FROM [412].[Oyster 32 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG35_01+numuniquepepsCG35_02+numuniquepepsCG35_03) AS [CG35 unique peps sum]
  FROM [412].[Oyster 35 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG221_01+numuniquepepsCG221_02+numuniquepepsCG221_03) AS [CG221 unique peps sum]
  FROM [412].[Oyster 221 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG224_01+numuniquepepsCG224_02+numuniquepepsCG224_03) AS [CG224 unique peps sum]
  FROM [412].[Oyster 224 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG227_01+numuniquepepsCG227_02+numuniquepepsCG227_03) AS [CG227 unique peps sum]
  FROM [412].[Oyster 227 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG230_01+numuniquepepsCG230_02+numuniquepepsCG230_03) AS [CG230 unique peps sum]
  FROM [412].[Oyster 230 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG242_01+numuniquepepsCG242_02+numuniquepepsCG242_03) AS [CG242 unique peps sum]
  FROM [412].[Oyster 242 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG245_01+numuniquepepsCG245_02+numuniquepepsCG245_03) AS [CG245 unique peps sum]
  FROM [412].[Oyster 245 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG248_01+numuniquepepsCG248_02+numuniquepepsCG248_03) AS [CG248 unique peps sum]
  FROM [412].[Oyster 248 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT [All Proteins],
  SUM (numuniquepepsCG251_01+numuniquepepsCG251_02+numuniquepepsCG251_03) AS [CG251 unique peps sum]
  FROM [412].[Oyster 251 spec counts]
  GROUP BY [All Proteins]


________________________________________


SELECT * FROM [412].[CG8 unique peps sum]
  WHERE [CG8 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG11 unique peps sum]
  WHERE [CG11 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG26 unique peps sum]
  WHERE [CG26 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG29 unique peps sum]
  WHERE [CG29 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG32 unique peps sum]
  WHERE [CG32 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG35 unique peps sum]
  WHERE [CG35 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG221 unique peps sum]
  WHERE [CG221 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG224 unique peps sum]
  WHERE [CG224 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG227 unique peps sum]
  WHERE [CG227 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG230 unique peps sum]
  WHERE [CG230 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG242 unique peps sum]
  WHERE [CG242 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG245 unique peps sum]
  WHERE [CG245 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG248 unique peps sum]
  WHERE [CG248 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[CG251 unique peps sum]
  WHERE [CG251 unique peps sum] > 1


________________________________________


SELECT * FROM [412].[Total SpC per oyster]
  WHERE [Total SpC] >7



________________________________________


SELECT * FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[CG2 unique peps > 1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG2 unique peps > 1].[All Proteins]
LEFT JOIN [412].[CG5 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG5 unique peps >1].[All Proteins]
  LEFT JOIN [412].[CG8 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG8 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG11 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG11 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG26 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG26 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG29 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG29 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG32 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG32 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG35 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG35 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG221 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG221 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG224 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG224 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG227 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG227 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG230 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG230 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG242 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG242 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG245 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG245 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG248 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG248 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG251 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG251 unique peps >1].[All Proteins]

  LEFT JOIN [412].[All reps SpC > 7]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[All reps SpC > 7].[All Proteins]



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
  


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
    LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
    LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
    LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
    LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
    LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01  
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
    LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
    LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01  
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02
    LEFT JOIN [101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_03.txt].proteinCG32_03



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
    LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
    LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01  
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02
    LEFT JOIN [101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_03.txt].proteinCG32_03
  LEFT JOIN [101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_01.txt].proteinCG35_01


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
    LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
    LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01  
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02
    LEFT JOIN [101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_03.txt].proteinCG32_03
  LEFT JOIN [101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_01.txt].proteinCG35_01
    LEFT JOIN [101B_35_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_02.txt].proteinCG35_02


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
    LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
    LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01  
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02
    LEFT JOIN [101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_03.txt].proteinCG32_03
  LEFT JOIN [101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_01.txt].proteinCG35_01
    LEFT JOIN [101B_35_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_02.txt].proteinCG35_02
    LEFT JOIN [101B_35_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_03.txt].proteinCG35_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
    LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
    LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01  
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02
    LEFT JOIN [101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_03.txt].proteinCG32_03
  LEFT JOIN [101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_01.txt].proteinCG35_01
    LEFT JOIN [101B_35_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_02.txt].proteinCG35_02
    LEFT JOIN [101B_35_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_03.txt].proteinCG35_03
    LEFT JOIN [103B_221_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_01.txt].proteinCG221_01


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
    LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
    LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
    LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
    LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
    LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
    LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
    LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
    LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02  
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01  
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
    LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
    LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
    LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
    LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01  
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02
    LEFT JOIN [101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_03.txt].proteinCG32_03
  LEFT JOIN [101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_01.txt].proteinCG35_01
    LEFT JOIN [101B_35_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_02.txt].proteinCG35_02
    LEFT JOIN [101B_35_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_03.txt].proteinCG35_03
    LEFT JOIN [103B_221_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_01.txt].proteinCG221_01
    LEFT JOIN [103B_221_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_02.txt].proteinCG221_02


________________________________________


SELECT 
  [protein] AS [proteinCG221_02],
  [num unique peps] AS [numuniquepepsCG221_02],
  [tot indep spectra] AS [totspecCG221_02]
  FROM [412].[table_103B_221_02.txt]
 


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [103B_221_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_01.txt].proteinCG221_01
  LEFT JOIN [103B_221_02 new.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_02 new.txt].proteinCG221_02
  LEFT JOIN [103B_221_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_03.txt].proteinCG221_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [101B_2_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_01.txt].proteinCG2_01
  LEFT JOIN [101B_2_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [101B_2_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_2_03.txt].proteinCG2_03
  LEFT JOIN [101B_5_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_01.txt].proteinCG5_01
  LEFT JOIN [101B_5_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_02.txt].proteinCG5_02
  LEFT JOIN [101B_5_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_5_03.txt].proteinCG5_03
  LEFT JOIN [101B_8_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_01.txt].proteinCG8_01
  LEFT JOIN [101B_8_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_02.txt].proteinCG8_02
  LEFT JOIN [101B_8_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_8_03.txt].proteinCG8_03
  LEFT JOIN [101B_11_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_01.txt].proteinCG11_01
  LEFT JOIN [101B_11_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_02.txt].proteinCG11_02
  LEFT JOIN [101B_11_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_11_03.txt].proteinCG11_03
  LEFT JOIN [101B_26_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_01.txt].proteinCG26_01
  LEFT JOIN [101B_26_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_02.txt].proteinCG26_02
  LEFT JOIN [101B_26_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_26_03.txt].proteinCG26_03
  LEFT JOIN [101B_29_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_01.txt].proteinCG29_01
  LEFT JOIN [101B_29_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_02.txt].proteinCG29_02
  LEFT JOIN [101B_29_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_29_03.txt].proteinCG29_03
  LEFT JOIN [101B_32_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_01.txt].proteinCG32_01
  LEFT JOIN [101B_32_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_02.txt].proteinCG32_02
  LEFT JOIN [101B_32_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_32_03.txt].proteinCG32_03
  LEFT JOIN [101B_35_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_01.txt].proteinCG35_01
  LEFT JOIN [101B_35_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_02.txt].proteinCG35_02
  LEFT JOIN [101B_35_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[101B_35_03.txt].proteinCG35_03
  LEFT JOIN [103B_221_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_01.txt].proteinCG221_01
  LEFT JOIN [103B_221_02 new.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_02 new.txt].proteinCG221_02
  LEFT JOIN [103B_221_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_221_03.txt].proteinCG221_03
  LEFT JOIN [103B_224_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_224_01.txt].proteinCG224_01
  LEFT JOIN [103B_224_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_224_02.txt].proteinCG224_02
  LEFT JOIN [103B_224_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_224_03.txt].proteinCG224_03
  LEFT JOIN [103B_227_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_227_01.txt].proteinCG227_01
  LEFT JOIN [103B_227_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_227_02.txt].proteinCG227_02
  LEFT JOIN [103B_227_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_227_03.txt].proteinCG227_03
  LEFT JOIN [103B_230_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_230_01.txt].proteinCG230_01
  LEFT JOIN [103B_230_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_230_02.txt].proteinCG230_02
  LEFT JOIN [103B_230_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_230_03.txt].proteinCG230_03
  LEFT JOIN [103B_242_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_242_01.txt].proteinCG242_01
  LEFT JOIN [103B_242_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_242_02.txt].proteinCG242_02
  LEFT JOIN [103B_242_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_242_03.txt].proteinCG242_03
  LEFT JOIN [103B_245_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_245_01.txt].proteinCG245_01
  LEFT JOIN [103B_245_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_245_02.txt].proteinCG245_02
  LEFT JOIN [103B_245_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_245_03.txt].proteinCG245_03
  LEFT JOIN [103B_248_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_248_01.txt].proteinCG248_01
  LEFT JOIN [103B_248_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_248_02.txt].proteinCG248_02
  LEFT JOIN [103B_248_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_248_03.txt].proteinCG248_03
  LEFT JOIN [103B_251_01.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_251_01.txt].proteinCG251_01
  LEFT JOIN [103B_251_02.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_251_02.txt].proteinCG251_02
  LEFT JOIN [103B_251_03.txt]
  ON [all sequenced proteins all treatments.txt].[All Proteins]=[103B_251_03.txt].proteinCG251_03


________________________________________


SELECT 
  CASE WHEN totspecCG2_01 is NULL THEN 0 ELSE totspecCG2_01 END AS totspecCG2_01 
  FROM [412].[All SpC joined for 16 oysters] 



________________________________________


SELECT [All Proteins],
  CASE WHEN totspecCG2_01 is NULL THEN 0 ELSE totspecCG2_01 END AS totspecCG2_01 
  FROM [412].[All SpC joined for 16 oysters] 



________________________________________


SELECT [All Proteins],
  CASE WHEN totspecCG2_01 is NULL THEN 0 ELSE totspecCG2_01 END AS totspecCG2_01 
  FROM [412].[All SpC joined for 16 oysters] 



________________________________________


SELECT [All Proteins],
  CASE WHEN totspecCG2_01 is NULL THEN 0 ELSE totspecCG2_01 END AS totspecCG2_01, 
  CASE WHEN totspecCG2_02 is NULL THEN 0 ELSE totspecCG2_02 END AS totspecCG2_02
  FROM [412].[All SpC joined for 16 oysters] 



________________________________________


SELECT [All Proteins],
  CASE WHEN totspecCG2_01 is NULL THEN 0 ELSE totspecCG2_01 END AS totspecCG2_01, 
  CASE WHEN totspecCG2_02 is NULL THEN 0 ELSE totspecCG2_02 END AS totspecCG2_02,
  CASE WHEN totspecCG2_03 is NULL THEN 0 ELSE totspecCG2_03 END AS totspecCG2_03, 
CASE WHEN totspecCG5_01 is NULL THEN 0 ELSE totspecCG5_01 END AS totspecCG5_01, 
CASE WHEN totspecCG5_02 is NULL THEN 0 ELSE totspecCG5_02 END AS totspecCG5_02, 
CASE WHEN totspecCG5_03 is NULL THEN 0 ELSE totspecCG5_03 END AS totspecCG5_03,
CASE WHEN totspecCG8_01 is NULL THEN 0 ELSE totspecCG8_01 END AS totspecCG8_01, 
CASE WHEN totspecCG8_02 is NULL THEN 0 ELSE totspecCG8_02 END AS totspecCG8_02, 
CASE WHEN totspecCG8_03 is NULL THEN 0 ELSE totspecCG8_03 END AS totspecCG8_03, 
CASE WHEN totspecCG11_01 is NULL THEN 0 ELSE totspecCG11_01 END AS totspecCG11_01, 
CASE WHEN totspecCG11_02 is NULL THEN 0 ELSE totspecCG11_02 END AS totspecCG11_02, 
CASE WHEN totspecCG11_03 is NULL THEN 0 ELSE totspecCG11_03 END AS totspecCG11_03, 
CASE WHEN totspecCG26_01 is NULL THEN 0 ELSE totspecCG26_01 END AS totspecCG26_01, 
CASE WHEN totspecCG26_02 is NULL THEN 0 ELSE totspecCG26_02 END AS totspecCG26_02, 
CASE WHEN totspecCG26_03 is NULL THEN 0 ELSE totspecCG26_03 END AS totspecCG26_03, 
CASE WHEN totspecCG29_01 is NULL THEN 0 ELSE totspecCG29_01 END AS totspecCG29_01, 
CASE WHEN totspecCG29_02 is NULL THEN 0 ELSE totspecCG29_02 END AS totspecCG29_02, 
CASE WHEN totspecCG29_03 is NULL THEN 0 ELSE totspecCG29_03 END AS totspecCG29_03, 
CASE WHEN totspecCG32_01 is NULL THEN 0 ELSE totspecCG32_01 END AS totspecCG32_01, 
CASE WHEN totspecCG32_02 is NULL THEN 0 ELSE totspecCG32_02 END AS totspecCG32_02, 
CASE WHEN totspecCG32_03 is NULL THEN 0 ELSE totspecCG32_03 END AS totspecCG32_03, 
CASE WHEN totspecCG35_01 is NULL THEN 0 ELSE totspecCG35_01 END AS totspecCG35_01, 
CASE WHEN totspecCG35_02 is NULL THEN 0 ELSE totspecCG35_02 END AS totspecCG35_02, 
CASE WHEN totspecCG35_03 is NULL THEN 0 ELSE totspecCG35_03 END AS totspecCG35_03, 
CASE WHEN totspecCG221_01 is NULL THEN 0 ELSE totspecCG221_01 END AS totspecCG221_01, 
CASE WHEN totspecCG221_02 is NULL THEN 0 ELSE totspecCG221_02 END AS totspecCG221_02, 
CASE WHEN totspecCG221_03 is NULL THEN 0 ELSE totspecCG221_03 END AS totspecCG221_03, 
CASE WHEN totspecCG224_01 is NULL THEN 0 ELSE totspecCG224_01 END AS totspecCG224_01, 
CASE WHEN totspecCG224_02 is NULL THEN 0 ELSE totspecCG224_02 END AS totspecCG224_02, 
CASE WHEN totspecCG224_03 is NULL THEN 0 ELSE totspecCG224_03 END AS totspecCG224_03, 
CASE WHEN totspecCG227_01 is NULL THEN 0 ELSE totspecCG227_01 END AS totspecCG227_01, 
CASE WHEN totspecCG227_02 is NULL THEN 0 ELSE totspecCG227_02 END AS totspecCG227_02, 
CASE WHEN totspecCG227_03 is NULL THEN 0 ELSE totspecCG227_03 END AS totspecCG227_03, 
CASE WHEN totspecCG230_01 is NULL THEN 0 ELSE totspecCG230_01 END AS totspecCG230_01, 
CASE WHEN totspecCG230_02 is NULL THEN 0 ELSE totspecCG230_02 END AS totspecCG230_02, 
CASE WHEN totspecCG230_03 is NULL THEN 0 ELSE totspecCG230_03 END AS totspecCG230_03, 
CASE WHEN totspecCG242_01 is NULL THEN 0 ELSE totspecCG242_01 END AS totspecCG242_01, 
CASE WHEN totspecCG242_02 is NULL THEN 0 ELSE totspecCG242_02 END AS totspecCG242_02, 
CASE WHEN totspecCG242_03 is NULL THEN 0 ELSE totspecCG242_03 END AS totspecCG242_03, 
CASE WHEN totspecCG245_01 is NULL THEN 0 ELSE totspecCG245_01 END AS totspecCG245_01, 
CASE WHEN totspecCG245_02 is NULL THEN 0 ELSE totspecCG245_02 END AS totspecCG245_02, 
CASE WHEN totspecCG245_03 is NULL THEN 0 ELSE totspecCG245_03 END AS totspecCG245_03, 
CASE WHEN totspecCG248_01 is NULL THEN 0 ELSE totspecCG248_01 END AS totspecCG248_01, 
CASE WHEN totspecCG248_02 is NULL THEN 0 ELSE totspecCG248_02 END AS totspecCG248_02, 
CASE WHEN totspecCG248_03 is NULL THEN 0 ELSE totspecCG248_03 END AS totspecCG248_03, 
CASE WHEN totspecCG251_01 is NULL THEN 0 ELSE totspecCG251_01 END AS totspecCG251_01, 
CASE WHEN totspecCG251_02 is NULL THEN 0 ELSE totspecCG251_02 END AS totspecCG251_02, 
CASE WHEN totspecCG251_03 is NULL THEN 0 ELSE totspecCG251_03 END AS totspecCG251_03 
  FROM [412].[All SpC joined for 16 oysters] 



________________________________________


SELECT [All Proteins],
  SUM (totspecCG2_01+totspecCG2_02+totspecCG2_03) AS [CG2 total SpC],
  SUM (totspecCG5_01+totspecCG5_02+totspecCG5_03) AS [CG5 total SpC],
  SUM (totspecCG8_01+totspecCG8_02+totspecCG8_03) AS [CG8 total SpC],
  SUM (totspecCG11_01+totspecCG11_02+totspecCG11_03) AS [CG11 total SpC],
  SUM (totspecCG26_01+totspecCG26_02+totspecCG26_03) AS [CG26 total SpC],
  SUM (totspecCG29_01+totspecCG29_02+totspecCG29_03) AS [CG29 total SpC],
  SUM (totspecCG32_01+totspecCG32_02+totspecCG32_03) AS [CG32 total SpC],
  SUM (totspecCG35_01+totspecCG35_02+totspecCG35_03) AS [CG35 total SpC],
  SUM (totspecCG221_01+totspecCG221_02+totspecCG221_03) AS [CG221 total SpC],
  SUM (totspecCG224_01+totspecCG224_02+totspecCG224_03) AS [CG224 total SpC],
  SUM (totspecCG227_01+totspecCG227_02+totspecCG227_03) AS [CG227 total SpC],
SUM (totspecCG230_01+totspecCG230_02+totspecCG230_03) AS [CG230 total SpC],
SUM (totspecCG242_01+totspecCG242_02+totspecCG242_03) AS [CG242 total SpC],
  SUM (totspecCG245_01+totspecCG245_02+totspecCG245_03) AS [CG245 total SpC],
  SUM (totspecCG248_01+totspecCG248_02+totspecCG248_03) AS [CG248 total SpC],
  SUM (totspecCG251_01+totspecCG251_02+totspecCG251_03) AS [CG251 total SpC],
  SUM(totspecCG2_01+ totspecCG2_02+ totspecCG2_03+ totspecCG5_01+ totspecCG5_02+ totspecCG5_03+ totspecCG8_01+ totspecCG8_02+ totspecCG8_03+ totspecCG11_01+ totspecCG11_02+ totspecCG11_03+ totspecCG26_01+ totspecCG26_02+ totspecCG26_03+ totspecCG29_01+ totspecCG29_02+ totspecCG29_03+ totspecCG32_01+ totspecCG32_02+ totspecCG32_03+ totspecCG35_01+ totspecCG35_02+ totspecCG35_03+ totspecCG221_01+ totspecCG221_02+ totspecCG221_03+ totspecCG224_01+ totspecCG224_02+ totspecCG224_03+ totspecCG227_01+ totspecCG227_02+ totspecCG227_03+ totspecCG230_01+ totspecCG230_02+ totspecCG230_03+ totspecCG242_01+ totspecCG242_02+ totspecCG242_03+ totspecCG245_01+ totspecCG245_02+ totspecCG245_03+ totspecCG248_01+ totspecCG248_02+ totspecCG248_03+ totspecCG251_01+ totspecCG251_02+ totspecCG251_03) AS [Total SpC]
  FROM [412].[All SpC for 16 oysters with 0]
  GROUP BY [All Proteins]



________________________________________


SELECT * FROM [412].[Total SpC per oyster]
  WHERE [Total SpC] >7



________________________________________


SELECT * FROM [412].[Total SpC per oyster]
  WHERE [Total SpC] >7


________________________________________


SELECT * FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[CG2 unique peps > 1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG2 unique peps > 1].[All Proteins]
LEFT JOIN [412].[CG5 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG5 unique peps >1].[All Proteins]
  LEFT JOIN [412].[CG8 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG8 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG11 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG11 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG26 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG26 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG29 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG29 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG32 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG32 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG35 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG35 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG221 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG221 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG224 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG224 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG227 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG227 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG230 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG230 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG242 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG242 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG245 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG245 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG248 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG248 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG251 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG251 unique peps >1].[All Proteins]
  LEFT JOIN [412].[All reps SpC >7 new]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[All reps SpC >7 new].[All Proteins]



________________________________________


SELECT * FROM [412].[Unique peptides all biological reps]
  LEFT JOIN [412].[table_protein length.txt]
  ON [412].[Unique peptides all biological reps].[All Proteins]=[412].[table_protein length.txt].protein


________________________________________


SELECT [All Proteins],
  [CG2 total SpC]/[protein length]
  FROM [412].[All proteins with length]


________________________________________


SELECT [All Proteins],
  ([CG2 total SpC]/[protein length]) AS [CG2 SpC/L]
  FROM [412].[All proteins with length]


________________________________________


SELECT [All Proteins],
 CAST([CG2 total SpC] AS FLOAT)/[protein length] AS [CG2 SpC/L],
  CAST([CG5 total SpC] AS FLOAT)/[protein length] AS [CG5 SpC/L],
CAST([CG8 total SpC] AS FLOAT)/[protein length] AS [CG8 SpC/L],
CAST([CG11 total SpC] AS FLOAT)/[protein length] AS [CG11 SpC/L],
CAST([CG26 total SpC] AS FLOAT)/[protein length] AS [CG26 SpC/L],
CAST([CG29 total SpC] AS FLOAT)/[protein length] AS [CG29 SpC/L],
CAST([CG32 total SpC] AS FLOAT)/[protein length] AS [CG32 SpC/L],
CAST([CG35 total SpC] AS FLOAT)/[protein length] AS [CG35 SpC/L],
CAST([CG221 total SpC] AS FLOAT)/[protein length] AS [CG221 SpC/L],
CAST([CG224 total SpC] AS FLOAT)/[protein length] AS [CG224 SpC/L],
CAST([CG227 total SpC] AS FLOAT)/[protein length] AS [CG227 SpC/L],
CAST([CG230 total SpC] AS FLOAT)/[protein length] AS [CG230 SpC/L],
CAST([CG242 total SpC] AS FLOAT)/[protein length] AS [CG242 SpC/L],
CAST([CG245 total SpC] AS FLOAT)/[protein length] AS [CG245 SpC/L],
CAST([CG248 total SpC] AS FLOAT)/[protein length] AS [CG248 SpC/L],
CAST([CG251 total SpC] AS FLOAT)/[protein length] AS [CG251 SpC/L]
  FROM [412].[All proteins with length]


________________________________________


SELECT 
  SUM([CG2 SpC/L]) AS [SUM CG2 SpC/L],
SUM([CG5 SpC/L]) AS [SUM CG5 SpC/L],
SUM([CG8 SpC/L]) AS [SUM CG8 SpC/L],
SUM([CG11 SpC/L]) AS [SUM CG11 SpC/L],
SUM([CG26 SpC/L]) AS [SUM CG26 SpC/L],
SUM([CG29 SpC/L]) AS [SUM CG29 SpC/L],
SUM([CG32 SpC/L]) AS [SUM CG32 SpC/L],
SUM([CG35 SpC/L]) AS [SUM CG35 SpC/L],
SUM([CG221 SpC/L]) AS [SUM CG221 SpC/L],
SUM([CG224 SpC/L]) AS [SUM CG224 SpC/L],
SUM([CG227 SpC/L]) AS [SUM CG227 SpC/L],
SUM([CG230 SpC/L]) AS [SUM CG230 SpC/L],
SUM([CG242 SpC/L]) AS [SUM CG242 SpC/L],
SUM([CG245 SpC/L]) AS [SUM CG245 SpC/L],
SUM([CG248 SpC/L]) AS [SUM CG248 SpC/L],
SUM([CG251 SpC/L]) AS [SUM CG251 SpC/L]  
  FROM [412].[SpC-L for all proteins all oysters]


________________________________________


SELECT 
  spc.[CG2 SpC/L] / allspc.[SUM CG2 SpC/L] AS [Relative CG2 SpC/L],
spc.[CG5 SpC/L] / allspc.[SUM CG5 SpC/L] AS [Relative CG5 SpC/L],
spc.[CG8 SpC/L] / allspc.[SUM CG8 SpC/L] AS [Relative CG8 SpC/L],
spc.[CG11 SpC/L] / allspc.[SUM CG11 SpC/L] AS [Relative CG11 SpC/L],
spc.[CG26 SpC/L] / allspc.[SUM CG26 SpC/L] AS [Relative CG26 SpC/L],
spc.[CG29 SpC/L] / allspc.[SUM CG29 SpC/L] AS [Relative CG29 SpC/L],
spc.[CG32 SpC/L] / allspc.[SUM CG32 SpC/L] AS [Relative CG32 SpC/L],
spc.[CG35 SpC/L] / allspc.[SUM CG35 SpC/L] AS [Relative CG35 SpC/L],
spc.[CG221 SpC/L] / allspc.[SUM CG221 SpC/L] AS [Relative CG221 SpC/L],
spc.[CG224 SpC/L] / allspc.[SUM CG224 SpC/L] AS [Relative CG224 SpC/L],
spc.[CG227 SpC/L] / allspc.[SUM CG227 SpC/L] AS [Relative CG227 SpC/L],
spc.[CG230 SpC/L] / allspc.[SUM CG230 SpC/L] AS [Relative CG230 SpC/L],
spc.[CG242 SpC/L] / allspc.[SUM CG242 SpC/L] AS [Relative CG242 SpC/L],
spc.[CG245 SpC/L] / allspc.[SUM CG245 SpC/L] AS [Relative CG245 SpC/L],
spc.[CG248 SpC/L] / allspc.[SUM CG248 SpC/L] AS [Relative CG248 SpC/L],
spc.[CG35 SpC/L] / allspc.[SUM CG35 SpC/L] AS [Relative CG35 SpC/L]
  FROM [412].[SpC-L for all proteins all oysters] spc,
  [412].[Sum all SpC-L] allspc


________________________________________


SELECT 
  spc.[CG2 SpC/L] / allspc.[SUM CG2 SpC/L] AS [Relative CG2 SpC/L],
spc.[CG5 SpC/L] / allspc.[SUM CG5 SpC/L] AS [Relative CG5 SpC/L],
spc.[CG8 SpC/L] / allspc.[SUM CG8 SpC/L] AS [Relative CG8 SpC/L],
spc.[CG11 SpC/L] / allspc.[SUM CG11 SpC/L] AS [Relative CG11 SpC/L],
spc.[CG26 SpC/L] / allspc.[SUM CG26 SpC/L] AS [Relative CG26 SpC/L],
spc.[CG29 SpC/L] / allspc.[SUM CG29 SpC/L] AS [Relative CG29 SpC/L],
spc.[CG32 SpC/L] / allspc.[SUM CG32 SpC/L] AS [Relative CG32 SpC/L],
spc.[CG35 SpC/L] / allspc.[SUM CG35 SpC/L] AS [Relative CG35 SpC/L],
spc.[CG221 SpC/L] / allspc.[SUM CG221 SpC/L] AS [Relative CG221 SpC/L],
spc.[CG224 SpC/L] / allspc.[SUM CG224 SpC/L] AS [Relative CG224 SpC/L],
spc.[CG227 SpC/L] / allspc.[SUM CG227 SpC/L] AS [Relative CG227 SpC/L],
spc.[CG230 SpC/L] / allspc.[SUM CG230 SpC/L] AS [Relative CG230 SpC/L],
spc.[CG242 SpC/L] / allspc.[SUM CG242 SpC/L] AS [Relative CG242 SpC/L],
spc.[CG245 SpC/L] / allspc.[SUM CG245 SpC/L] AS [Relative CG245 SpC/L],
spc.[CG248 SpC/L] / allspc.[SUM CG248 SpC/L] AS [Relative CG248 SpC/L],
spc.[CG35 SpC/L] / allspc.[SUM CG35 SpC/L] AS [Relative CG35 SpC/L]
  FROM [412].[SpC-L for all proteins all oysters] spc,
  [412].[Sum all SpC-L] allspc


________________________________________


SELECT [All Proteins],
  spc.[CG2 SpC/L] / allspc.[SUM CG2 SpC/L] AS [Relative CG2 SpC/L],
spc.[CG5 SpC/L] / allspc.[SUM CG5 SpC/L] AS [Relative CG5 SpC/L],
spc.[CG8 SpC/L] / allspc.[SUM CG8 SpC/L] AS [Relative CG8 SpC/L],
spc.[CG11 SpC/L] / allspc.[SUM CG11 SpC/L] AS [Relative CG11 SpC/L],
spc.[CG26 SpC/L] / allspc.[SUM CG26 SpC/L] AS [Relative CG26 SpC/L],
spc.[CG29 SpC/L] / allspc.[SUM CG29 SpC/L] AS [Relative CG29 SpC/L],
spc.[CG32 SpC/L] / allspc.[SUM CG32 SpC/L] AS [Relative CG32 SpC/L],
spc.[CG35 SpC/L] / allspc.[SUM CG35 SpC/L] AS [Relative CG35 SpC/L],
spc.[CG221 SpC/L] / allspc.[SUM CG221 SpC/L] AS [Relative CG221 SpC/L],
spc.[CG224 SpC/L] / allspc.[SUM CG224 SpC/L] AS [Relative CG224 SpC/L],
spc.[CG227 SpC/L] / allspc.[SUM CG227 SpC/L] AS [Relative CG227 SpC/L],
spc.[CG230 SpC/L] / allspc.[SUM CG230 SpC/L] AS [Relative CG230 SpC/L],
spc.[CG242 SpC/L] / allspc.[SUM CG242 SpC/L] AS [Relative CG242 SpC/L],
spc.[CG245 SpC/L] / allspc.[SUM CG245 SpC/L] AS [Relative CG245 SpC/L],
spc.[CG248 SpC/L] / allspc.[SUM CG248 SpC/L] AS [Relative CG248 SpC/L],
spc.[CG35 SpC/L] / allspc.[SUM CG35 SpC/L] AS [Relative CG35 SpC/L]
  FROM [412].[SpC-L for all proteins all oysters] spc,
  [412].[Sum all SpC-L] allspc


________________________________________


SELECT [All Proteins],
  spc.[CG2 SpC/L] / allspc.[SUM CG2 SpC/L] AS [Relative CG2 SpC/L],
spc.[CG5 SpC/L] / allspc.[SUM CG5 SpC/L] AS [Relative CG5 SpC/L],
spc.[CG8 SpC/L] / allspc.[SUM CG8 SpC/L] AS [Relative CG8 SpC/L],
spc.[CG11 SpC/L] / allspc.[SUM CG11 SpC/L] AS [Relative CG11 SpC/L],
spc.[CG26 SpC/L] / allspc.[SUM CG26 SpC/L] AS [Relative CG26 SpC/L],
spc.[CG29 SpC/L] / allspc.[SUM CG29 SpC/L] AS [Relative CG29 SpC/L],
spc.[CG32 SpC/L] / allspc.[SUM CG32 SpC/L] AS [Relative CG32 SpC/L],
spc.[CG35 SpC/L] / allspc.[SUM CG35 SpC/L] AS [Relative CG35 SpC/L],
spc.[CG221 SpC/L] / allspc.[SUM CG221 SpC/L] AS [Relative CG221 SpC/L],
spc.[CG224 SpC/L] / allspc.[SUM CG224 SpC/L] AS [Relative CG224 SpC/L],
spc.[CG227 SpC/L] / allspc.[SUM CG227 SpC/L] AS [Relative CG227 SpC/L],
spc.[CG230 SpC/L] / allspc.[SUM CG230 SpC/L] AS [Relative CG230 SpC/L],
spc.[CG242 SpC/L] / allspc.[SUM CG242 SpC/L] AS [Relative CG242 SpC/L],
spc.[CG245 SpC/L] / allspc.[SUM CG245 SpC/L] AS [Relative CG245 SpC/L],
spc.[CG248 SpC/L] / allspc.[SUM CG248 SpC/L] AS [Relative CG248 SpC/L],
spc.[CG251 SpC/L] / allspc.[SUM CG251 SpC/L] AS [Relative CG251 SpC/L]
  FROM [412].[SpC-L for all proteins all oysters] spc,
  [412].[Sum all SpC-L] allspc


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[101B_2_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_2_01.txt].proteinCG2_01
  LEFT JOIN [412].[101B_2_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_2_02.txt].proteinCG2_02
  LEFT JOIN [412].[101B_2_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_2_03.txt].proteinCG2_03



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[101B_5_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_5_01.txt].proteinCG5_01
  LEFT JOIN [412].[101B_5_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_5_02.txt].proteinCG5_02
  LEFT JOIN [412].[101B_5_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_5_03.txt].proteinCG5_03



________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[101B_8_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_8_01.txt].proteinCG8_01
  LEFT JOIN [412].[101B_8_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_8_02.txt].proteinCG8_02
  LEFT JOIN [412].[101B_8_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_8_03.txt].proteinCG8_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[101B_11_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_11_01.txt].proteinCG11_01
  LEFT JOIN [412].[101B_11_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_11_02.txt].proteinCG11_02
  LEFT JOIN [412].[101B_11_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_11_03.txt].proteinCG11_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[101B_26_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_26_01.txt].proteinCG26_01
  LEFT JOIN [412].[101B_26_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_26_02.txt].proteinCG26_02
  LEFT JOIN [412].[101B_26_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_26_03.txt].proteinCG26_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[101B_29_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_29_01.txt].proteinCG29_01
  LEFT JOIN [412].[101B_29_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_29_02.txt].proteinCG29_02
  LEFT JOIN [412].[101B_29_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_29_03.txt].proteinCG29_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[101B_32_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_32_01.txt].proteinCG32_01
  LEFT JOIN [412].[101B_32_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_32_02.txt].proteinCG32_02
  LEFT JOIN [412].[101B_32_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_32_03.txt].proteinCG32_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[101B_35_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_35_01.txt].proteinCG35_01
  LEFT JOIN [412].[101B_35_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_35_02.txt].proteinCG35_02
  LEFT JOIN [412].[101B_35_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[101B_35_03.txt].proteinCG35_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[103B_221_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_221_01.txt].proteinCG221_01
  LEFT JOIN [412].[103B_221_02 new.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_221_02 new.txt].proteinCG221_02
  LEFT JOIN [412].[103B_221_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_221_03.txt].proteinCG221_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[103B_224_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_224_01.txt].proteinCG224_01
  LEFT JOIN [412].[103B_224_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_224_02.txt].proteinCG224_02
  LEFT JOIN [412].[103B_224_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_224_03.txt].proteinCG224_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[103B_227_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_227_01.txt].proteinCG227_01
  LEFT JOIN [412].[103B_227_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_227_02.txt].proteinCG227_02
  LEFT JOIN [412].[103B_227_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_227_03.txt].proteinCG227_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[103B_230_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_230_01.txt].proteinCG230_01
  LEFT JOIN [412].[103B_230_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_230_02.txt].proteinCG230_02
  LEFT JOIN [412].[103B_230_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_230_03.txt].proteinCG230_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[103B_242_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_242_01.txt].proteinCG242_01
  LEFT JOIN [412].[103B_242_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_242_02.txt].proteinCG242_02
  LEFT JOIN [412].[103B_242_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_242_03.txt].proteinCG242_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[103B_245_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_245_01.txt].proteinCG245_01
  LEFT JOIN [412].[103B_245_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_245_02.txt].proteinCG245_02
  LEFT JOIN [412].[103B_245_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_245_03.txt].proteinCG245_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[103B_248_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_248_01.txt].proteinCG248_01
  LEFT JOIN [412].[103B_248_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_248_02.txt].proteinCG248_02
  LEFT JOIN [412].[103B_248_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_248_03.txt].proteinCG248_03


________________________________________


SELECT * 
  FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[103B_251_01.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_251_01.txt].proteinCG251_01
  LEFT JOIN [412].[103B_251_02.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_251_02.txt].proteinCG251_02
  LEFT JOIN [412].[103B_251_03.txt]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[103B_251_03.txt].proteinCG251_03


________________________________________


SELECT * FROM [412].[highly sig proteins from NMDS.txt]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[highly sig proteins from NMDS.txt].Protein=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[highly sig proteins NMDS with SPID]
  LEFT JOIN [412].[NSAF all oysters]
  ON [412].[highly sig proteins NMDS with SPID].[Protein]=[412].[NSAF all oysters].[All Proteins]


________________________________________


SELECT * FROM [412].[Unique peptides all biological reps]
  LEFT JOIN [412].[All SpC for 16 oysters with 0]
  ON [412].[Unique peptides all biological reps].[All Proteins]=[412].[All SpC for 16 oysters with 0].[All Proteins]


________________________________________


SELECT * FROM [412].[spec counts tech reps.csv]
  LEFT JOIN [412].[table_protein length.txt]
  ON [412].[spec counts tech reps.csv].[All Proteins]=[412].[table_protein length.txt].protein


________________________________________


SELECT [All Proteins],
 CAST([CG2_01] AS FLOAT)/[protein length] AS [CG2_01 SpC/L],
CAST([CG2_02] AS FLOAT)/[protein length] AS [CG2_02 SpC/L],
CAST([CG2_03] AS FLOAT)/[protein length] AS [CG2_03 SpC/L],
  CAST([CG5_01] AS FLOAT)/[protein length] AS [CG5_01 SpC/L],
 CAST([CG5_02] AS FLOAT)/[protein length] AS [CG5_02 SpC/L],
 CAST([CG5_03] AS FLOAT)/[protein length] AS [CG5_03 SpC/L],
CAST([CG8_01] AS FLOAT)/[protein length] AS [CG8_01 SpC/L],
CAST([CG8_02] AS FLOAT)/[protein length] AS [CG8_02 SpC/L],
CAST([CG8_03] AS FLOAT)/[protein length] AS [CG8_03 SpC/L],
CAST([CG11_01] AS FLOAT)/[protein length] AS [CG11_01 SpC/L],
CAST([CG11_02] AS FLOAT)/[protein length] AS [CG11_02 SpC/L],
CAST([CG11_03] AS FLOAT)/[protein length] AS [CG11_03 SpC/L],
CAST([CG26_01] AS FLOAT)/[protein length] AS [CG26_01 SpC/L],
CAST([CG26_02] AS FLOAT)/[protein length] AS [CG26_02 SpC/L],
CAST([CG26_03] AS FLOAT)/[protein length] AS [CG26_03 SpC/L],
CAST([CG29_01] AS FLOAT)/[protein length] AS [CG29_01 SpC/L],
CAST([CG29_02] AS FLOAT)/[protein length] AS [CG29_02 SpC/L],
CAST([CG29_03] AS FLOAT)/[protein length] AS [CG29_03 SpC/L],
CAST([CG32_01] AS FLOAT)/[protein length] AS [CG32_01 SpC/L],
CAST([CG32_02] AS FLOAT)/[protein length] AS [CG32_02 SpC/L],
CAST([CG32_03] AS FLOAT)/[protein length] AS [CG32_03 SpC/L],
CAST([CG35_01] AS FLOAT)/[protein length] AS [CG35_01 SpC/L],
CAST([CG35_02] AS FLOAT)/[protein length] AS [CG35_02 SpC/L],
CAST([CG35_03] AS FLOAT)/[protein length] AS [CG35_03 SpC/L],
CAST([CG221_01] AS FLOAT)/[protein length] AS [CG221_01 SpC/L],
CAST([CG221_02] AS FLOAT)/[protein length] AS [CG221_02 SpC/L],
CAST([CG221_03] AS FLOAT)/[protein length] AS [CG221_03 SpC/L],
CAST([CG224_01] AS FLOAT)/[protein length] AS [CG224_01 SpC/L],
CAST([CG224_02] AS FLOAT)/[protein length] AS [CG224_02 SpC/L],
CAST([CG224_03] AS FLOAT)/[protein length] AS [CG224_03 SpC/L],
CAST([CG227_01] AS FLOAT)/[protein length] AS [CG227_01 SpC/L],
CAST([CG227_02] AS FLOAT)/[protein length] AS [CG227_02 SpC/L],
CAST([CG227_03] AS FLOAT)/[protein length] AS [CG227_03 SpC/L],
CAST([CG230_01] AS FLOAT)/[protein length] AS [CG230_01 SpC/L],
CAST([CG230_02] AS FLOAT)/[protein length] AS [CG230_02 SpC/L],
CAST([CG230_03] AS FLOAT)/[protein length] AS [CG230_03 SpC/L],
CAST([CG242_01] AS FLOAT)/[protein length] AS [CG242_01 SpC/L],
CAST([CG242_02] AS FLOAT)/[protein length] AS [CG242_02 SpC/L],
CAST([CG242_03] AS FLOAT)/[protein length] AS [CG242_03 SpC/L],
CAST([CG245_01] AS FLOAT)/[protein length] AS [CG245_01 SpC/L],
CAST([CG245_02] AS FLOAT)/[protein length] AS [CG245_02 SpC/L],
CAST([CG245_03] AS FLOAT)/[protein length] AS [CG245_03 SpC/L],
CAST([CG248_01] AS FLOAT)/[protein length] AS [CG248_01 SpC/L],
CAST([CG248_02] AS FLOAT)/[protein length] AS [CG248_02 SpC/L],
CAST([CG248_03] AS FLOAT)/[protein length] AS [CG248_03 SpC/L],
CAST([CG251_01] AS FLOAT)/[protein length] AS [CG251_01 SpC/L],
CAST([CG251_02] AS FLOAT)/[protein length] AS [CG251_02 SpC/L],
CAST([CG251_03] AS FLOAT)/[protein length] AS [CG251_03 SpC/L]
  FROM [412].[tech reps with protein length]




________________________________________


  SELECT 
 SUM([CG2_01 SpC/L]) AS [CG2_01sum],
SUM([CG2_02 SpC/L]) AS [CG2_02sum],
SUM([CG2_03 SpC/L]) AS [CG2_03sum],
  SUM([CG5_01 SpC/L]) AS [CG5_01sum],
 SUM([CG5_02 SpC/L]) AS [CG5_02sum],
 SUM([CG5_03 SpC/L]) AS [CG5_03sum],
SUM([CG8_01 SpC/L]) AS [CG8_01sum],
SUM([CG8_02 SpC/L]) AS [CG8_02sum],
SUM([CG8_03 SpC/L]) AS [CG8_03sum],
SUM([CG11_01 SpC/L]) AS [CG11_01sum],
SUM([CG11_02 SpC/L]) AS [CG11_02sum],
SUM([CG11_03 SpC/L]) AS [CG11_03sum],
SUM([CG26_01 SpC/L]) AS [CG26_01sum],
SUM([CG26_02 SpC/L]) AS [CG26_02sum],
SUM([CG26_03 SpC/L]) AS [CG26_03sum],
SUM([CG29_01 SpC/L]) AS [CG29_01sum],
SUM([CG29_02 SpC/L]) AS [CG29_02sum],
SUM([CG29_03 SpC/L]) AS [CG29_03sum],
SUM([CG32_01 SpC/L]) AS [CG32_01sum],
SUM([CG32_02 SpC/L]) AS [CG32_02sum],
SUM([CG32_03 SpC/L]) AS [CG32_03sum],
SUM([CG35_01 SpC/L]) AS [CG35_01sum],
SUM([CG35_02 SpC/L]) AS [CG35_02sum],
SUM([CG35_03 SpC/L]) AS [CG35_03sum],
SUM([CG221_01 SpC/L]) AS [CG221_01sum],
SUM([CG221_02 SpC/L]) AS [CG221_02sum],
SUM([CG221_03 SpC/L]) AS [CG221_03sum],
SUM([CG224_01 SpC/L]) AS [CG224_01sum],
SUM([CG224_02 SpC/L]) AS [CG224_02sum],
SUM([CG224_03 SpC/L]) AS [CG224_03sum],
SUM([CG227_01 SpC/L]) AS [CG227_01sum],
SUM([CG227_02 SpC/L]) AS [CG227_02sum],
SUM([CG227_03 SpC/L]) AS [CG227_03sum],
SUM([CG230_01 SpC/L]) AS [CG230_01sum],
SUM([CG230_02 SpC/L]) AS [CG230_02sum],
SUM([CG230_03 SpC/L]) AS [CG230_03sum],
SUM([CG242_01 SpC/L]) AS [CG242_01sum],
SUM([CG242_02 SpC/L]) AS [CG242_02sum],
SUM([CG242_03 SpC/L]) AS [CG242_03sum],
SUM([CG245_01 SpC/L]) AS [CG245_01sum],
SUM([CG245_02 SpC/L]) AS [CG245_02sum],
SUM([CG245_03 SpC/L]) AS [CG245_03sum],
SUM([CG248_01 SpC/L]) AS [CG248_01sum],
SUM([CG248_02 SpC/L]) AS [CG248_02sum],
SUM([CG248_03 SpC/L]) AS [CG248_03sum],
SUM([CG251_01 SpC/L]) AS [CG251_01sum],
SUM([CG251_02 SpC/L]) AS [CG251_02sum],
SUM([CG251_03 SpC/L]) AS [CG251_03sum]
   FROM [412].[tech reps SpC-L]


________________________________________


SELECT 
 SUM([CG2_01 SpC/L]) AS [CG2_01sum],
SUM([CG2_02 SpC/L]) AS [CG2_02sum],
SUM([CG2_03 SpC/L]) AS [CG2_03sum],
  SUM([CG5_01 SpC/L]) AS [CG5_01sum],
 SUM([CG5_02 SpC/L]) AS [CG5_02sum],
 SUM([CG5_03 SpC/L]) AS [CG5_03sum],
SUM([CG8_01 SpC/L]) AS [CG8_01sum],
SUM([CG8_02 SpC/L]) AS [CG8_02sum],
SUM([CG8_03 SpC/L]) AS [CG8_03sum],
SUM([CG11_01 SpC/L]) AS [CG11_01sum],
SUM([CG11_02 SpC/L]) AS [CG11_02sum],
SUM([CG11_03 SpC/L]) AS [CG11_03sum],
SUM([CG26_01 SpC/L]) AS [CG26_01sum],
SUM([CG26_02 SpC/L]) AS [CG26_02sum],
SUM([CG26_03 SpC/L]) AS [CG26_03sum],
SUM([CG29_01 SpC/L]) AS [CG29_01sum],
SUM([CG29_02 SpC/L]) AS [CG29_02sum],
SUM([CG29_03 SpC/L]) AS [CG29_03sum],
SUM([CG32_01 SpC/L]) AS [CG32_01sum],
SUM([CG32_02 SpC/L]) AS [CG32_02sum],
SUM([CG32_03 SpC/L]) AS [CG32_03sum],
SUM([CG35_01 SpC/L]) AS [CG35_01sum],
SUM([CG35_02 SpC/L]) AS [CG35_02sum],
SUM([CG35_03 SpC/L]) AS [CG35_03sum],
SUM([CG221_01 SpC/L]) AS [CG221_01sum],
SUM([CG221_02 SpC/L]) AS [CG221_02sum],
SUM([CG221_03 SpC/L]) AS [CG221_03sum],
SUM([CG224_01 SpC/L]) AS [CG224_01sum],
SUM([CG224_02 SpC/L]) AS [CG224_02sum],
SUM([CG224_03 SpC/L]) AS [CG224_03sum],
SUM([CG227_01 SpC/L]) AS [CG227_01sum],
SUM([CG227_02 SpC/L]) AS [CG227_02sum],
SUM([CG227_03 SpC/L]) AS [CG227_03sum],
SUM([CG230_01 SpC/L]) AS [CG230_01sum],
SUM([CG230_02 SpC/L]) AS [CG230_02sum],
SUM([CG230_03 SpC/L]) AS [CG230_03sum],
SUM([CG242_01 SpC/L]) AS [CG242_01sum],
SUM([CG242_02 SpC/L]) AS [CG242_02sum],
SUM([CG242_03 SpC/L]) AS [CG242_03sum],
SUM([CG245_01 SpC/L]) AS [CG245_01sum],
SUM([CG245_02 SpC/L]) AS [CG245_02sum],
SUM([CG245_03 SpC/L]) AS [CG245_03sum],
SUM([CG248_01 SpC/L]) AS [CG248_01sum],
SUM([CG248_02 SpC/L]) AS [CG248_02sum],
SUM([CG248_03 SpC/L]) AS [CG248_03sum],
SUM([CG251_01 SpC/L]) AS [CG251_01sum],
SUM([CG251_02 SpC/L]) AS [CG251_02sum],
SUM([CG251_03 SpC/L]) AS [CG251_03sum]
   FROM [412].[tech reps SpC-L] 


________________________________________


SELECT 
 SUM([CG2_01 SpC/L]) AS [CG2_01sum],
SUM([CG2_02 SpC/L]) AS [CG2_02sum],
SUM([CG2_03 SpC/L]) AS [CG2_03sum],
  SUM([CG5_01 SpC/L]) AS [CG5_01sum],
 SUM([CG5_02 SpC/L]) AS [CG5_02sum],
 SUM([CG5_03 SpC/L]) AS [CG5_03sum],
SUM([CG8_01 SpC/L]) AS [CG8_01sum],
SUM([CG8_02 SpC/L]) AS [CG8_02sum],
SUM([CG8_03 SpC/L]) AS [CG8_03sum],
SUM([CG11_01 SpC/L]) AS [CG11_01sum],
SUM([CG11_02 SpC/L]) AS [CG11_02sum],
SUM([CG11_03 SpC/L]) AS [CG11_03sum],
SUM([CG26_01 SpC/L]) AS [CG26_01sum],
SUM([CG26_02 SpC/L]) AS [CG26_02sum],
SUM([CG26_03 SpC/L]) AS [CG26_03sum],
SUM([CG29_01 SpC/L]) AS [CG29_01sum],
SUM([CG29_02 SpC/L]) AS [CG29_02sum],
SUM([CG29_03 SpC/L]) AS [CG29_03sum],
SUM([CG32_01 SpC/L]) AS [CG32_01sum],
SUM([CG32_02 SpC/L]) AS [CG32_02sum],
SUM([CG32_03 SpC/L]) AS [CG32_03sum],
SUM([CG35_01 SpC/L]) AS [CG35_01sum],
SUM([CG35_02 SpC/L]) AS [CG35_02sum],
SUM([CG35_03 SpC/L]) AS [CG35_03sum],
SUM([CG221_01 SpC/L]) AS [CG221_01sum],
SUM([CG221_02 SpC/L]) AS [CG221_02sum],
SUM([CG221_03 SpC/L]) AS [CG221_03sum],
SUM([CG224_01 SpC/L]) AS [CG224_01sum],
SUM([CG224_02 SpC/L]) AS [CG224_02sum],
SUM([CG224_03 SpC/L]) AS [CG224_03sum],
SUM([CG227_01 SpC/L]) AS [CG227_01sum],
SUM([CG227_02 SpC/L]) AS [CG227_02sum],
SUM([CG227_03 SpC/L]) AS [CG227_03sum],
SUM([CG230_01 SpC/L]) AS [CG230_01sum],
SUM([CG230_02 SpC/L]) AS [CG230_02sum],
SUM([CG230_03 SpC/L]) AS [CG230_03sum],
SUM([CG242_01 SpC/L]) AS [CG242_01sum],
SUM([CG242_02 SpC/L]) AS [CG242_02sum],
SUM([CG242_03 SpC/L]) AS [CG242_03sum],
SUM([CG245_01 SpC/L]) AS [CG245_01sum],
SUM([CG245_02 SpC/L]) AS [CG245_02sum],
SUM([CG245_03 SpC/L]) AS [CG245_03sum],
SUM([CG248_01 SpC/L]) AS [CG248_01sum],
SUM([CG248_02 SpC/L]) AS [CG248_02sum],
SUM([CG248_03 SpC/L]) AS [CG248_03sum],
SUM([CG251_01 SpC/L]) AS [CG251_01sum],
SUM([CG251_02 SpC/L]) AS [CG251_02sum],
SUM([CG251_03 SpC/L]) AS [CG251_03sum]
   FROM [412].[tech reps SpC-L] 


________________________________________


SELECT [All Proteins],
 SPC.[CG2_01 SpC/L]/allspc.[CG2_01sum] AS [CG2_01 NSAF],
SPC.[CG2_02 SpC/L]/allspc.[CG2_02sum] AS [CG2_02 NSAF],
SPC.[CG2_03 SpC/L]/allspc.[CG2_03sum] AS [CG2_03 NSAF],
  SPC.[CG5_01 SpC/L]/allspc.[CG5_01sum] AS [CG5_01 NSAF],
 SPC.[CG5_02 SpC/L]/allspc.[CG5_02sum] AS [CG5_02 NSAF],
 SPC.[CG5_03 SpC/L]/allspc.[CG5_03sum] AS [CG5_03 NSAF],
SPC.[CG8_01 SpC/L]/allspc.[CG8_01sum] AS [CG8_01 NSAF],
SPC.[CG8_02 SpC/L]/allspc.[CG8_02sum] AS [CG8_02 NSAF],
SPC.[CG8_03 SpC/L]/allspc.[CG8_03sum] AS [CG8_03 NSAF],
SPC.[CG11_01 SpC/L]/allspc.[CG11_01sum] AS [CG11_01 NSAF],
SPC.[CG11_02 SpC/L]/allspc.[CG11_02sum] AS [CG11_02 NSAF],
SPC.[CG11_03 SpC/L]/allspc.[CG11_03sum] AS [CG11_03 NSAF],
SPC.[CG26_01 SpC/L]/allspc.[CG26_01sum] AS [CG26_01 NSAF],
SPC.[CG26_02 SpC/L]/allspc.[CG26_02sum] AS [CG26_02 NSAF],
SPC.[CG26_03 SpC/L]/allspc.[CG26_03sum] AS [CG26_03 NSAF],
SPC.[CG29_01 SpC/L]/allspc.[CG29_01sum] AS [CG29_01 NSAF],
SPC.[CG29_02 SpC/L]/allspc.[CG29_02sum] AS [CG29_02 NSAF],
SPC.[CG29_03 SpC/L]/allspc.[CG29_03sum] AS [CG29_03 NSAF],
SPC.[CG32_01 SpC/L]/allspc.[CG32_01sum] AS [CG32_01 NSAF],
SPC.[CG32_02 SpC/L]/allspc.[CG32_02sum] AS [CG32_02 NSAF],
SPC.[CG32_03 SpC/L]/allspc.[CG32_03sum] AS [CG32_03 NSAF],
SPC.[CG35_01 SpC/L]/allspc.[CG35_01sum] AS [CG35_01 NSAF],
SPC.[CG35_02 SpC/L]/allspc.[CG35_02sum] AS [CG35_02 NSAF],
SPC.[CG35_03 SpC/L]/allspc.[CG35_03sum] AS [CG35_03 NSAF],
SPC.[CG221_01 SpC/L]/allspc.[CG221_01sum] AS [CG221_01 NSAF],
SPC.[CG221_02 SpC/L]/allspc.[CG221_02sum] AS [CG221_02 NSAF],
SPC.[CG221_03 SpC/L]/allspc.[CG221_03sum] AS [CG221_03 NSAF],
SPC.[CG224_01 SpC/L]/allspc.[CG224_01sum] AS [CG224_01 NSAF],
SPC.[CG224_02 SpC/L]/allspc.[CG224_02sum] AS [CG224_02 NSAF],
SPC.[CG224_03 SpC/L]/allspc.[CG224_03sum] AS [CG224_03 NSAF],
SPC.[CG227_01 SpC/L]/allspc.[CG227_01sum] AS [CG227_01 NSAF],
SPC.[CG227_02 SpC/L]/allspc.[CG227_02sum] AS [CG227_02 NSAF],
SPC.[CG227_03 SpC/L]/allspc.[CG227_03sum] AS [CG227_03 NSAF],
SPC.[CG230_01 SpC/L]/allspc.[CG230_01sum] AS [CG230_01 NSAF],
SPC.[CG230_02 SpC/L]/allspc.[CG230_02sum] AS [CG230_02 NSAF],
SPC.[CG230_03 SpC/L]/allspc.[CG230_03sum] AS [CG230_03 NSAF],
SPC.[CG242_01 SpC/L]/allspc.[CG242_01sum] AS [CG242_01 NSAF],
SPC.[CG242_02 SpC/L]/allspc.[CG242_02sum] AS [CG242_02 NSAF],
SPC.[CG242_03 SpC/L]/allspc.[CG242_03sum] AS [CG242_03 NSAF],
SPC.[CG245_01 SpC/L]/allspc.[CG245_01sum] AS [CG245_01 NSAF],
SPC.[CG245_02 SpC/L]/allspc.[CG245_02sum] AS [CG245_02 NSAF],
SPC.[CG245_03 SpC/L]/allspc.[CG245_03sum] AS [CG245_03 NSAF],
SPC.[CG248_01 SpC/L]/allspc.[CG248_01sum] AS [CG248_01 NSAF],
SPC.[CG248_02 SpC/L]/allspc.[CG248_02sum] AS [CG248_02 NSAF],
SPC.[CG248_03 SpC/L]/allspc.[CG248_03sum] AS [CG248_03 NSAF],
SPC.[CG251_01 SpC/L]/allspc.[CG251_01sum] AS [CG251_01 NSAF],
SPC.[CG251_02 SpC/L]/allspc.[CG251_02sum] AS [CG251_02 NSAF],
SPC.[CG251_03 SpC/L]/allspc.[CG251_03sum] AS [CG251_03 NSAF]
   FROM [412].[tech reps SpC-L] spc,
  [412].[SpC-L sum tech reps] allspc



________________________________________


SELECT [All Proteins],
  SUM (totspecCG2_01+totspecCG2_02+totspecCG2_03)/3 AS [CG2 average SpC],
  SUM (totspecCG5_01+totspecCG5_02+totspecCG5_03)/3 AS [CG5 average SpC],
  SUM (totspecCG8_01+totspecCG8_02+totspecCG8_03)/3 AS [CG8 average SpC],
  SUM (totspecCG11_01+totspecCG11_02+totspecCG11_03)/3 AS [CG11 average SpC],
  SUM (totspecCG26_01+totspecCG26_02+totspecCG26_03)/3 AS [CG26 average SpC],
  SUM (totspecCG29_01+totspecCG29_02+totspecCG29_03)/3 AS [CG29 average SpC],
  SUM (totspecCG32_01+totspecCG32_02+totspecCG32_03)/3 AS [CG32 average SpC],
  SUM (totspecCG35_01+totspecCG35_02+totspecCG35_03)/3 AS [CG35 average SpC],
  SUM (totspecCG221_01+totspecCG221_02+totspecCG221_03)/3 AS [CG221 average SpC],
  SUM (totspecCG224_01+totspecCG224_02+totspecCG224_03)/3 AS [CG224 average SpC],
  SUM (totspecCG227_01+totspecCG227_02+totspecCG227_03)/3 AS [CG227 average SpC],
SUM (totspecCG230_01+totspecCG230_02+totspecCG230_03)/3 AS [CG230 average SpC],
SUM (totspecCG242_01+totspecCG242_02+totspecCG242_03)/3 AS [CG242 average SpC],
  SUM (totspecCG245_01+totspecCG245_02+totspecCG245_03)/3 AS [CG245 average SpC],
  SUM (totspecCG248_01+totspecCG248_02+totspecCG248_03)/3 AS [CG248 average SpC],
  SUM (totspecCG251_01+totspecCG251_02+totspecCG251_03)/3 AS [CG251 average SpC],
  SUM(totspecCG2_01+ totspecCG2_02+ totspecCG2_03+ totspecCG5_01+ totspecCG5_02+ totspecCG5_03+ totspecCG8_01+ totspecCG8_02+ totspecCG8_03+ totspecCG11_01+ totspecCG11_02+ totspecCG11_03+ totspecCG26_01+ totspecCG26_02+ totspecCG26_03+ totspecCG29_01+ totspecCG29_02+ totspecCG29_03+ totspecCG32_01+ totspecCG32_02+ totspecCG32_03+ totspecCG35_01+ totspecCG35_02+ totspecCG35_03+ totspecCG221_01+ totspecCG221_02+ totspecCG221_03+ totspecCG224_01+ totspecCG224_02+ totspecCG224_03+ totspecCG227_01+ totspecCG227_02+ totspecCG227_03+ totspecCG230_01+ totspecCG230_02+ totspecCG230_03+ totspecCG242_01+ totspecCG242_02+ totspecCG242_03+ totspecCG245_01+ totspecCG245_02+ totspecCG245_03+ totspecCG248_01+ totspecCG248_02+ totspecCG248_03+ totspecCG251_01+ totspecCG251_02+ totspecCG251_03) AS [Total SpC]
  FROM [412].[All SpC for 16 oysters with 0]
  GROUP BY [All Proteins]



________________________________________


SELECT [All Proteins],
  AVG (CAST((totspecCG2_01+totspecCG2_02+totspecCG2_03) AS FLOAT)) AS [CG2 average SpC],
  AVG (CAST((totspecCG5_01+totspecCG5_02+totspecCG5_03) AS FLOAT)) AS [CG5 average SpC],
  AVG (CAST((totspecCG8_01+totspecCG8_02+totspecCG8_03) AS FLOAT)) AS [CG8 average SpC],
  AVG (CAST((totspecCG11_01+totspecCG11_02+totspecCG11_03) AS FLOAT)) AS [CG11 average SpC],
  AVG (CAST((totspecCG26_01+totspecCG26_02+totspecCG26_03) AS FLOAT)) AS [CG26 average SpC],
  AVG (CAST((totspecCG29_01+totspecCG29_02+totspecCG29_03) AS FLOAT)) AS [CG29 average SpC],
  AVG (CAST((totspecCG32_01+totspecCG32_02+totspecCG32_03) AS FLOAT)) AS [CG32 average SpC],
  AVG (CAST((totspecCG35_01+totspecCG35_02+totspecCG35_03) AS FLOAT)) AS [CG35 average SpC],
  AVG (CAST((totspecCG221_01+totspecCG221_02+totspecCG221_03) AS FLOAT)) AS [CG221 average SpC],
  AVG (CAST((totspecCG224_01+totspecCG224_02+totspecCG224_03) AS FLOAT)) AS [CG224 average SpC],
  AVG (CAST((totspecCG227_01+totspecCG227_02+totspecCG227_03) AS FLOAT)) AS [CG227 average SpC],
AVG (CAST((totspecCG230_01+totspecCG230_02+totspecCG230_03) AS FLOAT)) AS [CG230 average SpC],
AVG (CAST((totspecCG242_01+totspecCG242_02+totspecCG242_03) AS FLOAT)) AS [CG242 average SpC],
  AVG (CAST((totspecCG245_01+totspecCG245_02+totspecCG245_03) AS FLOAT)) AS [CG245 average SpC],
  AVG (CAST((totspecCG248_01+totspecCG248_02+totspecCG248_03) AS FLOAT)) AS [CG248 average SpC],
  AVG (CAST((totspecCG251_01+totspecCG251_02+totspecCG251_03) AS FLOAT)) AS [CG251 average SpC],
  SUM(totspecCG2_01+ totspecCG2_02+ totspecCG2_03+ totspecCG5_01+ totspecCG5_02+ totspecCG5_03+ totspecCG8_01+ totspecCG8_02+ totspecCG8_03+ totspecCG11_01+ totspecCG11_02+ totspecCG11_03+ totspecCG26_01+ totspecCG26_02+ totspecCG26_03+ totspecCG29_01+ totspecCG29_02+ totspecCG29_03+ totspecCG32_01+ totspecCG32_02+ totspecCG32_03+ totspecCG35_01+ totspecCG35_02+ totspecCG35_03+ totspecCG221_01+ totspecCG221_02+ totspecCG221_03+ totspecCG224_01+ totspecCG224_02+ totspecCG224_03+ totspecCG227_01+ totspecCG227_02+ totspecCG227_03+ totspecCG230_01+ totspecCG230_02+ totspecCG230_03+ totspecCG242_01+ totspecCG242_02+ totspecCG242_03+ totspecCG245_01+ totspecCG245_02+ totspecCG245_03+ totspecCG248_01+ totspecCG248_02+ totspecCG248_03+ totspecCG251_01+ totspecCG251_02+ totspecCG251_03) AS [Total SpC]
  FROM [412].[All SpC for 16 oysters with 0]
  GROUP BY [All Proteins]





________________________________________


SELECT [All Proteins],
  CAST(SUM (totspecCG2_01+totspecCG2_02+totspecCG2_03/3) AS FLOAT) AS [CG2 average SpC],
  CAST(SUM (totspecCG5_01+totspecCG5_02+totspecCG5_03/3) AS FLOAT) AS [CG5 average SpC],
  CAST(SUM (totspecCG8_01+totspecCG8_02+totspecCG8_03/3) AS FLOAT) AS [CG8 average SpC],
  CAST(SUM (totspecCG11_01+totspecCG11_02+totspecCG11_03/3) AS FLOAT) AS [CG11 average SpC],
  CAST(SUM (totspecCG26_01+totspecCG26_02+totspecCG26_03/3) AS FLOAT) AS [CG26 average SpC],
  CAST(SUM (totspecCG29_01+totspecCG29_02+totspecCG29_03/3) AS FLOAT) AS [CG29 average SpC],
  CAST(SUM (totspecCG32_01+totspecCG32_02+totspecCG32_03/3) AS FLOAT) AS [CG32 average SpC],
  CAST(SUM (totspecCG35_01+totspecCG35_02+totspecCG35_03/3) AS FLOAT) AS [CG35 average SpC],
  CAST(SUM (totspecCG221_01+totspecCG221_02+totspecCG221_03/3) AS FLOAT) AS [CG221 average SpC],
  CAST(SUM (totspecCG224_01+totspecCG224_02+totspecCG224_03/3) AS FLOAT) AS [CG224 average SpC],
  CAST(SUM (totspecCG227_01+totspecCG227_02+totspecCG227_03/3) AS FLOAT) AS [CG227 average SpC],
CAST(SUM (totspecCG230_01+totspecCG230_02+totspecCG230_03/3) AS FLOAT) AS [CG230 average SpC],
CAST(SUM (totspecCG242_01+totspecCG242_02+totspecCG242_03/3) AS FLOAT) AS [CG242 average SpC],
  CAST(SUM (totspecCG245_01+totspecCG245_02+totspecCG245_03/3) AS FLOAT) AS [CG245 average SpC],
  CAST(SUM (totspecCG248_01+totspecCG248_02+totspecCG248_03/3) AS FLOAT) AS [CG248 average SpC],
  CAST(SUM (totspecCG251_01+totspecCG251_02+totspecCG251_03/3) AS FLOAT) AS [CG251 average SpC],
  SUM(totspecCG2_01+ totspecCG2_02+ totspecCG2_03+ totspecCG5_01+ totspecCG5_02+ totspecCG5_03+ totspecCG8_01+ totspecCG8_02+ totspecCG8_03+ totspecCG11_01+ totspecCG11_02+ totspecCG11_03+ totspecCG26_01+ totspecCG26_02+ totspecCG26_03+ totspecCG29_01+ totspecCG29_02+ totspecCG29_03+ totspecCG32_01+ totspecCG32_02+ totspecCG32_03+ totspecCG35_01+ totspecCG35_02+ totspecCG35_03+ totspecCG221_01+ totspecCG221_02+ totspecCG221_03+ totspecCG224_01+ totspecCG224_02+ totspecCG224_03+ totspecCG227_01+ totspecCG227_02+ totspecCG227_03+ totspecCG230_01+ totspecCG230_02+ totspecCG230_03+ totspecCG242_01+ totspecCG242_02+ totspecCG242_03+ totspecCG245_01+ totspecCG245_02+ totspecCG245_03+ totspecCG248_01+ totspecCG248_02+ totspecCG248_03+ totspecCG251_01+ totspecCG251_02+ totspecCG251_03) AS [Total SpC]
  FROM [412].[All SpC for 16 oysters with 0]
  GROUP BY [All Proteins]





________________________________________


SELECT [All Proteins],
  CAST(SUM (totspecCG2_01+totspecCG2_02+totspecCG2_03)/3 AS FLOAT) AS [CG2 average SpC],
  CAST(SUM (totspecCG5_01+totspecCG5_02+totspecCG5_03)/3 AS FLOAT) AS [CG5 average SpC],
  CAST(SUM (totspecCG8_01+totspecCG8_02+totspecCG8_03)/3 AS FLOAT) AS [CG8 average SpC],
  CAST(SUM (totspecCG11_01+totspecCG11_02+totspecCG11_03)/3 AS FLOAT) AS [CG11 average SpC],
  CAST(SUM (totspecCG26_01+totspecCG26_02+totspecCG26_03)/3 AS FLOAT) AS [CG26 average SpC],
  CAST(SUM (totspecCG29_01+totspecCG29_02+totspecCG29_03)/3 AS FLOAT) AS [CG29 average SpC],
  CAST(SUM (totspecCG32_01+totspecCG32_02+totspecCG32_03)/3 AS FLOAT) AS [CG32 average SpC],
  CAST(SUM (totspecCG35_01+totspecCG35_02+totspecCG35_03)/3 AS FLOAT) AS [CG35 average SpC],
  CAST(SUM (totspecCG221_01+totspecCG221_02+totspecCG221_03)/3 AS FLOAT) AS [CG221 average SpC],
  CAST(SUM (totspecCG224_01+totspecCG224_02+totspecCG224_03)/3 AS FLOAT) AS [CG224 average SpC],
  CAST(SUM (totspecCG227_01+totspecCG227_02+totspecCG227_03)/3 AS FLOAT) AS [CG227 average SpC],
CAST(SUM (totspecCG230_01+totspecCG230_02+totspecCG230_03)/3 AS FLOAT) AS [CG230 average SpC],
CAST(SUM (totspecCG242_01+totspecCG242_02+totspecCG242_03)/3 AS FLOAT) AS [CG242 average SpC],
  CAST(SUM (totspecCG245_01+totspecCG245_02+totspecCG245_03)/3 AS FLOAT) AS [CG245 average SpC],
  CAST(SUM (totspecCG248_01+totspecCG248_02+totspecCG248_03)/3 AS FLOAT) AS [CG248 average SpC],
  CAST(SUM (totspecCG251_01+totspecCG251_02+totspecCG251_03)/3 AS FLOAT) AS [CG251 average SpC],
  SUM(totspecCG2_01+ totspecCG2_02+ totspecCG2_03+ totspecCG5_01+ totspecCG5_02+ totspecCG5_03+ totspecCG8_01+ totspecCG8_02+ totspecCG8_03+ totspecCG11_01+ totspecCG11_02+ totspecCG11_03+ totspecCG26_01+ totspecCG26_02+ totspecCG26_03+ totspecCG29_01+ totspecCG29_02+ totspecCG29_03+ totspecCG32_01+ totspecCG32_02+ totspecCG32_03+ totspecCG35_01+ totspecCG35_02+ totspecCG35_03+ totspecCG221_01+ totspecCG221_02+ totspecCG221_03+ totspecCG224_01+ totspecCG224_02+ totspecCG224_03+ totspecCG227_01+ totspecCG227_02+ totspecCG227_03+ totspecCG230_01+ totspecCG230_02+ totspecCG230_03+ totspecCG242_01+ totspecCG242_02+ totspecCG242_03+ totspecCG245_01+ totspecCG245_02+ totspecCG245_03+ totspecCG248_01+ totspecCG248_02+ totspecCG248_03+ totspecCG251_01+ totspecCG251_02+ totspecCG251_03) AS [Total SpC]
  FROM [412].[All SpC for 16 oysters with 0]
  GROUP BY [All Proteins]





________________________________________


SELECT [All Proteins],
  CAST((SUM (totspecCG2_01+totspecCG2_02+totspecCG2_03)/3) AS FLOAT) AS [CG2 average SpC],
  CAST((SUM (totspecCG5_01+totspecCG5_02+totspecCG5_03)/3) AS FLOAT) AS [CG5 average SpC],
  CAST((SUM (totspecCG8_01+totspecCG8_02+totspecCG8_03)/3) AS FLOAT) AS [CG8 average SpC],
  CAST((SUM (totspecCG11_01+totspecCG11_02+totspecCG11_03)/3) AS FLOAT) AS [CG11 average SpC],
  CAST((SUM (totspecCG26_01+totspecCG26_02+totspecCG26_03)/3) AS FLOAT) AS [CG26 average SpC],
  CAST((SUM (totspecCG29_01+totspecCG29_02+totspecCG29_03)/3) AS FLOAT) AS [CG29 average SpC],
  CAST((SUM (totspecCG32_01+totspecCG32_02+totspecCG32_03)/3) AS FLOAT) AS [CG32 average SpC],
  CAST((SUM (totspecCG35_01+totspecCG35_02+totspecCG35_03)/3) AS FLOAT) AS [CG35 average SpC],
  CAST((SUM (totspecCG221_01+totspecCG221_02+totspecCG221_03)/3) AS FLOAT) AS [CG221 average SpC],
  CAST((SUM (totspecCG224_01+totspecCG224_02+totspecCG224_03)/3) AS FLOAT) AS [CG224 average SpC],
  CAST((SUM (totspecCG227_01+totspecCG227_02+totspecCG227_03)/3) AS FLOAT) AS [CG227 average SpC],
CAST((SUM (totspecCG230_01+totspecCG230_02+totspecCG230_03)/3) AS FLOAT) AS [CG230 average SpC],
CAST((SUM (totspecCG242_01+totspecCG242_02+totspecCG242_03)/3) AS FLOAT) AS [CG242 average SpC],
  CAST((SUM (totspecCG245_01+totspecCG245_02+totspecCG245_03)/3) AS FLOAT) AS [CG245 average SpC],
  CAST((SUM (totspecCG248_01+totspecCG248_02+totspecCG248_03)/3) AS FLOAT) AS [CG248 average SpC],
  CAST((SUM (totspecCG251_01+totspecCG251_02+totspecCG251_03)/3) AS FLOAT) AS [CG251 average SpC],
  SUM(totspecCG2_01+ totspecCG2_02+ totspecCG2_03+ totspecCG5_01+ totspecCG5_02+ totspecCG5_03+ totspecCG8_01+ totspecCG8_02+ totspecCG8_03+ totspecCG11_01+ totspecCG11_02+ totspecCG11_03+ totspecCG26_01+ totspecCG26_02+ totspecCG26_03+ totspecCG29_01+ totspecCG29_02+ totspecCG29_03+ totspecCG32_01+ totspecCG32_02+ totspecCG32_03+ totspecCG35_01+ totspecCG35_02+ totspecCG35_03+ totspecCG221_01+ totspecCG221_02+ totspecCG221_03+ totspecCG224_01+ totspecCG224_02+ totspecCG224_03+ totspecCG227_01+ totspecCG227_02+ totspecCG227_03+ totspecCG230_01+ totspecCG230_02+ totspecCG230_03+ totspecCG242_01+ totspecCG242_02+ totspecCG242_03+ totspecCG245_01+ totspecCG245_02+ totspecCG245_03+ totspecCG248_01+ totspecCG248_02+ totspecCG248_03+ totspecCG251_01+ totspecCG251_02+ totspecCG251_03) AS [Total SpC]
  FROM [412].[All SpC for 16 oysters with 0]
  GROUP BY [All Proteins]





________________________________________


SELECT [All Proteins],
CAST([CG2 total SpC]/3 AS FLOAT) as [CG2 avg SpC] 
  FROM [412].[Total SpC per oyster]


________________________________________


SELECT [All Proteins],
  CAST(([CG2 total SpC]/3) AS FLOAT) as [CG2 avg SpC] 
  FROM [412].[Total SpC per oyster]


________________________________________


SELECT [All Proteins],
  CAST(([CG2 total SpC]/3) AS FLOAT) as [CG2 avg SpC] 
  FROM [412].[Total SpC per oyster]


________________________________________


SELECT [All Proteins],
  CAST([CG2 total SpC] AS FLOAT)/3 as [CG2 avg SpC] 
  FROM [412].[Total SpC per oyster]


________________________________________


SELECT [All Proteins],
CAST([CG2 total SpC] AS FLOAT)/3 as [CG2 avg SpC],
CAST([CG5 total SpC] AS FLOAT)/3 as [CG5 avg SpC],
CAST([CG8 total SpC] AS FLOAT)/3 as [CG8 avg SpC],
CAST([CG11 total SpC] AS FLOAT)/3 as [CG11 avg SpC],
CAST([CG26 total SpC] AS FLOAT)/3 as [CG26 avg SpC],
CAST([CG29 total SpC] AS FLOAT)/3 as [CG29 avg SpC],
CAST([CG32 total SpC] AS FLOAT)/3 as [CG32 avg SpC],
CAST([CG35 total SpC] AS FLOAT)/3 as [CG35 avg SpC],
CAST([CG221 total SpC] AS FLOAT)/3 as [CG221 avg SpC],
CAST([CG224 total SpC] AS FLOAT)/3 as [CG224 avg SpC],
CAST([CG227 total SpC] AS FLOAT)/3 as [CG227 avg SpC],
CAST([CG230 total SpC] AS FLOAT)/3 as [CG230 avg SpC],
CAST([CG242 total SpC] AS FLOAT)/3 as [CG242 avg SpC],
CAST([CG245 total SpC] AS FLOAT)/3 as [CG245 avg SpC],
CAST([CG248 total SpC] AS FLOAT)/3 as [CG248 avg SpC],
CAST([CG251 total SpC] AS FLOAT)/3 as [CG251 avg SpC]
  FROM [412].[Total SpC per oyster]




________________________________________


SELECT [All Proteins], [Total SpC],
CAST([CG2 total SpC] AS FLOAT)/3 as [CG2 avg SpC],
CAST([CG5 total SpC] AS FLOAT)/3 as [CG5 avg SpC],
CAST([CG8 total SpC] AS FLOAT)/3 as [CG8 avg SpC],
CAST([CG11 total SpC] AS FLOAT)/3 as [CG11 avg SpC],
CAST([CG26 total SpC] AS FLOAT)/3 as [CG26 avg SpC],
CAST([CG29 total SpC] AS FLOAT)/3 as [CG29 avg SpC],
CAST([CG32 total SpC] AS FLOAT)/3 as [CG32 avg SpC],
CAST([CG35 total SpC] AS FLOAT)/3 as [CG35 avg SpC],
CAST([CG221 total SpC] AS FLOAT)/3 as [CG221 avg SpC],
CAST([CG224 total SpC] AS FLOAT)/3 as [CG224 avg SpC],
CAST([CG227 total SpC] AS FLOAT)/3 as [CG227 avg SpC],
CAST([CG230 total SpC] AS FLOAT)/3 as [CG230 avg SpC],
CAST([CG242 total SpC] AS FLOAT)/3 as [CG242 avg SpC],
CAST([CG245 total SpC] AS FLOAT)/3 as [CG245 avg SpC],
CAST([CG248 total SpC] AS FLOAT)/3 as [CG248 avg SpC],
CAST([CG251 total SpC] AS FLOAT)/3 as [CG251 avg SpC]
  FROM [412].[Total SpC per oyster]




________________________________________


SELECT * FROM [412].[Average SpC per protein]
  WHERE [Total SpC] >7
  
  


________________________________________


SELECT * FROM [412].[all sequenced proteins all treatments.txt]
  LEFT JOIN [412].[CG2 unique peps > 1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG2 unique peps > 1].[All Proteins]
LEFT JOIN [412].[CG5 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG5 unique peps >1].[All Proteins]
  LEFT JOIN [412].[CG8 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG8 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG11 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG11 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG26 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG26 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG29 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG29 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG32 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG32 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG35 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG35 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG221 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG221 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG224 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG224 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG227 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG227 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG230 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG230 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG242 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG242 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG245 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG245 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG248 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG248 unique peps >1].[All Proteins]
LEFT JOIN [412].[CG251 unique peps >1]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[CG251 unique peps >1].[All Proteins]
  LEFT JOIN [412].[Average counts with total spc>7]
  ON [412].[all sequenced proteins all treatments.txt].[All Proteins]=[412].[Average counts with total spc>7].[All Proteins]



________________________________________


SELECT * FROM [412].[Average spec counts with cutoffs]
  LEFT JOIN [412].[table_protein length.txt]
  ON [412].[Average spec counts with cutoffs].[All Proteins]=[412].[table_protein length.txt].protein



________________________________________


SELECT [All Proteins], [CG2 unique peps sum], [CG5 unique peps sum], [CG8 unique peps sum], [CG11 unique peps sum], [CG26 unique peps sum], [CG29 unique peps sum], [CG32 unique peps sum], [CG35 unique peps sum], [CG221 unique peps sum], [CG224 unique peps sum], [CG227 unique peps sum], [CG230 unique peps sum], [CG242 unique peps sum], [CG245 unique peps sum], [CG248 unique peps sum], [CG251 unique peps sum],
 CAST([CG2 avg SpC] AS FLOAT)/[protein length] AS [CG2 SpC/L],
  CAST([CG5 avg SpC] AS FLOAT)/[protein length] AS [CG5 SpC/L],
CAST([CG8 avg SpC] AS FLOAT)/[protein length] AS [CG8 SpC/L],
CAST([CG11 avg SpC] AS FLOAT)/[protein length] AS [CG11 SpC/L],
CAST([CG26 avg SpC] AS FLOAT)/[protein length] AS [CG26 SpC/L],
CAST([CG29 avg SpC] AS FLOAT)/[protein length] AS [CG29 SpC/L],
CAST([CG32 avg SpC] AS FLOAT)/[protein length] AS [CG32 SpC/L],
CAST([CG35 avg SpC] AS FLOAT)/[protein length] AS [CG35 SpC/L],
CAST([CG221 avg SpC] AS FLOAT)/[protein length] AS [CG221 SpC/L],
CAST([CG224 avg SpC] AS FLOAT)/[protein length] AS [CG224 SpC/L],
CAST([CG227 avg SpC] AS FLOAT)/[protein length] AS [CG227 SpC/L],
CAST([CG230 avg SpC] AS FLOAT)/[protein length] AS [CG230 SpC/L],
CAST([CG242 avg SpC] AS FLOAT)/[protein length] AS [CG242 SpC/L],
CAST([CG245 avg SpC] AS FLOAT)/[protein length] AS [CG245 SpC/L],
CAST([CG248 avg SpC] AS FLOAT)/[protein length] AS [CG248 SpC/L],
CAST([CG251 avg SpC] AS FLOAT)/[protein length] AS [CG251 SpC/L]



  FROM [412].[average spec counts with prot length]


________________________________________


SELECT 
  SUM([CG2 SpC/L]) AS [SUM CG2 SpC/L],
SUM([CG5 SpC/L]) AS [SUM CG5 SpC/L],
SUM([CG8 SpC/L]) AS [SUM CG8 SpC/L],
SUM([CG11 SpC/L]) AS [SUM CG11 SpC/L],
SUM([CG26 SpC/L]) AS [SUM CG26 SpC/L],
SUM([CG29 SpC/L]) AS [SUM CG29 SpC/L],
SUM([CG32 SpC/L]) AS [SUM CG32 SpC/L],
SUM([CG35 SpC/L]) AS [SUM CG35 SpC/L],
SUM([CG221 SpC/L]) AS [SUM CG221 SpC/L],
SUM([CG224 SpC/L]) AS [SUM CG224 SpC/L],
SUM([CG227 SpC/L]) AS [SUM CG227 SpC/L],
SUM([CG230 SpC/L]) AS [SUM CG230 SpC/L],
SUM([CG242 SpC/L]) AS [SUM CG242 SpC/L],
SUM([CG245 SpC/L]) AS [SUM CG245 SpC/L],
SUM([CG248 SpC/L]) AS [SUM CG248 SpC/L],
SUM([CG251 SpC/L]) AS [SUM CG251 SpC/L]

  FROM [412].[SpC-L for all oysters (average spc)]


________________________________________


SELECT [All Proteins],
  spc.[CG2 SpC/L] / allspc.[SUM CG2 SpC/L] AS [NSAF CG2],
spc.[CG5 SpC/L] / allspc.[SUM CG5 SpC/L] AS [NSAF CG5],
spc.[CG8 SpC/L] / allspc.[SUM CG8 SpC/L] AS [NSAF CG8],
spc.[CG11 SpC/L] / allspc.[SUM CG11 SpC/L] AS [NSAF CG11],
spc.[CG26 SpC/L] / allspc.[SUM CG26 SpC/L] AS [NSAF CG26],
spc.[CG29 SpC/L] / allspc.[SUM CG29 SpC/L] AS [NSAF CG29],
spc.[CG32 SpC/L] / allspc.[SUM CG32 SpC/L] AS [NSAF CG32],
spc.[CG35 SpC/L] / allspc.[SUM CG35 SpC/L] AS [NSAF CG35],
spc.[CG221 SpC/L] / allspc.[SUM CG221 SpC/L] AS [NSAF CG221],
spc.[CG224 SpC/L] / allspc.[SUM CG224 SpC/L] AS [NSAF CG224],
spc.[CG227 SpC/L] / allspc.[SUM CG227 SpC/L] AS [NSAF CG227],
spc.[CG230 SpC/L] / allspc.[SUM CG230 SpC/L] AS [NSAF CG230],
spc.[CG242 SpC/L] / allspc.[SUM CG242 SpC/L] AS [NSAF CG242],
spc.[CG245 SpC/L] / allspc.[SUM CG245 SpC/L] AS [NSAF CG245],
spc.[CG248 SpC/L] / allspc.[SUM CG248 SpC/L] AS [NSAF CG248],
spc.[CG251 SpC/L] / allspc.[SUM CG251 SpC/L] AS [NSAF CG251]
  FROM [412].[SpC-L for all oysters (average spc)] spc,
  [412].[Sum SpC-L for avg spc] allspc




________________________________________


SELECT [All Proteins], [CG2 unique peps sum], [CG5 unique peps sum], [CG8 unique peps sum], [CG11 unique peps sum], [CG26 unique peps sum], [CG29 unique peps sum], [CG32 unique peps sum], [CG35 unique peps sum], [CG221 unique peps sum], [CG224 unique peps sum], [CG227 unique peps sum], [CG230 unique peps sum], [CG242 unique peps sum], [CG245 unique peps sum], [CG248 unique peps sum], [CG251 unique peps sum],
  spc.[CG2 SpC/L] / allspc.[SUM CG2 SpC/L] AS [NSAF CG2],
spc.[CG5 SpC/L] / allspc.[SUM CG5 SpC/L] AS [NSAF CG5],
spc.[CG8 SpC/L] / allspc.[SUM CG8 SpC/L] AS [NSAF CG8],
spc.[CG11 SpC/L] / allspc.[SUM CG11 SpC/L] AS [NSAF CG11],
spc.[CG26 SpC/L] / allspc.[SUM CG26 SpC/L] AS [NSAF CG26],
spc.[CG29 SpC/L] / allspc.[SUM CG29 SpC/L] AS [NSAF CG29],
spc.[CG32 SpC/L] / allspc.[SUM CG32 SpC/L] AS [NSAF CG32],
spc.[CG35 SpC/L] / allspc.[SUM CG35 SpC/L] AS [NSAF CG35],
spc.[CG221 SpC/L] / allspc.[SUM CG221 SpC/L] AS [NSAF CG221],
spc.[CG224 SpC/L] / allspc.[SUM CG224 SpC/L] AS [NSAF CG224],
spc.[CG227 SpC/L] / allspc.[SUM CG227 SpC/L] AS [NSAF CG227],
spc.[CG230 SpC/L] / allspc.[SUM CG230 SpC/L] AS [NSAF CG230],
spc.[CG242 SpC/L] / allspc.[SUM CG242 SpC/L] AS [NSAF CG242],
spc.[CG245 SpC/L] / allspc.[SUM CG245 SpC/L] AS [NSAF CG245],
spc.[CG248 SpC/L] / allspc.[SUM CG248 SpC/L] AS [NSAF CG248],
spc.[CG251 SpC/L] / allspc.[SUM CG251 SpC/L] AS [NSAF CG251]
  FROM [412].[SpC-L for all oysters (average spc)] spc,
  [412].[Sum SpC-L for avg spc] allspc




________________________________________


SELECT * FROM [412].[proteins that pass cutoffs.txt]
  LEFT JOIN [412].[table_protein length.txt]
  ON [412].[proteins that pass cutoffs.txt].[All Proteins]=[412].[table_protein length.txt].protein
  LEFT JOIN [412].[Average SpC per protein]
  ON [412].[proteins that pass cutoffs.txt].[All Proteins]=[412].[Average SpC per protein].[All Proteins]



________________________________________


SELECT * FROM [412].[greater than 5 fold change.txt]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
ON [412].[greater than 5 fold change.txt].Protein=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]



________________________________________


SELECT [NSAF CG2], [NSAF CG5], [NSAF CG8], [NSAF CG11], [NSAF CG26], [NSAF CG29], [NSAF CG32], [NSAF CG35], [NSAF CG221], [NSAF CG224], [NSAF CG227], [NSAF CG230], [NSAF CG242], [NSAF CG245], [NSAF CG248], [NSAF CG251] FROM [412].[NSAF based on avg spc]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[NSAF based on avg spc].[All Proteins]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT [All Proteins],[NSAF CG2], [NSAF CG5], [NSAF CG8], [NSAF CG11], [NSAF CG26], [NSAF CG29], [NSAF CG32], [NSAF CG35], [NSAF CG221], [NSAF CG224], [NSAF CG227], [NSAF CG230], [NSAF CG242], [NSAF CG245], [NSAF CG248], [NSAF CG251] FROM [412].[NSAF based on avg spc]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[NSAF based on avg spc].[All Proteins]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[NSAF based on avg spc]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[NSAF based on avg spc].[All Proteins]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[NSAF avg SpC.csv]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[NSAF avg SpC.csv].[All Proteins]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]



________________________________________


SELECT * FROM [412].[NSAF avg SpC.csv]
  LEFT JOIN [412].[NSAF tech reps]
ON [412].[NSAF avg SpC.csv].[All Proteins]=[412].[NSAF tech reps].[All Proteins]


________________________________________


SELECT * FROM [412].[proteins that pass cutoffs.txt]
  LEFT JOIN [412].[NSAF tech reps]
  ON [412].[proteins that pass cutoffs.txt].[All Proteins]=[412].[NSAF tech reps].[All Proteins]


________________________________________


SELECT * FROM [412].[proteins that pass cutoffs.txt]
  LEFT JOIN [412].[NSAF tech reps]
  ON [412].[proteins that pass cutoffs.txt].[All Proteins]=[412].[NSAF tech reps].[All Proteins]
  LEFT JOIN [412].[Average spec counts with cutoffs]
  ON [412].[proteins that pass cutoffs.txt].[All Proteins]=[412].[Average spec counts with cutoffs].[All Proteins]


________________________________________


SELECT * FROM [412].[NSAF based on avg SpC with SPIDs]
  LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [412].[NSAF based on avg SpC with SPIDs].SPID=[354].[SPID_GOnumber.txt].A0A000



________________________________________


SELECT * FROM [412].[NSAF avg SpC with GO]
  LEFT JOIN [1123].[GO_to_GOslim]
  ON [412].[NSAF avg SpC with GO].[GO:0003824]=[1123].[GO_to_GOslim].GO_id


________________________________________


SELECT DISTINCT * FROM [412].[NSAF based on avg SpC with SPIDs]
  LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [412].[NSAF based on avg SpC with SPIDs].SPID=[354].[SPID_GOnumber.txt].A0A000



________________________________________


SELECT DISTINCT * FROM [412].[NSAF avg SpC with GO]
  LEFT JOIN [1123].[GO_to_GOslim]
  ON [412].[NSAF avg SpC with GO].[GO:0003824]=[1123].[GO_to_GOslim].GO_id


________________________________________


SELECT * FROM [412].[NSAF avg SpC with GO slim]
 WHERE [aspect]='P'
  


________________________________________


SELECT DISTINCT * FROM [412].[NSAF avg SpC with GO slim]
 WHERE [aspect]='P'
  


________________________________________


SELECT DISTINCT [All Proteins], [NSAF CG2], [NSAF CG5], [NSAF CG8], [NSAF CG11], [NSAF CG26], [NSAF CG29], [NSAF CG32], [NSAF CG35], [NSAF CG221], [NSAF CG224], [NSAF CG227], [NSAF CG230], [NSAF CG242], [NSAF CG245], [NSAF CG248], [NSAF CG251], [SPID], [evalue], [Gene Name], [GOSlim_bin]
  FROM [412].[NSAF avg SpC biological processes]


________________________________________


SELECT DISTINCT [All Proteins], [NSAF CG2], [NSAF CG5], [NSAF CG8], [NSAF CG11], [NSAF CG26], [NSAF CG29], [NSAF CG32], [NSAF CG35], [NSAF CG221], [NSAF CG224], [NSAF CG227], [NSAF CG230], [NSAF CG242], [NSAF CG245], [NSAF CG248], [NSAF CG251], [SPID], [evalue], [Gene Name], [GOSlim_bin]
  FROM [412].[NSAF avg SpC biological processes]


________________________________________


SELECT DISTINCT [All Proteins], [NSAF CG2], [NSAF CG5], [NSAF CG8], [NSAF CG11], [NSAF CG26], [NSAF CG29], [NSAF CG32], [NSAF CG35], [NSAF CG221], [NSAF CG224], [NSAF CG227], [NSAF CG230], [NSAF CG242], [NSAF CG245], [NSAF CG248], [NSAF CG251], [SPID], [evalue], [Gene Name], [GOSlim_bin]
  FROM [412].[NSAF avg SpC biological processes]


________________________________________


SELECT [All Proteins],
CASE WHEN [NSAF CG2] =0 THEN 1E-20 ELSE [NSAF CG2] END AS [NSAF CG2]
  FROM [412].[NSAF avg SpC.csv]


________________________________________


SELECT [All Proteins],
CASE WHEN [NSAF CG2] =0 THEN 1E-20 ELSE [NSAF CG2] END AS [NSAF CG2],
  CASE WHEN [NSAF CG5]=0 THEN 1E-20 ELSE [NSAF CG5] END AS [NSAF CG2],
CASE WHEN [NSAF CG8]=0 THEN 1E-20 ELSE [NSAF CG8] END AS [NSAF CG2],
CASE WHEN [NSAF CG11]=0 THEN 1E-20 ELSE [NSAF CG11] END AS [NSAF CG2],
CASE WHEN [NSAF CG26]=0 THEN 1E-20 ELSE [NSAF CG26] END AS [NSAF CG2],
CASE WHEN [NSAF CG29]=0 THEN 1E-20 ELSE [NSAF CG29] END AS [NSAF CG2],
CASE WHEN [NSAF CG32]=0 THEN 1E-20 ELSE [NSAF CG32] END AS [NSAF CG2],
CASE WHEN [NSAF CG35]=0 THEN 1E-20 ELSE [NSAF CG35] END AS [NSAF CG2],
CASE WHEN [NSAF CG221]=0 THEN 1E-20 ELSE [NSAF CG221] END AS [NSAF CG2],
CASE WHEN [NSAF CG224]=0 THEN 1E-20 ELSE [NSAF CG224] END AS [NSAF CG2],
CASE WHEN [NSAF CG227]=0 THEN 1E-20 ELSE [NSAF CG227] END AS [NSAF CG2],
CASE WHEN [NSAF CG230]=0 THEN 1E-20 ELSE [NSAF CG230] END AS [NSAF CG2],
CASE WHEN [NSAF CG242]=0 THEN 1E-20 ELSE [NSAF CG242] END AS [NSAF CG2],
CASE WHEN [NSAF CG245]=0 THEN 1E-20 ELSE [NSAF CG245] END AS [NSAF CG2],
CASE WHEN [NSAF CG248]=0 THEN 1E-20 ELSE [NSAF CG248] END AS [NSAF CG2],
CASE WHEN [NSAF CG251] =0 THEN 1E-20 ELSE [NSAF CG251] END AS [NSAF CG2]
  FROM [412].[NSAF avg SpC.csv]


________________________________________


SELECT [All Proteins],
CASE WHEN [NSAF CG2] =0 THEN 1E-20 ELSE [NSAF CG2] END AS [NSAF CG2],
  CASE WHEN [NSAF CG5]=0 THEN 1E-20 ELSE [NSAF CG5] END AS [NSAF CG5],
CASE WHEN [NSAF CG8]=0 THEN 1E-20 ELSE [NSAF CG8] END AS [NSAF CG8],
CASE WHEN [NSAF CG11]=0 THEN 1E-20 ELSE [NSAF CG11] END AS [NSAF CG11],
CASE WHEN [NSAF CG26]=0 THEN 1E-20 ELSE [NSAF CG26] END AS [NSAF CG26],
CASE WHEN [NSAF CG29]=0 THEN 1E-20 ELSE [NSAF CG29] END AS [NSAF CG29],
CASE WHEN [NSAF CG32]=0 THEN 1E-20 ELSE [NSAF CG32] END AS [NSAF CG32],
CASE WHEN [NSAF CG35]=0 THEN 1E-20 ELSE [NSAF CG35] END AS [NSAF CG35],
CASE WHEN [NSAF CG221]=0 THEN 1E-20 ELSE [NSAF CG221] END AS [NSAF CG221],
CASE WHEN [NSAF CG224]=0 THEN 1E-20 ELSE [NSAF CG224] END AS [NSAF CG224],
CASE WHEN [NSAF CG227]=0 THEN 1E-20 ELSE [NSAF CG227] END AS [NSAF CG227],
CASE WHEN [NSAF CG230]=0 THEN 1E-20 ELSE [NSAF CG230] END AS [NSAF CG230],
CASE WHEN [NSAF CG242]=0 THEN 1E-20 ELSE [NSAF CG242] END AS [NSAF CG242],
CASE WHEN [NSAF CG245]=0 THEN 1E-20 ELSE [NSAF CG245] END AS [NSAF CG245],
CASE WHEN [NSAF CG248]=0 THEN 1E-20 ELSE [NSAF CG248] END AS [NSAF CG248],
CASE WHEN [NSAF CG251] =0 THEN 1E-20 ELSE [NSAF CG251] END AS [NSAF CG251]
  FROM [412].[NSAF avg SpC.csv]


________________________________________


SELECT * ,
  CAST(([NSAF CG2]+[NSAF CG5]+[NSAF CG8]+[NSAF CG11]) AS FLOAT)/4 AS [400 avg NSAF]
  FROM [412].[NSAF avg SpC no 0]



________________________________________


SELECT * ,
  CAST(([NSAF CG2]+[NSAF CG5]+[NSAF CG8]+[NSAF CG11]) AS FLOAT)/4 AS [2800 avg NSAF],
  CAST(([NSAF CG26]+[NSAF CG29]+[NSAF CG32]+[NSAF CG35]) AS FLOAT)/4 AS [2800MechS avg NSAF],
  CAST(([NSAF CG221]+[NSAF CG224]+[NSAF CG227]+[NSAF CG230]) AS FLOAT)/4 AS [400 avg NSAF],
  CAST(([NSAF CG242]+[NSAF CG245]+[NSAF CG248]+[NSAF CG251]) AS FLOAT)/4 AS [400MechS avg NSAF]
  FROM [412].[NSAF avg SpC no 0]



________________________________________


SELECT *,
  CAST([2800 avg NSAF]/[400 avg NSAF] AS FLOAT) as [OA fold change],
  CAST([400MechS avg NSAF]/[400 avg NSAF] AS FLOAT) as [MechS 400 fold change],
  CAST([2800MechS avg NSAF]/[2800 avg NSAF] AS FLOAT) as [MechS 2800 fold change]
  FROM [412].[NSAF avg SpC with avg NSAF]


________________________________________


SELECT [All Proteins] FROM [412].[NSAF avg SpC with fold change]
  WHERE [OA fold change] >=2 
  


________________________________________


SELECT * FROM [412].[proteins with 2 fold diff.txt]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[proteins with 2 fold diff.txt].Protein=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI protein]



________________________________________


SELECT * FROM [412].[5-fold diff expressed proteins.txt]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[5-fold diff expressed proteins.txt].[OA 5-fold]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]



________________________________________


SELECT * FROM [412].[5-fold diff expressed proteins.txt]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[5-fold diff expressed proteins.txt].Protein=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[5-fold diff expressed proteins.txt]
  LEFT JOIN [412].[NSAF based on avg SpC with SPIDs]
  ON [412].[5-fold diff expressed proteins.txt].Protein=[412].[NSAF based on avg SpC with SPIDs].[All Proteins]


________________________________________


SELECT [Protein], [Comparison],
  (CASE WHEN [Comparison]='OA' THEN [Protein] end) AS [OA5x]
  FROM [412].[5-fold diff expressed proteins.txt]
  GROUP BY [Protein], [Comparison]
 


________________________________________


SELECT [Protein], [Comparison],
  (CASE WHEN [Comparison]='OA' THEN [Protein] end) AS [OA5x],
  (CASE WHEN [Comparison]='400MechS' THEN [Protein] end) AS [400Mech5x],
  (CASE WHEN [Comparison]='2800MechS' THEN [Protein] end) AS [2800Mech5x]
  FROM [412].[5-fold diff expressed proteins.txt]
  GROUP BY [Protein], [Comparison]
 


________________________________________


SELECT [OA5x], [400Mech5x], [2800Mech5x]
  FROM [412].[5-fold proteins for venn]


________________________________________


SELECT [OA5x], [400Mech5x], [2800Mech5x] FROM [412].[5-fold proteins for venn]
  LEFT JOIN [412].[table_proteins that pass cutoffs.txt]
  ON [412].[5-fold proteins for venn].[OA5x]=[412].[table_proteins that pass cutoffs.txt].[All Proteins]
  


________________________________________


SELECT [OA5x], [400Mech5x], [2800Mech5x] FROM [412].[5-fold proteins for venn]

  


________________________________________


SELECT * FROM [412].[5-fold different proteins separate]
  LEFT JOIN [412].[table_proteins that pass cutoffs.txt]
  ON [412].[5-fold different proteins separate].[OA5x]=[412].[table_proteins that pass cutoffs.txt].[All Proteins]


________________________________________


SELECT * FROM [412].[table_proteins that pass cutoffs.txt]
  LEFT JOIN [412].[5-fold different proteins separate]
  ON [412].[table_proteins that pass cutoffs.txt].[All Proteins]=[412].[5-fold different proteins separate].[OA5x]


________________________________________


SELECT Distinct [Protein], [OA5x], [400Mech5x], [2800Mech5x]
  FROM [412].[5-fold proteins for venn]


________________________________________


SELECT * FROM [412].[5-fold diff expressed proteins.txt]
LEFT JOIN [412].[NSAF based on avg SpC with SPIDs]
ON [412].[5-fold diff expressed proteins.txt].Protein=[412].[NSAF based on avg SpC with SPIDs].[All Proteins]


________________________________________


SELECT [Protein], [Comparison],
(CASE WHEN [Comparison]='OA' THEN [Protein] end) AS [OA5x],
(CASE WHEN [Comparison]='400MechS' THEN [Protein] end) AS [400Mech5x],
(CASE WHEN [Comparison]='2800MechS' THEN [Protein] end) AS [2800Mech5x]
FROM [412].[5-fold diff expressed proteins.txt]
GROUP BY [Protein], [Comparison]


________________________________________


SELECT [OA5x], [400Mech5x], [2800Mech5x]
  FROM [412].[5-fold proteins for Venn]


________________________________________


SELECT DISTINCT [All Proteins] FROM [412].[NSAF avg SpC GO Slim]


________________________________________


SELECT DISTINCT [All Proteins] FROM [412].[NSAF avg SpC with GO slim]


________________________________________


SELECT * FROM [412].[5-fold proteins for Venn]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[5-fold proteins for Venn].Protein=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]



________________________________________


SELECT * ,
  CAST(([NSAF CG2]+[NSAF CG5]+[NSAF CG8]+[NSAF CG11]) AS FLOAT)/4 AS [2800 avg NSAF],
  CAST(([NSAF CG26]+[NSAF CG29]+[NSAF CG32]+[NSAF CG35]) AS FLOAT)/4 AS [2800MechS avg NSAF],
  CAST(([NSAF CG221]+[NSAF CG224]+[NSAF CG227]+[NSAF CG230]) AS FLOAT)/4 AS [400 avg NSAF],
  CAST(([NSAF CG242]+[NSAF CG245]+[NSAF CG248]+[NSAF CG251]) AS FLOAT)/4 AS [400MechS avg NSAF]
  FROM [412].[table_NSAF avg SpC.csv]



________________________________________


SELECT * FROM [412].[NSAF with averages per treatment]
  LEFT JOIN [412].[table_5-fold proteins for S4.txt]
  ON [412].[NSAF with averages per treatment].[All Proteins]=[412].[table_5-fold proteins for S4.txt].Protein



________________________________________


SELECT * FROM [412].[NSAF with averages, 5-fold]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[NSAF with averages, 5-fold].[All Proteins]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]



________________________________________


SELECT * FROM [412].[NSAF averages, 5-fold, SPID]
  LEFT JOIN [412].[table_enriched proteins for S4.txt]
  ON [412].[NSAF averages, 5-fold, SPID].SPID=[412].[table_enriched proteins for S4.txt].Protein



________________________________________


SELECT DISTINCT * FROM [412].[NSAF averages, 5-fold, SPID, enriched]


________________________________________


Select 
  Count (Distinct [Protein]) FROM [412].[enriched proteins for S4.txt]


________________________________________


Select 
  Count ([Protein]) FROM [412].[enriched proteins for S4.txt]


________________________________________


SELECT * FROM [412].[NSAF averages, 5-fold, SPID]
  LEFT JOIN [412].[table_enriched proteins for S4.txt]
  ON [412].[NSAF averages, 5-fold, SPID].SPID=[412].[table_enriched proteins for S4.txt].Protein



________________________________________


SELECT * FROM [412].[NSAF averages, 5-fold, SPID]
  LEFT JOIN [412].[table_enriched proteins for S4.txt]
  ON [412].[NSAF averages, 5-fold, SPID].SPID=[412].[table_enriched proteins for S4.txt].Protein


________________________________________


SELECT 
  [Column1] AS [Query],
  [Column2] AS [Subject],
  [Column3] AS [perc ID],
  [Column4] AS [align lengths],
  [Column5] AS [mismatches],
  [Column6] AS [gap openings],
  [Column7] AS [query start],
  [Column8] AS [query end],
  [Column9] AS [subject start],
  [Column10] AS [subject end],
  [Column11] AS [e-value],
  [Column12] AS [bit score]
  FROM [412].[table_Brest_proteins_blastpout_12prot]


________________________________________


SELECT 
  (CASE WHEN [perc ID] > 50 THEN [perc ID] end) as [perc ID]
  FROM [412].[Brest_proteins_blastpout_12prot]


________________________________________


SELECT * FROM [412].[Brest_proteins_blastpout_12prot]
  WHERE [Query]='apolipophorin'



________________________________________


SELECT * FROM [412].[Brest_proteins_blastpout_12prot]
  WHERE [Subject]='CGI_10003308'



________________________________________


SELECT 
  [Column1] AS [Query],

[Column2] AS [Subject],

[Column3] AS [perc ID],

[Column4] AS [align lengths],

[Column5] AS [mismatches],

[Column6] AS [gap openings],

[Column7] AS [query start],

[Column8] AS [query end],

[Column9] AS [subject start],

[Column10] AS [subject end],

[Column11] AS [e-value],

[Column12] AS [bit score]
  FROM [412].[table_Brest_proteins_blastpout]


________________________________________


SELECT * FROM [412].[Brest_proteins_blastpout]
  WHERE Query='CGI_10003308'


________________________________________


SELECT * FROM [412].[NSAF with averages, 5-fold, SPIDs, enrichment]
  LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [412].[NSAF with averages, 5-fold, SPIDs, enrichment].SPID=[354].[SPID_GOnumber.txt].A0A000



________________________________________


SELECT * FROM [412].[Proteins with NSAF and GO]
  LEFT JOIN [1123].[GO_to_GOslim]
  ON [412].[Proteins with NSAF and GO].[GO:0003824]=[1123].[GO_to_GOslim].GO_id


________________________________________


SELECT * FROM [412].[mech_stress_diff_exp_for_annotation.txt]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[mech_stress_diff_exp_for_annotation.txt].[All Proteins]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]


________________________________________


SELECT * FROM [412].[avg NSAF by treatment colors.csv]
  LEFT JOIN [412].[table_true fold OA.txt]
  ON [412].[avg NSAF by treatment colors.csv].[All Proteins]=[412].[table_true fold OA.txt].[Protein OA]
  LEFT JOIN [412].[table_true fold 400 MechS.txt]
  ON [412].[avg NSAF by treatment colors.csv].[All Proteins]=[412].[table_true fold 400 MechS.txt].[Protein 400MechS]
  LEFT JOIN [412].[table_true fold 2800 MechS.txt]
  ON [412].[avg NSAF by treatment colors.csv].[All Proteins]=[412].[table_true fold 2800 MechS.txt].[Protein 2800MechS]



________________________________________


SELECT * FROM [412].[2-fold_protein_list.csv]
LEFT JOIN [412].[NSAF based on avg SpC with SPIDs]
ON [412].[2-fold_protein_list.csv].Protein=[412].[NSAF based on avg SpC with SPIDs].[All Proteins]



________________________________________


SELECT * FROM [412].[all_2-fold_proteins.txt]
  LEFT JOIN [412].[OA_2-fold.txt]
  ON [412].[all_2-fold_proteins.txt].Protein=[412].[OA_2-fold.txt].Protein
  LEFT JOIN [412].[400MechS_2-fold.txt]
  ON [412].[all_2-fold_proteins.txt].Protein=[412].[400MechS_2-fold.txt].Protein
  LEFT JOIN [412].[2800MechS_2-fold.txt]
  ON [412].[all_2-fold_proteins.txt].Protein=[412].[2800MechS_2-fold.txt].Protein
  



________________________________________


SELECT * FROM [412].[Table_S3.txt]
  LEFT JOIN [412].[all_2-fold_proteins.txt]
  ON [412].[Table_S3.txt].[All Proteins]=[412].[all_2-fold_proteins.txt].Protein



________________________________________


SELECT 
  [Protein] AS [2-fold Proteins],
  [SPID] AS [SPID],
  [Annotation] AS [Annotation],
  [Protein] AS [OA],
  [Protein] AS [400MechS],
  [Protein] AS [2800MechS]
  FROM [412].[2-fold diff proteins for venn]


________________________________________


SELECT * FROM [412].[Table_S3.txt]
  LEFT JOIN [412].[2-fold diff proteins for venn new col names]
  ON [412].[Table_S3.txt].[All Proteins]=[412].[2-fold diff proteins for venn new col names].[2-fold Proteins]



________________________________________


SELECT * FROM [412].[Table_S3.txt]
  LEFT JOIN [412].[2-fold diff proteins for venn]
  ON [412].[Table_S3.txt].[All Proteins]=[412].[2-fold diff proteins for venn].[Protein]



________________________________________


SELECT * FROM [412].[2-fold diff proteins for venn]
  LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [412].[2-fold diff proteins for venn].SPID=[354].[SPID_GOnumber.txt].A0A000




________________________________________


SELECT DISTINCT * FROM [412].[2-fold diff exp with GO]


________________________________________


SELECT
  REPLACE([Column2], 'gnl|CDD|', '')
  FROM [412].[proteome_cdd_010813]


________________________________________


SELECT
  REPLACE([Column2], 'gnl|CDD|', '')
  FROM [412].[proteome_cdd_010813]
  UPDATE [412].[proteome_cdd_010813] SET [Column2]=REPLACE([Column2], 'gnl|CDD|', '') 



________________________________________


UPDATE [412].[table_proteome_cdd_010813] SET [Column2] = REPLACE([Column2], 'gnl|CDD|', '')



________________________________________


SELECT 
 Column1 AS [CGI number],
  Column4 AS [CDD annotation],
  Column13 AS [e-value]
  FROM [412].[proteome_cdd_sepnumb]


________________________________________


SELECT * FROM [412].[proteome CDD annot small file]
  LEFT JOIN [412].[table_cddannot.txt]
  ON [412].[proteome CDD annot small file].[CDD annotation]=[412].[table_cddannot.txt].[PSSM-ID]



________________________________________


SELECT * FROM [412].[proteome CDD annot small file]
  LEFT JOIN [412].[table_cddannot.txt]
  ON [412].[proteome CDD annot small file].[CDD annotation]=[412].[table_cddannot.txt].[PSSM-ID]
  LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [412].[proteome CDD annot small file].[CGI number]=[354].[SPID_GOnumber.txt].A0A000



________________________________________


SELECT * FROM [412].[proteome CDD annot small file]
  LEFT JOIN [412].[table_cddannot.txt]
  ON [412].[proteome CDD annot small file].[CDD annotation]=[412].[table_cddannot.txt].[PSSM-ID]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[proteome CDD annot small file].[CGI number]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]



________________________________________


SELECT * FROM [412].[proteome CDD annotations and SPIDs]
  LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [412].[proteome CDD annotations and SPIDs].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * FROM [412].[proteome CDD annotations, SPIDs, and GO]
  LEFT JOIN [1123].[GO_to_GOslim]
  ON [412].[proteome CDD annotations, SPIDs, and GO].[GO:0003824]=[1123].[GO_to_GOslim].GO_id



________________________________________


SELECT * FROM [412].[proteome CDD annotations, SPIDs, and GO slim]
  WHERE [aspect]='P'


________________________________________


SELECT [CGI Number],[CDD annotation],[PSSM-ID],[feature description], [Gene Name], [term],[GOSlim_bin] FROM [412].[proteome CDD annotations, SPIDs, and GO slim]
  WHERE [aspect]='P'


________________________________________


SELECT [feature description], [GOSlim_bin],
  CASE WHEN [GOSlim_bin]='cell adhesion' THEN 1 END
  FROM [412].[proteome CDD bio processes]


________________________________________


SELECT [feature description], [GOSlim_bin],
  CASE WHEN [GOSlim_bin]='cell adhesion' THEN 1
 WHEN [GOSlim_bin]='RNA 1341bolism' THEN 2 
  END
  FROM [412].[proteome CDD bio processes]


________________________________________


SELECT [feature description], [GOSlim_bin],
  CASE WHEN [GOSlim_bin]='cell adhesion' THEN 1
 WHEN [GOSlim_bin]='cell cycle and proliferation' THEN 2
  WHEN [GOSlim_bin]='cell organization and biogenesis' THEN 2
  WHEN [GOSlim_bin]='cell-cell signaling' THEN 4
  WHEN [GOSlim_bin]='death' THEN 5
  WHEN [GOSlim_bin]='developmental processes' THEN 6
  WHEN [GOSlim_bin]='DNA 1341bolism' THEN 7
  WHEN [GOSlim_bin]='other biological processes' THEN 8
  WHEN [GOSlim_bin]='other 1341bolic processes' THEN 9
  WHEN [GOSlim_bin]='protein 1341bolism' THEN 10
  WHEN [GOSlim_bin]='RNA 1341bolism' THEN 11
  WHEN [GOSlim_bin]='signal transduction' THEN 12
  WHEN [GOSlim_bin]='stress response' THEN 13
  WHEN [GOSlim_bin]='transport' THEN 14
  END
  FROM [412].[proteome CDD bio processes]


________________________________________


SELECT [CGI Number],[CDD annotation],[PSSM-ID],[feature description], [Gene Name], [term],[GO_id],[GOSlim_bin] FROM [412].[proteome CDD annotations, SPIDs, and GO slim]
  WHERE [aspect]='P'


________________________________________


SELECT [Column1] AS [CGI ID],
 [Column3] AS [SPID],
 [Column4] AS [Mouse Protein],
 [Column13] AS [e-value] 
  FROM [412].[table_oyster_blastp_mouse]


________________________________________


SELECT * FROM [412].[oyster_blastp_mouse]
  LEFT JOIN [412].[table_OA_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[table_OA_CGIDs.txt].Protein 
LEFT JOIN [412].[table_400MechS_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[table_400MechS_CGIDs.txt].Protein
  LEFT JOIN [412].[table_2800MechS_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[table_2800MechS_CGIDs.txt].Protein



________________________________________


SELECT [CGI ID], [SPID], [Mouse Protein], [e-value],
  [Protein] AS [OA],
  [Protein] AS [400MechS],
  [Protein] AS [2800 MechS]
  FROM [412].[mouse blast with treatments]


________________________________________


SELECT [Protein] AS [OA]
  FROM [412].[table_OA_CGIDs.txt]


________________________________________


SELECT [Protein] AS [400MechS]
  FROM [412].[table_400MechS_CGIDs.txt]


________________________________________


SELECT [Protein] AS [2800MechS] FROM [412].[table_2800MechS_CGIDs.txt]


________________________________________


SELECT * FROM [412].[oyster_blastp_mouse]
  LEFT JOIN [412].[OA_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[OA_CGIDs.txt].OA 
LEFT JOIN [412].[400MechS_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[400MechS_CGIDs.txt].[400MechS]
  LEFT JOIN [412].[2800MechS_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[2800MechS_CGIDs.txt].[2800MechS]



________________________________________


SELECT DISTINCT * FROM [412].[oyster_blastp_mouse]
  LEFT JOIN [412].[OA_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[OA_CGIDs.txt].OA 
LEFT JOIN [412].[400MechS_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[400MechS_CGIDs.txt].[400MechS]
  LEFT JOIN [412].[2800MechS_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[2800MechS_CGIDs.txt].[2800MechS]



________________________________________


SELECT DISTINCT * FROM [412].[oyster_blastp_mouse]


________________________________________


SELECT DISTINCT [CGI ID], [SPID], [Mouse Protein] FROM [412].[oyster_blastp_mouse]
  LEFT JOIN [412].[OA_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[OA_CGIDs.txt].OA 
LEFT JOIN [412].[400MechS_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[400MechS_CGIDs.txt].[400MechS]
  LEFT JOIN [412].[2800MechS_CGIDs.txt]
  ON [412].[oyster_blastp_mouse].[CGI ID]=[412].[2800MechS_CGIDs.txt].[2800MechS]



________________________________________


SELECT DISTINCT [CGI ID], [SPID], [Mouse Protein] FROM [412].[oyster_blastp_mouse]


________________________________________


SELECT DISTINCT * FROM [412].[distinct oyster blastp mouse]
  LEFT JOIN [412].[OA_CGIDs.txt]
  ON [412].[distinct oyster blastp mouse].[CGI ID]=[412].[OA_CGIDs.txt].OA 
LEFT JOIN [412].[400MechS_CGIDs.txt]
  ON [412].[distinct oyster blastp mouse].[CGI ID]=[412].[400MechS_CGIDs.txt].[400MechS]
  LEFT JOIN [412].[2800MechS_CGIDs.txt]
  ON [412].[distinct oyster blastp mouse].[CGI ID]=[412].[2800MechS_CGIDs.txt].[2800MechS]



________________________________________


SELECT [protein], [tot indep spectra]
  FROM [412].[A1_file_21.txt]


________________________________________


SELECT Distinct [protein], [tot indep spectra]
  FROM [412].[A1_file_21.txt]


________________________________________


SELECT CASE WHEN PATINDEX('%0-9%',[protein])=1
  AND CHARINDEX(',', [protein])=0
  THEN [protein]
  ELSE SUBSTRING ([protein],
    PATINDEX('%0-9%',[protein]),
    CHARINDEX(',', [protein])-PATINDEX('%0-9%',[protein]))
  END AS [protein]
  ,[tot indep spectra]
  FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A1_file19.txt]


________________________________________


SELECT Distinct CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A1_file19.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]  
  FROM [412].[A1_file20.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A1_file160.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A1_file161.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A1_file162.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A2_file13.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A2_file14.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A2_file15.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A2_file163.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A2_file164.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A2_file165.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A3_file16.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A3_file17.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A3_file18.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A3_file157.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A3_file158.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[A3_file159.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B1_file150.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B1_file151.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B1_file152.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B2_file34.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B2_file38.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B2_file39.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B2_file127.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B2_file128.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B2_file129.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B3_file130.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B3_file131.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B3_file132.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[B3_file137.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[C1_file141.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[C1_file142.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[C1_file143.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[C1_TCAfile175_1.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[C1_TCAfile176_1.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[C1_TCAfile177.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[C2_file136.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[C3_file145.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[C3_file146.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[D1_file122.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[D1_file123.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[D1_file124.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein]
      , [tot indep spectra]
  FROM [412].[D2_file169.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D2169] 
      , [tot indep spectra] AS [tot spectra D2169]
  FROM [412].[D2_file169.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D2170]
      , [tot indep spectra] AS [tot spectra D2170]
  FROM [412].[D2_file170.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D2171]
      , [tot indep spectra] AS [tot spectra D2171]
  FROM [412].[D2_file171.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D3119]
      , [tot indep spectra] AS [tot spectra D3119]
  FROM [412].[D3_file119.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D3120]
      , [tot indep spectra] AS [tot spectra D3120]
  FROM [412].[D3_file120.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D3121]
      , [tot indep spectra] AS [tot spectra D3121]
  FROM [412].[D3_file121.txt]


________________________________________


SELECT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A121]
      , [tot indep spectra] AS [tot spectra A121]
FROM [412].[A1 file 21 reduced]


________________________________________


SELECT Distinct CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A119]
      , [tot indep spectra] AS [tot spectra A119]
  FROM [412].[A1_file19.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A120]
      , [tot indep spectra] AS [tot spectra A120]
  FROM [412].[A1_file20.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A1160]
      , [tot indep spectra] AS [tot spectra A1160]
  FROM [412].[A1_file160.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A1161]
      , [tot indep spectra] AS [tot spectra A1161]
  FROM [412].[A1_file161.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A1162]
      , [tot indep spectra] AS [tot spectra A1162]
  FROM [412].[A1_file162.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A213]
      , [tot indep spectra] AS [tot spectra A213]
  FROM [412].[A2_file13.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A214]
      , [tot indep spectra] AS [tot spectra A214]
  FROM [412].[A2_file14.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A215]
      , [tot indep spectra] AS [tot spectra A215]
  FROM [412].[A2_file15.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A2163]
      , [tot indep spectra] AS [tot spectra A2163]
  FROM [412].[A2_file163.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A2164]
      , [tot indep spectra] AS [tot spectra A2164]
  FROM [412].[A2_file164.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A2165]
      , [tot indep spectra] AS [tot spectra A2165]
  FROM [412].[A2_file165.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A316]
      , [tot indep spectra] AS [tot spectra A316]
  FROM [412].[A3_file16.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A317]
      , [tot indep spectra] AS [tot spectra A317]
  FROM [412].[A3_file17.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A318]
      , [tot indep spectra] AS [tot spectra A318]
  FROM [412].[A3_file18.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A3157]
      , [tot indep spectra] AS [tot spectra A3157]
  FROM [412].[A3_file157.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A3158]
      , [tot indep spectra] AS [tot spectra A3158]
  FROM [412].[A3_file158.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A3159]
      , [tot indep spectra] AS [tot spectra A3159]
  FROM [412].[A3_file159.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B1150]
      , [tot indep spectra] AS [tot spectra B1150]
  FROM [412].[B1_file150.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B1151]
      , [tot indep spectra] AS [tot spectra B1151]
  FROM [412].[B1_file151.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B1152]
      , [tot indep spectra] AS [tot spectra B1152]
  FROM [412].[B1_file152.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B234]
      , [tot indep spectra] AS [tot spectra B234]
  FROM [412].[B2_file34.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B238]
      , [tot indep spectra] AS [tot spectra B238]
  FROM [412].[B2_file38.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B239]
      , [tot indep spectra] AS [tot spectra B239]
  FROM [412].[B2_file39.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B2127]
      , [tot indep spectra] AS [tot spectra B2127]
  FROM [412].[B2_file127.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B2138]
      , [tot indep spectra] AS [tot spectra B2138]
  FROM [412].[B2_file128.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B2129]
      , [tot indep spectra] AS [tot spectra B2129]
  FROM [412].[B2_file129.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B3130]
      , [tot indep spectra] AS [tot spectra B3130]
  FROM [412].[B3_file130.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B3131]
      , [tot indep spectra] AS [tot spectra B3131]
  FROM [412].[B3_file131.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B3132]
      , [tot indep spectra] AS [tot spectra B3132]
  FROM [412].[B3_file132.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B3137]
      , [tot indep spectra] AS [tot spectra B3137]
  FROM [412].[B3_file137.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C1141]
      , [tot indep spectra] AS [tot spectra C1141]
  FROM [412].[C1_file141.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C1142]
      , [tot indep spectra] AS [tot spectra C1142]
  FROM [412].[C1_file142.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C1143]
      , [tot indep spectra] AS [tot spectra C1143]
  FROM [412].[C1_file143.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C1TCA175]
      , [tot indep spectra] AS [tot spectra C1TCA175]
  FROM [412].[C1_TCAfile175_1.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C1TCA176]
      , [tot indep spectra] AS [tot spectra C1TCA176]
  FROM [412].[C1_TCAfile176_1.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C1TCA177]
      , [tot indep spectra] AS [tot spectra C1TCA177]
  FROM [412].[C1_TCAfile177.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C2136]
      , [tot indep spectra] AS [tot spectra C2136]
  FROM [412].[C2_file136.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C3145]
      , [tot indep spectra] AS [tot spectra C3145]
  FROM [412].[C3_file145.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C3146]
      , [tot indep spectra] AS [tot spectra C3146]
  FROM [412].[C3_file146.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D1122]
      , [tot indep spectra] AS [tot spectra D1122]
  FROM [412].[D1_file122.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D1123]
      , [tot indep spectra] AS [tot spectra D1123]
  FROM [412].[D1_file123.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D1124]
      , [tot indep spectra] AS [tot spectra D1124]
  FROM [412].[D1_file124.txt]


________________________________________


SELECT * FROM [412].[PNitsch_annotations.txt]
  LEFT JOIN [412].[A1 file 21 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A1 file 21 single IDs].[protein A121]



________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B2128]
      , [tot indep spectra] AS [tot spectra B2128]
  FROM [412].[B2_file128.txt]


________________________________________


SELECT * FROM [412].[PNitsch_annotations.txt]
  LEFT JOIN [412].[A1 file 21 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A1 file 21 single IDs].[protein A121]
  LEFT JOIN [412].[A1 file 19 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A1 file 19 single IDs].[protein A119]
  LEFT JOIN [412].[A1 file 20 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A1 file 20 single IDs].[protein A120]
  LEFT JOIN [412].[A1 file 160 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A1 file 160 single IDs].[protein A1160]
  LEFT JOIN [412].[A1 file 161 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A1 file 161 single IDs].[protein A1161]
  LEFT JOIN [412].[A1 file 162 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A1 file 162 single IDs].[protein A1162]
  LEFT JOIN [412].[A2 file 13 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A2 file 13 single IDs].[protein A213]
  LEFT JOIN [412].[A2 file 14 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A2 file 14 single IDs].[protein A214]
  LEFT JOIN [412].[A2 file 15 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A2 file 15 single IDs].[protein A215]
  LEFT JOIN [412].[A2 file 163 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A2 file 163 single IDs].[protein A2163]
  LEFT JOIN [412].[A2 file 164 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A2 file 164 single IDs].[protein A2164]
   LEFT JOIN [412].[A2 file 165 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A2 file 165 single IDs].[protein A2165]
  LEFT JOIN [412].[A3 file 16 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A3 file 16 single IDs].[protein A316]
  LEFT JOIN [412].[A3 file 17 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A3 file 17 single IDs].[protein A317]
  LEFT JOIN [412].[A3 file 18 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A3 file 18 single IDs].[protein A318]
  LEFT JOIN [412].[A3 file 157 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A3 file 157 single IDs].[protein A3157]
  LEFT JOIN [412].[A3 file 158 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A3 file 158 single IDs].[protein A3158]
  LEFT JOIN [412].[A3 file 159 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[A3 file 159 single IDs].[protein A3159]
  LEFT JOIN [412].[B1 file 150 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B1 file 150 single IDs].[protein B1150]
  LEFT JOIN [412].[B1 file 151 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B1 file 151 single IDs].[protein B1151]
  LEFT JOIN [412].[B1 file 152 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B1 file 152 single IDs].[protein B1152]
  LEFT JOIN [412].[B2 file 34 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B2 file 34 single IDs].[protein B234]
  LEFT JOIN [412].[B2 file 38 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B2 file 38 single IDs].[protein B238]
  LEFT JOIN [412].[B2 file 39 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B2 file 39 single IDs].[protein B239]
  LEFT JOIN [412].[B2 file 127 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B2 file 127 single IDs].[protein B2127]
  LEFT JOIN [412].[B2 file 128 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B2 file 128 single IDs].[protein B2128]
  LEFT JOIN [412].[B2 file 129 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B2 file 129 single IDs].[protein B2129]
  LEFT JOIN [412].[B3 file 130 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B3 file 130 single IDs].[protein B3130]
  LEFT JOIN [412].[B3 file 131 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B3 file 131 single IDs].[protein B3131]
  LEFT JOIN [412].[B3 file 132 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B3 file 132 single IDs].[protein B3132]
  LEFT JOIN [412].[B3 file 137 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[B3 file 137 single IDs].[protein B3137]
  LEFT JOIN [412].[C1 file 141 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[C1 file 141 single IDs].[protein C1141]
  LEFT JOIN [412].[C1 file 142 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[C1 file 142 single IDs].[protein C1142]
  LEFT JOIN [412].[C1 file 143 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[C1 file 143 single IDs].[protein C1143]
  LEFT JOIN [412].[C1 TCA file 175 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[C1 TCA file 175 single IDs].[protein C1TCA175]
LEFT JOIN [412].[C1 file TCA 176 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[C1 file TCA 176 single IDs].[protein C1TCA176]
LEFT JOIN [412].[C1 TCA file 177]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[C1 TCA file 177].[protein C1TCA177]
LEFT JOIN [412].[C2 file 136]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[C2 file 136].[protein C2136]
LEFT JOIN [412].[C3 file 145]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[C3 file 145].[protein C3145]
LEFT JOIN [412].[C3 file 146 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[C3 file 146 single IDs].[protein C3146]
LEFT JOIN [412].[D1 file 122 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[D1 file 122 single IDs].[protein D1122]
LEFT JOIN [412].[D1 file 123 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[D1 file 123 single IDs].[protein D1123]
LEFT JOIN [412].[D1 file 124 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[D1 file 124 single IDs].[protein D1124]
LEFT JOIN [412].[D2 file 169 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[D2 file 169 single IDs].[protein D2169]
LEFT JOIN [412].[D2 file 170 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[D2 file 170 single IDs].[protein D2170]
LEFT JOIN [412].[D2 file 171 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[D2 file 171 single IDs].[protein D2171]
LEFT JOIN [412].[D3 file 119 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[D3 file 119 single IDs].[protein D3119]
LEFT JOIN [412].[D3 file 120 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[D3 file 120 single IDs].[protein D3120]
LEFT JOIN [412].[D3 file 121 single IDs]
  ON [412].[PNitsch_annotations.txt].proteinId=[412].[D3 file 121 single IDs].[protein D3121]



________________________________________


SELECT [proteinId], 
SUM ([tot spectra A121]+ [tot spectra A119]+ [tot spectra A120]+ [tot spectra A1160]+ [tot spectra A1161]+ [tot spectra A1162]+ [tot spectra A213]+ [tot spectra A214]+ [tot spectra A215]+ [tot spectra A2163]+ [tot spectra A2164]+ [tot spectra A2165]+ [tot spectra A316]+ [tot spectra A317]+ [tot spectra A318]+ [tot spectra A3157]+ [tot spectra A3158]+ [tot spectra A3159]+ [tot spectra B1150]+ [tot spectra B1151]+ [tot spectra B1152]+ [tot spectra B2127]+ [tot spectra B2128]+ [tot spectra B2129]+ [tot spectra B3130]+ [tot spectra C1142]+ [tot spectra C1143]+ [tot spectra C1TCA175]+ [tot spectra C1TCA176]+ [tot spectra C1TCA177]+ [tot spectra C2136]+ [tot spectra C3145]+ [tot spectra C3146]+ [tot spectra D1122]+ [tot spectra D1123]+ [tot spectra D1124]+ [tot spectra D2169]+ [tot spectra D2170]+ [tot spectra D2171]+ [tot spectra D3119]+ [tot spectra D3120]+ [tot spectra D3121]) AS [Total Spectra]
  FROM [412].[Joined PNitzschia Files]
  GROUP BY [proteinId]



________________________________________


SELECT [proteinId] AS [protein], 
SUM ([tot spectra A121]+ [tot spectra A119]+ [tot spectra A120]+ [tot spectra A1160]+ [tot spectra A1161]+ [tot spectra A1162]+ [tot spectra A213]+ [tot spectra A214]+ [tot spectra A215]+ [tot spectra A2163]+ [tot spectra A2164]+ [tot spectra A2165]+ [tot spectra A316]+ [tot spectra A317]+ [tot spectra A318]+ [tot spectra A3157]+ [tot spectra A3158]+ [tot spectra A3159]+ [tot spectra B1150]+ [tot spectra B1151]+ [tot spectra B1152]+ [tot spectra B2127]+ [tot spectra B2128]+ [tot spectra B2129]+ [tot spectra B3130]+ [tot spectra C1142]+ [tot spectra C1143]+ [tot spectra C1TCA175]+ [tot spectra C1TCA176]+ [tot spectra C1TCA177]+ [tot spectra C2136]+ [tot spectra C3145]+ [tot spectra C3146]+ [tot spectra D1122]+ [tot spectra D1123]+ [tot spectra D1124]+ [tot spectra D2169]+ [tot spectra D2170]+ [tot spectra D2171]+ [tot spectra D3119]+ [tot spectra D3120]+ [tot spectra D3121]) AS [Total Spectra]
  FROM [412].[Joined PNitzschia Files]
  GROUP BY [proteinId]



________________________________________


SELECT [proteinId], [simple_functional_annotation], [KEGG], [KOG], [IPR], [GO], [tot spectra A121], [tot spectra A119], [tot spectra A120], [tot spectra A1160], [tot spectra A1161], [tot spectra A1162], [tot spectra A213], [tot spectra A214], [tot spectra A215], [tot spectra A2163], [tot spectra A2164], [tot spectra A2165], [tot spectra A316], [tot spectra A317], [tot spectra A318], [tot spectra A3157], [tot spectra A3158], [tot spectra A3159], [tot spectra B1150], [tot spectra B1151], [tot spectra B1152], [tot spectra B2127], [tot spectra B2128], [tot spectra B2129], [tot spectra B3130], [tot spectra C1142], [tot spectra C1143], [tot spectra C1TCA175], [tot spectra C1TCA176], [tot spectra C1TCA177], [tot spectra C2136], [tot spectra C3145], [tot spectra C3146], [tot spectra D1122], [tot spectra D1123], [tot spectra D1124], [tot spectra D2169], [tot spectra D2170], [tot spectra D2171], [tot spectra D3119], [tot spectra D3120], [tot spectra D3121]  FROM [412].[Joined PNitzschia Files]
  LEFT JOIN [412].[PNitzschia total spec counts]
  ON [412].[Joined PNitzschia Files].[proteinId]=[412].[PNitzschia total spec counts].[protein]
 


________________________________________


SELECT [proteinId]  FROM [412].[Joined PNitzschia Files]
  LEFT JOIN [412].[PNitzschia total spec counts]
  ON [412].[Joined PNitzschia Files].[proteinId]=[412].[PNitzschia total spec counts].[protein]
 


________________________________________


SELECT [proteinId], [simple_functional_annotation], [KEGG], [KOG], [IPR], [GO], [tot spectra A121], [tot spectra A119], [tot spectra A120], [tot spectra A1160], [tot spectra A1161], [tot spectra A1162], [tot spectra A213], [tot spectra A214], [tot spectra A215], [tot spectra A2163], [tot spectra A2164], [tot spectra A2165], [tot spectra A316], [tot spectra A317], [tot spectra A318], [tot spectra A3157], [tot spectra A3158], [tot spectra A3159], [tot spectra B1150], [tot spectra B1151], [tot spectra B1152], [tot spectra B2127], [tot spectra B2128], [tot spectra B2129], [tot spectra B3130], [tot spectra C1142], [tot spectra C1143], [tot spectra C1TCA175], [tot spectra C1TCA176], [tot spectra C1TCA177], [tot spectra C2136], [tot spectra C3145], [tot spectra C3146], [tot spectra D1122], [tot spectra D1123], [tot spectra D1124], [tot spectra D2169], [tot spectra D2170], [tot spectra D2171], [tot spectra D3119], [tot spectra D3120], [tot spectra D3121]  FROM [412].[Joined PNitzschia Files]
 


________________________________________


SELECT * FROM [412].[PNitzschia spec counts only]
  LEFT JOIN [412].[PNitzschia total spec counts]
  ON [412].[PNitzschia spec counts only].[proteinId]=[412].[PNitzschia total spec counts].[protein]




________________________________________


SELECT * FROM [412].[PNitzschia joined total SpC]
  WHERE [Total Spectra]>0



________________________________________


SELECT COUNT([proteinId]) FROM [412].[PNitzschia spec counts only]


________________________________________


SELECT *, 
  CASE WHEN [tot spectra A121] is NULL THEN 0 ELSE [tot spectra A121] END AS [tot spectra A121]
  FROM [412].[PNitzschia joined total SpC]


________________________________________


SELECT [proteinId], 
  CASE WHEN [tot spectra A121] is NULL THEN 0 ELSE [tot spectra A121] END AS [tot spectra A121]
  FROM [412].[PNitzschia joined total SpC]


________________________________________


SELECT [proteinId], [simple_functional_annotation], [KEGG], [KOG], [IPR], [GO],
CASE WHEN [tot spectra A121] is NULL THEN 0 ELSE [tot spectra A121] END AS [tot spectra A121], 
CASE WHEN [tot spectra A119] is NULL THEN 0 ELSE [tot spectra A119] END AS [tot spectra A119],
CASE WHEN [tot spectra A120] is NULL THEN 0 ELSE [tot spectra A120] END AS [tot spectra A120],
CASE WHEN [tot spectra A1160] is NULL THEN 0 ELSE [tot spectra A1160] END AS [tot spectra A1160],
CASE WHEN [tot spectra A1161] is NULL THEN 0 ELSE [tot spectra A1161] END AS [tot spectra A1161],
CASE WHEN [tot spectra A1162] is NULL THEN 0 ELSE [tot spectra A1162] END AS [tot spectra A1162],
CASE WHEN [tot spectra A213] is NULL THEN 0 ELSE [tot spectra A213] END AS [tot spectra A213],
CASE WHEN [tot spectra A214] is NULL THEN 0 ELSE [tot spectra A214] END AS [tot spectra A214],
CASE WHEN [tot spectra A215] is NULL THEN 0 ELSE [tot spectra A215] END AS [tot spectra A215],
CASE WHEN [tot spectra A2163] is NULL THEN 0 ELSE [tot spectra A2163] END AS [tot spectra A2163],
CASE WHEN [tot spectra A2164] is NULL THEN 0 ELSE [tot spectra A2164] END AS [tot spectra A2164],
CASE WHEN [tot spectra A2165] is NULL THEN 0 ELSE [tot spectra A2165] END AS [tot spectra A2165],
CASE WHEN [tot spectra A316] is NULL THEN 0 ELSE [tot spectra A316] END AS [tot spectra A316],
CASE WHEN [tot spectra A317] is NULL THEN 0 ELSE [tot spectra A317] END AS [tot spectra A317],
CASE WHEN [tot spectra A318] is NULL THEN 0 ELSE [tot spectra A318] END AS [tot spectra A318],
CASE WHEN [tot spectra A3157] is NULL THEN 0 ELSE [tot spectra A3157] END AS [tot spectra A3157],
CASE WHEN [tot spectra A3158] is NULL THEN 0 ELSE [tot spectra A3158] END AS [tot spectra A3158],
CASE WHEN [tot spectra A3159] is NULL THEN 0 ELSE [tot spectra A3159] END AS [tot spectra A3159],
CASE WHEN [tot spectra B1150] is NULL THEN 0 ELSE [tot spectra B1150] END AS [tot spectra B1150],
CASE WHEN [tot spectra B1151] is NULL THEN 0 ELSE [tot spectra B1151] END AS [tot spectra B1151],
CASE WHEN [tot spectra B1152] is NULL THEN 0 ELSE [tot spectra B1152] END AS [tot spectra B1152],
CASE WHEN [tot spectra B2127] is NULL THEN 0 ELSE [tot spectra B2127] END AS [tot spectra B2127],
CASE WHEN [tot spectra B2128] is NULL THEN 0 ELSE [tot spectra B2128] END AS [tot spectra B2128],
CASE WHEN [tot spectra B2129] is NULL THEN 0 ELSE [tot spectra B2129] END AS [tot spectra B2129],
CASE WHEN [tot spectra B3130] is NULL THEN 0 ELSE [tot spectra B3130] END AS [tot spectra B3130],
CASE WHEN [tot spectra C1142] is NULL THEN 0 ELSE [tot spectra C1142] END AS [tot spectra C1142],
CASE WHEN [tot spectra C1143] is NULL THEN 0 ELSE [tot spectra C1143] END AS [tot spectra C1143],
CASE WHEN [tot spectra C1TCA175] is NULL THEN 0 ELSE [tot spectra C1TCA175] END AS [tot spectra C1TCA175],
CASE WHEN [tot spectra C1TCA176] is NULL THEN 0 ELSE [tot spectra C1TCA176] END AS [tot spectra C1TCA176],
CASE WHEN [tot spectra C1TCA177] is NULL THEN 0 ELSE [tot spectra C1TCA177] END AS [tot spectra C1TCA177],
CASE WHEN [tot spectra C2136] is NULL THEN 0 ELSE [tot spectra C2136] END AS [tot spectra C2136],
CASE WHEN [tot spectra C3145] is NULL THEN 0 ELSE [tot spectra C3145] END AS [tot spectra C3145],
CASE WHEN [tot spectra C3146] is NULL THEN 0 ELSE [tot spectra C3146] END AS [tot spectra C3146],
CASE WHEN [tot spectra D1122] is NULL THEN 0 ELSE [tot spectra D1122] END AS [tot spectra D1122],
CASE WHEN [tot spectra D1123] is NULL THEN 0 ELSE [tot spectra D1123] END AS [tot spectra D1123],
CASE WHEN [tot spectra D1124] is NULL THEN 0 ELSE [tot spectra D1124] END AS [tot spectra D1124],
CASE WHEN [tot spectra D2169] is NULL THEN 0 ELSE [tot spectra D2169] END AS [tot spectra D2169],
CASE WHEN [tot spectra D2170] is NULL THEN 0 ELSE [tot spectra D2170] END AS [tot spectra D2170],
CASE WHEN [tot spectra D2171] is NULL THEN 0 ELSE [tot spectra D2171] END AS [tot spectra D2171],
CASE WHEN [tot spectra D3119] is NULL THEN 0 ELSE [tot spectra D3119] END AS [tot spectra D3119],
CASE WHEN [tot spectra D3120] is NULL THEN 0 ELSE [tot spectra D3120] END AS [tot spectra D3120],
CASE WHEN [tot spectra D3121] is NULL THEN 0 ELSE [tot spectra D3121] END AS [tot spectra D3121]

  FROM [412].[Joined PNitzschia Files]


________________________________________


SELECT [proteinId] AS [protein], 
SUM ([tot spectra A121]+ [tot spectra A119]+ [tot spectra A120]+ [tot spectra A1160]+ [tot spectra A1161]+ [tot spectra A1162]+ [tot spectra A213]+ [tot spectra A214]+ [tot spectra A215]+ [tot spectra A2163]+ [tot spectra A2164]+ [tot spectra A2165]+ [tot spectra A316]+ [tot spectra A317]+ [tot spectra A318]+ [tot spectra A3157]+ [tot spectra A3158]+ [tot spectra A3159]+ [tot spectra B1150]+ [tot spectra B1151]+ [tot spectra B1152]+ [tot spectra B2127]+ [tot spectra B2128]+ [tot spectra B2129]+ [tot spectra B3130]+ [tot spectra C1142]+ [tot spectra C1143]+ [tot spectra C1TCA175]+ [tot spectra C1TCA176]+ [tot spectra C1TCA177]+ [tot spectra C2136]+ [tot spectra C3145]+ [tot spectra C3146]+ [tot spectra D1122]+ [tot spectra D1123]+ [tot spectra D1124]+ [tot spectra D2169]+ [tot spectra D2170]+ [tot spectra D2171]+ [tot spectra D3119]+ [tot spectra D3120]+ [tot spectra D3121]) AS [Total Spectra]
  FROM [412].[Joined PNitzschia 0s]
  GROUP BY [proteinId]



________________________________________


SELECT [proteinId] AS [protein], 
SUM ([tot spectra A121]+ [tot spectra A119]+ [tot spectra A120]+ [tot spectra A1160]+ [tot spectra A1161]+ [tot spectra A1162]+ [tot spectra A213]+ [tot spectra A214]+ [tot spectra A215]+ [tot spectra A2163]+ [tot spectra A2164]+ [tot spectra A2165]+ [tot spectra A316]+ [tot spectra A317]+ [tot spectra A318]+ [tot spectra A3157]+ [tot spectra A3158]+ [tot spectra A3159]+ [tot spectra B1150]+ [tot spectra B1151]+ [tot spectra B1152]+ [tot spectra B2127]+ [tot spectra B2128]+ [tot spectra B2129]+ [tot spectra B3130]+ [tot spectra C1142]+ [tot spectra C1143]+ [tot spectra C1TCA175]+ [tot spectra C1TCA176]+ [tot spectra C1TCA177]+ [tot spectra C2136]+ [tot spectra C3145]+ [tot spectra C3146]+ [tot spectra D1122]+ [tot spectra D1123]+ [tot spectra D1124]+ [tot spectra D2169]+ [tot spectra D2170]+ [tot spectra D2171]+ [tot spectra D3119]+ [tot spectra D3120]+ [tot spectra D3121]) AS [Total Spectra]
  FROM [412].[Joined PNitzschia 0s]
  GROUP BY [proteinId]



________________________________________


SELECT * FROM [412].[Joined PNitzschia 0s]
  LEFT JOIN [412].[PNitzschia total spec counts]
  ON [412].[Joined PNitzschia 0s].[proteinId]=[412].[PNitzschia total spec counts].[protein]




________________________________________


SELECT *, 
  [Column1] AS [400MechS GO]
  FROM [412].[table_400MechS_immune_by_GO.csv]


________________________________________


SELECT 
  [Column1] AS [400MechS GO],
  [summary.Mech400.term..maxsum...200.] AS [Mech400 Occurrences],
  [term],
  [mean], [sd]
  FROM [412].[table_400MechS_immune_by_GO.csv]


________________________________________


SELECT 
  [Column1] AS [400MechS GO],
  [summary.Mech400.term..maxsum...200.] AS [Mech400 Occurrences],
  [term] AS [Mech400 term],
  [mean] AS [Mech400 mean], [sd] AS [Mech400 sd]
  FROM [412].[table_400MechS_immune_by_GO.csv]


________________________________________


SELECT 
  [Column1] AS [OA GO terms],
  [summary.oa.dat.term.] AS [OA Occurrences],
  [term] AS [OA term], [mean] AS [OA mean], [sd] AS [OA sd]
  FROM [412].[table_OA_immune_by_GO.csv]


________________________________________


SELECT 
  [Column1] AS [2800Mech GO terms],
  [summary.Mech2800.term..maxsum...200.] AS [2800Mech Occurrences],
  [term] AS [2800Mech term],
  [mean] AS [2800Mech mean], [sd] AS [2800Mech sd]
  FROM [412].[table_2800MechS_immune_by_GO.csv]


________________________________________


UPDATE [412].[unique_immune_GO_terms.txt]
  SET GO = REPLACE(GO, '"', '');



________________________________________


SELECT * FROM [412].[unique_immune_GO_terms.txt]
  LEFT JOIN [412].[OA_immune_by_GO.csv]
  ON [412].[unique_immune_GO_terms.txt].GO=[412].[OA_immune_by_GO.csv].[OA GO terms]



________________________________________


SELECT * FROM [412].[unique_immune_GO_terms.txt]
  LEFT JOIN [412].[OA_immune_by_GO.csv]
  ON [412].[unique_immune_GO_terms.txt].GO=[412].[OA_immune_by_GO.csv].[OA GO terms]
  LEFT JOIN [412].[400MechS_immune_by_GO.csv]
  ON [412].[unique_immune_GO_terms.txt].GO=[412].[400MechS_immune_by_GO.csv].[400MechS GO]
  LEFT JOIN [412].[2800MechS_immune_by_GO.csv]
  ON [412].[unique_immune_GO_terms.txt].GO=[412].[2800MechS_immune_by_GO.csv].[2800Mech GO terms]



________________________________________


SELECT DISTINCT [protein], [tot indep spectra]
  FROM [412].[A1_trip_files_160_161_162.prot.xls]


________________________________________


SELECT DISTINCT [protein] AS [protein A1], [tot indep spectra] AS [tot spectra A1]
  FROM [412].[A1_trip_files_160_161_162.prot.xls]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A1]
      , [tot indep spectra] AS [tot spectra A1]
  FROM [412].[A1_trip_files_160_161_162.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A2.13]
      , [tot indep spectra] AS [tot spectra A2.13]
  FROM [412].[A2_trip_files_15_14_13.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A2.157]
      , [tot indep spectra] AS [tot spectra A2.157]
  FROM [412].[A2_trip_files_159_158_157.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein A2.163]
      , [tot indep spectra] AS [tot spectra A2.163]
  FROM [412].[A2_trip_files_163_164_165.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B1]
      , [tot indep spectra] AS [tot spectra B1]
  FROM [412].[B1_trip_files_151_152_150.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B2]
      , [tot indep spectra] AS [tot spectra B2]
  FROM [412].[B2_trip_files_127_128_129.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein B3]
      , [tot indep spectra] AS [tot spectra B3]
  FROM [412].[B3_trip_files_130_131_132.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C1]
      , [tot indep spectra] AS [tot spectra C1]
  FROM [412].[C1_trip_files_141_142_143.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C2]
      , [tot indep spectra] AS [tot spectra C2]
  FROM [412].[C2mix_trip_files_142_143_136.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C3]
      , [tot indep spectra] AS [tot spectra C3]
  FROM [412].[C3_trip_files_144_145_136.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein C123]
      , [tot indep spectra] AS [tot spectra C123]
  FROM [412].[C123_noTCA_trip_files_175_176_177.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D1]
      , [tot indep spectra] AS [tot spectra D1]
  FROM [412].[D1_trip_files_124_123_122.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D2]
      , [tot indep spectra] AS [tot spectra D2]
  FROM [412].[D2_trip_files_169_170_171.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D3D2]
      , [tot indep spectra] AS [tot spectra D3D2]
  FROM [412].[D3_D2_trip_files_169_170_121.prot.txt]


________________________________________


SELECT DISTINCT CASE WHEN PATINDEX('%[0-9]%', [protein]) = 1 -- first char is number
                 AND CHARINDEX(',', [protein]) = 0 -- AND no comma present
            THEN [protein] 
            ELSE SUBSTRING([protein],
                    PATINDEX('%[0-9]%', [protein]), -- start at first number
                    CHARINDEX(',', [protein])-PATINDEX('%[0-9]%', [protein])) -- length
            END AS [protein D3]
      , [tot indep spectra] AS [tot spectra D3] 
  FROM [412].[D3_trip_files_119_120_121.prot.txt]


________________________________________


SELECT * FROM [412].[PNitsch_annotations.txt]
  LEFT JOIN [412].[A1 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[A1 trip single IDs].[protein A1]
  LEFT JOIN [412].[A2.13 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[A2.13 trip single IDs].[protein A2.13]
  LEFT JOIN [412].[A2.157 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[A2.157 trip single IDs].[protein A2.157]
  LEFT JOIN [412].[A2.163 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[A2.163 trip single IDs].[protein A2.163]
  LEFT JOIN [412].[B1 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[B1 trip single IDs].[protein B1]
  LEFT JOIN [412].[B2 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[B2 trip single IDs].[protein B2]
  LEFT JOIN [412].[B3 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[B3 trip single IDs].[protein B3]
  LEFT JOIN [412].[C1 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[C1 trip single IDs].[protein C1]
  LEFT JOIN [412].[C2 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[C2 trip single IDs].[protein C2]
  LEFT JOIN [412].[C3 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[C3 trip single IDs].[protein C3]
  LEFT JOIN [412].[C123 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[C123 trip single IDs].[protein C123]
  LEFT JOIN [412].[D1 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[D1 trip single IDs].[protein D1]
  LEFT JOIN [412].[D2 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[D2 trip single IDs].[protein D2]
  LEFT JOIN [412].[D3D2 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[D3D2 trip single IDs].[protein D3D2]
  LEFT JOIN [412].[D3 trip single IDs]
  ON [412].[PNitsch_annotations.txt].[proteinId]=[412].[D3 trip single IDs].[protein D3]



________________________________________


SELECT [proteinId], [simple_functional_annotation], [KEGG], [KOG], [IPR], [GO],
  CASE WHEN [tot spectra A1] is NULL THEN 0 ELSE [tot spectra A1] END AS [tot spectra A1],
  CASE WHEN [tot spectra A2.13] is NULL THEN 0 ELSE [tot spectra A2.13] END AS [tot spectra A2.13],
  CASE WHEN [tot spectra A2.157] is NULL THEN 0 ELSE [tot spectra A2.157] END AS [tot spectra A2.157],
  CASE WHEN [tot spectra A2.163] is NULL THEN 0 ELSE [tot spectra A2.163] END AS [tot spectra A2.163],
  CASE WHEN [tot spectra B1] is NULL THEN 0 ELSE [tot spectra B1] END AS [tot spectra B1],
  CASE WHEN [tot spectra B2] is NULL THEN 0 ELSE [tot spectra B2] END AS [tot spectra B2],
  CASE WHEN [tot spectra B3] is NULL THEN 0 ELSE [tot spectra B3] END AS [tot spectra B3],
  CASE WHEN [tot spectra C1] is NULL THEN 0 ELSE [tot spectra C1] END AS [tot spectra C1],
  CASE WHEN [tot spectra C2] is NULL THEN 0 ELSE [tot spectra C2] END AS [tot spectra C2],
  CASE WHEN [tot spectra C3] is NULL THEN 0 ELSE [tot spectra C3] END AS [tot spectra C3],
  CASE WHEN [tot spectra C123] is NULL THEN 0 ELSE [tot spectra C123] END AS [tot spectra C123],
  CASE WHEN [tot spectra D1] is NULL THEN 0 ELSE [tot spectra D1] END AS [tot spectra D1],
  CASE WHEN [tot spectra D2] is NULL THEN 0 ELSE [tot spectra D2] END AS [tot spectra D2],
  CASE WHEN [tot spectra D3D2] is NULL THEN 0 ELSE [tot spectra D3D2] END AS [tot spectra D3D2],
  CASE WHEN [tot spectra D3] is NULL THEN 0 ELSE [tot spectra D3] END AS [tot spectra D3]
  FROM [412].[Joined Pnitzschia trips]


________________________________________


SELECT [proteinId] AS [protein],
  SUM ([tot spectra A1]+[tot spectra A2.13]+[tot spectra A2.157]+[tot spectra A2.163]+[tot spectra B1]+[tot spectra B2]+[tot spectra B3]+[tot spectra C1]+[tot spectra C2]+[tot spectra C3]+[tot spectra C123]+[tot spectra D1]+[tot spectra D2]+[tot spectra D3D2]+[tot spectra D3]) AS [total spectra]
  FROM [412].[Joined Pnitzschia trips 0s]
  Group BY [proteinId]


________________________________________


SELECT * FROM [412].[Joined Pnitzschia trips 0s]
  LEFT JOIN [412].[Total SpC trips]
  ON [412].[Joined Pnitzschia trips 0s].[proteinId]=[412].[Total SpC trips].[protein]



________________________________________


SELECT [Column1] AS [PNitzsch Protein],
  [Column2] AS [SPID],
  [Column11] AS [evalue]
  FROM [412].[pseudonitz_blastp_03202014]


________________________________________


SELECT DISTINCT [Column1] AS [PNitzsch Protein],
  [Column2] AS [SPID],
  [Column11] AS [evalue]
  FROM [412].[pseudonitz_blastp_03202014]


________________________________________


SELECT [Column4] AS [PNitzsch Protein],
  [Column6] AS [SwissProt ID],
  [Column7] AS [SwissProt Org],
  [Column16] AS [evalue]
  FROM [412].[pseudonitz_blastp_tabdelim]


________________________________________


SELECT DISTINCT [Column4] AS [PNitzsch Protein],
  [Column6] AS [SwissProt ID],
  [Column7] AS [SwissProt Org],
  [Column16] AS [evalue]
  FROM [412].[pseudonitz_blastp_tabdelim]


________________________________________


SELECT DISTINCT [Column3] AS [PNitzsch Protein],
  [Column6] AS [SwissProt ID],
  [Column7] AS [SwissProt Org],
  [Column16] AS [evalue]
  FROM [412].[pseudonitz_blastp_tabdelim]


________________________________________


SELECT * FROM [412].[Pnitzschia_diff_exp.csv]
  LEFT JOIN [412].[pseudonitz blastp]
  ON [412].[Pnitzschia_diff_exp.csv].[Pnitzschia_techtrip_QSPECprep]=[412].[pseudonitz blastp].[PNitzsch Protein]
 



________________________________________


SELECT * FROM [412].[all_sequenced_proteins.csv]
  LEFT JOIN [412].[pseudonitz blastp]
  ON [412].[all_sequenced_proteins.csv].[Pnitzschia Protein]=[412].[pseudonitz blastp].[PNitzsch Protein]



________________________________________


SELECT * FROM [412].[all_sequenced_proteins.csv]
  LEFT JOIN [412].[pseudonitz blastp]
  ON [412].[all_sequenced_proteins.csv].[Pnitzschia Protein]=[412].[pseudonitz blastp].[PNitzsch Protein]



________________________________________


SELECT DISTINCT [Column1]
  FROM [412].[Galaxy31-FASTA-to-Tabular_on_data_30.tabular]


________________________________________


SELECT DISTINCT [Column4]
  FROM [412].[pseudonitz_blastp_tabdelim2]


________________________________________


SELECT DISTINCT [Column4]
  FROM [412].[pseudonitz_blastp_tabdelim2]


________________________________________


SELECT DISTINCT [Column3] AS [PNitzsch Protein],
  [Column6] AS [SwissProt ID],
  [Column7] AS [SwissProt Org],
  [Column16] AS [evalue]
   FROM [412].[pseudonitz_blastp_tabdelim2]


________________________________________


SELECT * FROM [412].[Pnitzschia_diff_exp.csv]
  LEFT JOIN [412].[pseudo nitzschia blastp results]
  ON [412].[Pnitzschia_diff_exp.csv].[Pnitzschia_techtrip_QSPECprep]=[412].[pseudo nitzschia blastp results].[PNitzsch Protein]



________________________________________


SELECT * FROM [412].[all_sequenced_proteins.csv]
  LEFT JOIN [412].[pseudo nitzschia blastp results]
  ON [412].[all_sequenced_proteins.csv].[Pnitzschia Protein]=[412].[pseudo nitzschia blastp results].[PNitzsch Protein]


________________________________________


SELECT DISTINCT [PNitzsch Protein]
  FROM [412].[pseudonitz blastp]


________________________________________


SELECT *, ROW_NUMBER()
  OVER (PARTITION BY [PNitzsch Protein] ORDER BY [evalue] ASC) AS [evalue rank]  
  FROM [412].[pseudonitz blastp]


________________________________________


SELECT * FROM [412].[psuedonitz blastp evalue rank]
  WHERE [evalue rank] =1



________________________________________


SELECT * FROM [412].[Pnitzschia_diff_exp.csv]
  LEFT JOIN [412].[pseudonitz blastp single annotation]
  ON [412].[Pnitzschia_diff_exp.csv].[Pnitzschia_techtrip_QSPECprep]=[412].[pseudonitz blastp single annotation].[PNitzsch Protein]
 



________________________________________


SELECT *, ROW_NUMBER()
  OVER (PARTITION BY [Pnitzschia Protein] ORDER BY [evalue] ASC) AS [evalue rank]
  FROM [412].[all seq pnitzschia proteins with swissprot]


________________________________________


SELECT * FROM [412].[all seq proteins evalue ranked]
  WHERE [evalue rank] =1



________________________________________


SELECT * FROM [412].[all_proteins_for_heatmap.csv]
  LEFT JOIN [412].[all seq proteins unique annotations]
  ON [412].[all_proteins_for_heatmap.csv].[Pnitzschia_techtrip_QSPECprep]=[412].[all seq proteins unique annotations].[Pnitzschia Protein]



________________________________________


SELECT [New_Global IDs], [YP accession]
  FROM [412].[table_Colwellia_YP_to_global_1.txt]


________________________________________


SELECT * FROM [412].[All_SPEC_COUNT_DATA2.csv]
  LEFT JOIN [412].[table_diff_exp_proteins_colwellia.txt]
  ON [412].[All_SPEC_COUNT_DATA2.csv].Protein=[412].[table_diff_exp_proteins_colwellia.txt].Protein
  LEFT JOIN [412].[Colwellia_YP_to_global_1.txt]
  ON [412].[All_SPEC_COUNT_DATA2.csv].Protein=[412].[Colwellia_YP_to_global_1.txt].[YP accession]


________________________________________


SELECT * FROM [412].[charlotte.txt]
  LEFT JOIN [1123].[uniprot-reviewed_wGO_010714]
  ON [412].[charlotte.txt].[Uniprot accession number]=[1123].[uniprot-reviewed_wGO_010714].[Entry]



________________________________________


SELECT * FROM [412].[mod_search_136.txt]
  LEFT JOIN [412].[all seq pnitzschia proteins with swissprot]
  ON [412].[mod_search_136.txt].protein=[412].[all seq pnitzschia proteins with swissprot].[Pnitzschia Protein]


________________________________________


SELECT * FROM [412].[mod_search_136.txt]
  LEFT JOIN [412].[all seq pnitzschia proteins with swissprot]
  ON [412].[mod_search_136.txt].protein=[412].[all seq pnitzschia proteins with swissprot].[Pnitzschia Protein]


________________________________________


SELECT * FROM [412].[mod search 236 with swissprot]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[mod search 236 with swissprot].[SwissProt ID]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].SPID


________________________________________


SELECT DISTINCT protein, [protein probability] FROM [412].[mod search 236 with swissprot]
  WHERE [protein probability] >= 0.9
  


________________________________________


SELECT DISTINCT * FROM [412].[B3_BLN.prot.txt]


________________________________________


SELECT DISTINCT [entry no.], [protein], [protein probability], [percent coverage], [tot indep spectra]
  FROM [412].[B3 BLN distinct]
  WHERE [protein probability] >=0.9


________________________________________


SELECT DISTINCT [entry no.], [protein], [protein probability], [percent coverage], [tot indep spectra]
  FROM [412].[B3 BLN distinct]
  WHERE [protein probability] >=0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT DISTINCT * FROM [412].[B3_ETS.prot.txt]


________________________________________


SELECT DISTINCT [entry no.], [protein], [protein probability], [percent coverage], [tot indep spectra] 
  FROM [412].[B3 ETS distinct]
  WHERE [protein probability] >=0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT protein FROM [412].[B3 ETS high conf proteins]
  UNION ALL
  SELECT protein FROM [412].[B3 BLN high conf proteins]


________________________________________


SELECT DISTINCT * FROM [412].[all proteins BLN ETS B3]


________________________________________


SELECT DISTINCT [entry no.] AS [entry ETS], [protein] AS [protein ETS], [protein probability] AS [probability ETS], [percent coverage] AS [coverage ETS], [tot indep spectra] AS [spectra ETS]
  FROM [412].[B3 ETS distinct]
  WHERE [protein probability] >=0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT DISTINCT [entry no.] AS [entry BLN], [protein] AS [protein BLN], [protein probability] AS [probability BLN], [percent coverage] AS [coverage BLN], [tot indep spectra] AS [spectra BLN]
  FROM [412].[B3 BLN distinct]
  WHERE [protein probability] >=0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT * FROM [412].[B3 BLN high conf proteins]
  LEFT JOIN [412].[B3 ETS high conf proteins]
  ON [B3 BLN high conf proteins].[protein BLN]=[B3 ETS high conf proteins].[protein ETS]


________________________________________


SELECT column_name
  FROM information_schema.columns
  WHERE table_name='distinct proteins BLN ETS B3'


________________________________________


SELECT [protein ETS] FROM [412].[B3 ETS high conf proteins]
  UNION ALL
  SELECT [protein BLN] FROM [412].[B3 BLN high conf proteins]


________________________________________


SELECT DISTINCT [protein ETS] AS [protein ID] FROM [412].[all proteins BLN ETS B3]


________________________________________


SELECT * FROM [412].[distinct proteins BLN ETS B3]
  LEFT JOIN [412].[B3 BLN high conf proteins]
  ON [412].[distinct proteins BLN ETS B3].[protein ID]=[412].[B3 BLN high conf proteins].[protein BLN]
  LEFT JOIN [412].[B3 ETS high conf proteins]
  ON [412].[distinct proteins BLN ETS B3].[protein ID]=[412].[B3 ETS high conf proteins].[protein ETS]


________________________________________


SELECT DISTINCT [entry no.] AS [entry BLN], [protein] AS [protein BLN], [protein probability] AS [probability BLN], [percent coverage] AS [coverage BLN], [tot indep spectra] AS [spectra BLN]
  FROM [412].[C2_BLN.prot.txt]
  WHERE [protein probability] >=0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT DISTINCT [entry no.] AS [entry ETS], [protein] AS [protein ETS], [protein probability] AS [probability ETS], [percent coverage] AS [coverage ETS], [tot indep spectra] AS [spectra ETS] 
  FROM [412].[table_C2_ETS.prot.txt]
  WHERE [protein probability] >=0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT [protein ETS] FROM [412].[C2_ETS.prot.txt]
  UNION ALL
  SELECT [protein BLN] FROM [412].[C2 BLN distinct]


________________________________________


SELECT [protein ETS] AS [protein ID] FROM [412].[C2_ETS.prot.txt]
  UNION ALL
  SELECT [protein BLN] FROM [412].[C2 BLN distinct]


________________________________________


SELECT [protein ETS] FROM [412].[C2_ETS.prot.txt]


________________________________________


SELECT * FROM [412].[C2 distinct proteins]
  LEFT JOIN [412].[C2_ETS.prot.txt]
  ON [412].[C2 distinct proteins].[protein ID]=[412].[C2_ETS.prot.txt].[protein ETS]
  LEFT JOIN [412].[C2 BLN distinct]
  ON [412].[C2 distinct proteins].[protein ID]=[412].[C2 BLN distinct].[protein BLN]


________________________________________


SELECT DISTINCT [protein] AS [protein ETS], [protein probability] AS [probability ETS], [percent coverage] AS [coverage ETS], [tot indep spectra] AS [spectra ETS] 
  FROM [412].[table_C2_ETS.prot.txt]
  WHERE [protein probability] >=0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT DISTINCT [protein ETS] FROM [412].[C2_ETS.prot.txt]


________________________________________


SELECT DISTINCT [protein BLN] FROM [412].[C2 BLN distinct]


________________________________________


SELECT DISTINCT [protein ID] FROM [412].[C2 distinct proteins]


________________________________________


SELECT DISTINCT [protein ID] FROM [412].[C2 distinct proteins]


________________________________________


SELECT * FROM [412].[C2 real distinct proteins]
  LEFT JOIN [412].[C2_ETS.prot.txt]
  ON [412].[C2 real distinct proteins].[protein ID]=[412].[C2_ETS.prot.txt].[protein ETS]
  LEFT JOIN [412].[C2 BLN distinct]
  ON [412].[C2 real distinct proteins].[protein ID]=[412].[C2 BLN distinct].[protein BLN]


________________________________________


SELECT * FROM [412].[output_temp.txt]
  LEFT JOIN [412].[Colwellia_YP_to_global_1.txt]
  ON [412].[output_temp.txt].Column1=[412].[Colwellia_YP_to_global_1.txt].[YP accession]


________________________________________


SELECT DISTINCT [entry no.] AS [entry 48], [protein] AS [protein 48], [protein probability] AS [probability 48], [percent coverage] AS [coverage 48], [tot indep spectra] AS [spectra 48]
  FROM [412].[Fusion_48.prot.txt]
  WHERE [protein probability] >= 0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT DISTINCT [entry no.] AS [entry 48], [protein] AS [protein 48], [protein probability] AS [probability 48], [percent coverage] AS [coverage 48], [tot indep spectra] AS [spectra 48]
  FROM [412].[Fusion_48.prot_1.txt]
  WHERE [protein probability] >= 0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT DISTINCT [entry no.] AS [entry 56], [protein] AS [protein 56], [protein probability] AS [probability 56], [percent coverage] AS [coverage 56], [tot indep spectra] AS [spectra 56]
  FROM [412].[Fusion_56.prot_1.txt]
  WHERE [protein probability] >= 0.9 AND
  [tot indep spectra] >1


________________________________________


SELECT * FROM [412].[Fusion_48.prot_1.txt]
  LEFT JOIN [412].[Fusion_56.prot_1.txt]
  ON [412].[Fusion_48.prot_1.txt].protein=[412].[Fusion_56.prot_1.txt].protein


________________________________________


SELECT * FROM [412].[PNitzschia_proteome.txt]
  LEFT JOIN [412].[qspec_resultsAB.txt]
  ON [412].[PNitzschia_proteome.txt].PROTID=[412].[qspec_resultsAB.txt].Protein
  LEFT JOIN [412].[qspec_resultsDC.txt]
  ON [412].[PNitzschia_proteome.txt].PROTID=[412].[qspec_resultsDC.txt].Protein
  LEFT JOIN [412].[qspec_resultsAC.txt]
  ON [412].[PNitzschia_proteome.txt].PROTID=[412].[qspec_resultsAC.txt].Protein


________________________________________


SELECT * FROM [412].[pnitzschia qspec results]
  LEFT JOIN [412].[all seq pnitzschia proteins with swissprot]
  ON [412].[pnitzschia qspec results].PROTID=[412].[all seq pnitzschia proteins with swissprot].[Pnitzschia Protein]


________________________________________


SELECT Column1 AS [protein number],
  Column2 AS [b]
  FROM [412].[table_seq_list_for_skyline_fasta_2.txt]


________________________________________


SELECT  Column1 AS [jgi],
  Column2 AS [Psemu1],
  Column3 AS [ID],
  Column4 AS [gm1]
  FROM [412].[table_PNitzschia_protein_names.txt]


________________________________________


SELECT [protein number] FROM [412].[seq_list_for_skyline_fasta_2.txt]
  LEFT JOIN [412].[PNitzschia_protein_names.txt]
  ON [412].[seq_list_for_skyline_fasta_2.txt].[protein number]=[412].[PNitzschia_protein_names.txt].[ID]


________________________________________


SELECT * FROM [412].[seq_list_for_skyline_fasta_2.txt]
  LEFT JOIN [412].[PNitzschia_protein_names.txt]
  ON [412].[seq_list_for_skyline_fasta_2.txt].[protein number]=[412].[PNitzschia_protein_names.txt].[ID]


________________________________________


SELECT * FROM [412].[PNitzschia_proteome.txt]
  LEFT JOIN [412].[qspec_resultsAB.txt]
  ON [412].[PNitzschia_proteome.txt].PROTID=[412].[qspec_resultsAB.txt].Protein
  LEFT JOIN [412].[qspec_resultsDC.txt]
  ON [412].[PNitzschia_proteome.txt].PROTID=[412].[qspec_resultsDC.txt].Protein
  LEFT JOIN [412].[qspec_resultsAC.txt]
  ON [412].[PNitzschia_proteome.txt].PROTID=[412].[qspec_resultsAC.txt].Protein
  LEFT JOIN [412].[qpsec_resultsAD.txt]
  ON [412].[PNitzschia_proteome.txt].PROTID=[412].[qpsec_resultsAD.txt].Protein


________________________________________


SELECT * FROM [412].[pnitzschia qspec results]
  LEFT JOIN [412].[all seq pnitzschia proteins with swissprot]
  ON [412].[pnitzschia qspec results].PROTID=[412].[all seq pnitzschia proteins with swissprot].[Pnitzschia Protein]


________________________________________


SELECT * FROM [412].[pnitzschia qspec results]
  LEFT JOIN [412].[all seq pnitzschia proteins with swissprot]
  ON [412].[pnitzschia qspec results].PROTID=[412].[all seq pnitzschia proteins with swissprot].[Pnitzschia Protein]


________________________________________


SELECT * FROM [412].[pnitzschia qspec results]
  LEFT JOIN [412].[all seq pnitzschia proteins with swissprot]
  ON [412].[pnitzschia qspec results].PROTID=[412].[all seq pnitzschia proteins with swissprot].[Pnitzschia Protein]


________________________________________


SELECT DISTINCT [Pnitzschia Protein] FROM [412].[all seq pnitzschia proteins with swissprot]


________________________________________


SELECT DISTINCT * FROM [412].[qspec_results_AB_DC_AC_AD.txt]


________________________________________


SELECT DISTINCT PROTID FROM [412].[QSPEC results AB DC AC AD distinct]


________________________________________


SELECT * FROM [412].[pnitzschia qspec results]
  LEFT JOIN [412].[table_adjNSAFnoD3.csv]
  ON [412].[pnitzschia qspec results].PROTID=[412].[table_adjNSAFnoD3.csv].PROTID


________________________________________


SELECT [Column1] AS [Protein ID],
 [Column2] AS [SwissProt],
 [Column11] AS [evalue] FROM [412].[Pante_SRR493637_blastp091922]


________________________________________


SELECT [Column1] AS [Protein ID],
 [Column3] AS [SwissProt ID],
 [Column4] AS [organism],
 [Column13] AS [evalue] FROM [412].[Pante_SRR493637_blastp_sep]


________________________________________


SELECT [PROTID],
 [X2014_AUG_18_QE15B_NUMSPECSTOT] AS [QE15 TOT SPC],
 [X2014_AUG_18_QE15B_ADJNSAF] AS [QE15 ADJNSAF],
 [X2014_AUG_18_QE16_NUMSPECSTOT] AS [QE16 TOT SPC],
 [X2014_AUG_18_QE16_ADJNSAF] AS [QE16 ADJNSAF],
 [X2014_AUG_18_QE17_NUMSPECSTOT] AS [QE17 TOT SPC],
 [X2014_AUG_18_QE17_ADJNSAF] AS [QE17 ADJNSAF],
 [X2014_AUG_18_QE21_NUMSPECSTOT] AS [QE21 TOT SPC],
 [X2014_AUG_18_QE21_ADJNSAF] AS [QE21 ADJNSAF],
 [X2014_AUG_18_QE22_NUMSPECSTOT] AS [QE22 TOT SPC],
 [X2014_AUG_18_QE22_ADJNSAF] AS [QE22 ADJNSAF],
 [X2014_AUG_18_QE23_NUMSPECSTOT] AS [QE23 TOT SPC],
 [X2014_AUG_18_QE23_ADJNSAF] AS [QE23 ADJNSAF],
 [X2014_AUG_18_QE28_NUMSPECSTOT] AS [QE28 TOT SPC],
 [X2014_AUG_18_QE28_ADJNSAF] AS [QE28 ADJNSAF],
 [X2014_AUG_18_QE29_NUMSPECSTOT] AS [QE29 TOT SPC],
 [X2014_AUG_18_QE29_ADJNSAF] AS [QE29 ADJNSAF],
 [X2014_AUG_18_QE30_NUMSPECSTOT] AS [QE30 TOT SPC],
 [X2014_AUG_18_QE30_ADJNSAF] AS [QE30 ADJSNSAF],
 [X2014_AUG_18_QE33_NUMSPECSTOT] AS [QE33 TOT SPC],
 [X2014_AUG_18_QE33_ADJNSAF] AS [QE33 ADJNSAF],
 [X2014_AUG_18_QE41_NUMSPECSTOT] AS [QE41 TOT SPC],
 [X2014_AUG_18_QE41_ADJNSAF] AS [QE41 ADJNSAF],
 [X2014_AUG_18_QE42_NUMSPECSTOT] AS [QE42 TOT SPC],
 [X2014_AUG_18_QE42_ADJNSAF] AS [QE42 ADJNSAF],
 [X2014_AUG_18_QE43_NUMSPECSTOT] AS [QE43 TOT SPC],
 [X2014_AUG_18_QE43_ADJNSAF] AS [QE43 ADJNSAF],
 [X2014_AUG_18_QE450_NUMSPECSTOT] AS [QE50 TOT SPC],
 [X2014_AUG_18_QE450_ADJNSAF] AS [QE50 ADJNSAF],
 [X2014_AUG_18_QE453_NUMSPECSTOT] AS [QE53 TOT SPC],
 [X2014_AUG_18_QE453_ADJNSAF] AS [QE53 ADJNSAF],
 [X2014_AUG_18_QE46_NUMSPECSTOT] AS [QE46 TOT SPC],
 [X2014_AUG_18_QE46_ADJNSAF] AS [QE46 ADJNSAF],
 [X2014_AUG_18_QE47_NUMSPECSTOT] AS [QE47 TOT SPC],
 [X2014_AUG_18_QE47_ADJNSAF] AS [QE47 ADJNSAF],
 [X2014_AUG_18_QE54_NUMSPECSTOT] AS [QE54 TOT SPC],
 [X2014_AUG_18_QE54_ADJNSAF] AS [QE54 ADJNSAF],
 [X2014_AUG_18_QE55_NUMSPECSTOT] AS [QE55 TOT SPC],
 [X2014_AUG_18_QE55_ADJNSAF] AS [QE55 ADJNSAF] FROM [412].[ABACUS_Mbalthica_092014.tsv]


________________________________________


SELECT * FROM [412].[Mbalthica total spc and nsaf QE Sept 2014]
  LEFT JOIN [412].[Swissprot Annotated Pante SRR493637]
  ON [412].[Mbalthica total spc and nsaf QE Sept 2014].[PROTID]=[412].[Swissprot Annotated Pante SRR493637].[Protein ID]


________________________________________


SELECT * FROM [412].[Mbalthica total spc and nsaf QE Sept 2014]
  LEFT JOIN [412].[Swissprot Annotated Pante SRR493637]
  ON [412].[Mbalthica total spc and nsaf QE Sept 2014].[PROTID]=[412].[Swissprot Annotated Pante SRR493637].[Protein ID]


________________________________________


SELECT * FROM [412].[Mbalthica spc and nsaf with swissprot]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[Mbalthica spc and nsaf with swissprot].[SwissProt ID]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].SPID


________________________________________


SELECT [PROTID],
 [X2014_AUG_18_QE15B_NUMSPECSTOT] AS [QE15 TOT SPC],
 [X2014_AUG_18_QE15B_ADJNSAF] AS [QE15 ADJNSAF],
 [X2014_AUG_18_QE16_NUMSPECSTOT] AS [QE16 TOT SPC],
 [X2014_AUG_18_QE16_ADJNSAF] AS [QE16 ADJNSAF],
 [X2014_AUG_18_QE17_NUMSPECSTOT] AS [QE17 TOT SPC],
 [X2014_AUG_18_QE17_ADJNSAF] AS [QE17 ADJNSAF],
 [X2014_AUG_18_QE18_NUMSPECSTOT] AS [QE18 TOT SPC],
 [X2014_AUG_18_QE18_ADJNSAF] AS [QE18 ADJNSAF], 
 [X2014_AUG_18_QE21_NUMSPECSTOT] AS [QE21 TOT SPC],
 [X2014_AUG_18_QE21_ADJNSAF] AS [QE21 ADJNSAF],
 [X2014_AUG_18_QE22_NUMSPECSTOT] AS [QE22 TOT SPC],
 [X2014_AUG_18_QE22_ADJNSAF] AS [QE22 ADJNSAF],
 [X2014_AUG_18_QE23_NUMSPECSTOT] AS [QE23 TOT SPC],
 [X2014_AUG_18_QE23_ADJNSAF] AS [QE23 ADJNSAF],
 [X2014_AUG_18_QE28_NUMSPECSTOT] AS [QE28 TOT SPC],
 [X2014_AUG_18_QE28_ADJNSAF] AS [QE28 ADJNSAF],
 [X2014_AUG_18_QE29_NUMSPECSTOT] AS [QE29 TOT SPC],
 [X2014_AUG_18_QE29_ADJNSAF] AS [QE29 ADJNSAF],
 [X2014_AUG_18_QE30_NUMSPECSTOT] AS [QE30 TOT SPC],
 [X2014_AUG_18_QE30_ADJNSAF] AS [QE30 ADJSNSAF],
 [X2014_AUG_18_QE33_NUMSPECSTOT] AS [QE33 TOT SPC],
 [X2014_AUG_18_QE33_ADJNSAF] AS [QE33 ADJNSAF],
  [X2014_AUG_18_QE34_NUMSPECSTOT] AS [QE34 TOT SPC],
 [X2014_AUG_18_QE34_ADJNSAF] AS [QE34 ADJNSAF],
  [X2014_AUG_18_QE35_NUMSPECSTOT] AS [QE35 TOT SPC],
 [X2014_AUG_18_QE35_ADJNSAF] AS [QE35 ADJNSAF],
 [X2014_AUG_18_QE41_NUMSPECSTOT] AS [QE41 TOT SPC],
 [X2014_AUG_18_QE41_ADJNSAF] AS [QE41 ADJNSAF],
 [X2014_AUG_18_QE42_NUMSPECSTOT] AS [QE42 TOT SPC],
 [X2014_AUG_18_QE42_ADJNSAF] AS [QE42 ADJNSAF],
 [X2014_AUG_18_QE43_NUMSPECSTOT] AS [QE43 TOT SPC],
 [X2014_AUG_18_QE43_ADJNSAF] AS [QE43 ADJNSAF],
 [X2014_AUG_18_QE450_NUMSPECSTOT] AS [QE50 TOT SPC],
 [X2014_AUG_18_QE450_ADJNSAF] AS [QE50 ADJNSAF],
 [X2014_AUG_18_QE453_NUMSPECSTOT] AS [QE53 TOT SPC],
 [X2014_AUG_18_QE453_ADJNSAF] AS [QE53 ADJNSAF],
 [X2014_AUG_18_QE46_NUMSPECSTOT] AS [QE46 TOT SPC],
 [X2014_AUG_18_QE46_ADJNSAF] AS [QE46 ADJNSAF],
 [X2014_AUG_18_QE47_NUMSPECSTOT] AS [QE47 TOT SPC],
 [X2014_AUG_18_QE47_ADJNSAF] AS [QE47 ADJNSAF],
 [X2014_AUG_18_QE54_NUMSPECSTOT] AS [QE54 TOT SPC],
 [X2014_AUG_18_QE54_ADJNSAF] AS [QE54 ADJNSAF],
 [X2014_AUG_18_QE55_NUMSPECSTOT] AS [QE55 TOT SPC],
 [X2014_AUG_18_QE55_ADJNSAF] AS [QE55 ADJNSAF] 
  FROM [412].[ABACUS_output.tsv]


________________________________________


SELECT * FROM [412].[Mbalthica SpC and NSAF]
  LEFT JOIN [412].[Swissprot Annotated Pante SRR493637]
  ON [412].[Mbalthica SpC and NSAF].[PROTID]=[412].[Swissprot Annotated Pante SRR493637].[Protein ID]


________________________________________


SELECT * FROM [412].[Mbalthica spc and nsaf with swissprot]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[Mbalthica spc and nsaf with swissprot].[SwissProt ID]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].SPID


________________________________________


SELECT * FROM [412].[Mbalthica spc and nsaf with swissprot]
  LEFT JOIN [412].[table_TJGR_Gene_SPID_evalue_Description.txt]
  ON [412].[Mbalthica spc and nsaf with swissprot].[SwissProt ID]=[412].[table_TJGR_Gene_SPID_evalue_Description.txt].SPID


________________________________________


SELECT * FROM [412].[Swissprot Annotated Pante SRR493637]
  LEFT JOIN [412].[table_diff_abund_proteins_CvsVT.txt]
  ON [412].[Swissprot Annotated Pante SRR493637].[Protein ID]=[412].[table_diff_abund_proteins_CvsVT.txt].Protein
  LEFT JOIN [412].[table_diff_abund_proteins_CvsT.txt]
  ON [412].[Swissprot Annotated Pante SRR493637].[Protein ID]=[412].[table_diff_abund_proteins_CvsT.txt].Protein
  LEFT JOIN [412].[table_diff_abund_proteins_CvsV.txt]
  ON [412].[Swissprot Annotated Pante SRR493637].[Protein ID]=[412].[table_diff_abund_proteins_CvsV.txt].Protein


________________________________________


SELECT PROTID FROM [412].[Mbalthica SpC and NSAF]
  LEFT JOIN [412].[table_diff_abund_proteins_CvsT.txt]
  ON [412].[Mbalthica SpC and NSAF].PROTID=[412].[table_diff_abund_proteins_CvsT.txt].Protein
  LEFT JOIN [412].[table_diff_abund_proteins_CvsV.txt]
  ON [412].[Mbalthica SpC and NSAF].PROTID=[412].[table_diff_abund_proteins_CvsV.txt].Protein
  LEFT JOIN [412].[table_diff_abund_proteins_CvsVT.txt]
  ON [412].[Mbalthica SpC and NSAF].PROTID=[412].[table_diff_abund_proteins_CvsVT.txt].Protein


________________________________________


SELECT * FROM [412].[Mbalthica SpC and NSAF]
  LEFT JOIN [412].[table_diff_abund_proteins_CvsT.txt]
  ON [412].[Mbalthica SpC and NSAF].PROTID=[412].[table_diff_abund_proteins_CvsT.txt].Protein
  LEFT JOIN [412].[table_diff_abund_proteins_CvsV.txt]
  ON [412].[Mbalthica SpC and NSAF].PROTID=[412].[table_diff_abund_proteins_CvsV.txt].Protein
  LEFT JOIN [412].[table_diff_abund_proteins_CvsVT.txt]
  ON [412].[Mbalthica SpC and NSAF].PROTID=[412].[table_diff_abund_proteins_CvsVT.txt].Protein


________________________________________


SELECT [Column6] AS [SeqNumber], [Column15] AS [ProtSeq] FROM [412].[Pnitzschia_proteomefasta_tabular.txt]


________________________________________


SELECT * FROM [412].[envfit_output_1.csv]
  LEFT JOIN [412].[PNitzschia_proteome.txt]
  ON [412].[envfit_output_1.csv].Protein=[412].[PNitzschia_proteome.txt].PROTID


________________________________________


SELECT * FROM [412].[combined_Thaps_Rpom_digested_Mass400to6000_1.txt]
  WHERE Unique_ID >13514 AND Unique_ID <1887119
  


________________________________________


SELECT * FROM [412].[Ruegeria_pomeroyi_uniprot_digested_Mass400to6000.txt]
  LEFT JOIN [412].[table_Thaps_v3_250NCBI_contam_bd_digested_Mass400to6000.txt]
  ON [412].[Ruegeria_pomeroyi_uniprot_digested_Mass400to6000.txt].Sequence=[412].[table_Thaps_v3_250NCBI_contam_bd_digested_Mass400to6000.txt].Sequence


________________________________________


SELECT Protein_Name AS Protein_Name_Rpom,
  Sequence AS Sequence_Rpom,
  Unique_ID AS Unique_ID_Rpom
  FROM [412].[Ruegeria_pomeroyi_uniprot_digested_Mass400to6000.txt]


________________________________________


SELECT Protein_Name AS Protein_Name_Thaps,
  Sequence AS Sequence_Thaps,
  Unique_ID AS Unique_ID_Thaps
  FROM [412].[Thaps_v3_250NCBI_contam_bd_digested_Mass400to6000.txt]


________________________________________


SELECT * FROM [412].[Rpom peptides]
  LEFT JOIN [412].[Thaps peptides]
  ON [412].[Rpom peptides].Sequence_Rpom=[412].[Thaps peptides].Sequence_Thaps


________________________________________


SELECT Protein_Name_Thaps, COUNT(Protein_Name_Thaps) 
  FROM [412].[Rpom Thaps peptide overlap]
  Group By Protein_Name_Thaps


________________________________________


SELECT Protein_Name_Thaps, COUNT(Protein_Name_Thaps) AS [Peptide Count] 
  FROM [412].[Rpom Thaps peptide overlap]
  Group By Protein_Name_Thaps


________________________________________


SELECT [Peptide Count], SUM([Peptide Count]) 
  FROM [412].[Number peptide overlaps]
  Group By [Peptide Count]


________________________________________


SELECT * FROM [412].[Thaps_number_peptide_overlaps_1.csv]
  LEFT JOIN [412].[table_Thaps3_bd_unmapped_koginfo_FilteredModels1.tab]
  ON [412].[Thaps_number_peptide_overlaps_1.csv].Protein_Name_Thaps=[412].[table_Thaps3_bd_unmapped_koginfo_FilteredModels1.tab].proteinID
  LEFT JOIN [412].[table_Thaps3_bd_unmapped_ecpathwayinfo_FilteredModels1_2.tab]
  ON [412].[Thaps_number_peptide_overlaps_1.csv].Protein_Name_Thaps=[412].[table_Thaps3_bd_unmapped_ecpathwayinfo_FilteredModels1_2.tab].proteinID
  LEFT JOIN [412].[table_Thaps3_bd_unmapped_goinfo_FilteredModels1.tab]
  ON [412].[Thaps_number_peptide_overlaps_1.csv].Protein_Name_Thaps=[412].[table_Thaps3_bd_unmapped_goinfo_FilteredModels1.tab].proteinID


________________________________________


SELECT * FROM [412].[Thaps_number_peptide_overlaps_1.csv]
  LEFT JOIN [412].[table_Thaps3_bd_unmapped_koginfo_FilteredModels1.tab]
  ON [412].[Thaps_number_peptide_overlaps_1.csv].Protein_Name_Thaps=[412].[table_Thaps3_bd_unmapped_koginfo_FilteredModels1.tab].proteinID
  LEFT JOIN [412].[table_Thaps3_bd_unmapped_ecpathwayinfo_FilteredModels1_2.tab]
  ON [412].[Thaps_number_peptide_overlaps_1.csv].Protein_Name_Thaps=[412].[table_Thaps3_bd_unmapped_ecpathwayinfo_FilteredModels1_2.tab].proteinID


________________________________________


SELECT * FROM [412].[Thaps_number_peptide_overlaps_1.csv]
  LEFT JOIN [412].[table_Thaps3_bd_unmapped_goinfo_FilteredModels1.tab]
  ON [412].[Thaps_number_peptide_overlaps_1.csv].Protein_Name_Thaps=[412].[table_Thaps3_bd_unmapped_goinfo_FilteredModels1.tab].proteinID


________________________________________


SELECT CONCAT(Protein_Name_Thaps, Unique_ID_Thaps), Sequence_Thaps
  FROM [412].[Rpom Thaps peptide overlap]


________________________________________


SELECT CONCAT(Protein_Name_Thaps, Unique_ID_Thaps) AS Thaps_peptide, Sequence_Thaps
  FROM [412].[Rpom Thaps peptide overlap]


________________________________________


SELECT MIN([protein probability])
  FROM [412].[2015_May_6_Bacteria_Dectection10.prot.xls]


________________________________________


SELECT [entry no.] as [A2 entry no.],
  [protein] AS [A2 protein],
  [protein probability] AS [A2 protein probability],
  [protein description] AS [A2 protein description],
  [percent coverage] AS [A2 percent coverage],
  [tot indep spectra] AS [A2 tot indep spectra],
  [percent share of spectrum IDs] AS [A2 percent share of spectrum IDs],
  [peptides] as [A2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection10.prot.xls]


________________________________________


SELECT [entry no.] as [A3 entry no.],
  [protein] AS [A3 protein],
  [protein probability] AS [A3 protein probability],
  [protein description] AS [A3 protein description],
  [percent coverage] AS [A3 percent coverage],
  [tot indep spectra] AS [A3 tot indep spectra],
  [percent share of spectrum IDs] AS [A3 percent share of spectrum IDs],
  [peptides] as [A3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection11.prot.xls]


________________________________________


SELECT [entry no.] as [F1 entry no.],
  [protein] AS [F1 protein],
  [protein probability] AS [F1 protein probability],
  [protein description] AS [F1 protein description],
  [percent coverage] AS [F1 percent coverage],
  [tot indep spectra] AS [F1 tot indep spectra],
  [percent share of spectrum IDs] AS [F1 percent share of spectrum IDs],
  [peptides] as [F1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection13.prot.xls]


________________________________________


SELECT [entry no.] as [F2 entry no.],
  [protein] AS [F2 protein],
  [protein probability] AS [F2 protein probability],
  [protein description] AS [F2 protein description],
  [percent coverage] AS [F2 percent coverage],
  [tot indep spectra] AS [F2 tot indep spectra],
  [percent share of spectrum IDs] AS [F2 percent share of spectrum IDs],
  [peptides] as [F2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection14.prot.xls]


________________________________________


SELECT [entry no.] as [F3 entry no.],
  [protein] AS [F3 protein],
  [protein probability] AS [F3 protein probability],
  [protein description] AS [F3 protein description],
  [percent coverage] AS [F3 percent coverage],
  [tot indep spectra] AS [F3 tot indep spectra],
  [percent share of spectrum IDs] AS [F3 percent share of spectrum IDs],
  [peptides] as [F3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection15.prot_1.xls]


________________________________________


SELECT [entry no.] as [A1 entry no.],
  [protein] AS [A1 protein],
  [protein probability] AS [A1 protein probability],
  [protein description] AS [A1 protein description],
  [percent coverage] AS [A1 percent coverage],
  [tot indep spectra] AS [A1 tot indep spectra],
  [percent share of spectrum IDs] AS [A1 percent share of spectrum IDs],
  [peptides] as [A1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection9.prot.xls]


________________________________________


SELECT [entry no.] as [D1 entry no.],
  [protein] AS [D1 protein],
  [protein probability] AS [D1 protein probability],
  [protein description] AS [D1 protein description],
  [percent coverage] AS [D1 percent coverage],
  [tot indep spectra] AS [D1 tot indep spectra],
  [percent share of spectrum IDs] AS [D1 percent share of spectrum IDs],
  [peptides] as [D1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection17.prot.xls]


________________________________________


SELECT [entry no.] as [D2 entry no.],
  [protein] AS [D2 protein],
  [protein probability] AS [D2 protein probability],
  [protein description] AS [D2 protein description],
  [percent coverage] AS [D2 percent coverage],
  [tot indep spectra] AS [D2 tot indep spectra],
  [percent share of spectrum IDs] AS [D2 percent share of spectrum IDs],
  [peptides] as [D2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection18.prot.xls]


________________________________________


SELECT [entry no.] as [D3 entry no.],
  [protein] AS [D3 protein],
  [protein probability] AS [D3 protein probability],
  [protein description] AS [D3 protein description],
  [percent coverage] AS [D3 percent coverage],
  [tot indep spectra] AS [D3 tot indep spectra],
  [percent share of spectrum IDs] AS [D3 percent share of spectrum IDs],
  [peptides] as [D3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection19.prot.xls]


________________________________________


SELECT [entry no.] as [B1 entry no.],
  [protein] AS [B1 protein],
  [protein probability] AS [B1 protein probability],
  [protein description] AS [B1 protein description],
  [percent coverage] AS [B1 percent coverage],
  [tot indep spectra] AS [B1 tot indep spectra],
  [percent share of spectrum IDs] AS [B1 percent share of spectrum IDs],
  [peptides] as [B1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection23.prot.xls]


________________________________________


SELECT [entry no.] as [B2 entry no.],
  [protein] AS [B2 protein],
  [protein probability] AS [B2 protein probability],
  [protein description] AS [B2 protein description],
  [percent coverage] AS [B2 percent coverage],
  [tot indep spectra] AS [B2 tot indep spectra],
  [percent share of spectrum IDs] AS [B2 percent share of spectrum IDs],
  [peptides] as [B2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection24.prot.xls]


________________________________________


SELECT [entry no.] as [B3 entry no.],
  [protein] AS [B3 protein],
  [protein probability] AS [B3 protein probability],
  [protein description] AS [B3 protein description],
  [percent coverage] AS [B3 percent coverage],
  [tot indep spectra] AS [B3 tot indep spectra],
  [percent share of spectrum IDs] AS [B3 percent share of spectrum IDs],
  [peptides] as [B3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection25.prot.xls]


________________________________________


SELECT [entry no.] as [C1 entry no.],
  [protein] AS [C1 protein],
  [protein probability] AS [C1 protein probability],
  [protein description] AS [C1 protein description],
  [percent coverage] AS [C1 percent coverage],
  [tot indep spectra] AS [C1 tot indep spectra],
  [percent share of spectrum IDs] AS [C1 percent share of spectrum IDs],
  [peptides] as [C1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection27.prot.xls]


________________________________________


SELECT [entry no.] as [C3 entry no.],
  [protein] AS [C3 protein],
  [protein probability] AS [C3 protein probability],
  [protein description] AS [C3 protein description],
  [percent coverage] AS [C3 percent coverage],
  [tot indep spectra] AS [C3 tot indep spectra],
  [percent share of spectrum IDs] AS [C3 percent share of spectrum IDs],
  [peptides] as [C3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection29.prot.xls]


________________________________________


SELECT [entry no.] as [H1 entry no.],
  [protein] AS [H1 protein],
  [protein probability] AS [H1 protein probability],
  [protein description] AS [H1 protein description],
  [percent coverage] AS [H1 percent coverage],
  [tot indep spectra] AS [H1 tot indep spectra],
  [percent share of spectrum IDs] AS [H1 percent share of spectrum IDs],
  [peptides] as [H1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection31.prot.xls]


________________________________________


SELECT [entry no.] as [H2 entry no.],
  [protein] AS [H2 protein],
  [protein probability] AS [H2 protein probability],
  [protein description] AS [H2 protein description],
  [percent coverage] AS [H2 percent coverage],
  [tot indep spectra] AS [H2 tot indep spectra],
  [percent share of spectrum IDs] AS [H2 percent share of spectrum IDs],
  [peptides] as [H2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection32.prot.xls]


________________________________________


SELECT [entry no.] as [H3 entry no.],
  [protein] AS [H3 protein],
  [protein probability] AS [H3 protein probability],
  [protein description] AS [H3 protein description],
  [percent coverage] AS [H3 percent coverage],
  [tot indep spectra] AS [H3 tot indep spectra],
  [percent share of spectrum IDs] AS [H3 percent share of spectrum IDs],
  [peptides] as [H3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection33.prot.xls]


________________________________________


SELECT [entry no.] as [G1 entry no.],
  [protein] AS [G1 protein],
  [protein probability] AS [G1 protein probability],
  [protein description] AS [G1 protein description],
  [percent coverage] AS [G1 percent coverage],
  [tot indep spectra] AS [G1 tot indep spectra],
  [percent share of spectrum IDs] AS [G1 percent share of spectrum IDs],
  [peptides] as [G1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection37.prot.xls]


________________________________________


SELECT [entry no.] as [G2 entry no.],
  [protein] AS [G2 protein],
  [protein probability] AS [G2 protein probability],
  [protein description] AS [G2 protein description],
  [percent coverage] AS [G2 percent coverage],
  [tot indep spectra] AS [G2 tot indep spectra],
  [percent share of spectrum IDs] AS [G2 percent share of spectrum IDs],
  [peptides] as [G2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection38.prot.xls]


________________________________________


SELECT [entry no.] as [G3 entry no.],
  [protein] AS [G3 protein],
  [protein probability] AS [G3 protein probability],
  [protein description] AS [G3 protein description],
  [percent coverage] AS [G3 percent coverage],
  [tot indep spectra] AS [G3 tot indep spectra],
  [percent share of spectrum IDs] AS [G3 percent share of spectrum IDs],
  [peptides] as [G3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection39.prot.xls]


________________________________________


SELECT [entry no.] as [I1 entry no.],
  [protein] AS [I1 protein],
  [protein probability] AS [I1 protein probability],
  [protein description] AS [I1 protein description],
  [percent coverage] AS [I1 percent coverage],
  [tot indep spectra] AS [I1 tot indep spectra],
  [percent share of spectrum IDs] AS [I1 percent share of spectrum IDs],
  [peptides] as [I1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection41.prot.xls]


________________________________________


SELECT [entry no.] as [I2 entry no.],
  [protein] AS [I2 protein],
  [protein probability] AS [I2 protein probability],
  [protein description] AS [I2 protein description],
  [percent coverage] AS [I2 percent coverage],
  [tot indep spectra] AS [I2 tot indep spectra],
  [percent share of spectrum IDs] AS [I2 percent share of spectrum IDs],
  [peptides] as [I2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection42.prot.xls]


________________________________________


SELECT [entry no.] as [I3 entry no.],
  [protein] AS [I3 protein],
  [protein probability] AS [I3 protein probability],
  [protein description] AS [I3 protein description],
  [percent coverage] AS [I3 percent coverage],
  [tot indep spectra] AS [I3 tot indep spectra],
  [percent share of spectrum IDs] AS [I3 percent share of spectrum IDs],
  [peptides] as [I3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection43.prot.xls]


________________________________________


SELECT [entry no.] as [E1 entry no.],
  [protein] AS [E1 protein],
  [protein probability] AS [E1 protein probability],
  [protein description] AS [E1 protein description],
  [percent coverage] AS [E1 percent coverage],
  [tot indep spectra] AS [E1 tot indep spectra],
  [percent share of spectrum IDs] AS [E1 percent share of spectrum IDs],
  [peptides] as [E1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection45.prot.xls]


________________________________________


SELECT [entry no.] as [E2 entry no.],
  [protein] AS [E2 protein],
  [protein probability] AS [E2 protein probability],
  [protein description] AS [E2 protein description],
  [percent coverage] AS [E2 percent coverage],
  [tot indep spectra] AS [E2 tot indep spectra],
  [percent share of spectrum IDs] AS [E2 percent share of spectrum IDs],
  [peptides] as [E2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection46.prot.xls]


________________________________________


SELECT [entry no.] as [E3 entry no.],
  [protein] AS [E3 protein],
  [protein probability] AS [E3 protein probability],
  [protein description] AS [E3 protein description],
  [percent coverage] AS [E3 percent coverage],
  [tot indep spectra] AS [E3 tot indep spectra],
  [percent share of spectrum IDs] AS [E3 percent share of spectrum IDs],
  [peptides] as [E3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection47.prot.xls]


________________________________________


SELECT [entry no.] as [B1 entry no.],
  [protein] AS [B1 protein],
  [protein probability] AS [B1 protein probability],
  [protein description] AS [B1 protein description],
  [percent coverage] AS [B1 percent coverage],
  [tot indep spectra] AS [B1 tot indep spectra],
  [percent share of spectrum IDs] AS [B1 percent share of spectrum IDs],
  [peptides] as [B1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection51.prot.xls]


________________________________________


SELECT [entry no.] as [B2 entry no.],
  [protein] AS [B2 protein],
  [protein probability] AS [B2 protein probability],
  [protein description] AS [B2 protein description],
  [percent coverage] AS [B2 percent coverage],
  [tot indep spectra] AS [B2 tot indep spectra],
  [percent share of spectrum IDs] AS [B2 percent share of spectrum IDs],
  [peptides] as [B2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection52.prot.xls]


________________________________________


SELECT [entry no.] as [B3 entry no.],
  [protein] AS [B3 protein],
  [protein probability] AS [B3 protein probability],
  [protein description] AS [B3 protein description],
  [percent coverage] AS [B3 percent coverage],
  [tot indep spectra] AS [B3 tot indep spectra],
  [percent share of spectrum IDs] AS [B3 percent share of spectrum IDs],
  [peptides] as [B3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection53.prot.xls]


________________________________________


SELECT [entry no.] as [E1 entry no.],
  [protein] AS [E1 protein],
  [protein probability] AS [E1 protein probability],
  [protein description] AS [E1 protein description],
  [percent coverage] AS [E1 percent coverage],
  [tot indep spectra] AS [E1 tot indep spectra],
  [percent share of spectrum IDs] AS [E1 percent share of spectrum IDs],
  [peptides] as [E1 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection55.prot.xls]


________________________________________


SELECT [entry no.] as [E2 entry no.],
  [protein] AS [E2 protein],
  [protein probability] AS [E2 protein probability],
  [protein description] AS [E2 protein description],
  [percent coverage] AS [E2 percent coverage],
  [tot indep spectra] AS [E2 tot indep spectra],
  [percent share of spectrum IDs] AS [E2 percent share of spectrum IDs],
  [peptides] as [E2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection56.prot.xls]


________________________________________


SELECT [entry no.] as [E3 entry no.],
  [protein] AS [E3 protein],
  [protein probability] AS [E3 protein probability],
  [protein description] AS [E3 protein description],
  [percent coverage] AS [E3 percent coverage],
  [tot indep spectra] AS [E3 tot indep spectra],
  [percent share of spectrum IDs] AS [E3 percent share of spectrum IDs],
  [peptides] as [E3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection57.prot.xls]


________________________________________


SELECT [entry no.] as [D1.2 entry no.],
  [protein] AS [D1.2 protein],
  [protein probability] AS [D1.2 protein probability],
  [protein description] AS [D1.2 protein description],
  [percent coverage] AS [D1.2 percent coverage],
  [tot indep spectra] AS [D1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [D1.2 percent share of spectrum IDs],
  [peptides] as [D1.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection59.prot.xls]


________________________________________


SELECT [entry no.] as [B1.2 entry no.],
  [protein] AS [B1.2 protein],
  [protein probability] AS [B1.2 protein probability],
  [protein description] AS [B1.2 protein description],
  [percent coverage] AS [B1.2 percent coverage],
  [tot indep spectra] AS [B1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [B1.2 percent share of spectrum IDs],
  [peptides] as [B1.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection51.prot.xls]


________________________________________


SELECT [entry no.] as [B2.2 entry no.],
  [protein] AS [B2.2 protein],
  [protein probability] AS [B2.2 protein probability],
  [protein description] AS [B2.2 protein description],
  [percent coverage] AS [B2.2 percent coverage],
  [tot indep spectra] AS [B2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [B2.2 percent share of spectrum IDs],
  [peptides] as [B2.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection52.prot.xls]


________________________________________


SELECT [entry no.] as [B3.2 entry no.],
  [protein] AS [B3.2 protein],
  [protein probability] AS [B3.2 protein probability],
  [protein description] AS [B3.2 protein description],
  [percent coverage] AS [B3.2 percent coverage],
  [tot indep spectra] AS [B3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [B3.2 percent share of spectrum IDs],
  [peptides] as [B3.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection53.prot.xls]


________________________________________


SELECT [entry no.] as [E1.2 entry no.],
  [protein] AS [E1.2 protein],
  [protein probability] AS [E1.2 protein probability],
  [protein description] AS [E1.2 protein description],
  [percent coverage] AS [E1.2 percent coverage],
  [tot indep spectra] AS [E1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [E1.2 percent share of spectrum IDs],
  [peptides] as [E1.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection55.prot.xls]


________________________________________


SELECT [entry no.] as [E2.2 entry no.],
  [protein] AS [E2.2 protein],
  [protein probability] AS [E2.2 protein probability],
  [protein description] AS [E2.2 protein description],
  [percent coverage] AS [E2.2 percent coverage],
  [tot indep spectra] AS [E2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [E2.2 percent share of spectrum IDs],
  [peptides] as [E2.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection56.prot.xls]


________________________________________


SELECT [entry no.] as [E3.2 entry no.],
  [protein] AS [E3.2 protein],
  [protein probability] AS [E3.2 protein probability],
  [protein description] AS [E3.2 protein description],
  [percent coverage] AS [E3.2 percent coverage],
  [tot indep spectra] AS [E3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [E3.2 percent share of spectrum IDs],
  [peptides] as [E3.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection57.prot.xls]


________________________________________


SELECT [entry no.] as [D2.2 entry no.],
  [protein] AS [D2.2 protein],
  [protein probability] AS [D2.2 protein probability],
  [protein description] AS [D2.2 protein description],
  [percent coverage] AS [D2.2 percent coverage],
  [tot indep spectra] AS [D2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [D2.2 percent share of spectrum IDs],
  [peptides] as [D2.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection60.prot.xls]


________________________________________


SELECT [entry no.] as [D3.2 entry no.],
  [protein] AS [D3.2 protein],
  [protein probability] AS [D3.2 protein probability],
  [protein description] AS [D3.2 protein description],
  [percent coverage] AS [D3.2 percent coverage],
  [tot indep spectra] AS [D3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [D3.2 percent share of spectrum IDs],
  [peptides] as [D3.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection61.prot.xls]


________________________________________


SELECT [entry no.] as [I1.2 entry no.],
  [protein] AS [I1.2 protein],
  [protein probability] AS [I1.2 protein probability],
  [protein description] AS [I1.2 protein description],
  [percent coverage] AS [I1.2 percent coverage],
  [tot indep spectra] AS [I1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [I1.2 percent share of spectrum IDs],
  [peptides] as [I1.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection65.prot.xls]


________________________________________


SELECT [entry no.] as [I2.2 entry no.],
  [protein] AS [I2.2 protein],
  [protein probability] AS [I2.2 protein probability],
  [protein description] AS [I2.2 protein description],
  [percent coverage] AS [I2.2 percent coverage],
  [tot indep spectra] AS [I2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [I2.2 percent share of spectrum IDs],
  [peptides] as [I2.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection66.prot.xls]


________________________________________


SELECT [entry no.] as [I3.2 entry no.],
  [protein] AS [I3.2 protein],
  [protein probability] AS [I3.2 protein probability],
  [protein description] AS [I3.2 protein description],
  [percent coverage] AS [I3.2 percent coverage],
  [tot indep spectra] AS [I3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [I3.2 percent share of spectrum IDs],
  [peptides] as [I3.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection67.prot.xls]


________________________________________


SELECT [entry no.] as [A1.2 entry no.],
  [protein] AS [A1.2 protein],
  [protein probability] AS [A1.2 protein probability],
  [protein description] AS [A1.2 protein description],
  [percent coverage] AS [A1.2 percent coverage],
  [tot indep spectra] AS [A1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [A1.2 percent share of spectrum IDs],
  [peptides] as [A1.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection69.prot.xls]


________________________________________


SELECT [entry no.] as [A2.2 entry no.],
  [protein] AS [A2.2 protein],
  [protein probability] AS [A2.2 protein probability],
  [protein description] AS [A2.2 protein description],
  [percent coverage] AS [A2.2 percent coverage],
  [tot indep spectra] AS [A2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [A2.2 percent share of spectrum IDs],
  [peptides] as [A2.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection70.prot.xls]


________________________________________


SELECT [entry no.] as [A3.2 entry no.],
  [protein] AS [A3.2 protein],
  [protein probability] AS [A3.2 protein probability],
  [protein description] AS [A3.2 protein description],
  [percent coverage] AS [A3.2 percent coverage],
  [tot indep spectra] AS [A3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [A3.2 percent share of spectrum IDs],
  [peptides] as [A3.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection71.prot.xls]


________________________________________


SELECT [entry no.] as [G1.2 entry no.],
  [protein] AS [G1.2 protein],
  [protein probability] AS [G1.2 protein probability],
  [protein description] AS [G1.2 protein description],
  [percent coverage] AS [G1.2 percent coverage],
  [tot indep spectra] AS [G1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [G1.2 percent share of spectrum IDs],
  [peptides] as [G1.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection73.prot.xls]


________________________________________


SELECT [entry no.] as [G2.2 entry no.],
  [protein] AS [G2.2 protein],
  [protein probability] AS [G2.2 protein probability],
  [protein description] AS [G2.2 protein description],
  [percent coverage] AS [G2.2 percent coverage],
  [tot indep spectra] AS [G2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [G2.2 percent share of spectrum IDs],
  [peptides] as [G2.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection74.prot.xls]


________________________________________


SELECT [entry no.] as [G3.2 entry no.],
  [protein] AS [G3.2 protein],
  [protein probability] AS [G3.2 protein probability],
  [protein description] AS [G3.2 protein description],
  [percent coverage] AS [G3.2 percent coverage],
  [tot indep spectra] AS [G3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [G3.2 percent share of spectrum IDs],
  [peptides] as [G3.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection75.prot.xls]


________________________________________


SELECT [entry no.] as [F1.2 entry no.],
  [protein] AS [F1.2 protein],
  [protein probability] AS [F1.2 protein probability],
  [protein description] AS [F1.2 protein description],
  [percent coverage] AS [F1.2 percent coverage],
  [tot indep spectra] AS [F1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [F1.2 percent share of spectrum IDs],
  [peptides] as [F1.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection79.prot.xls]


________________________________________


SELECT [entry no.] as [F2.2 entry no.],
  [protein] AS [F2.2 protein],
  [protein probability] AS [F2.2 protein probability],
  [protein description] AS [F2.2 protein description],
  [percent coverage] AS [F2.2 percent coverage],
  [tot indep spectra] AS [F2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [F2.2 percent share of spectrum IDs],
  [peptides] as [F2.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection80.prot.xls]


________________________________________


SELECT [entry no.] as [F3.2 entry no.],
  [protein] AS [F3.2 protein],
  [protein probability] AS [F3.2 protein probability],
  [protein description] AS [F3.2 protein description],
  [percent coverage] AS [F3.2 percent coverage],
  [tot indep spectra] AS [F3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [F3.2 percent share of spectrum IDs],
  [peptides] as [F3.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection81.prot.xls]


________________________________________


SELECT [entry no.] as [H1.2 entry no.],
  [protein] AS [H1.2 protein],
  [protein probability] AS [H1.2 protein probability],
  [protein description] AS [H1.2 protein description],
  [percent coverage] AS [H1.2 percent coverage],
  [tot indep spectra] AS [H1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [H1.2 percent share of spectrum IDs],
  [peptides] as [H1.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection83.prot.xls]


________________________________________


SELECT [entry no.] as [H2.2 entry no.],
  [protein] AS [H2.2 protein],
  [protein probability] AS [H2.2 protein probability],
  [protein description] AS [H2.2 protein description],
  [percent coverage] AS [H2.2 percent coverage],
  [tot indep spectra] AS [H2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [H2.2 percent share of spectrum IDs],
  [peptides] as [H2.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection84.prot.xls]


________________________________________


SELECT [entry no.] as [H3.2 entry no.],
  [protein] AS [H3.2 protein],
  [protein probability] AS [H3.2 protein probability],
  [protein description] AS [H3.2 protein description],
  [percent coverage] AS [H3.2 percent coverage],
  [tot indep spectra] AS [H3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [H3.2 percent share of spectrum IDs],
  [peptides] as [H3.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection85.prot.xls]


________________________________________


SELECT [entry no.] as [C1.2 entry no.],
  [protein] AS [C1.2 protein],
  [protein probability] AS [C1.2 protein probability],
  [protein description] AS [C1.2 protein description],
  [percent coverage] AS [C1.2 percent coverage],
  [tot indep spectra] AS [C1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [C1.2 percent share of spectrum IDs],
  [peptides] as [C1.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection87_15051208724.prot.xls]


________________________________________


SELECT [entry no.] as [F1.3 entry no.],
  [protein] AS [F1.3 protein],
  [protein probability] AS [F1.3 protein probability],
  [protein description] AS [F1.3 protein description],
  [percent coverage] AS [F1.3 percent coverage],
  [tot indep spectra] AS [F1.3 tot indep spectra],
  [percent share of spectrum IDs] AS [F1.3 percent share of spectrum IDs],
  [peptides] as [F1.3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection87.prot.xls]


________________________________________


SELECT [entry no.] as [C2.2 entry no.],
  [protein] AS [C2.2 protein],
  [protein probability] AS [C2.2 protein probability],
  [protein description] AS [C2.2 protein description],
  [percent coverage] AS [C2.2 percent coverage],
  [tot indep spectra] AS [C2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [C2.2 percent share of spectrum IDs],
  [peptides] as [C2.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection88_150512103018.prot.xls]


________________________________________


SELECT [entry no.] as [F2.3 entry no.],
  [protein] AS [F2.3 protein],
  [protein probability] AS [F2.3 protein probability],
  [protein description] AS [F2.3 protein description],
  [percent coverage] AS [F2.3 percent coverage],
  [tot indep spectra] AS [F2.3 tot indep spectra],
  [percent share of spectrum IDs] AS [F2.3 percent share of spectrum IDs],
  [peptides] as [F2.3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection88.prot.xls]


________________________________________


SELECT [entry no.] as [C3.2 entry no.],
  [protein] AS [C3.2 protein],
  [protein probability] AS [C3.2 protein probability],
  [protein description] AS [C3.2 protein description],
  [percent coverage] AS [C3.2 percent coverage],
  [tot indep spectra] AS [C3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [C3.2 percent share of spectrum IDs],
  [peptides] as [C3.2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection89_150512121311.prot.xls]


________________________________________


SELECT [entry no.] as [F3.3 entry no.],
  [protein] AS [F3.3 protein],
  [protein probability] AS [F3.3 protein probability],
  [protein description] AS [F3.3 protein description],
  [percent coverage] AS [F3.3 percent coverage],
  [tot indep spectra] AS [F3.3 tot indep spectra],
  [percent share of spectrum IDs] AS [F3.3 percent share of spectrum IDs],
  [peptides] as [F3.3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection89.prot.xls]


________________________________________


SELECT [entry no.] as [H2.3 entry no.],
  [protein] AS [H2.3 protein],
  [protein probability] AS [H2.3 protein probability],
  [protein description] AS [H2.3 protein description],
  [percent coverage] AS [H2.3 percent coverage],
  [tot indep spectra] AS [H2.3 tot indep spectra],
  [percent share of spectrum IDs] AS [H2.3 percent share of spectrum IDs],
  [peptides] as [H2.3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection84_15051204842.prot.xls]


________________________________________


SELECT [entry no.] as [H3.3 entry no.],
  [protein] AS [H3.3 protein],
  [protein probability] AS [H3.3 protein probability],
  [protein description] AS [H3.3 protein description],
  [percent coverage] AS [H3.3 percent coverage],
  [tot indep spectra] AS [H3.3 tot indep spectra],
  [percent share of spectrum IDs] AS [H3.3 percent share of spectrum IDs],
  [peptides] as [H3.3 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection85_150512055136.prot.xls]


________________________________________


SELECT [A2 protein], [A2 tot indep spectra], [A2 peptides]
   FROM [412].[2015_May_6_Bacteria_Dectection10.prot.xls]
  WHERE [A2 tot indep spectra]>1
 


________________________________________


SELECT [A3 protein], [A3 tot indep spectra], [A3 peptides]
  FROM [412].[2015_May_6_Bacteria_Dectection11.prot.xls]
  WHERE [A3 tot indep spectra]>1


________________________________________


SELECT [F1 protein], [F1 tot indep spectra], [F1 peptides]
  FROM [412].[2015_May_6_Bacteria_Dectection13.prot.xls]
  WHERE [F1 tot indep spectra]>1


________________________________________


SELECT [F2 protein], [F2 tot indep spectra], [F2 peptides]
  FROM [412].[2015_May_6_Bacteria_Dectection14.prot.xls]
    WHERE [F2 tot indep spectra]>1


________________________________________


SELECT [F3 protein], [F3 tot indep spectra], [F3 peptides]
    FROM [412].[2015_May_6_Bacteria_Dectection15.prot_1.xls]
  WHERE [F3 tot indep spectra]>1



________________________________________


SELECT [A1 protein], [A1 tot indep spectra], [A1 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection9.prot.xls]
  WHERE [A1 tot indep spectra]>1
  


________________________________________


SELECT [D1 protein], [D1 tot indep spectra], [D1 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection17.prot.xls]
  WHERE [D1 tot indep spectra]>1
  


________________________________________


SELECT [D2 protein], [D2 tot indep spectra], [D2 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection18.prot.xls]
  WHERE [D2 tot indep spectra]>1  


________________________________________


SELECT [D3 protein], [D3 tot indep spectra], [D3 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection19.prot.xls]
  WHERE [D3 tot indep spectra]>1
  


________________________________________


SELECT [B1 protein], [B1 tot indep spectra], [B1 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection23.prot.xls]
  WHERE [B1 tot indep spectra]>1
  


________________________________________


SELECT [B2 protein], [B2 tot indep spectra], [B2 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection24.prot.xls]
  WHERE [B2 tot indep spectra]>1
  


________________________________________


SELECT [B3 protein], [B3 tot indep spectra], [B3 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection25.prot.xls]
  WHERE [B3 tot indep spectra]>1
  


________________________________________


SELECT [C1 protein], [C1 tot indep spectra], [C1 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection27.prot.xls]
  WHERE [C1 tot indep spectra]>1 
  


________________________________________


SELECT [entry no.] as [C2 entry no.],
  [protein] AS [C2 protein],
  [protein probability] AS [C2 protein probability],
  [protein description] AS [C2 protein description],
  [percent coverage] AS [C2 percent coverage],
  [tot indep spectra] AS [C2 tot indep spectra],
  [percent share of spectrum IDs] AS [C2 percent share of spectrum IDs],
  [peptides] as [C2 peptides]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection28.prot.xls]


________________________________________


SELECT [C2 protein], [C2 tot indep spectra], [C2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection28.prot.xls]
  WHERE [C2 tot indep spectra]>1
  


________________________________________


SELECT [C3 protein], [C3 tot indep spectra], [C3 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection29.prot.xls]
  WHERE [C3 tot indep spectra]>1
  


________________________________________


SELECT [H1 protein], [H1 tot indep spectra], [H1 peptides]
  FROM [412].[interact-2015_May_6_Bacteria_Detection31.prot.xls]
  WHERE [H1 tot indep spectra]>1
  


________________________________________


SELECT [H2 protein], [H2 tot indep spectra], [H2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection32.prot.xls]
  WHERE [H2 tot indep spectra]>1
  


________________________________________


SELECT [H3 protein], [H3 tot indep spectra], [H3 peptides]
FROM [412].[2015_May_6_Bacteria_Detection33.prot.xls]
  WHERE [H3 tot indep spectra]>1
  


________________________________________


SELECT [G1 protein], [G1 tot indep spectra], [G1 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection37.prot.xls]
  WHERE [G1 tot indep spectra]>1
  


________________________________________


SELECT [G2 protein], [G2 tot indep spectra], [G2 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection38.prot.xls]
  WHERE [G2 tot indep spectra]>1
  


________________________________________


SELECT [G3 protein], [G3 tot indep spectra], [G3 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection39.prot.xls]
  WHERE [G3 tot indep spectra]>1
  


________________________________________


SELECT [I1 protein], [I1 tot indep spectra], [I1 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection41.prot.xls]
  WHERE [I1 tot indep spectra]>1
  


________________________________________


SELECT [I2 protein], [I2 tot indep spectra], [I2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection42.prot.xls]
  WHERE [I2 tot indep spectra]>1
  


________________________________________


SELECT [I3 protein], [I3 tot indep spectra], [I3 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection43.prot.xls]
  WHERE [I3 tot indep spectra]>1
  


________________________________________


SELECT [E1 protein], [E1 tot indep spectra], [E1 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection45.prot.xls]
  WHERE [E1 tot indep spectra]>1
  


________________________________________


SELECT [E2 protein], [E2 tot indep spectra], [E2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection46.prot.xls]
  WHERE [E2 tot indep spectra]>1
  


________________________________________


SELECT [E3 protein], [E3 tot indep spectra], [E3 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection47.prot.xls]
  WHERE [E3 tot indep spectra]>1
  


________________________________________


SELECT [D1.2 protein], [D1.2 tot indep spectra], [D1.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection59.prot.xls]
  WHERE [D1.2 tot indep spectra]>1
  


________________________________________


SELECT [B1.2 protein], [B1.2 tot indep spectra], [B1.2 peptides]
    FROM [412].[2015_May_6_Bacteria_Detection51.prot.xls]
  WHERE [B1.2 tot indep spectra]>1
 


________________________________________


SELECT [B2.2 protein], [B2.2 tot indep spectra], [B2.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection52.prot.xls]
  WHERE [B2.2 tot indep spectra]>1
  


________________________________________


SELECT [B3.2 protein], [B3.2 tot indep spectra], [B3.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection53.prot.xls]
  WHERE [B3.2 tot indep spectra]>1
  


________________________________________


SELECT [E1.2 protein], [E1.2 tot indep spectra], [E1.2 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection55.prot.xls]
  WHERE [E1.2 tot indep spectra]>1
  


________________________________________


SELECT [E2.2 protein], [E2.2 tot indep spectra], [E2.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection56.prot.xls]
  WHERE [E2.2 tot indep spectra]>1
  


________________________________________


SELECT [E3.2 protein], [E3.2 tot indep spectra], [E3.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection57.prot.xls]
  WHERE [E3.2 tot indep spectra]>1
  


________________________________________


SELECT [D2.2 protein], [D2.2 tot indep spectra], [D2.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection60.prot.xls]
  WHERE [D2.2 tot indep spectra]>1
  


________________________________________


SELECT [D3.2 protein], [D3.2 tot indep spectra], [D3.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection61.prot.xls]
  WHERE [D3.2 tot indep spectra]>1
  


________________________________________


SELECT [I1.2 protein], [I1.2 tot indep spectra], [I1.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection65.prot.xls]
  WHERE [I1.2 tot indep spectra]>1
  


________________________________________


SELECT [I2.2 protein], [I2.2 tot indep spectra], [I2.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection66.prot.xls]
  WHERE [I2.2 tot indep spectra]>1
  


________________________________________


SELECT [I3.2 protein], [I3.2 tot indep spectra], [I3.2 peptides]
    FROM [412].[2015_May_6_Bacteria_Detection67.prot.xls]
  WHERE [I3.2 tot indep spectra]>1
 


________________________________________


SELECT [A1.2 protein], [A1.2 tot indep spectra], [A1.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection69.prot.xls]
  WHERE [A1.2 tot indep spectra]>1
  


________________________________________


SELECT [A2.2 protein], [A2.2 tot indep spectra], [A2.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection70.prot.xls]
  WHERE [A2.2 tot indep spectra]>1
  


________________________________________


SELECT [A3.2 protein], [A3.2 tot indep spectra], [A3.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection71.prot.xls]
  WHERE [A3.2 tot indep spectra]>1
  


________________________________________


SELECT [G1.2 protein], [G1.2 tot indep spectra], [G1.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection73.prot.xls]
  WHERE [G1.2 tot indep spectra]>1
  


________________________________________


SELECT [G2.2 protein], [G2.2 tot indep spectra], [G2.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection74.prot.xls]
  WHERE [G2.2 tot indep spectra]>1
  


________________________________________


SELECT [G3.2 protein], [G3.2 tot indep spectra], [G3.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection75.prot.xls]
  WHERE [G3.2 tot indep spectra]>1
  


________________________________________


SELECT [F1.2 protein], [F1.2 tot indep spectra], [F1.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection79.prot.xls]
  WHERE [F1.2 tot indep spectra]>1
  


________________________________________


SELECT [F2.2 protein], [F2.2 tot indep spectra], [F2.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection80.prot.xls]
  WHERE [F2.2 tot indep spectra]>1
  


________________________________________


SELECT [F3.2 protein], [F3.2 tot indep spectra], [F3.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection81.prot.xls]
  WHERE [F3.2 tot indep spectra]>1
  


________________________________________


SELECT [H1.2 protein], [H1.2 tot indep spectra], [H1.2 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection83.prot.xls]
  WHERE [H1.2 tot indep spectra]>1
  


________________________________________


SELECT [H2.2 protein], [H2.2 tot indep spectra], [H2.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection84.prot.xls]
  WHERE [H2.2 tot indep spectra]>1
  


________________________________________


SELECT [H2.3 protein], [H2.3 tot indep spectra], [H2.3 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection84_15051204842.prot.xls]
  WHERE [H2.3 tot indep spectra]>1
  


________________________________________


SELECT [H3.2 protein], [H3.2 tot indep spectra], [H3.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection85.prot.xls]
  WHERE [H3.2 tot indep spectra]>1
  


________________________________________


SELECT [H3.3 protein], [H3.3 tot indep spectra], [H3.3 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection85_150512055136.prot.xls]
  WHERE [H3.3 tot indep spectra]>1
  


________________________________________


SELECT [F1.3 protein], [F1.3 tot indep spectra], [F1.3 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection87.prot.xls]
  WHERE [F1.3 tot indep spectra]>1
  


________________________________________


SELECT [F2.3 protein], [F2.3 tot indep spectra], [F2.3 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection88.prot.xls]
  WHERE [F2.3 tot indep spectra]>1
  


________________________________________


SELECT [F3.3 protein], [F3.3 tot indep spectra], [F3.3 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection89.prot.xls]
  WHERE [F3.3 tot indep spectra]>1
  


________________________________________


SELECT [C1.2 protein], [C1.2 tot indep spectra], [C1.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection87_15051208724.prot.xls]
  WHERE [C1.2 tot indep spectra]>1
  


________________________________________


SELECT [C2.2 protein], [C2.2 tot indep spectra], [C2.2 peptides]
  FROM [412].[2015_May_6_Bacteria_Detection88_150512103018.prot.xls]
  WHERE [C2.2 tot indep spectra]>1
  


________________________________________


SELECT [C3.2 protein], [C3.2 tot indep spectra], [C3.2 peptides]
   FROM [412].[2015_May_6_Bacteria_Detection89_150512121311.prot.xls]
  WHERE [C3.2 tot indep spectra]>1
  


________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
 


________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
  LEFT JOIN [412].[BactDetection A1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.2].[A1.2 protein]
  LEFT JOIN [412].[BactDetection A2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.1].[A2 protein]
 


________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
  LEFT JOIN [412].[BactDetection A1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.2].[A1.2 protein]
  LEFT JOIN [412].[BactDetection A2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.1].[A2 protein]
  LEFT JOIN [412].[BactDetection A2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.2].[A2.2 protein]
 


________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
  LEFT JOIN [412].[BactDetection A1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.2].[A1.2 protein]
  LEFT JOIN [412].[BactDetection A2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.1].[A2 protein]
  LEFT JOIN [412].[BactDetection A2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.2].[A2.2 protein]
  LEFT JOIN [412].[BactDetection A3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.1].[A3 protein]
 


________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
  LEFT JOIN [412].[BactDetection A1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.2].[A1.2 protein]
  LEFT JOIN [412].[BactDetection A2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.1].[A2 protein]
  LEFT JOIN [412].[BactDetection A2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.2].[A2.2 protein]
  LEFT JOIN [412].[BactDetection A3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.1].[A3 protein]
  LEFT JOIN [412].[BactDetection A3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.2].[A3.2 protein]
  LEFT JOIN [412].[BactDetection B1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.1].[B1 protein]
  LEFT JOIN [412].[BactDetection B1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.2].[B1.2 protein]
  LEFT JOIN [412].[BactDetection B2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.1].[B2 protein]
  LEFT JOIN [412].[BactDetection B2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.2].[B2.2 protein]
  LEFT JOIN [412].[BactDetection B3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.1].[B3 protein]
  LEFT JOIN [412].[BactDetection B3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.2].[B3.2 protein]
  LEFT JOIN [412].[BactDetection C1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.1].[C1 protein]
  LEFT JOIN [412].[BactDetection C1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.2].[C1.2 protein]
  LEFT JOIN [412].[BactDetection C2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.1].[C2 protein]
  LEFT JOIN [412].[BactDetection C2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.2].[C2.2 protein]
  LEFT JOIN [412].[BactDetection C3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.1].[C3 protein]
  LEFT JOIN [412].[BactDetection C3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.2].[C3.2 protein]
  LEFT JOIN [412].[BactDetection D1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.1].[D1 protein]
  LEFT JOIN [412].[BactDetection D1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.2].[D1.2 protein]
  LEFT JOIN [412].[BactDetection D2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.1].[D2 protein]
  LEFT JOIN [412].[BactDetection D2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.2].[D2.2 protein]
  LEFT JOIN [412].[BactDetection D3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.1].[D3 protein]
  LEFT JOIN [412].[BactDetection D3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.2].[D3.2 protein]
  LEFT JOIN [412].[BactDetection E1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.1].[E1 protein]
  LEFT JOIN [412].[BactDetection E1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.2].[E1.2 protein]
  LEFT JOIN [412].[BactDetection E2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.1].[E2 protein]
  LEFT JOIN [412].[BactDetection E2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.2].[E2.2 protein]
  LEFT JOIN [412].[BactDetection E3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.1].[E3 protein]
  LEFT JOIN [412].[BactDetection F1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.1].[F1 protein]
  LEFT JOIN [412].[BactDetection F1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.2].[F1.2 protein]
  LEFT JOIN [412].[BactDetection F1.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.3].[F1.3 protein]
  LEFT JOIN [412].[BactDetection F2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.1].[F2 protein]
  LEFT JOIN [412].[BactDetection F2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.2].[F2.2 protein]
  LEFT JOIN [412].[BactDetection F2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.3].[F2.3 protein]
  LEFT JOIN [412].[BactDetection F3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.1].[F3 protein]
  LEFT JOIN [412].[BactDetection F3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.2].[F3.2 protein]
  LEFT JOIN [412].[BactDetection F3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.3].[F3.3 protein]
  LEFT JOIN [412].[BactDetection G1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.1].[G1 protein]
  LEFT JOIN [412].[BactDetection G1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.2].[G1.2 protein]
  LEFT JOIN [412].[BactDetection G2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.1].[G2 protein]
  LEFT JOIN [412].[BactDetection G2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.2].[G2.2 protein]
LEFT JOIN [412].[BactDetection G3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.1].[G3 protein]
  LEFT JOIN [412].[BactDetection G3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.2].[G3.2 protein]
  LEFT JOIN [412].[BactDetection H1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.1].[H1 protein]
  LEFT JOIN [412].[BactDetection H1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.2].[H1.2 protein]
  LEFT JOIN [412].[BactDetection H2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.1].[H2 protein]
  LEFT JOIN [412].[BactDetection H2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.2].[H2.2 protein]
  LEFT JOIN [412].[BactDetection H2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.3].[H2.3 protein]
  LEFT JOIN [412].[BactDetection H3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.1].[H3 protein]
LEFT JOIN [412].[BactDetection H3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.2].[H3.2 protein]  
  LEFT JOIN [412].[BactDetection H3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.3].[H3.3 protein]
  LEFT JOIN [412].[BactDetection I1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.1].[I1 protein]
  LEFT JOIN [412].[BactDetection I1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.2].[I1.2 protein]
  LEFT JOIN [412].[BactDetection I2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.1].[I2 protein]
  LEFT JOIN [412].[BactDetection I2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.2].[I2.2 protein]
  LEFT JOIN [412].[BactDetection I3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.1].[I3 protein]
  LEFT JOIN [412].[BactDetection I3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.2].[I3.2 protein]


________________________________________


SELECT CONCAT(Protein_Name_Thaps, Unique_ID_Thaps) AS Thaps_peptide, Sequence_Thaps
  FROM [412].[Rpom Thaps peptide overlap]


________________________________________


SELECT Column1 AS Protein, Column2 AS ProtLength FROM [412].[table_Thaps_Rpom_sequence_lenghts.csv]


________________________________________


SELECT Column1 AS Protein, Column2 AS Length FROM [412].[table_Thaps_Rpom_sequence_lenghts.csv]


________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[Thaps_Rpom_sequence_lenghts.csv]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Thaps_Rpom_sequence_lenghts.csv].Protein
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
  LEFT JOIN [412].[BactDetection A1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.2].[A1.2 protein]
  LEFT JOIN [412].[BactDetection A2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.1].[A2 protein]
  LEFT JOIN [412].[BactDetection A2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.2].[A2.2 protein]
  LEFT JOIN [412].[BactDetection A3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.1].[A3 protein]
  LEFT JOIN [412].[BactDetection A3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.2].[A3.2 protein]
  LEFT JOIN [412].[BactDetection B1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.1].[B1 protein]
  LEFT JOIN [412].[BactDetection B1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.2].[B1.2 protein]
  LEFT JOIN [412].[BactDetection B2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.1].[B2 protein]
  LEFT JOIN [412].[BactDetection B2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.2].[B2.2 protein]
  LEFT JOIN [412].[BactDetection B3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.1].[B3 protein]
  LEFT JOIN [412].[BactDetection B3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.2].[B3.2 protein]
  LEFT JOIN [412].[BactDetection C1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.1].[C1 protein]
  LEFT JOIN [412].[BactDetection C1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.2].[C1.2 protein]
  LEFT JOIN [412].[BactDetection C2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.1].[C2 protein]
  LEFT JOIN [412].[BactDetection C2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.2].[C2.2 protein]
  LEFT JOIN [412].[BactDetection C3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.1].[C3 protein]
  LEFT JOIN [412].[BactDetection C3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.2].[C3.2 protein]
  LEFT JOIN [412].[BactDetection D1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.1].[D1 protein]
  LEFT JOIN [412].[BactDetection D1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.2].[D1.2 protein]
  LEFT JOIN [412].[BactDetection D2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.1].[D2 protein]
  LEFT JOIN [412].[BactDetection D2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.2].[D2.2 protein]
  LEFT JOIN [412].[BactDetection D3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.1].[D3 protein]
  LEFT JOIN [412].[BactDetection D3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.2].[D3.2 protein]
  LEFT JOIN [412].[BactDetection E1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.1].[E1 protein]
  LEFT JOIN [412].[BactDetection E1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.2].[E1.2 protein]
  LEFT JOIN [412].[BactDetection E2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.1].[E2 protein]
  LEFT JOIN [412].[BactDetection E2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.2].[E2.2 protein]
  LEFT JOIN [412].[BactDetection E3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.1].[E3 protein]
  LEFT JOIN [412].[BactDetection F1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.1].[F1 protein]
  LEFT JOIN [412].[BactDetection F1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.2].[F1.2 protein]
  LEFT JOIN [412].[BactDetection F1.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.3].[F1.3 protein]
  LEFT JOIN [412].[BactDetection F2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.1].[F2 protein]
  LEFT JOIN [412].[BactDetection F2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.2].[F2.2 protein]
  LEFT JOIN [412].[BactDetection F2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.3].[F2.3 protein]
  LEFT JOIN [412].[BactDetection F3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.1].[F3 protein]
  LEFT JOIN [412].[BactDetection F3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.2].[F3.2 protein]
  LEFT JOIN [412].[BactDetection F3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.3].[F3.3 protein]
  LEFT JOIN [412].[BactDetection G1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.1].[G1 protein]
  LEFT JOIN [412].[BactDetection G1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.2].[G1.2 protein]
  LEFT JOIN [412].[BactDetection G2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.1].[G2 protein]
  LEFT JOIN [412].[BactDetection G2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.2].[G2.2 protein]
LEFT JOIN [412].[BactDetection G3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.1].[G3 protein]
  LEFT JOIN [412].[BactDetection G3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.2].[G3.2 protein]
  LEFT JOIN [412].[BactDetection H1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.1].[H1 protein]
  LEFT JOIN [412].[BactDetection H1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.2].[H1.2 protein]
  LEFT JOIN [412].[BactDetection H2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.1].[H2 protein]
  LEFT JOIN [412].[BactDetection H2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.2].[H2.2 protein]
  LEFT JOIN [412].[BactDetection H2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.3].[H2.3 protein]
  LEFT JOIN [412].[BactDetection H3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.1].[H3 protein]
LEFT JOIN [412].[BactDetection H3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.2].[H3.2 protein]  
  LEFT JOIN [412].[BactDetection H3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.3].[H3.3 protein]
  LEFT JOIN [412].[BactDetection I1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.1].[I1 protein]
  LEFT JOIN [412].[BactDetection I1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.2].[I1.2 protein]
  LEFT JOIN [412].[BactDetection I2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.1].[I2 protein]
  LEFT JOIN [412].[BactDetection I2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.2].[I2.2 protein]
  LEFT JOIN [412].[BactDetection I3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.1].[I3 protein]
  LEFT JOIN [412].[BactDetection I3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.2].[I3.2 protein]


________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[Thaps_Rpom_sequence_lenghts.csv]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Thaps_Rpom_sequence_lenghts.csv].Protein
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
  LEFT JOIN [412].[BactDetection A1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.2].[A1.2 protein]
  LEFT JOIN [412].[BactDetection A2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.1].[A2 protein]
  LEFT JOIN [412].[BactDetection A2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.2].[A2.2 protein]
  LEFT JOIN [412].[BactDetection A3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.1].[A3 protein]
  LEFT JOIN [412].[BactDetection A3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.2].[A3.2 protein]
  LEFT JOIN [412].[BactDetection B1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.1].[B1 protein]
  LEFT JOIN [412].[BactDetection B1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.2].[B1.2 protein]
  LEFT JOIN [412].[BactDetection B2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.1].[B2 protein]
  LEFT JOIN [412].[BactDetection B2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.2].[B2.2 protein]
  LEFT JOIN [412].[BactDetection B3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.1].[B3 protein]
  LEFT JOIN [412].[BactDetection B3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.2].[B3.2 protein]
  LEFT JOIN [412].[BactDetection C1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.1].[C1 protein]
  LEFT JOIN [412].[BactDetection C1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.2].[C1.2 protein]
  LEFT JOIN [412].[BactDetection C2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.1].[C2 protein]
  LEFT JOIN [412].[BactDetection C2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.2].[C2.2 protein]
  LEFT JOIN [412].[BactDetection C3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.1].[C3 protein]
  LEFT JOIN [412].[BactDetection C3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.2].[C3.2 protein]
  LEFT JOIN [412].[BactDetection D1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.1].[D1 protein]
  LEFT JOIN [412].[BactDetection D1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.2].[D1.2 protein]
  LEFT JOIN [412].[BactDetection D2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.1].[D2 protein]
  LEFT JOIN [412].[BactDetection D2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.2].[D2.2 protein]
  LEFT JOIN [412].[BactDetection D3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.1].[D3 protein]
  LEFT JOIN [412].[BactDetection D3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.2].[D3.2 protein]
  LEFT JOIN [412].[BactDetection E1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.1].[E1 protein]
  LEFT JOIN [412].[BactDetection E1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.2].[E1.2 protein]
  LEFT JOIN [412].[BactDetection E2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.1].[E2 protein]
  LEFT JOIN [412].[BactDetection E2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.2].[E2.2 protein]
  LEFT JOIN [412].[BactDetection E3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.1].[E3 protein]
  LEFT JOIN [412].[BactDetection E3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.2].[E3.2 protein]
  LEFT JOIN [412].[BactDetection F1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.1].[F1 protein]
  LEFT JOIN [412].[BactDetection F1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.2].[F1.2 protein]
  LEFT JOIN [412].[BactDetection F1.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.3].[F1.3 protein]
  LEFT JOIN [412].[BactDetection F2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.1].[F2 protein]
  LEFT JOIN [412].[BactDetection F2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.2].[F2.2 protein]
  LEFT JOIN [412].[BactDetection F2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.3].[F2.3 protein]
  LEFT JOIN [412].[BactDetection F3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.1].[F3 protein]
  LEFT JOIN [412].[BactDetection F3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.2].[F3.2 protein]
  LEFT JOIN [412].[BactDetection F3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.3].[F3.3 protein]
  LEFT JOIN [412].[BactDetection G1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.1].[G1 protein]
  LEFT JOIN [412].[BactDetection G1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.2].[G1.2 protein]
  LEFT JOIN [412].[BactDetection G2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.1].[G2 protein]
  LEFT JOIN [412].[BactDetection G2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.2].[G2.2 protein]
LEFT JOIN [412].[BactDetection G3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.1].[G3 protein]
  LEFT JOIN [412].[BactDetection G3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.2].[G3.2 protein]
  LEFT JOIN [412].[BactDetection H1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.1].[H1 protein]
  LEFT JOIN [412].[BactDetection H1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.2].[H1.2 protein]
  LEFT JOIN [412].[BactDetection H2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.1].[H2 protein]
  LEFT JOIN [412].[BactDetection H2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.2].[H2.2 protein]
  LEFT JOIN [412].[BactDetection H2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.3].[H2.3 protein]
  LEFT JOIN [412].[BactDetection H3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.1].[H3 protein]
LEFT JOIN [412].[BactDetection H3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.2].[H3.2 protein]  
  LEFT JOIN [412].[BactDetection H3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.3].[H3.3 protein]
  LEFT JOIN [412].[BactDetection I1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.1].[I1 protein]
  LEFT JOIN [412].[BactDetection I1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.2].[I1.2 protein]
  LEFT JOIN [412].[BactDetection I2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.1].[I2 protein]
  LEFT JOIN [412].[BactDetection I2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.2].[I2.2 protein]
  LEFT JOIN [412].[BactDetection I3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.1].[I3 protein]
  LEFT JOIN [412].[BactDetection I3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.2].[I3.2 protein]


________________________________________


SELECT Protein, Description, Length, [A1 tot indep spectra],
  [A1.2 tot indep spectra],
  [A2 tot indep spectra], 
  [A2.2 tot indep spectra],
  [A3 tot indep spectra],
  [A3.2 tot indep spectra],
  [B1 tot indep spectra],
  [B1.2 tot indep spectra],
  [B2 tot indep spectra],
  [B2.2 tot indep spectra],
  [B3 tot indep spectra],
  [B3.2 tot indep spectra],
  [C1 tot indep spectra],
  [C1.2 tot indep spectra],
  [C2 tot indep spectra],
  [C2.2 tot indep spectra],
  [C3 tot indep spectra],
  [C3.2 tot indep spectra],
  [D1 tot indep spectra],
  [D1.2 tot indep spectra],
  [D2 tot indep spectra],
  [D2.2 tot indep spectra],
  [D3 tot indep spectra],
  [D3.2 tot indep spectra],
  [E1 tot indep spectra],
  [E1.2 tot indep spectra],
  [E2 tot indep spectra],
  [E2.2 tot indep spectra],
  [E3 tot indep spectra],
  [E3.2 tot indep spectra],
  [F1 tot indep spectra],
  [F1.2 tot indep spectra],
  [F1.3 tot indep spectra],
  [F2 tot indep spectra],
  [F2.2 tot indep spectra],
  [F2.3 tot indep spectra],
  [F3 tot indep spectra],
  [F3.2 tot indep spectra],
  [F3.3 tot indep spectra],
  [G1 tot indep spectra],
  [G1.2 tot indep spectra],
  [G2 tot indep spectra],
  [G2.2 tot indep spectra],
  [G3 tot indep spectra],
  [G3.2 tot indep spectra],
  [H1 tot indep spectra],
  [H1.2 tot indep spectra],
  [H2 tot indep spectra],
  [H2.2 tot indep spectra],
  [H2.3 tot indep spectra],
  [H3 tot indep spectra],
  [H3.3 tot indep spectra],
  [I1 tot indep spectra],
  [I1.2 tot indep spectra],
  [I2 tot indep spectra],
  [I2.2 tot indep spectra],
  [I3 tot indep spectra],
  [I3.2 tot indep spectra]
  FROM [412].[Bact Detection all data]


________________________________________


SELECT Protein, Description, Length,
  CASE WHEN [A1 tot indep spectra] is NULL THEN 0 ELSE [A1 tot indep spectra] END AS [A1 tot indep spectra],
  CASE WHEN [A1.2 tot indep spectra] is NULL THEN 0 ELSE [A1.2 tot indep spectra] END AS [A1.2 tot indep spectra],
  CASE WHEN [A2 tot indep spectra] is NULL THEN 0 ELSE [A2 tot indep spectra] END AS [A2 tot indep spectra],
  CASE WHEN [A2.2 tot indep spectra] is NULL THEN 0 ELSE [A2.2 tot indep spectra] END AS [A2.2 tot indep spectra],
  CASE WHEN [A3 tot indep spectra] is NULL THEN 0 ELSE [A3 tot indep spectra] END AS [A3 tot indep spectra],
  CASE WHEN [A3.2 tot indep spectra] is NULL THEN 0 ELSE [A3.2 tot indep spectra] END AS [A3.2 tot indep spectra],
  CASE WHEN [B1 tot indep spectra] is NULL THEN 0 ELSE [B1 tot indep spectra] END AS [B1 tot indep spectra],
  CASE WHEN [B1.2 tot indep spectra] is NULL THEN 0 ELSE [B1.2 tot indep spectra] END AS [B1.2 tot indep spectra],
  CASE WHEN [B2 tot indep spectra] is NULL THEN 0 ELSE [B2 tot indep spectra] END AS [B2 tot indep spectra],
  CASE WHEN [B2.2 tot indep spectra] is NULL THEN 0 ELSE [B2.2 tot indep spectra] END AS [B2.2 tot indep spectra]
  FROM [412].[Bact detection all spec counts]


________________________________________


SELECT Protein, Description, Length, [A1 tot indep spectra],
  [A1.2 tot indep spectra],
  [A2 tot indep spectra], 
  [A2.2 tot indep spectra],
  [A3 tot indep spectra],
  [A3.2 tot indep spectra],
  [B1 tot indep spectra],
  [B1.2 tot indep spectra],
  [B2 tot indep spectra],
  [B2.2 tot indep spectra],
  [B3 tot indep spectra],
  [B3.2 tot indep spectra],
  [C1 tot indep spectra],
  [C1.2 tot indep spectra],
  [C2 tot indep spectra],
  [C2.2 tot indep spectra],
  [C3 tot indep spectra],
  [C3.2 tot indep spectra],
  [D1 tot indep spectra],
  [D1.2 tot indep spectra],
  [D2 tot indep spectra],
  [D2.2 tot indep spectra],
  [D3 tot indep spectra],
  [D3.2 tot indep spectra],
  [E1 tot indep spectra],
  [E1.2 tot indep spectra],
  [E2 tot indep spectra],
  [E2.2 tot indep spectra],
  [E3 tot indep spectra],
  [E3.2 tot indep spectra],
  [F1 tot indep spectra],
  [F1.2 tot indep spectra],
  [F1.3 tot indep spectra],
  [F2 tot indep spectra],
  [F2.2 tot indep spectra],
  [F2.3 tot indep spectra],
  [F3 tot indep spectra],
  [F3.2 tot indep spectra],
  [F3.3 tot indep spectra],
  [G1 tot indep spectra],
  [G1.2 tot indep spectra],
  [G2 tot indep spectra],
  [G2.2 tot indep spectra],
  [G3 tot indep spectra],
  [G3.2 tot indep spectra],
  [H1 tot indep spectra],
  [H1.2 tot indep spectra],
  [H2 tot indep spectra],
  [H2.2 tot indep spectra],
  [H2.3 tot indep spectra],
  [H3 tot indep spectra],
  [H3.2 tot indep spectra],
  [H3.3 tot indep spectra],
  [I1 tot indep spectra],
  [I1.2 tot indep spectra],
  [I2 tot indep spectra],
  [I2.2 tot indep spectra],
  [I3 tot indep spectra],
  [I3.2 tot indep spectra]
  FROM [412].[Bact Detection all data]


________________________________________


SELECT Protein, Description, Length,
  CASE WHEN [A1 tot indep spectra] is NULL THEN 0 ELSE [A1 tot indep spectra] END AS [A1 tot indep spectra],
  CASE WHEN [A1.2 tot indep spectra] is NULL THEN 0 ELSE [A1.2 tot indep spectra] END AS [A1.2 tot indep spectra],
  CASE WHEN [A2 tot indep spectra] is NULL THEN 0 ELSE [A2 tot indep spectra] END AS [A2 tot indep spectra],
  CASE WHEN [A2.2 tot indep spectra] is NULL THEN 0 ELSE [A2.2 tot indep spectra] END AS [A2.2 tot indep spectra],
  CASE WHEN [A3 tot indep spectra] is NULL THEN 0 ELSE [A3 tot indep spectra] END AS [A3 tot indep spectra],
  CASE WHEN [A3.2 tot indep spectra] is NULL THEN 0 ELSE [A3.2 tot indep spectra] END AS [A3.2 tot indep spectra],
  CASE WHEN [B1 tot indep spectra] is NULL THEN 0 ELSE [B1 tot indep spectra] END AS [B1 tot indep spectra],
  CASE WHEN [B1.2 tot indep spectra] is NULL THEN 0 ELSE [B1.2 tot indep spectra] END AS [B1.2 tot indep spectra],
  CASE WHEN [B2 tot indep spectra] is NULL THEN 0 ELSE [B2 tot indep spectra] END AS [B2 tot indep spectra],
  CASE WHEN [B2.2 tot indep spectra] is NULL THEN 0 ELSE [B2.2 tot indep spectra] END AS [B2.2 tot indep spectra],
  CASE WHEN [B3 tot indep spectra] is NULL THEN 0 ELSE [B3 tot indep spectra] END AS [B3 tot indep spectra],
  CASE WHEN [B3.2 tot indep spectra] is NULL THEN 0 ELSE [B3.2 tot indep spectra] END AS [B3.2 tot indep spectra],
  CASE WHEN [C1 tot indep spectra] is NULL THEN 0 ELSE [C1 tot indep spectra] END AS [C1 tot indep spectra],
  CASE WHEN [C1.2 tot indep spectra] is NULL THEN 0 ELSE [C1.2 tot indep spectra] END AS [C1.2 tot indep spectra],
  CASE WHEN [C2 tot indep spectra] is NULL THEN 0 ELSE [C2 tot indep spectra] END AS [C2 tot indep spectra],
  CASE WHEN [C2.2 tot indep spectra] is NULL THEN 0 ELSE [C2.2 tot indep spectra] END AS [C2.2 tot indep spectra],
  CASE WHEN [C3 tot indep spectra] is NULL THEN 0 ELSE [C3 tot indep spectra] END AS [C3 tot indep spectra],
  CASE WHEN [C3.2 tot indep spectra] is NULL THEN 0 ELSE [C3.2 tot indep spectra] END AS [C3.2 tot indep spectra],
  CASE WHEN [D1 tot indep spectra] is NULL THEN 0 ELSE [D1 tot indep spectra] END AS [D1 tot indep spectra],
  CASE WHEN [D1.2 tot indep spectra] is NULL THEN 0 ELSE [D1.2 tot indep spectra] END AS [D1.2 tot indep spectra],
  CASE WHEN [D2 tot indep spectra] is NULL THEN 0 ELSE [D2 tot indep spectra] END AS [D2 tot indep spectra],
  CASE WHEN [D2.2 tot indep spectra] is NULL THEN 0 ELSE [D2.2 tot indep spectra] END AS [D2.2 tot indep spectra],
  CASE WHEN [D3 tot indep spectra] is NULL THEN 0 ELSE [D3 tot indep spectra] END AS [D3 tot indep spectra],
  CASE WHEN [D3.2 tot indep spectra] is NULL THEN 0 ELSE [D3.2 tot indep spectra] END AS [D3.2 tot indep spectra],
  CASE WHEN [E1 tot indep spectra] is NULL THEN 0 ELSE [E1 tot indep spectra] END AS [E1 tot indep spectra],
  CASE WHEN [E1.2 tot indep spectra] is NULL THEN 0 ELSE [E1.2 tot indep spectra] END AS [E1.2 tot indep spectra],
  CASE WHEN [E2 tot indep spectra] is NULL THEN 0 ELSE [E2 tot indep spectra] END AS [E2 tot indep spectra],
  CASE WHEN [E2.2 tot indep spectra] is NULL THEN 0 ELSE [E2.2 tot indep spectra] END AS [E2.2 tot indep spectra],
  CASE WHEN [E3 tot indep spectra] is NULL THEN 0 ELSE [E3 tot indep spectra] END AS [E3 tot indep spectra],
  CASE WHEN [E3.2 tot indep spectra] is NULL THEN 0 ELSE [E3.2 tot indep spectra] END AS [E3.2 tot indep spectra],
  CASE WHEN [F1 tot indep spectra] is NULL THEN 0 ELSE [F1 tot indep spectra] END AS [F1 tot indep spectra],
  CASE WHEN [F1.2 tot indep spectra] is NULL THEN 0 ELSE [F1.2 tot indep spectra] END AS [F1.2 tot indep spectra],
  CASE WHEN [F1.3 tot indep spectra] is NULL THEN 0 ELSE [F1.3 tot indep spectra] END AS [F1.3 tot indep spectra],
  CASE WHEN [F2 tot indep spectra] is NULL THEN 0 ELSE [F2 tot indep spectra] END AS [F2 tot indep spectra],
  CASE WHEN [F2.2 tot indep spectra] is NULL THEN 0 ELSE [F2.2 tot indep spectra] END AS [F2.2 tot indep spectra],
  CASE WHEN [F2.3 tot indep spectra] is NULL THEN 0 ELSE [F2.3 tot indep spectra] END AS [F2.3 tot indep spectra],
  CASE WHEN [F3 tot indep spectra] is NULL THEN 0 ELSE [F3 tot indep spectra] END AS [F3 tot indep spectra],
  CASE WHEN [F3.2 tot indep spectra] is NULL THEN 0 ELSE [F3.2 tot indep spectra] END AS [F3.2 tot indep spectra],
  CASE WHEN [F3.3 tot indep spectra] is NULL THEN 0 ELSE [F3.3 tot indep spectra] END AS [F3.3 tot indep spectra],
  CASE WHEN [G1 tot indep spectra] is NULL THEN 0 ELSE [G1 tot indep spectra] END AS [G1 tot indep spectra],
  CASE WHEN [G1.2 tot indep spectra] is NULL THEN 0 ELSE [G1.2 tot indep spectra] END AS [G1.2 tot indep spectra],
  CASE WHEN [G2 tot indep spectra] is NULL THEN 0 ELSE [G2 tot indep spectra] END AS [G2 tot indep spectra],
  CASE WHEN [G2.2 tot indep spectra] is NULL THEN 0 ELSE [G2.2 tot indep spectra] END AS [G2.2 tot indep spectra],
  CASE WHEN [G3 tot indep spectra] is NULL THEN 0 ELSE [G3 tot indep spectra] END AS [G3 tot indep spectra],
  CASE WHEN [G3.2 tot indep spectra] is NULL THEN 0 ELSE [G3.2 tot indep spectra] END AS [G3.2 tot indep spectra],
  CASE WHEN [H1 tot indep spectra] is NULL THEN 0 ELSE [H1 tot indep spectra] END AS [H1 tot indep spectra],
  CASE WHEN [H1.2 tot indep spectra] is NULL THEN 0 ELSE [H1.2 tot indep spectra] END AS [H1.2 tot indep spectra],
  CASE WHEN [H2 tot indep spectra] is NULL THEN 0 ELSE [H2 tot indep spectra] END AS [H2 tot indep spectra],
  CASE WHEN [H2.2 tot indep spectra] is NULL THEN 0 ELSE [H2.2 tot indep spectra] END AS [H2.2 tot indep spectra],
  CASE WHEN [H2.3 tot indep spectra] is NULL THEN 0 ELSE [H2.3 tot indep spectra] END AS [H2.3 tot indep spectra],
  CASE WHEN [H3 tot indep spectra] is NULL THEN 0 ELSE [H3 tot indep spectra] END AS [H3 tot indep spectra],
  CASE WHEN [H3.2 tot indep spectra] is NULL THEN 0 ELSE [H3.2 tot indep spectra] END AS [H3.2 tot indep spectra],
  CASE WHEN [H3.3 tot indep spectra] is NULL THEN 0 ELSE [H3.3 tot indep spectra] END AS [H3.3 tot indep spectra],
  CASE WHEN [I1 tot indep spectra] is NULL THEN 0 ELSE [I1 tot indep spectra] END AS [I1 tot indep spectra],
  CASE WHEN [I1.2 tot indep spectra] is NULL THEN 0 ELSE [I1.2 tot indep spectra] END AS [I1.2 tot indep spectra],
  CASE WHEN [I2 tot indep spectra] is NULL THEN 0 ELSE [I2 tot indep spectra] END AS [I2 tot indep spectra],
  CASE WHEN [I2.2 tot indep spectra] is NULL THEN 0 ELSE [I2.2 tot indep spectra] END AS [I2.2 tot indep spectra],
  CASE WHEN [I3 tot indep spectra] is NULL THEN 0 ELSE [I3 tot indep spectra] END AS [I3 tot indep spectra],
  CASE WHEN [I3.2 tot indep spectra] is NULL THEN 0 ELSE [I3.2 tot indep spectra] END AS [I3.2 tot indep spectra]
  FROM [412].[Bact detection all spec counts]


________________________________________


SELECT Protein, 
  SUM ([A1.2 tot indep spectra]+
  [A2 tot indep spectra]+ 
  [A2.2 tot indep spectra]+
  [A3 tot indep spectra]+
  [A3.2 tot indep spectra]+
  [B1 tot indep spectra]+
  [B1.2 tot indep spectra]+
  [B2 tot indep spectra]+
  [B2.2 tot indep spectra]+
  [B3 tot indep spectra]+
  [B3.2 tot indep spectra]+
  [C1 tot indep spectra]+
  [C1.2 tot indep spectra]+
  [C2 tot indep spectra]+
  [C2.2 tot indep spectra]+
  [C3 tot indep spectra]+
  [C3.2 tot indep spectra]+
  [D1 tot indep spectra]+
  [D1.2 tot indep spectra]+
  [D2 tot indep spectra]+
  [D2.2 tot indep spectra]+
  [D3 tot indep spectra]+
  [D3.2 tot indep spectra]+
  [E1 tot indep spectra]+
  [E1.2 tot indep spectra]+
  [E2 tot indep spectra]+
  [E2.2 tot indep spectra]+
  [E3 tot indep spectra]+
  [E3.2 tot indep spectra]+
  [F1 tot indep spectra]+
  [F1.2 tot indep spectra]+
  [F1.3 tot indep spectra]+
  [F2 tot indep spectra]+
  [F2.2 tot indep spectra]+
  [F2.3 tot indep spectra]+
  [F3 tot indep spectra]+
  [F3.2 tot indep spectra]+
  [F3.3 tot indep spectra]+
  [G1 tot indep spectra]+
  [G1.2 tot indep spectra]+
  [G2 tot indep spectra]+
  [G2.2 tot indep spectra]+
  [G3 tot indep spectra]+
  [G3.2 tot indep spectra]+
  [H1 tot indep spectra]+
  [H1.2 tot indep spectra]+
  [H2 tot indep spectra]+
  [H2.2 tot indep spectra]+
  [H2.3 tot indep spectra]+
  [H3 tot indep spectra]+
  [H3.2 tot indep spectra]+
  [H3.3 tot indep spectra]+
  [I1 tot indep spectra]+
  [I1.2 tot indep spectra]+
  [I2 tot indep spectra]+
  [I2.2 tot indep spectra]+
  [I3 tot indep spectra]+
    [I3.2 tot indep spectra]) AS [Total SpC]
  FROM [412].[Bact detection spec counts with 0]
GROUP BY Protein


________________________________________


SELECT * FROM [412].[Bact detection spec counts with 0]
  LEFT JOIN [412].[total spc per protein]
  ON [412].[Bact detection spec counts with 0].Protein=[412].[total spc per protein].Protein



________________________________________


SELECT * FROM [412].[bact detection all spec counts with total]
  WHERE [Total SpC]>0


________________________________________


SELECT Protein, 
  SUM ([A1 tot indep spectra]+[A1.2 tot indep spectra]+
  [A2 tot indep spectra]+ 
  [A2.2 tot indep spectra]+
  [A3 tot indep spectra]+
  [A3.2 tot indep spectra]+
  [B1 tot indep spectra]+
  [B1.2 tot indep spectra]+
  [B2 tot indep spectra]+
  [B2.2 tot indep spectra]+
  [B3 tot indep spectra]+
  [B3.2 tot indep spectra]+
  [C1 tot indep spectra]+
  [C1.2 tot indep spectra]+
  [C2 tot indep spectra]+
  [C2.2 tot indep spectra]+
  [C3 tot indep spectra]+
  [C3.2 tot indep spectra]+
  [D1 tot indep spectra]+
  [D1.2 tot indep spectra]+
  [D2 tot indep spectra]+
  [D2.2 tot indep spectra]+
  [D3 tot indep spectra]+
  [D3.2 tot indep spectra]+
  [E1 tot indep spectra]+
  [E1.2 tot indep spectra]+
  [E2 tot indep spectra]+
  [E2.2 tot indep spectra]+
  [E3 tot indep spectra]+
  [E3.2 tot indep spectra]+
  [F1 tot indep spectra]+
  [F1.2 tot indep spectra]+
  [F1.3 tot indep spectra]+
  [F2 tot indep spectra]+
  [F2.2 tot indep spectra]+
  [F2.3 tot indep spectra]+
  [F3 tot indep spectra]+
  [F3.2 tot indep spectra]+
  [F3.3 tot indep spectra]+
  [G1 tot indep spectra]+
  [G1.2 tot indep spectra]+
  [G2 tot indep spectra]+
  [G2.2 tot indep spectra]+
  [G3 tot indep spectra]+
  [G3.2 tot indep spectra]+
  [H1 tot indep spectra]+
  [H1.2 tot indep spectra]+
  [H2 tot indep spectra]+
  [H2.2 tot indep spectra]+
  [H2.3 tot indep spectra]+
  [H3 tot indep spectra]+
  [H3.2 tot indep spectra]+
  [H3.3 tot indep spectra]+
  [I1 tot indep spectra]+
  [I1.2 tot indep spectra]+
  [I2 tot indep spectra]+
  [I2.2 tot indep spectra]+
  [I3 tot indep spectra]+
    [I3.2 tot indep spectra]) AS [Total SpC]
  FROM [412].[Bact detection spec counts with 0]
GROUP BY Protein


________________________________________


SELECT * FROM [412].[Bact detection spec counts with 0]
  LEFT JOIN [412].[total spc per protein]
  ON [412].[Bact detection spec counts with 0].Protein=[412].[total spc per protein].Protein



________________________________________


SELECT Protein,
  SUM([A1 tot indep spectra]+[A1.2 tot indep spectra]) AS A1,
  SUM([A2 tot indep spectra]+[A2.2 tot indep spectra]) AS A2,
  SUM([A3 tot indep spectra]+[A3.2 tot indep spectra]) AS A3,
  SUM([B1 tot indep spectra]+[B1.2 tot indep spectra]) AS B1,
  SUM([B2 tot indep spectra]+[B2.2 tot indep spectra]) AS B2,
  SUM([B3 tot indep spectra]+[B3.2 tot indep spectra]) AS B3,
  SUM([C1 tot indep spectra]+[C1.2 tot indep spectra]) AS C1,
  SUM([C2 tot indep spectra]+[C2.2 tot indep spectra]) AS C2,
  SUM([C3 tot indep spectra]+[C3.2 tot indep spectra]) AS C3,
  SUM([D1 tot indep spectra]+[D1.2 tot indep spectra]) AS D1,
  SUM([D2 tot indep spectra]+[D2.2 tot indep spectra]) AS D2,
  SUM([D3 tot indep spectra]+[D3.2 tot indep spectra]) AS D3,
  SUM([E1 tot indep spectra]+[E1.2 tot indep spectra]) AS E1,
  SUM([E2 tot indep spectra]+[E2.2 tot indep spectra]) AS E2,
  SUM([E3 tot indep spectra]+[E3.2 tot indep spectra]) AS E3,
  SUM([F1 tot indep spectra]+[F1.2 tot indep spectra]+[F1.3 tot indep spectra]) AS F1,
  SUM([F2 tot indep spectra]+[F2.2 tot indep spectra]+[F2.3 tot indep spectra]) AS F2,
  SUM([F3 tot indep spectra]+[F3.2 tot indep spectra]+[F3.3 tot indep spectra]) AS F3,
  SUM([G1 tot indep spectra]+[G1.2 tot indep spectra]) AS G1,
  SUM([G2 tot indep spectra]+[G2.2 tot indep spectra]) AS G2,
  SUM([G3 tot indep spectra]+[G3.2 tot indep spectra]) AS G3,
  SUM([H1 tot indep spectra]+[H1.2 tot indep spectra]) AS H1,
  SUM([H2 tot indep spectra]+[H2.2 tot indep spectra]+[H2.3 tot indep spectra]) AS H2,
  SUM([H3 tot indep spectra]+[H3.2 tot indep spectra]+[H3.3 tot indep spectra]) AS H3
  FROM [412].[bact detection all proteins non-zero spc]
  GROUP BY Protein


________________________________________


SELECT * FROM [412].[bact detection tech reps summed]
  LEFT JOIN [412].[Thaps_Rpom_sequence_lenghts.csv]
  ON [412].[bact detection tech reps summed].Protein=[412].[Thaps_Rpom_sequence_lenghts.csv].Protein
  


________________________________________


SELECT Protein, Length, A1, A2, A3, B1, B2, B3, C1, C2, C3, D1, D2, D3, E1, E2, E3, F1, F2, F3, G1, G2, G3, H1, H2, H3,
  CAST([A1] AS FLOAT)/[Length] AS [A1 SpC/L],
   CAST([A2] AS FLOAT)/[Length] AS [A2 SpC/L],
   CAST([A3] AS FLOAT)/[Length] AS [A3 SpC/L],
   CAST([B1] AS FLOAT)/[Length] AS [B1 SpC/L],
   CAST([B2] AS FLOAT)/[Length] AS [B2 SpC/L],
   CAST([B3] AS FLOAT)/[Length] AS [B3 SpC/L],
   CAST([C1] AS FLOAT)/[Length] AS [C1 SpC/L],
   CAST([C2] AS FLOAT)/[Length] AS [C2 SpC/L],
   CAST([C3] AS FLOAT)/[Length] AS [C3 SpC/L],
   CAST([D1] AS FLOAT)/[Length] AS [D1 SpC/L],
   CAST([D2] AS FLOAT)/[Length] AS [D2 SpC/L],
   CAST([D3] AS FLOAT)/[Length] AS [D3 SpC/L],
   CAST([E1] AS FLOAT)/[Length] AS [E1 SpC/L],
   CAST([E2] AS FLOAT)/[Length] AS [E2 SpC/L],
   CAST([E3] AS FLOAT)/[Length] AS [E3 SpC/L],
   CAST([F1] AS FLOAT)/[Length] AS [F1 SpC/L],
   CAST([F2] AS FLOAT)/[Length] AS [F2 SpC/L],
   CAST([F3] AS FLOAT)/[Length] AS [F3 SpC/L],
   CAST([G1] AS FLOAT)/[Length] AS [G1 SpC/L],
   CAST([G2] AS FLOAT)/[Length] AS [G2 SpC/L],
   CAST([G3] AS FLOAT)/[Length] AS [G3 SpC/L],
   CAST([H1] AS FLOAT)/[Length] AS [H1 SpC/L],
   CAST([H2] AS FLOAT)/[Length] AS [H2 SpC/L],
   CAST([H3] AS FLOAT)/[Length] AS [H3 SpC/L]
  FROM [412].[Sum tech reps with protein length]


________________________________________


SELECT Protein,
  CAST([A1] AS FLOAT)/2 as [A1 avg SpC]
  FROM [412].[bact detection tech reps summed]


________________________________________


SELECT Protein, Length,
  CAST([A1] AS FLOAT)/2 as [A1 avg SpC]
  FROM [412].[Sum tech reps with protein length]


________________________________________


SELECT Protein, Length,
  CAST([A1] AS FLOAT)/2 as [A1 avg SpC],
  CAST([A2] AS FLOAT)/2 as [A2 avg SpC],
  CAST([A3] AS FLOAT)/2 as [A3 avg SpC],
  CAST([B1] AS FLOAT)/2 as [B1 avg SpC],
  CAST([B2] AS FLOAT)/2 as [B2 avg SpC],
  CAST([B3] AS FLOAT)/2 as [B3 avg SpC],
  CAST([C1] AS FLOAT)/2 as [C1 avg SpC],
  CAST([C2] AS FLOAT)/2 as [C2 avg SpC],
  CAST([C3] AS FLOAT)/2 as [C3 avg SpC],
  CAST([D1] AS FLOAT)/2 as [D1 avg SpC],
  CAST([D2] AS FLOAT)/2 as [D2 avg SpC],
  CAST([D3] AS FLOAT)/2 as [D3 avg SpC],
  CAST([E1] AS FLOAT)/2 as [E1 avg SpC],
  CAST([E2] AS FLOAT)/2 as [E2 avg SpC],
  CAST([E3] AS FLOAT)/2 as [E3 avg SpC],
  CAST([F1] AS FLOAT)/3 as [F1 avg SpC],
  CAST([F2] AS FLOAT)/3 as [F2 avg SpC],
  CAST([F3] AS FLOAT)/3 as [F3 avg SpC],
  CAST([G1] AS FLOAT)/2 as [G1 avg SpC],
  CAST([G2] AS FLOAT)/2 as [G2 avg SpC],
  CAST([G3] AS FLOAT)/2 as [G3 avg SpC],
  CAST([H1] AS FLOAT)/2 as [H1 avg SpC],
  CAST([H2] AS FLOAT)/3 as [H2 avg SpC],
  CAST([H3] AS FLOAT)/3 as [H3 avg SpC]
  FROM [412].[Sum tech reps with protein length]


________________________________________


SELECT Protein, Length, [A1 avg SpC],[A2 avg SpC],[A3 avg SpC],
  [B1 avg SpC],
  [B2 avg SpC],
  [B3 avg SpC],
  [C1 avg SpC],
  [C2 avg SpC],
  [C3 avg SpC],
  [D1 avg SpC],
  [D2 avg SpC],
  [D3 avg SpC],
  [E1 avg SpC],
  [E2 avg SpC],
  [E3 avg SpC],
  [F1 avg SpC],
  [F2 avg SpC],
  [F3 avg SpC],
  [G1 avg SpC],
  [G2 avg SpC],
  [G3 avg SpC],
  [H1 avg SpC],
  [H2 avg SpC],
  [H3 avg SpC],
  CAST([A1 avg SpC] AS FLOAT)/[Length] AS [A1 SpC/L],
  CAST([A2 avg SpC] AS FLOAT)/[Length] AS [A2 SpC/L],
  CAST([A3 avg SpC] AS FLOAT)/[Length] AS [A3 SpC/L],
  CAST([B1 avg SpC] AS FLOAT)/[Length] AS [B1 SpC/L],
  CAST([B2 avg SpC] AS FLOAT)/[Length] AS [B2 SpC/L],
  CAST([B3 avg SpC] AS FLOAT)/[Length] AS [B3 SpC/L],
  CAST([C1 avg SpC] AS FLOAT)/[Length] AS [C1 SpC/L],
  CAST([C2 avg SpC] AS FLOAT)/[Length] AS [C2 SpC/L],
  CAST([C3 avg SpC] AS FLOAT)/[Length] AS [C3 SpC/L],
  CAST([D1 avg SpC] AS FLOAT)/[Length] AS [D1 SpC/L],
  CAST([D2 avg SpC] AS FLOAT)/[Length] AS [D2 SpC/L],
  CAST([D3 avg SpC] AS FLOAT)/[Length] AS [D3 SpC/L],
  CAST([E1 avg SpC] AS FLOAT)/[Length] AS [E1 SpC/L],
  CAST([E2 avg SpC] AS FLOAT)/[Length] AS [E2 SpC/L],
  CAST([E3 avg SpC] AS FLOAT)/[Length] AS [E3 SpC/L],
  CAST([F1 avg SpC] AS FLOAT)/[Length] AS [F1 SpC/L],
  CAST([F2 avg SpC] AS FLOAT)/[Length] AS [F2 SpC/L],
  CAST([F3 avg SpC] AS FLOAT)/[Length] AS [F3 SpC/L],
  CAST([G1 avg SpC] AS FLOAT)/[Length] AS [G1 SpC/L],
  CAST([G2 avg SpC] AS FLOAT)/[Length] AS [G2 SpC/L],
  CAST([G3 avg SpC] AS FLOAT)/[Length] AS [G3 SpC/L],
  CAST([H1 avg SpC] AS FLOAT)/[Length] AS [H1 SpC/L],
  CAST([H2 avg SpC] AS FLOAT)/[Length] AS [H2 SpC/L],
  CAST([H3 avg SpC] AS FLOAT)/[Length] AS [H3 SpC/L]
  FROM [412].[bact detection average spc]


________________________________________


SELECT 
  SUM([A1 SpC/L]) AS [SUM A1 SpC/L],
  SUM([A2 SpC/L]) AS [SUM A2 SpC/L],
  SUM([A3 SpC/L]) AS [SUM A3 SpC/L],
  SUM([B1 SpC/L]) AS [SUM B1 SpC/L],
  SUM([B2 SpC/L]) AS [SUM B2 SpC/L],
  SUM([B3 SpC/L]) AS [SUM B3 SpC/L],
  SUM([C1 SpC/L]) AS [SUM C1 SpC/L],
  SUM([C2 SpC/L]) AS [SUM C2 SpC/L],
  SUM([C3 SpC/L]) AS [SUM C3 SpC/L],
  SUM([D1 SpC/L]) AS [SUM D1 SpC/L],
  SUM([D2 SpC/L]) AS [SUM D2 SpC/L],
  SUM([D3 SpC/L]) AS [SUM D3 SpC/L],
  SUM([E1 SpC/L]) AS [SUM E1 SpC/L],
  SUM([E2 SpC/L]) AS [SUM E2 SpC/L],
  SUM([E3 SpC/L]) AS [SUM E3 SpC/L],
  SUM([F1 SpC/L]) AS [SUM F1 SpC/L],
  SUM([F2 SpC/L]) AS [SUM F2 SpC/L],
  SUM([F3 SpC/L]) AS [SUM F3 SpC/L],
  SUM([G1 SpC/L]) AS [SUM G1 SpC/L],
  SUM([G2 SpC/L]) AS [SUM G2 SpC/L],
  SUM([G3 SpC/L]) AS [SUM G3 SpC/L],
  SUM([H1 SpC/L]) AS [SUM H1 SpC/L],
  SUM([H2 SpC/L]) AS [SUM H2 SpC/L],
  SUM([H3 SpC/L]) AS [SUM H3 SpC/L]
  FROM [412].[bact detection SpC-L]


________________________________________


SELECT Protein,
  spc.[A1 SpC/L] / allspc.[SUM A1 SpC/L] AS [NSAF A1],
  spc.[A2 SpC/L] / allspc.[SUM A2 SpC/L] AS [NSAF A2],
  spc.[A3 SpC/L] / allspc.[SUM A3 SpC/L] AS [NSAF A3],
  spc.[B1 SpC/L] / allspc.[SUM B1 SpC/L] AS [NSAF B1],
  spc.[B2 SpC/L] / allspc.[SUM B2 SpC/L] AS [NSAF B2],
  spc.[B3 SpC/L] / allspc.[SUM B3 SpC/L] AS [NSAF B3],
  spc.[C1 SpC/L] / allspc.[SUM C1 SpC/L] AS [NSAF C1],
  spc.[C2 SpC/L] / allspc.[SUM C2 SpC/L] AS [NSAF C2],
  spc.[C3 SpC/L] / allspc.[SUM C3 SpC/L] AS [NSAF C3],
  spc.[D1 SpC/L] / allspc.[SUM D1 SpC/L] AS [NSAF D1],
  spc.[D2 SpC/L] / allspc.[SUM D2 SpC/L] AS [NSAF D2],
  spc.[D3 SpC/L] / allspc.[SUM D3 SpC/L] AS [NSAF D3],
  spc.[E1 SpC/L] / allspc.[SUM E1 SpC/L] AS [NSAF E1],
  spc.[E2 SpC/L] / allspc.[SUM E2 SpC/L] AS [NSAF E2],
  spc.[E3 SpC/L] / allspc.[SUM E3 SpC/L] AS [NSAF E3],
  spc.[F1 SpC/L] / allspc.[SUM F1 SpC/L] AS [NSAF F1],
  spc.[F2 SpC/L] / allspc.[SUM F2 SpC/L] AS [NSAF F2],
  spc.[F3 SpC/L] / allspc.[SUM F3 SpC/L] AS [NSAF F3],
  spc.[G1 SpC/L] / allspc.[SUM G1 SpC/L] AS [NSAF G1],
  spc.[G2 SpC/L] / allspc.[SUM G2 SpC/L] AS [NSAF G2],
  spc.[G3 SpC/L] / allspc.[SUM G3 SpC/L] AS [NSAF G3],
  spc.[H1 SpC/L] / allspc.[SUM H1 SpC/L] AS [NSAF H1],
  spc.[H2 SpC/L] / allspc.[SUM H2 SpC/L] AS [NSAF H2],
  spc.[H3 SpC/L] / allspc.[SUM H3 SpC/L] AS [NSAF H3]
  FROM [412].[bact detection SpC-L] spc,
  [412].[Bact detection sum spc-l] allspc


________________________________________


SELECT [protein] AS [protein08],
  [protein probability] AS [protein probability08],
  [percent coverage] AS [percent coverage08],
  [tot indep spectra] AS [tot indep spectra08],
  [peptides] AS [peptides08]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea08.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein10],
  [protein probability] AS [protein probability10],
  [percent coverage] AS [percent coverage10],
  [tot indep spectra] AS [tot indep spectra10],
  [peptides] AS [peptides10]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea10.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein12],
  [protein probability] AS [protein probability12],
  [percent coverage] AS [percent coverage12],
  [tot indep spectra] AS [tot indep spectra12],
  [peptides] AS [peptides12]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea12.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein14],
  [protein probability] AS [protein probability14],
  [percent coverage] AS [percent coverage14],
  [tot indep spectra] AS [tot indep spectra14],
  [peptides] AS [peptides14]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea14.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein16],
  [protein probability] AS [protein probability16],
  [percent coverage] AS [percent coverage16],
  [tot indep spectra] AS [tot indep spectra16],
  [peptides] AS [peptides16]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea16.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein17],
  [protein probability] AS [protein probability17],
  [percent coverage] AS [percent coverage17],
  [tot indep spectra] AS [tot indep spectra17],
  [peptides] AS [peptides17]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea17.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein19],
  [protein probability] AS [protein probability19],
  [percent coverage] AS [percent coverage19],
  [tot indep spectra] AS [tot indep spectra19],
  [peptides] AS [peptides19]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea19.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein20],
  [protein probability] AS [protein probability20],
  [percent coverage] AS [percent coverage20],
  [tot indep spectra] AS [tot indep spectra20],
  [peptides] AS [peptides20]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea20.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein22],
  [protein probability] AS [protein probability22],
  [percent coverage] AS [percent coverage22],
  [tot indep spectra] AS [tot indep spectra22],
  [peptides] AS [peptides22]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea22.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein23],
  [protein probability] AS [protein probability23],
  [percent coverage] AS [percent coverage23],
  [tot indep spectra] AS [tot indep spectra23],
  [peptides] AS [peptides23]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea23.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein25],
  [protein probability] AS [protein probability25],
  [percent coverage] AS [percent coverage25],
  [tot indep spectra] AS [tot indep spectra25],
  [peptides] AS [peptides25]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea25.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein26],
  [protein probability] AS [protein probability26],
  [percent coverage] AS [percent coverage26],
  [tot indep spectra] AS [tot indep spectra26],
  [peptides] AS [peptides26]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea26.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein28],
  [protein probability] AS [protein probability28],
  [percent coverage] AS [percent coverage28],
  [tot indep spectra] AS [tot indep spectra28],
  [peptides] AS [peptides28]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea28.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein29],
  [protein probability] AS [protein probability29],
  [percent coverage] AS [percent coverage29],
  [tot indep spectra] AS [tot indep spectra29],
  [peptides] AS [peptides29]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea29.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein30],
  [protein probability] AS [protein probability30],
  [percent coverage] AS [percent coverage30],
  [tot indep spectra] AS [tot indep spectra30],
  [peptides] AS [peptides30]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea30.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein31],
  [protein probability] AS [protein probability31],
  [percent coverage] AS [percent coverage31],
  [tot indep spectra] AS [tot indep spectra31],
  [peptides] AS [peptides31]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea31.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein32],
  [protein probability] AS [protein probability32],
  [percent coverage] AS [percent coverage32],
  [tot indep spectra] AS [tot indep spectra32],
  [peptides] AS [peptides32]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea32.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein34],
  [protein probability] AS [protein probability34],
  [percent coverage] AS [percent coverage34],
  [tot indep spectra] AS [tot indep spectra34],
  [peptides] AS [peptides34]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea34.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein35],
  [protein probability] AS [protein probability35],
  [percent coverage] AS [percent coverage35],
  [tot indep spectra] AS [tot indep spectra35],
  [peptides] AS [peptides35]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea35.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein36],
  [protein probability] AS [protein probability36],
  [percent coverage] AS [percent coverage36],
  [tot indep spectra] AS [tot indep spectra36],
  [peptides] AS [peptides36]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea36.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein37],
  [protein probability] AS [protein probability37],
  [percent coverage] AS [percent coverage37],
  [tot indep spectra] AS [tot indep spectra37],
  [peptides] AS [peptides37]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea37.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein38],
  [protein probability] AS [protein probability38],
  [percent coverage] AS [percent coverage38],
  [tot indep spectra] AS [tot indep spectra38],
  [peptides] AS [peptides38]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea38.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein39],
  [protein probability] AS [protein probability39],
  [percent coverage] AS [percent coverage39],
  [tot indep spectra] AS [tot indep spectra39],
  [peptides] AS [peptides39]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea39.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein42],
  [protein probability] AS [protein probability42],
  [percent coverage] AS [percent coverage42],
  [tot indep spectra] AS [tot indep spectra42],
  [peptides] AS [peptides42]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea42.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein43],
  [protein probability] AS [protein probability43],
  [percent coverage] AS [percent coverage43],
  [tot indep spectra] AS [tot indep spectra43],
  [peptides] AS [peptides43]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea43.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein44],
  [protein probability] AS [protein probability44],
  [percent coverage] AS [percent coverage44],
  [tot indep spectra] AS [tot indep spectra44],
  [peptides] AS [peptides44]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea44.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein45],
  [protein probability] AS [protein probability45],
  [percent coverage] AS [percent coverage45],
  [tot indep spectra] AS [tot indep spectra45],
  [peptides] AS [peptides45]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea45.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein46],
  [protein probability] AS [protein probability46],
  [percent coverage] AS [percent coverage46],
  [tot indep spectra] AS [tot indep spectra46],
  [peptides] AS [peptides46]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea46.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein47],
  [protein probability] AS [protein probability47],
  [percent coverage] AS [percent coverage47],
  [tot indep spectra] AS [tot indep spectra47],
  [peptides] AS [peptides47]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea47.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein48],
  [protein probability] AS [protein probability48],
  [percent coverage] AS [percent coverage48],
  [tot indep spectra] AS [tot indep spectra48],
  [peptides] AS [peptides48]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea48.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein49],
  [protein probability] AS [protein probability49],
  [percent coverage] AS [percent coverage49],
  [tot indep spectra] AS [tot indep spectra49],
  [peptides] AS [peptides49]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea49.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein50],
  [protein probability] AS [protein probability50],
  [percent coverage] AS [percent coverage50],
  [tot indep spectra] AS [tot indep spectra50],
  [peptides] AS [peptides50]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea50.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein51],
  [protein probability] AS [protein probability51],
  [percent coverage] AS [percent coverage51],
  [tot indep spectra] AS [tot indep spectra51],
  [peptides] AS [peptides51]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea51.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein54],
  [protein probability] AS [protein probability54],
  [percent coverage] AS [percent coverage54],
  [tot indep spectra] AS [tot indep spectra54],
  [peptides] AS [peptides54]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea54.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein55],
  [protein probability] AS [protein probability55],
  [percent coverage] AS [percent coverage55],
  [tot indep spectra] AS [tot indep spectra55],
  [peptides] AS [peptides55]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea55.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein56],
  [protein probability] AS [protein probability56],
  [percent coverage] AS [percent coverage56],
  [tot indep spectra] AS [tot indep spectra56],
  [peptides] AS [peptides56]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea56.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein57],
  [protein probability] AS [protein probability57],
  [percent coverage] AS [percent coverage57],
  [tot indep spectra] AS [tot indep spectra57],
  [peptides] AS [peptides57]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea57.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein58],
  [protein probability] AS [protein probability58],
  [percent coverage] AS [percent coverage58],
  [tot indep spectra] AS [tot indep spectra58],
  [peptides] AS [peptides58]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea58.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein59],
  [protein probability] AS [protein probability59],
  [percent coverage] AS [percent coverage59],
  [tot indep spectra] AS [tot indep spectra59],
  [peptides] AS [peptides59]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea59.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein62],
  [protein probability] AS [protein probability62],
  [percent coverage] AS [percent coverage62],
  [tot indep spectra] AS [tot indep spectra62],
  [peptides] AS [peptides62]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea62.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein63],
  [protein probability] AS [protein probability63],
  [percent coverage] AS [percent coverage63],
  [tot indep spectra] AS [tot indep spectra63],
  [peptides] AS [peptides63]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea63.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein64],
  [protein probability] AS [protein probability64],
  [percent coverage] AS [percent coverage64],
  [tot indep spectra] AS [tot indep spectra64],
  [peptides] AS [peptides64]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea64.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein65],
  [protein probability] AS [protein probability65],
  [percent coverage] AS [percent coverage65],
  [tot indep spectra] AS [tot indep spectra65],
  [peptides] AS [peptides65]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea65.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein66],
  [protein probability] AS [protein probability66],
  [percent coverage] AS [percent coverage66],
  [tot indep spectra] AS [tot indep spectra66],
  [peptides] AS [peptides66]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea66.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein67],
  [protein probability] AS [protein probability67],
  [percent coverage] AS [percent coverage67],
  [tot indep spectra] AS [tot indep spectra67],
  [peptides] AS [peptides67]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea67.prot.xls]


________________________________________


SELECT 
  [protein] AS [protein33],
  [protein probability] AS [protein probability33],
  [percent coverage] AS [percent coverage33],
  [tot indep spectra] AS [tot indep spectra33],
  [peptides] AS [peptides33]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea33.prot.xls]


________________________________________


SELECT protein67 FROM [412].[Prophet_2014_Sept_08_BeringSea67.prot.xls]
  UNION ALL
  SELECT protein08 FROM [412].[Prophet_2014_Sept_08_BeringSea08.prot.xls]
UNION ALL
  SELECT protein10 FROM [412].[Prophet_2014_Sept_08_BeringSea10.prot.xls]
UNION ALL
  SELECT protein12 FROM [412].[Prophet_2014_Sept_08_BeringSea12.prot.xls]
 UNION ALL
  SELECT protein14 FROM [412].[Prophet_2014_Sept_08_BeringSea14.prot.xls]
 UNION ALL
  SELECT protein16 FROM [412].[Prophet_2014_Sept_08_BeringSea16.prot.xls]
  UNION ALL
  SELECT protein17 FROM [412].[Prophet_2014_Sept_08_BeringSea17.prot.xls]
  UNION ALL
  SELECT protein19 FROM [412].[Prophet_2014_Sept_08_BeringSea19.prot.xls]
  UNION ALL
  SELECT protein20 FROM [412].[Prophet_2014_Sept_08_BeringSea20.prot.xls]
  UNION ALL
  SELECT protein22 FROM [412].[Prophet_2014_Sept_08_BeringSea22.prot.xls]
  UNION ALL
  SELECT protein23 FROM [412].[Prophet_2014_Sept_08_BeringSea23.prot.xls]
  UNION ALL
  SELECT protein25 FROM [412].[Prophet_2014_Sept_08_BeringSea25.prot.xls]
  UNION ALL
  SELECT protein26 FROM [412].[Prophet_2014_Sept_08_BeringSea26.prot.xls]
  UNION ALL
  SELECT protein28 FROM [412].[Prophet_2014_Sept_08_BeringSea28.prot.xls]
  UNION ALL
  SELECT protein29 FROM [412].[Prophet_2014_Sept_08_BeringSea29.prot.xls]
  UNION ALL
  SELECT protein30 FROM [412].[Prophet_2014_Sept_08_BeringSea30.prot.xls]
  UNION ALL
  SELECT protein31 FROM [412].[Prophet_2014_Sept_08_BeringSea31.prot.xls]
  UNION ALL
  SELECT protein32 FROM [412].[Prophet_2014_Sept_08_BeringSea32.prot.xls]
  UNION ALL
  SELECT protein33 FROM [412].[Prophet_2014_Sept_08_BeringSea33.prot.xls]
  UNION ALL
  SELECT protein34 FROM [412].[Prophet_2014_Sept_08_BeringSea34.prot.xls]
  UNION ALL
  SELECT protein35 FROM [412].[Prophet_2014_Sept_08_BeringSea35.prot.xls]
  UNION ALL
  SELECT protein36 FROM [412].[Prophet_2014_Sept_08_BeringSea36.prot.xls]
  UNION ALL
  SELECT protein37 FROM [412].[Prophet_2014_Sept_08_BeringSea37.prot.xls]
  UNION ALL
  SELECT protein38 FROM [412].[Prophet_2014_Sept_08_BeringSea38.prot.xls]
  UNION ALL
  SELECT protein39 FROM [412].[Prophet_2014_Sept_08_BeringSea39.prot.xls]
  UNION ALL
  SELECT protein42 FROM [412].[Prophet_2014_Sept_08_BeringSea42.prot.xls]
  UNION ALL
  SELECT protein43 FROM [412].[Prophet_2014_Sept_08_BeringSea43.prot.xls]
  UNION ALL
  SELECT protein44 FROM [412].[Prophet_2014_Sept_08_BeringSea44.prot.xls]
  UNION ALL
  SELECT protein45 FROM [412].[Prophet_2014_Sept_08_BeringSea45.prot.xls]
  UNION ALL
  SELECT protein46 FROM [412].[Prophet_2014_Sept_08_BeringSea46.prot.xls]
  UNION ALL
  SELECT protein47 FROM [412].[Prophet_2014_Sept_08_BeringSea47.prot.xls]
  UNION ALL
  SELECT protein48 FROM [412].[Prophet_2014_Sept_08_BeringSea48.prot.xls]
  UNION ALL
  SELECT protein49 FROM [412].[Prophet_2014_Sept_08_BeringSea49.prot.xls]
  UNION ALL
  SELECT protein50 FROM [412].[Prophet_2014_Sept_08_BeringSea50.prot.xls]
  UNION ALL
  SELECT protein51 FROM [412].[Prophet_2014_Sept_08_BeringSea51.prot.xls]
  UNION ALL
  SELECT protein54 FROM [412].[Prophet_2014_Sept_08_BeringSea54.prot.xls]
  UNION ALL
  SELECT protein55 FROM [412].[Prophet_2014_Sept_08_BeringSea55.prot.xls]
  UNION ALL
  SELECT protein56 FROM [412].[Prophet_2014_Sept_08_BeringSea56.prot.xls]
  UNION ALL
  SELECT protein57 FROM [412].[Prophet_2014_Sept_08_BeringSea57.prot.xls]
  UNION ALL
  SELECT protein58 FROM [412].[Prophet_2014_Sept_08_BeringSea58.prot.xls]
  UNION ALL
  SELECT protein59 FROM [412].[Prophet_2014_Sept_08_BeringSea59.prot.xls]
  UNION ALL
  SELECT protein62 FROM [412].[Prophet_2014_Sept_08_BeringSea62.prot.xls]
  UNION ALL
  SELECT protein63 FROM [412].[Prophet_2014_Sept_08_BeringSea63.prot.xls]
  UNION ALL
  SELECT protein64 FROM [412].[Prophet_2014_Sept_08_BeringSea64.prot.xls]
  UNION ALL
  SELECT protein65 FROM [412].[Prophet_2014_Sept_08_BeringSea65.prot.xls]
  UNION ALL
  SELECT protein66 FROM [412].[Prophet_2014_Sept_08_BeringSea66.prot.xls]
  UNION ALL
  SELECT protein67 FROM [412].[Prophet_2014_Sept_08_BeringSea67.prot.xls]



________________________________________


SELECT protein67 AS Protein FROM [412].[Prophet_2014_Sept_08_BeringSea67.prot.xls]
  UNION ALL
  SELECT protein08 FROM [412].[Prophet_2014_Sept_08_BeringSea08.prot.xls]
UNION ALL
  SELECT protein10 FROM [412].[Prophet_2014_Sept_08_BeringSea10.prot.xls]
UNION ALL
  SELECT protein12 FROM [412].[Prophet_2014_Sept_08_BeringSea12.prot.xls]
 UNION ALL
  SELECT protein14 FROM [412].[Prophet_2014_Sept_08_BeringSea14.prot.xls]
 UNION ALL
  SELECT protein16 FROM [412].[Prophet_2014_Sept_08_BeringSea16.prot.xls]
  UNION ALL
  SELECT protein17 FROM [412].[Prophet_2014_Sept_08_BeringSea17.prot.xls]
  UNION ALL
  SELECT protein19 FROM [412].[Prophet_2014_Sept_08_BeringSea19.prot.xls]
  UNION ALL
  SELECT protein20 FROM [412].[Prophet_2014_Sept_08_BeringSea20.prot.xls]
  UNION ALL
  SELECT protein22 FROM [412].[Prophet_2014_Sept_08_BeringSea22.prot.xls]
  UNION ALL
  SELECT protein23 FROM [412].[Prophet_2014_Sept_08_BeringSea23.prot.xls]
  UNION ALL
  SELECT protein25 FROM [412].[Prophet_2014_Sept_08_BeringSea25.prot.xls]
  UNION ALL
  SELECT protein26 FROM [412].[Prophet_2014_Sept_08_BeringSea26.prot.xls]
  UNION ALL
  SELECT protein28 FROM [412].[Prophet_2014_Sept_08_BeringSea28.prot.xls]
  UNION ALL
  SELECT protein29 FROM [412].[Prophet_2014_Sept_08_BeringSea29.prot.xls]
  UNION ALL
  SELECT protein30 FROM [412].[Prophet_2014_Sept_08_BeringSea30.prot.xls]
  UNION ALL
  SELECT protein31 FROM [412].[Prophet_2014_Sept_08_BeringSea31.prot.xls]
  UNION ALL
  SELECT protein32 FROM [412].[Prophet_2014_Sept_08_BeringSea32.prot.xls]
  UNION ALL
  SELECT protein33 FROM [412].[Prophet_2014_Sept_08_BeringSea33.prot.xls]
  UNION ALL
  SELECT protein34 FROM [412].[Prophet_2014_Sept_08_BeringSea34.prot.xls]
  UNION ALL
  SELECT protein35 FROM [412].[Prophet_2014_Sept_08_BeringSea35.prot.xls]
  UNION ALL
  SELECT protein36 FROM [412].[Prophet_2014_Sept_08_BeringSea36.prot.xls]
  UNION ALL
  SELECT protein37 FROM [412].[Prophet_2014_Sept_08_BeringSea37.prot.xls]
  UNION ALL
  SELECT protein38 FROM [412].[Prophet_2014_Sept_08_BeringSea38.prot.xls]
  UNION ALL
  SELECT protein39 FROM [412].[Prophet_2014_Sept_08_BeringSea39.prot.xls]
  UNION ALL
  SELECT protein42 FROM [412].[Prophet_2014_Sept_08_BeringSea42.prot.xls]
  UNION ALL
  SELECT protein43 FROM [412].[Prophet_2014_Sept_08_BeringSea43.prot.xls]
  UNION ALL
  SELECT protein44 FROM [412].[Prophet_2014_Sept_08_BeringSea44.prot.xls]
  UNION ALL
  SELECT protein45 FROM [412].[Prophet_2014_Sept_08_BeringSea45.prot.xls]
  UNION ALL
  SELECT protein46 FROM [412].[Prophet_2014_Sept_08_BeringSea46.prot.xls]
  UNION ALL
  SELECT protein47 FROM [412].[Prophet_2014_Sept_08_BeringSea47.prot.xls]
  UNION ALL
  SELECT protein48 FROM [412].[Prophet_2014_Sept_08_BeringSea48.prot.xls]
  UNION ALL
  SELECT protein49 FROM [412].[Prophet_2014_Sept_08_BeringSea49.prot.xls]
  UNION ALL
  SELECT protein50 FROM [412].[Prophet_2014_Sept_08_BeringSea50.prot.xls]
  UNION ALL
  SELECT protein51 FROM [412].[Prophet_2014_Sept_08_BeringSea51.prot.xls]
  UNION ALL
  SELECT protein54 FROM [412].[Prophet_2014_Sept_08_BeringSea54.prot.xls]
  UNION ALL
  SELECT protein55 FROM [412].[Prophet_2014_Sept_08_BeringSea55.prot.xls]
  UNION ALL
  SELECT protein56 FROM [412].[Prophet_2014_Sept_08_BeringSea56.prot.xls]
  UNION ALL
  SELECT protein57 FROM [412].[Prophet_2014_Sept_08_BeringSea57.prot.xls]
  UNION ALL
  SELECT protein58 FROM [412].[Prophet_2014_Sept_08_BeringSea58.prot.xls]
  UNION ALL
  SELECT protein59 FROM [412].[Prophet_2014_Sept_08_BeringSea59.prot.xls]
  UNION ALL
  SELECT protein62 FROM [412].[Prophet_2014_Sept_08_BeringSea62.prot.xls]
  UNION ALL
  SELECT protein63 FROM [412].[Prophet_2014_Sept_08_BeringSea63.prot.xls]
  UNION ALL
  SELECT protein64 FROM [412].[Prophet_2014_Sept_08_BeringSea64.prot.xls]
  UNION ALL
  SELECT protein65 FROM [412].[Prophet_2014_Sept_08_BeringSea65.prot.xls]
  UNION ALL
  SELECT protein66 FROM [412].[Prophet_2014_Sept_08_BeringSea66.prot.xls]
  UNION ALL
  SELECT protein67 FROM [412].[Prophet_2014_Sept_08_BeringSea67.prot.xls]



________________________________________


SELECT DISTINCT Protein FROM [412].[Metaproteome detected proteins]


________________________________________


SELECT * FROM [412].[Distinct 1341proteome detected proteins]
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea08.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea08.prot.xls].protein08
LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea10.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea10.prot.xls].protein10
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea12.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea12.prot.xls].protein12
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea14.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea14.prot.xls].protein14
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea16.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea16.prot.xls].protein16
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea17.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea17.prot.xls].protein17
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea19.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea19.prot.xls].protein19
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea20.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea20.prot.xls].protein20
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea22.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea22.prot.xls].protein22
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea23.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea23.prot.xls].protein23
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea25.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea25.prot.xls].protein25
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea26.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea26.prot.xls].protein26
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea28.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea28.prot.xls].protein28
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea29.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea29.prot.xls].protein29
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea30.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea30.prot.xls].protein30
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea31.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea31.prot.xls].protein31
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea32.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea32.prot.xls].protein32
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea33.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea33.prot.xls].protein33
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea34.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea34.prot.xls].protein34
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea35.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea35.prot.xls].protein35
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea36.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea36.prot.xls].protein36
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea37.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea37.prot.xls].protein37
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea38.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea38.prot.xls].protein38
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea39.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea39.prot.xls].protein39
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea42.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea42.prot.xls].protein42
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea43.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea43.prot.xls].protein43
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea44.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea44.prot.xls].protein44
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea45.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea45.prot.xls].protein45
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea46.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea46.prot.xls].protein46
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea47.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea47.prot.xls].protein47
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea48.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea48.prot.xls].protein48
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea49.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea49.prot.xls].protein49
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea50.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea50.prot.xls].protein50
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea51.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea51.prot.xls].protein51
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea54.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea54.prot.xls].protein54
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea55.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea55.prot.xls].protein55
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea56.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea56.prot.xls].protein56
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea57.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea57.prot.xls].protein57
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea58.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea58.prot.xls].protein58
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea59.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea59.prot.xls].protein59
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea62.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea62.prot.xls].protein62
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea63.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea63.prot.xls].protein63
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea64.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea64.prot.xls].protein64
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea65.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea65.prot.xls].protein65
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea66.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea66.prot.xls].protein66
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea67.prot.xls]
ON [412].[Distinct 1341proteome detected proteins].Protein=[412].[Prophet_2014_Sept_08_BeringSea67.prot.xls].protein67



________________________________________


SELECT 
  protein AS [protein 3],
  [protein probability] AS [probability 3],
  [percent coverage] AS [coverage 3],
  [tot indep spectra] AS [tot indep spectra 3]
  FROM [412].[table_interact-2015_May_26_Geoduck_09.prot.xls]


________________________________________


SELECT 
  protein AS [protein 34],
  [protein probability] AS [probability 34],
  [percent coverage] AS [coverage 34],
  [tot indep spectra] AS [tot indep spectra 34]
  FROM [412].[table_interact-2015_May_26_Geoduck_13.prot.xls]


________________________________________


SELECT 
  protein AS [protein 51],
  [protein probability] AS [probability 51],
  [percent coverage] AS [coverage 51],
  [tot indep spectra] AS [tot indep spectra 51]
  FROM [412].[table_interact-2015_May_26_Geoduck_17.prot.xls]


________________________________________


SELECT 
  protein AS [protein 2],
  [protein probability] AS [probability 2],
  [percent coverage] AS [coverage 2],
  [tot indep spectra] AS [tot indep spectra 2]
  FROM [412].[table_interact-2015_May_26_Geoduck_23.prot.xls]


________________________________________


SELECT 
  protein AS [protein 41],
  [protein probability] AS [probability 41],
  [percent coverage] AS [coverage 41],
  [tot indep spectra] AS [tot indep spectra 41]
  FROM [412].[table_interact-2015_May_26_Geoduck_27.prot.xls]


________________________________________


SELECT 
  protein AS [protein 65],
  [protein probability] AS [probability 65],
  [percent coverage] AS [coverage 65],
  [tot indep spectra] AS [tot indep spectra 65]
  FROM [412].[table_interact-2015_May_26_Geoduck_31.prot.xls]


________________________________________


SELECT * FROM [412].[TJGR_Gene_SPID_evalue_Description.txt]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_09.prot.xls]
  ON [412].[TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]=[412].[interact-2015_May_26_Geoduck_09.prot.xls].[protein 3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_13.prot.xls]
  ON [412].[TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]=[412].[interact-2015_May_26_Geoduck_13.prot.xls].[protein 34]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_17.prot.xls]
  ON [412].[TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]=[412].[interact-2015_May_26_Geoduck_17.prot.xls].[protein 51]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_23.prot.xls]
  ON [412].[TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]=[412].[interact-2015_May_26_Geoduck_23.prot.xls].[protein 2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_27.prot.xls]
  ON [412].[TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]=[412].[interact-2015_May_26_Geoduck_27.prot.xls].[protein 41]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_31.prot.xls]
  ON [412].[TJGR_Gene_SPID_evalue_Description.txt].[CGI Protein]=[412].[interact-2015_May_26_Geoduck_31.prot.xls].[protein 65]
  
  
  
  


________________________________________


SELECT [protein] AS [protein08],
  [protein probability] AS [protein probability08],
  [percent coverage] AS [percent coverage08],
  [tot indep spectra] AS [tot indep spectra08],
  [peptides] AS [peptides08]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea08.prot.xls]
  WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein10],
  [protein probability] AS [protein probability10],
  [percent coverage] AS [percent coverage10],
  [tot indep spectra] AS [tot indep spectra10],
  [peptides] AS [peptides10]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea10.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein12],
  [protein probability] AS [protein probability12],
  [percent coverage] AS [percent coverage12],
  [tot indep spectra] AS [tot indep spectra12],
  [peptides] AS [peptides12]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea12.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein14],
  [protein probability] AS [protein probability14],
  [percent coverage] AS [percent coverage14],
  [tot indep spectra] AS [tot indep spectra14],
  [peptides] AS [peptides14]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea14.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein16],
  [protein probability] AS [protein probability16],
  [percent coverage] AS [percent coverage16],
  [tot indep spectra] AS [tot indep spectra16],
  [peptides] AS [peptides16]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea16.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein17],
  [protein probability] AS [protein probability17],
  [percent coverage] AS [percent coverage17],
  [tot indep spectra] AS [tot indep spectra17],
  [peptides] AS [peptides17]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea17.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein19],
  [protein probability] AS [protein probability19],
  [percent coverage] AS [percent coverage19],
  [tot indep spectra] AS [tot indep spectra19],
  [peptides] AS [peptides19]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea19.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein20],
  [protein probability] AS [protein probability20],
  [percent coverage] AS [percent coverage20],
  [tot indep spectra] AS [tot indep spectra20],
  [peptides] AS [peptides20]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea20.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein22],
  [protein probability] AS [protein probability22],
  [percent coverage] AS [percent coverage22],
  [tot indep spectra] AS [tot indep spectra22],
  [peptides] AS [peptides22]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea22.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein23],
  [protein probability] AS [protein probability23],
  [percent coverage] AS [percent coverage23],
  [tot indep spectra] AS [tot indep spectra23],
  [peptides] AS [peptides23]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea23.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein25],
  [protein probability] AS [protein probability25],
  [percent coverage] AS [percent coverage25],
  [tot indep spectra] AS [tot indep spectra25],
  [peptides] AS [peptides25]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea25.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein26],
  [protein probability] AS [protein probability26],
  [percent coverage] AS [percent coverage26],
  [tot indep spectra] AS [tot indep spectra26],
  [peptides] AS [peptides26]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea26.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein28],
  [protein probability] AS [protein probability28],
  [percent coverage] AS [percent coverage28],
  [tot indep spectra] AS [tot indep spectra28],
  [peptides] AS [peptides28]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea28.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein29],
  [protein probability] AS [protein probability29],
  [percent coverage] AS [percent coverage29],
  [tot indep spectra] AS [tot indep spectra29],
  [peptides] AS [peptides29]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea29.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein30],
  [protein probability] AS [protein probability30],
  [percent coverage] AS [percent coverage30],
  [tot indep spectra] AS [tot indep spectra30],
  [peptides] AS [peptides30]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea30.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein31],
  [protein probability] AS [protein probability31],
  [percent coverage] AS [percent coverage31],
  [tot indep spectra] AS [tot indep spectra31],
  [peptides] AS [peptides31]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea31.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein32],
  [protein probability] AS [protein probability32],
  [percent coverage] AS [percent coverage32],
  [tot indep spectra] AS [tot indep spectra32],
  [peptides] AS [peptides32]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea32.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein34],
  [protein probability] AS [protein probability34],
  [percent coverage] AS [percent coverage34],
  [tot indep spectra] AS [tot indep spectra34],
  [peptides] AS [peptides34]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea34.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein35],
  [protein probability] AS [protein probability35],
  [percent coverage] AS [percent coverage35],
  [tot indep spectra] AS [tot indep spectra35],
  [peptides] AS [peptides35]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea35.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein36],
  [protein probability] AS [protein probability36],
  [percent coverage] AS [percent coverage36],
  [tot indep spectra] AS [tot indep spectra36],
  [peptides] AS [peptides36]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea36.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein37],
  [protein probability] AS [protein probability37],
  [percent coverage] AS [percent coverage37],
  [tot indep spectra] AS [tot indep spectra37],
  [peptides] AS [peptides37]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea37.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein38],
  [protein probability] AS [protein probability38],
  [percent coverage] AS [percent coverage38],
  [tot indep spectra] AS [tot indep spectra38],
  [peptides] AS [peptides38]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea38.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein39],
  [protein probability] AS [protein probability39],
  [percent coverage] AS [percent coverage39],
  [tot indep spectra] AS [tot indep spectra39],
  [peptides] AS [peptides39]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea39.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein42],
  [protein probability] AS [protein probability42],
  [percent coverage] AS [percent coverage42],
  [tot indep spectra] AS [tot indep spectra42],
  [peptides] AS [peptides42]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea42.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein43],
  [protein probability] AS [protein probability43],
  [percent coverage] AS [percent coverage43],
  [tot indep spectra] AS [tot indep spectra43],
  [peptides] AS [peptides43]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea43.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein44],
  [protein probability] AS [protein probability44],
  [percent coverage] AS [percent coverage44],
  [tot indep spectra] AS [tot indep spectra44],
  [peptides] AS [peptides44]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea44.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein45],
  [protein probability] AS [protein probability45],
  [percent coverage] AS [percent coverage45],
  [tot indep spectra] AS [tot indep spectra45],
  [peptides] AS [peptides45]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea45.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein46],
  [protein probability] AS [protein probability46],
  [percent coverage] AS [percent coverage46],
  [tot indep spectra] AS [tot indep spectra46],
  [peptides] AS [peptides46]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea46.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein47],
  [protein probability] AS [protein probability47],
  [percent coverage] AS [percent coverage47],
  [tot indep spectra] AS [tot indep spectra47],
  [peptides] AS [peptides47]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea47.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein48],
  [protein probability] AS [protein probability48],
  [percent coverage] AS [percent coverage48],
  [tot indep spectra] AS [tot indep spectra48],
  [peptides] AS [peptides48]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea48.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein49],
  [protein probability] AS [protein probability49],
  [percent coverage] AS [percent coverage49],
  [tot indep spectra] AS [tot indep spectra49],
  [peptides] AS [peptides49]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea49.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein50],
  [protein probability] AS [protein probability50],
  [percent coverage] AS [percent coverage50],
  [tot indep spectra] AS [tot indep spectra50],
  [peptides] AS [peptides50]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea50.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein51],
  [protein probability] AS [protein probability51],
  [percent coverage] AS [percent coverage51],
  [tot indep spectra] AS [tot indep spectra51],
  [peptides] AS [peptides51]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea51.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein54],
  [protein probability] AS [protein probability54],
  [percent coverage] AS [percent coverage54],
  [tot indep spectra] AS [tot indep spectra54],
  [peptides] AS [peptides54]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea54.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein55],
  [protein probability] AS [protein probability55],
  [percent coverage] AS [percent coverage55],
  [tot indep spectra] AS [tot indep spectra55],
  [peptides] AS [peptides55]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea55.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein56],
  [protein probability] AS [protein probability56],
  [percent coverage] AS [percent coverage56],
  [tot indep spectra] AS [tot indep spectra56],
  [peptides] AS [peptides56]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea56.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein57],
  [protein probability] AS [protein probability57],
  [percent coverage] AS [percent coverage57],
  [tot indep spectra] AS [tot indep spectra57],
  [peptides] AS [peptides57]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea57.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein58],
  [protein probability] AS [protein probability58],
  [percent coverage] AS [percent coverage58],
  [tot indep spectra] AS [tot indep spectra58],
  [peptides] AS [peptides58]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea58.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein59],
  [protein probability] AS [protein probability59],
  [percent coverage] AS [percent coverage59],
  [tot indep spectra] AS [tot indep spectra59],
  [peptides] AS [peptides59]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea59.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein62],
  [protein probability] AS [protein probability62],
  [percent coverage] AS [percent coverage62],
  [tot indep spectra] AS [tot indep spectra62],
  [peptides] AS [peptides62]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea62.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein63],
  [protein probability] AS [protein probability63],
  [percent coverage] AS [percent coverage63],
  [tot indep spectra] AS [tot indep spectra63],
  [peptides] AS [peptides63]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea63.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein64],
  [protein probability] AS [protein probability64],
  [percent coverage] AS [percent coverage64],
  [tot indep spectra] AS [tot indep spectra64],
  [peptides] AS [peptides64]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea64.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein65],
  [protein probability] AS [protein probability65],
  [percent coverage] AS [percent coverage65],
  [tot indep spectra] AS [tot indep spectra65],
  [peptides] AS [peptides65]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea65.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein66],
  [protein probability] AS [protein probability66],
  [percent coverage] AS [percent coverage66],
  [tot indep spectra] AS [tot indep spectra66],
  [peptides] AS [peptides66]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea66.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein67],
  [protein probability] AS [protein probability67],
  [percent coverage] AS [percent coverage67],
  [tot indep spectra] AS [tot indep spectra67],
  [peptides] AS [peptides67]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea67.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  [protein] AS [protein33],
  [protein probability] AS [protein probability33],
  [percent coverage] AS [percent coverage33],
  [tot indep spectra] AS [tot indep spectra33],
  [peptides] AS [peptides33]
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea33.prot.xls]
    WHERE [tot indep spectra]>1


________________________________________


SELECT 
  probability AS [probability54],
  start_scan AS start_scan54,
  expect AS expect54,
  peptide AS peptide54,
  protein AS protein54
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea54.pep.xls]


________________________________________


SELECT 
  probability AS [probability56],
  start_scan AS start_scan56,
  expect AS expect56,
  peptide AS peptide56,
  protein AS protein56
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea56.pep.xls]


________________________________________


SELECT 
  probability AS [probability58],
  start_scan AS start_scan58,
  expect AS expect58,
  peptide AS peptide58,
  protein AS protein58
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea58.pep.xls]


________________________________________


SELECT 
  probability AS [probability62],
  start_scan AS start_scan62,
  expect AS expect62,
  peptide AS peptide62,
  protein AS protein62
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea62.pep.xls]


________________________________________


SELECT 
  probability AS [probability64],
  start_scan AS start_scan64,
  expect AS expect64,
  peptide AS peptide64,
  protein AS protein64
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea64.pep.xls]


________________________________________


SELECT 
  probability AS [probability66],
  start_scan AS start_scan66,
  expect AS expect66,
  peptide AS peptide66,
  protein AS protein66
  FROM [412].[table_Prophet_2014_Sept_08_BeringSea66.pep.xls]


________________________________________


SELECT peptide54 AS peptide FROM [412].[Prophet_2014_Sept_08_BeringSea54.pep.xls]
  UNION ALL
  SELECT peptide56 FROM [412].[Prophet_2014_Sept_08_BeringSea56.pep.xls]
  UNION ALL
  SELECT peptide58 FROM [412].[Prophet_2014_Sept_08_BeringSea58.pep.xls]
  UNION ALL
  SELECT peptide62 FROM [412].[Prophet_2014_Sept_08_BeringSea62.pep.xls]
  UNION ALL
  SELECT peptide64 FROM [412].[Prophet_2014_Sept_08_BeringSea64.pep.xls]
  UNION ALL
  SELECT peptide66 FROM [412].[Prophet_2014_Sept_08_BeringSea66.pep.xls]




________________________________________


SELECT DISTINCT peptide FROM [412].[redundant 1341genome peptide list]


________________________________________


SELECT * FROM [412].[distinct 1341genome peptides]
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea54.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea54.pep.xls].peptide54
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea56.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea56.pep.xls].peptide56
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea58.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea58.pep.xls].peptide58
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea62.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea62.pep.xls].peptide62
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea64.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea64.pep.xls].peptide64
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea66.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea66.pep.xls].peptide66


________________________________________


SELECT 
  probability AS [probability66nr],
  start_scan AS start_scan66nr,
  expect AS expect66nr,
  peptide AS peptide66nr,
  protein AS protein66nr
  FROM [412].[table_interact-2014_Sept_08_BeringSea54.pep.xls]


________________________________________


SELECT 
  probability AS [probability54nr],
  start_scan AS start_scan54nr,
  expect AS expect54nr,
  peptide AS peptide54nr,
  protein AS protein54nr
  FROM [412].[table_interact-2014_Sept_08_BeringSea54.pep.xls]


________________________________________


SELECT 
  probability AS [probability56nr],
  start_scan AS start_scan56nr,
  expect AS expect56nr,
  peptide AS peptide56nr,
  protein AS protein56nr
  FROM [412].[table_interact-2014_Sept_08_BeringSea56.pep.xls]


________________________________________


SELECT 
  probability AS [probability58nr],
  start_scan AS start_scan58nr,
  expect AS expect58nr,
  peptide AS peptide58nr,
  protein AS protein58nr
  FROM [412].[table_interact-2014_Sept_08_BeringSea58.pep.xls]


________________________________________


SELECT 
  probability AS [probability62nr],
  start_scan AS start_scan62nr,
  expect AS expect62nr,
  peptide AS peptide62nr,
  protein AS protein62nr
  FROM [412].[table_interact-2014_Sept_08_BeringSea62.pep.xls]


________________________________________


SELECT 
  probability AS [probability64nr],
  start_scan AS start_scan64nr,
  expect AS expect64nr,
  peptide AS peptide64nr,
  protein AS protein64nr
  FROM [412].[table_interact-2014_Sept_08_BeringSea64.pep.xls]


________________________________________


SELECT 
  probability AS [probability66nr],
  start_scan AS start_scan66nr,
  expect AS expect66nr,
  peptide AS peptide66nr,
  protein AS protein66nr
  FROM [412].[table_interact-2014_Sept_08_BeringSea66.pep.xls]


________________________________________


SELECT peptide54 AS peptide FROM [412].[Prophet_2014_Sept_08_BeringSea54.pep.xls]
  UNION ALL
  SELECT peptide56 FROM [412].[Prophet_2014_Sept_08_BeringSea56.pep.xls]
  UNION ALL
  SELECT peptide58 FROM [412].[Prophet_2014_Sept_08_BeringSea58.pep.xls]
  UNION ALL
  SELECT peptide62 FROM [412].[Prophet_2014_Sept_08_BeringSea62.pep.xls]
  UNION ALL
  SELECT peptide64 FROM [412].[Prophet_2014_Sept_08_BeringSea64.pep.xls]
  UNION ALL
  SELECT peptide66 FROM [412].[Prophet_2014_Sept_08_BeringSea66.pep.xls]
UNION ALL
  SELECT peptide54nr FROM [412].[interact-2014_Sept_08_BeringSea54.pep.xls]
  UNION ALL
  SELECT peptide56nr FROM [412].[interact-2014_Sept_08_BeringSea56.pep.xls]
UNION ALL
  SELECT peptide58nr FROM [412].[interact-2014_Sept_08_BeringSea58.pep.xls]
UNION ALL
  SELECT peptide62nr FROM [412].[interact-2014_Sept_08_BeringSea62.pep.xls]
  UNION ALL
  SELECT peptide64nr FROM [412].[interact-2014_Sept_08_BeringSea64.pep.xls]
  UNION ALL
  SELECT peptide66nr FROM [412].[interact-2014_Sept_08_BeringSea66.pep.xls]


________________________________________


SELECT DISTINCT peptide FROM [412].[redundant 1341genome peptide list]


________________________________________


SELECT * FROM [412].[distinct 1341genome peptides]
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea54.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea54.pep.xls].peptide54
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea56.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea56.pep.xls].peptide56
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea58.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea58.pep.xls].peptide58
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea62.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea62.pep.xls].peptide62
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea64.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea64.pep.xls].peptide64
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea66.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea66.pep.xls].peptide66
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea54.pep.xls]
   ON [412].[distinct 1341genome peptides].peptide=[412].[interact-2014_Sept_08_BeringSea54.pep.xls].peptide54nr
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea56.pep.xls]
   ON [412].[distinct 1341genome peptides].peptide=[412].[interact-2014_Sept_08_BeringSea56.pep.xls].peptide56nr
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea58.pep.xls]
   ON [412].[distinct 1341genome peptides].peptide=[412].[interact-2014_Sept_08_BeringSea58.pep.xls].peptide58nr
   LEFT JOIN [412].[interact-2014_Sept_08_BeringSea62.pep.xls]
   ON [412].[distinct 1341genome peptides].peptide=[412].[interact-2014_Sept_08_BeringSea62.pep.xls].peptide62nr
   LEFT JOIN [412].[interact-2014_Sept_08_BeringSea64.pep.xls]
   ON [412].[distinct 1341genome peptides].peptide=[412].[interact-2014_Sept_08_BeringSea64.pep.xls].peptide64nr
   LEFT JOIN [412].[interact-2014_Sept_08_BeringSea66.pep.xls]
   ON [412].[distinct 1341genome peptides].peptide=[412].[interact-2014_Sept_08_BeringSea66.pep.xls].peptide66nr


________________________________________


SELECT *, 
  CASE WHEN [probability54] is NULL THEN 0 ELSE [probability54] END AS [probability54],
   CASE WHEN [probability56] is NULL THEN 0 ELSE [probability56] END AS [probability56],
   CASE WHEN [probability58] is NULL THEN 0 ELSE [probability58] END AS [probability58],
   CASE WHEN [probability62] is NULL THEN 0 ELSE [probability62] END AS [probability62],
   CASE WHEN [probability64] is NULL THEN 0 ELSE [probability64] END AS [probability64],
   CASE WHEN [probability66] is NULL THEN 0 ELSE [probability66] END AS [probability66],
    CASE WHEN [probability54nr] is NULL THEN 0 ELSE [probability54nr] END AS [probability54nr],
   CASE WHEN [probability56nr] is NULL THEN 0 ELSE [probability56nr] END AS [probability56nr],
   CASE WHEN [probability58nr] is NULL THEN 0 ELSE [probability58nr] END AS [probability58nr],
   CASE WHEN [probability62nr] is NULL THEN 0 ELSE [probability62nr] END AS [probability62nr],
   CASE WHEN [probability64nr] is NULL THEN 0 ELSE [probability64nr] END AS [probability64nr],
   CASE WHEN [probability66nr] is NULL THEN 0 ELSE [probability66nr] END AS [probability66nr]
  FROM [412].[1341proteome peptide files joined by peptide]


________________________________________


SELECT start_scan54,
  expect54,
  peptide54,
  protein54,
  start_scan56,
  expect56,
  peptide56,
  protein56,
  start_scan58,
  expect58,
  peptide58,
  protein58,
  start_scan62,
  expect62,
  peptide62,
  protein62,
  start_scan64,
  expect64,
  peptide64,
  protein64,
  start_scan66,
  expect66,
  peptide66,
  protein66,
  start_scan54nr,
  expect54nr,
  peptide54nr,
  protein54nr,
  start_scan56nr,
  expect56nr,
  peptide56nr,
  protein56nr,
  start_scan58nr,
  expect58nr,
  peptide58nr,
  protein58nr,
  start_scan62nr,
  expect62nr,
  peptide62nr,
  protein62nr,
  start_scan64nr,
  expect64nr,
  peptide64nr,
  protein64nr,
  start_scan66nr,
  expect66nr,
  peptide66nr,
  protein66nr,
  CASE WHEN [probability54] is NULL THEN 0 ELSE [probability54] END AS [probability54],
   CASE WHEN [probability56] is NULL THEN 0 ELSE [probability56] END AS [probability56],
   CASE WHEN [probability58] is NULL THEN 0 ELSE [probability58] END AS [probability58],
   CASE WHEN [probability62] is NULL THEN 0 ELSE [probability62] END AS [probability62],
   CASE WHEN [probability64] is NULL THEN 0 ELSE [probability64] END AS [probability64],
   CASE WHEN [probability66] is NULL THEN 0 ELSE [probability66] END AS [probability66],
    CASE WHEN [probability54nr] is NULL THEN 0 ELSE [probability54nr] END AS [probability54nr],
   CASE WHEN [probability56nr] is NULL THEN 0 ELSE [probability56nr] END AS [probability56nr],
   CASE WHEN [probability58nr] is NULL THEN 0 ELSE [probability58nr] END AS [probability58nr],
   CASE WHEN [probability62nr] is NULL THEN 0 ELSE [probability62nr] END AS [probability62nr],
   CASE WHEN [probability64nr] is NULL THEN 0 ELSE [probability64nr] END AS [probability64nr],
   CASE WHEN [probability66nr] is NULL THEN 0 ELSE [probability66nr] END AS [probability66nr]
  FROM [412].[1341proteome peptide files joined by peptide]


________________________________________


SELECT start_scan54,
  expect54,
  peptide54,
  protein54,
  start_scan56,
  expect56,
  peptide56,
  protein56,
  start_scan58,
  expect58,
  peptide58,
  protein58,
  start_scan62,
  expect62,
  peptide62,
  protein62,
  start_scan64,
  expect64,
  peptide64,
  protein64,
  start_scan66,
  expect66,
  peptide66,
  protein66,
  start_scan54nr,
  expect54nr,
  peptide54nr,
  protein54nr,
  start_scan56nr,
  expect56nr,
  peptide56nr,
  protein56nr,
  start_scan58nr,
  expect58nr,
  peptide58nr,
  protein58nr,
  start_scan62nr,
  expect62nr,
  peptide62nr,
  protein62nr,
  start_scan64nr,
  expect64nr,
  peptide64nr,
  protein64nr,
  start_scan66nr,
  expect66nr,
  peptide66nr,
  protein66nr,
  CASE WHEN [probability54] is NULL THEN 0 ELSE [probability54] END AS [probability54],
   CASE WHEN [probability56] is NULL THEN 0 ELSE [probability56] END AS [probability56],
   CASE WHEN [probability58] is NULL THEN 0 ELSE [probability58] END AS [probability58],
   CASE WHEN [probability62] is NULL THEN 0 ELSE [probability62] END AS [probability62],
   CASE WHEN [probability64] is NULL THEN 0 ELSE [probability64] END AS [probability64],
   CASE WHEN [probability66] is NULL THEN 0 ELSE [probability66] END AS [probability66],
    CASE WHEN [probability54nr] is NULL THEN 0 ELSE [probability54nr] END AS [probability54nr],
   CASE WHEN [probability56nr] is NULL THEN 0 ELSE [probability56nr] END AS [probability56nr],
   CASE WHEN [probability58nr] is NULL THEN 0 ELSE [probability58nr] END AS [probability58nr],
   CASE WHEN [probability62nr] is NULL THEN 0 ELSE [probability62nr] END AS [probability62nr],
   CASE WHEN [probability64nr] is NULL THEN 0 ELSE [probability64nr] END AS [probability64nr],
   CASE WHEN [probability66nr] is NULL THEN 0 ELSE [probability66nr] END AS [probability66nr]
  FROM [412].[1341proteome peptide files joined by peptide]


________________________________________


SELECT * ,
  [probability54]+[probability56]+[probability58]+[probability62]+[probability64]+[probability66]+
  [probability54nr]+[probability56nr]+[probability58nr]+[probability62nr]+[probability64nr]+[probability66nr]
AS [sum probability]
  FROM [412].[pepxml files joined by peptide]


________________________________________


SELECT * FROM [412].[pepxml files joined by peptide with summed probabilities]
  WHERE [sum probability]>0


________________________________________


SELECT DISTINCT [peptide] FROM [412].[1341proteome peptide files joined by peptide]


________________________________________


SELECT DISTINCT peptide FROM [412].[redundant 1341genome peptide list]


________________________________________


SELECT * FROM [412].[distinct 1341genome peptides]
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea54.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea54.pep.xls].peptide54


________________________________________


SELECT * FROM [412].[distinct 1341genome peptides]
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea54.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea54.pep.xls].peptide54
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea56.pep.xls]
  ON [412].[distinct 1341genome peptides].peptide=[412].[Prophet_2014_Sept_08_BeringSea56.pep.xls].peptide56


________________________________________


SELECT start_scan54 AS scan FROM [412].[Prophet_2014_Sept_08_BeringSea54.pep.xls]
  UNION ALL
  SELECT start_scan56 FROM [412].[Prophet_2014_Sept_08_BeringSea56.pep.xls]
  UNION ALL
  SELECT start_scan58 FROM [412].[Prophet_2014_Sept_08_BeringSea58.pep.xls]
  UNION ALL
  SELECT start_scan62 FROM [412].[Prophet_2014_Sept_08_BeringSea62.pep.xls]
  UNION ALL
  SELECT start_scan64 FROM [412].[Prophet_2014_Sept_08_BeringSea64.pep.xls]
  UNION ALL
  SELECT start_scan66 FROM [412].[Prophet_2014_Sept_08_BeringSea66.pep.xls]
UNION ALL
  SELECT start_scan54nr FROM [412].[interact-2014_Sept_08_BeringSea54.pep.xls]
  UNION ALL
  SELECT start_scan56nr FROM [412].[interact-2014_Sept_08_BeringSea56.pep.xls]
UNION ALL
  SELECT start_scan58nr FROM [412].[interact-2014_Sept_08_BeringSea58.pep.xls]
UNION ALL
  SELECT start_scan62nr FROM [412].[interact-2014_Sept_08_BeringSea62.pep.xls]
  UNION ALL
  SELECT start_scan64nr FROM [412].[interact-2014_Sept_08_BeringSea64.pep.xls]
  UNION ALL
  SELECT start_scan66nr FROM [412].[interact-2014_Sept_08_BeringSea66.pep.xls]


________________________________________


SELECT DISTINCT scan FROM [412].[1341proteome redundant list of scan numbers]


________________________________________


SELECT * FROM [412].[1341proteome distinct scan numbers]
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea54.pep.xls]
  ON [412].[1341proteome distinct scan numbers].scan=[412].[Prophet_2014_Sept_08_BeringSea54.pep.xls].start_scan54
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea56.pep.xls]
  ON [412].[1341proteome distinct scan numbers].scan=[412].[Prophet_2014_Sept_08_BeringSea56.pep.xls].start_scan56
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea58.pep.xls]
  ON [412].[1341proteome distinct scan numbers].scan=[412].[Prophet_2014_Sept_08_BeringSea58.pep.xls].start_scan58
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea62.pep.xls]
  ON [412].[1341proteome distinct scan numbers].scan=[412].[Prophet_2014_Sept_08_BeringSea62.pep.xls].start_scan62
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea64.pep.xls]
  ON [412].[1341proteome distinct scan numbers].scan=[412].[Prophet_2014_Sept_08_BeringSea64.pep.xls].start_scan64
  LEFT JOIN [412].[Prophet_2014_Sept_08_BeringSea66.pep.xls]
  ON [412].[1341proteome distinct scan numbers].scan=[412].[Prophet_2014_Sept_08_BeringSea66.pep.xls].start_scan66
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea54.pep.xls]
   ON [412].[1341proteome distinct scan numbers].scan=[412].[interact-2014_Sept_08_BeringSea54.pep.xls].start_scan54nr
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea56.pep.xls]
   ON [412].[1341proteome distinct scan numbers].scan=[412].[interact-2014_Sept_08_BeringSea56.pep.xls].start_scan56nr
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea58.pep.xls]
   ON [412].[1341proteome distinct scan numbers].scan=[412].[interact-2014_Sept_08_BeringSea58.pep.xls].start_scan58nr
   LEFT JOIN [412].[interact-2014_Sept_08_BeringSea62.pep.xls]
   ON [412].[1341proteome distinct scan numbers].scan=[412].[interact-2014_Sept_08_BeringSea62.pep.xls].start_scan62nr
   LEFT JOIN [412].[interact-2014_Sept_08_BeringSea64.pep.xls]
   ON [412].[1341proteome distinct scan numbers].scan=[412].[interact-2014_Sept_08_BeringSea64.pep.xls].start_scan64nr
   LEFT JOIN [412].[interact-2014_Sept_08_BeringSea66.pep.xls]
   ON [412].[1341proteome distinct scan numbers].scan=[412].[interact-2014_Sept_08_BeringSea66.pep.xls].start_scan66nr


________________________________________


SELECT [Protein], [SpC_C1A_15],
  [SpC_C1B_16],
  [SpC_C2_17],
  [SpC_C3_18],
  [SpC_T8A_21],
  [SpC_T10_22],
  [SpC_T11_23],
  [SpC_V13B_28],
  [SpC_V14_29],
  [SpC_V17_30],
  [SpC_VT21_33],
  [SpC_VT22_34],
  [SpC_VT23_35],
  [SpC_C2_41],
  [SpC_C1A_42],
  [SpC_C3_43],
  [SpC_T10_46],
  [SpC_T8A_47],
  [SpC_T11_50],
  [SpC_VT23_53],
  [SpC_VT21_54],
  [SpC_VT22_55],
  [SpC_C1A_15]+[SpC_C1B_16]+[SpC_C2_17]+[SpC_C3_18]+[SpC_T8A_21]+[SpC_T10_22]+[SpC_T11_23]+[SpC_V13B_28]+[SpC_V14_29]+[SpC_V17_30]+[SpC_VT21_33]+[SpC_VT22_34]+[SpC_VT23_35]+[SpC_C2_41]+[SpC_C1A_42]+[SpC_C3_43]+[SpC_T10_46]+[SpC_T8A_47]+[SpC_T11_50]+[SpC_VT23_53]+[SpC_VT21_54]+[SpC_VT22_55] AS [Sum SpC]
  FROM [412].[Macoma_all_replicates.csv]


________________________________________


SELECT * FROM [412].[Sum all Macoma SpC]
  WHERE [Sum SpC]>3


________________________________________


SELECT Column1 AS Protein,
  Column2 AS Length
  FROM [412].[table_AGS1714_translated_sequence_length.tabular]


________________________________________


SELECT * FROM [412].[Macoma SpC > 3]
  LEFT JOIN [412].[AGS1714_translated_sequence_length.tabular]
  ON [412].[Macoma SpC > 3].Protein=[412].[AGS1714_translated_sequence_length.tabular].Protein


________________________________________


SELECT * FROM [412].[Macoma SpC > 3]
  LEFT JOIN [412].[AGS1714_translated_sequence_length.tabular]
  ON [412].[Macoma SpC > 3].Protein=[412].[AGS1714_translated_sequence_length.tabular].Protein


________________________________________


SELECT [Protein], [SpC_C1A_15],
  [SpC_C1B_16],
  [SpC_C2_17],
  [SpC_C3_18],
  [SpC_T8A_21],
  [SpC_T10_22],
  [SpC_T11_23],
  [SpC_V13B_28],
  [SpC_V14_29],
  [SpC_V17_30],
  [SpC_VT21_33],
  [SpC_VT22_34],
  [SpC_VT23_35],
  [SpC_C2_41],
  [SpC_C1A_42],
  [SpC_C3_43],
  [SpC_T10_46],
  [SpC_T8A_47],
  [SpC_T11_50],
  [SpC_VT23_53],
  [SpC_VT21_54],
  [SpC_VT22_55],
  CAST([SpC_C1A_15] AS FLOAT)/[Length] AS [C1A_15 SpC/L],
  CAST([SpC_C1B_16] AS FLOAT)/[Length] AS [C1B_16 SpC/L],
  CAST([SpC_C2_17] AS FLOAT)/[Length] AS [C2_17 SpC/L],
  CAST([SpC_C3_18] AS FLOAT)/[Length] AS [C3_18 SpC/L],
  CAST([SpC_T8A_21] AS FLOAT)/[Length] AS [T8A_21 SpC/L],
  CAST([SpC_T10_22] AS FLOAT)/[Length] AS [T10_22 SpC/L],
  CAST([SpC_T11_23] AS FLOAT)/[Length] AS [T11_23 SpC/L],
  CAST([SpC_V13B_28] AS FLOAT)/[Length] AS [V13B_28 SpC/L],
  CAST([SpC_V14_29] AS FLOAT)/[Length] AS [V14_29 SpC/L],
  CAST([SpC_V17_30] AS FLOAT)/[Length] AS [V17_30 SpC/L],
  CAST([SpC_VT21_33] AS FLOAT)/[Length] AS [VT21_33 SpC/L],
  CAST([SpC_VT22_34] AS FLOAT)/[Length] AS [VT22_34 SpC/L],
  CAST([SpC_VT23_35] AS FLOAT)/[Length] AS [VT23_35 SpC/L],
  CAST([SpC_C2_41] AS FLOAT)/[Length] AS [C2_41 SpC/L],
  CAST([SpC_C1A_42] AS FLOAT)/[Length] AS [C1A_42 SpC/L],
  CAST([SpC_C3_43] AS FLOAT)/[Length] AS [C3_43 SpC/L],
  CAST([SpC_T10_46] AS FLOAT)/[Length] AS [T10_46 SpC/L],
  CAST([SpC_T8A_47] AS FLOAT)/[Length] AS [T8A_47 SpC/L],
  CAST([SpC_T11_50] AS FLOAT)/[Length] AS [T11_50 SpC/L],
  CAST([SpC_VT23_53] AS FLOAT)/[Length] AS [VT23_53 SpC/L],
  CAST([SpC_VT21_54] AS FLOAT)/[Length] AS [VT21_54 SpC/L],
  CAST([SpC_VT22_55] AS FLOAT)/[Length] AS [VT22_55 SpC/L]
  FROM [412].[Macoma SpC with sequence length]


________________________________________


SELECT 
  SUM([C1A_15 SpC/L]) AS [SUM C1A_15 SpC/L],
  SUM([C1B_16 SpC/L]) AS [SUM C1B_16 SpC/L],
  SUM([C2_17 SpC/L]) AS [SUM C2_17 SpC/L],
  SUM([C3_18 SpC/L]) AS [SUM C3_18 SpC/L],
  SUM([T8A_21 SpC/L]) AS [SUM T8A_21 SpC/L],
  SUM([T10_22 SpC/L]) AS [SUM T10_22 SpC/L],
  SUM([T11_23 SpC/L]) AS [SUM T11_23 SpC/L],
  SUM([V13B_28 SpC/L]) AS [SUM V13B_28 SpC/L],
  SUM([V14_29 SpC/L]) AS [SUM V14_29 SpC/L],
  SUM([V17_30 SpC/L]) AS [SUM V17_30 SpC/L],
  SUM([VT21_33 SpC/L]) AS [SUM VT21_33 SpC/L],
  SUM([VT22_34 SpC/L]) AS [SUM VT22_34 SpC/L],
  SUM([VT23_35 SpC/L]) AS [SUM VT23_35 SpC/L],
  SUM([C2_41 SpC/L]) AS [SUM C2_41 SpC/L],
  SUM([C1A_42 SpC/L]) AS [SUM C1A_42 SpC/L],
  SUM([C3_43 SpC/L]) AS [SUM C3_43 SpC/L],
  SUM([T10_46 SpC/L]) AS [SUM T10_46 SpC/L],
  SUM([T8A_47 SpC/L]) AS [SUM T8A_47 SpC/L],
  SUM([T11_50 SpC/L]) AS [SUM T11_50 SpC/L],
  SUM([VT23_53 SpC/L]) AS [SUM VT23_53 SpC/L],
  SUM([VT21_54 SpC/L]) AS [SUM VT21_54 SpC/L],
  SUM([VT22_55 SpC/L]) AS [SUM VT22_55 SpC/L]
  FROM [412].[Macoma individual SpC-L]


________________________________________


SELECT Protein,
 spc.[C1A_15 SpC/L]/allspc.[SUM C1A_15 SpC/L] AS [NSAF C1A_15],
  spc.[C1B_16 SpC/L]/allspc.[SUM C1B_16 SpC/L] AS [NSAF C1B_16],
  spc.[C2_17 SpC/L]/allspc.[SUM C2_17 SpC/L] AS [NSAF C2_17],
  spc.[C3_18 SpC/L]/allspc.[SUM C3_18 SpC/L] AS [NSAF C3_18],
  spc.[T8A_21 SpC/L]/allspc.[SUM T8A_21 SpC/L] AS [NSAF T8A_21],
   spc.[T10_22 SpC/L]/allspc.[SUM T10_22 SpC/L] AS [NSAF T10_22],
  spc.[T11_23 SpC/L]/allspc.[SUM T11_23 SpC/L] AS [NSAF T11_23],
  spc.[V13B_28 SpC/L]/allspc.[SUM V13B_28 SpC/L] AS [NSAF V13B_28],
  spc.[V14_29 SpC/L]/allspc.[SUM V14_29 SpC/L] AS [NSAF V14_29],
  spc.[V17_30 SpC/L]/allspc.[SUM V17_30 SpC/L] AS [NSAF V17_30],
  spc.[VT21_33 SpC/L]/allspc.[SUM VT21_33 SpC/L] AS [NSAF VT21_33],
  spc.[VT22_34 SpC/L]/allspc.[SUM VT22_34 SpC/L] AS [NSAF VT22_34],
  spc.[VT23_35 SpC/L]/allspc.[SUM VT23_35 SpC/L] AS [NSAF VT23_35],
spc.[C2_41 SpC/L]/allspc.[SUM C2_41 SpC/L] AS [NSAF C2_41],
  spc.[C1A_42 SpC/L]/allspc.[SUM C1A_42 SpC/L] AS [NSAF C1A_42],
  spc.[C3_43 SpC/L]/allspc.[SUM C3_43 SpC/L] AS [NSAF C3_43],
  spc.[T10_46 SpC/L]/allspc.[SUM T10_46 SpC/L] AS [NSAF T10_46],
  spc.[T8A_47 SpC/L]/allspc.[SUM T8A_47 SpC/L] AS [NSAF T8A_47],
  spc.[T11_50 SpC/L]/allspc.[SUM T11_50 SpC/L] AS [NSAF T11_50],
  spc.[VT23_53 SpC/L]/allspc.[SUM VT23_53 SpC/L] AS [NSAF VT23_53],
  spc.[VT21_54 SpC/L]/allspc.[SUM VT21_54 SpC/L] AS [NSAF VT21_54],
  spc.[VT22_55 SpC/L]/allspc.[SUM VT22_55 SpC/L] AS [NSAF VT22_55]
  FROM [412].[Macoma individual SpC-L] spc, [412].[Macoma individual sum spc-l] allspc


________________________________________


SELECT Protein, Length
  FROM [412].[Macoma SpC with sequence length]




________________________________________


SELECT Protein, Length,
  [SpC_C1A_15]
  FROM [412].[Macoma SpC with sequence length]




________________________________________


SELECT Protein, Length,
  ([SpC_C1A_15]+[SpC_C1A_42]) AS [C1A]
  FROM [412].[Macoma SpC with sequence length]




________________________________________


SELECT Protein, Length,
  ([SpC_C1A_15]+[SpC_C1A_42])/2 AS [C1A]
  FROM [412].[Macoma SpC with sequence length]




________________________________________


SELECT Protein, Length,
  ([SpC_C1A_15]+[SpC_C1A_42]) AS [C1A]
  FROM [412].[Macoma SpC with sequence length]




________________________________________


SELECT Protein, Length,
  ([SpC_C1A_15]+[SpC_C1A_42]) AS [C1A]
  
  FROM [412].[Macoma SpC with sequence length]




________________________________________


SELECT Protein, Length,
  ([SpC_C1A_15]+[SpC_C1A_42]) AS [C1A],
  SpC_C1B_16 AS C1B,
  ([SpC_C2_17]+[SpC_C2_41]) AS [C2],
  ([SpC_C3_18]+[SpC_C3_43]) AS [C3],
  ([SpC_T10_22]+[SpC_T10_46]) AS [T10],
  ([SpC_T11_23]+[SpC_T11_50]) AS [T11],
  ([SpC_T8A_21]+[SpC_T8A_47]) AS [T8A],
  [SpC_V13B_28] AS [V13B],
  [SpC_V14_29] AS [V14],
  [SpC_V17_30] AS [V17],
  ([SpC_VT21_33]+[SpC_VT21_54]) AS [VT21],
  ([SpC_VT22_34]+[SpC_VT22_55]) AS [VT22],
  ([SpC_VT23_35]+[SpC_VT23_53]) AS [VT23]
  FROM [412].[Macoma SpC with sequence length]




________________________________________


SELECT Protein, Length,
  CAST([C1A] AS FLOAT)/2 AS [Avg C1A]
  FROM [412].[Sum Macoma SpC]


________________________________________


SELECT Protein, Length,
  CAST([C1A] AS FLOAT)/2 AS [Avg C1A],
  [C1B],
  CAST([C2] AS FLOAT)/2 AS [Avg C2],
  CAST([C3] AS FLOAT)/2 AS [Avg C3],
  CAST([T10] AS FLOAT)/2 AS [Avg T10],
  CAST([T11] AS FLOAT)/2 AS [Avg T11],
  CAST([T8A] AS FLOAT)/2 AS [Avg T8A],
  V13B, V14, V17,
  CAST([VT21] AS FLOAT)/2 AS [Avg VT21],
  CAST([VT22] AS FLOAT)/2 AS [Avg VT22],
  CAST([VT23] AS FLOAT)/2 AS [Avg VT23]
  FROM [412].[Sum Macoma SpC]


________________________________________


SELECT Protein, Length, [Avg C1A],
  [C1B],
  [Avg C2],
  [Avg C3],
  [Avg T10],
  [Avg T11],
  [Avg T8A],
  [V13B],
  [V14],
  [V17],
  [Avg VT21],
  [Avg VT22],
  [Avg VT23],
  CAST([Avg C1A] AS FLOAT)/[Length] AS [C1A SpC/L],
  CAST([C1B] AS FLOAT)/[Length] AS [C1B SpC/L],
  CAST([Avg C2] AS FLOAT)/[Length] AS [C2 SpC/L],
  CAST([Avg C3] AS FLOAT)/[Length] AS [C3 SpC/L],
  CAST([Avg T10] AS FLOAT)/[Length] AS [T10 SpC/L],
  CAST([Avg T11] AS FLOAT)/[Length] AS [T11 SpC/L],
  CAST([Avg T8A] AS FLOAT)/[Length] AS [T8A SpC/L],
  CAST([V13B] AS FLOAT)/[Length] AS [V13B SpC/L],
  CAST([V14] AS FLOAT)/[Length] AS [V14 SpC/L],
  CAST([V17] AS FLOAT)/[Length] AS [V17 SpC/L],
  CAST([Avg VT21] AS FLOAT)/[Length] AS [VT21 SpC/L],
  CAST([Avg VT22] AS FLOAT)/[Length] AS [VT22 SpC/L],
  CAST([Avg VT23] AS FLOAT)/[Length] AS [VT23 SpC/L]
  FROM [412].[Macoma average SpC]


________________________________________


SELECT 
  SUM([C1A SpC/L]) AS [SUM C1A SpC/L],
  SUM([C1B SpC/L]) AS [SUM C1B SpC/L],
  SUM([C2 SpC/L]) AS [SUM C2 SpC/L],
  SUM([C3 SpC/L]) AS [SUM C3 SpC/L],
  SUM([T10 SpC/L]) AS [SUM T10 SpC/L],
  SUM([T11 SpC/L]) AS [SUM T11 SpC/L],
  SUM([T8A SpC/L]) AS [SUM T8A SpC/L],
  SUM([V13B SpC/L]) AS [SUM V13B SpC/L],
  SUM([V14 SpC/L]) AS [SUM V14 SpC/L],
  SUM([V17 SpC/L]) AS [SUM V17 SpC/L],
  SUM([VT21 SpC/L]) AS [SUM VT21 SpC/L],
  SUM([VT22 SpC/L]) AS [SUM VT22 SpC/L],
  SUM([VT23 SpC/L]) AS [SUM VT23 SpC/L]
  FROM [412].[Macoma combined SpC-L]


________________________________________


SELECT 
   spc.[C1A SpC/L]/allspc.[SUM C1A SpC/L] AS [NSAF C1A],
  spc.[C1B SpC/L]/allspc.[SUM C1B SpC/L] AS [NSAF C1B],
  spc.[C2 SpC/L]/allspc.[SUM C2 SpC/L] AS [NSAF C2],
  spc.[C3 SpC/L]/allspc.[SUM C3 SpC/L] AS [NSAF C3],
  spc.[T10 SpC/L]/allspc.[SUM T10 SpC/L] AS [NSAF T10],
  spc.[T11 SpC/L]/allspc.[SUM T11 SpC/L] AS [NSAF T11],
  spc.[T8A SpC/L]/allspc.[SUM T8A SpC/L] AS [NSAF T8A],
  spc.[V13B SpC/L]/allspc.[SUM V13B SpC/L] AS [NSAF V13B],
  spc.[V14 SpC/L]/allspc.[SUM V14 SpC/L] AS [NSAF V14],
  spc.[VT21 SpC/L]/allspc.[SUM VT21 SpC/L] AS [NSAF VT21],
  spc.[VT22 SpC/L]/allspc.[SUM VT22 SpC/L] AS [NSAF VT22],
  spc.[VT23 SpC/L]/allspc.[SUM VT23 SpC/L] AS [NSAF VT23]
  FROM [412].[Macoma combined SpC-L] spc, [412].[Macoma combined sum SpC-L] allspc


________________________________________


SELECT [Protein],
   spc.[C1A SpC/L]/allspc.[SUM C1A SpC/L] AS [NSAF C1A],
  spc.[C1B SpC/L]/allspc.[SUM C1B SpC/L] AS [NSAF C1B],
  spc.[C2 SpC/L]/allspc.[SUM C2 SpC/L] AS [NSAF C2],
  spc.[C3 SpC/L]/allspc.[SUM C3 SpC/L] AS [NSAF C3],
  spc.[T10 SpC/L]/allspc.[SUM T10 SpC/L] AS [NSAF T10],
  spc.[T11 SpC/L]/allspc.[SUM T11 SpC/L] AS [NSAF T11],
  spc.[T8A SpC/L]/allspc.[SUM T8A SpC/L] AS [NSAF T8A],
  spc.[V13B SpC/L]/allspc.[SUM V13B SpC/L] AS [NSAF V13B],
  spc.[V14 SpC/L]/allspc.[SUM V14 SpC/L] AS [NSAF V14],
  spc.[VT21 SpC/L]/allspc.[SUM VT21 SpC/L] AS [NSAF VT21],
  spc.[VT22 SpC/L]/allspc.[SUM VT22 SpC/L] AS [NSAF VT22],
  spc.[VT23 SpC/L]/allspc.[SUM VT23 SpC/L] AS [NSAF VT23]
  FROM [412].[Macoma combined SpC-L] spc, [412].[Macoma combined sum SpC-L] allspc


________________________________________


SELECT [Protein],
   spc.[C1A SpC/L]/allspc.[SUM C1A SpC/L] AS [NSAF C1A],
  spc.[C1B SpC/L]/allspc.[SUM C1B SpC/L] AS [NSAF C1B],
  spc.[C2 SpC/L]/allspc.[SUM C2 SpC/L] AS [NSAF C2],
  spc.[C3 SpC/L]/allspc.[SUM C3 SpC/L] AS [NSAF C3],
  spc.[T10 SpC/L]/allspc.[SUM T10 SpC/L] AS [NSAF T10],
  spc.[T11 SpC/L]/allspc.[SUM T11 SpC/L] AS [NSAF T11],
  spc.[T8A SpC/L]/allspc.[SUM T8A SpC/L] AS [NSAF T8A],
  spc.[V13B SpC/L]/allspc.[SUM V13B SpC/L] AS [NSAF V13B],
  spc.[V14 SpC/L]/allspc.[SUM V14 SpC/L] AS [NSAF V14],
  spc.[V17 SpC/L]/allspc.[SUM V17 SpC/L] AS [NSAF V17],
  spc.[VT21 SpC/L]/allspc.[SUM VT21 SpC/L] AS [NSAF VT21],
  spc.[VT22 SpC/L]/allspc.[SUM VT22 SpC/L] AS [NSAF VT22],
  spc.[VT23 SpC/L]/allspc.[SUM VT23 SpC/L] AS [NSAF VT23]
  FROM [412].[Macoma combined SpC-L] spc, [412].[Macoma combined sum SpC-L] allspc


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  WHERE [evalue]<2E-10


________________________________________


SELECT [entry no.] as [N2 entry no.],
  [protein] AS [N2 protein],
  [protein probability] AS [N2 protein probability],
  [protein description] AS [N2 protein description],
  [percent coverage] AS [N2 percent coverage],
  [tot indep spectra] AS [N2 tot indep spectra],
  [percent share of spectrum IDs] AS [N2 percent share of spectrum IDs],
  [peptides] as [N2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection22.prot.xls]


________________________________________


SELECT [entry no.] as [N3 entry no.],
  [protein] AS [N3 protein],
  [protein probability] AS [N3 protein probability],
  [protein description] AS [N3 protein description],
  [percent coverage] AS [N3 percent coverage],
  [tot indep spectra] AS [N3 tot indep spectra],
  [percent share of spectrum IDs] AS [N3 percent share of spectrum IDs],
  [peptides] as [N3 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection25.prot.xls]


________________________________________


SELECT [entry no.] as [M1 entry no.],
  [protein] AS [A2 protein],
  [protein probability] AS [M1 protein probability],
  [protein description] AS [M1 protein description],
  [percent coverage] AS [M1 percent coverage],
  [tot indep spectra] AS [M1 tot indep spectra],
  [percent share of spectrum IDs] AS [M1 percent share of spectrum IDs],
  [peptides] as [M1 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection26.prot.xls]


________________________________________


SELECT [entry no.] as [M2 entry no.],
  [protein] AS [M2 protein],
  [protein probability] AS [M2 protein probability],
  [protein description] AS [M2 protein description],
  [percent coverage] AS [M2 percent coverage],
  [tot indep spectra] AS [M2 tot indep spectra],
  [percent share of spectrum IDs] AS [M2 percent share of spectrum IDs],
  [peptides] as [M2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection27.prot.xls]


________________________________________


SELECT [entry no.] as [M3 entry no.],
  [protein] AS [M3 protein],
  [protein probability] AS [M3 protein probability],
  [protein description] AS [M3 protein description],
  [percent coverage] AS [M3 percent coverage],
  [tot indep spectra] AS [M3 tot indep spectra],
  [percent share of spectrum IDs] AS [M3 percent share of spectrum IDs],
  [peptides] as [M3 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection28.prot.xls]


________________________________________


SELECT [entry no.] as [N1 entry no.],
  [protein] AS [N1 protein],
  [protein probability] AS [N1 protein probability],
  [protein description] AS [N1 protein description],
  [percent coverage] AS [N1 percent coverage],
  [tot indep spectra] AS [N1 tot indep spectra],
  [percent share of spectrum IDs] AS [N1 percent share of spectrum IDs],
  [peptides] as [N1 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection30.prot_1.xls]


________________________________________


SELECT [entry no.] as [L1 entry no.],
  [protein] AS [L1 protein],
  [protein probability] AS [L1 protein probability],
  [protein description] AS [L1 protein description],
  [percent coverage] AS [L1 percent coverage],
  [tot indep spectra] AS [L1 tot indep spectra],
  [percent share of spectrum IDs] AS [L1 percent share of spectrum IDs],
  [peptides] as [L1 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection32.prot_1.xls]


________________________________________


SELECT [entry no.] as [L2 entry no.],
  [protein] AS [L2 protein],
  [protein probability] AS [L2 protein probability],
  [protein description] AS [L2 protein description],
  [percent coverage] AS [L2 percent coverage],
  [tot indep spectra] AS [L2 tot indep spectra],
  [percent share of spectrum IDs] AS [L2 percent share of spectrum IDs],
  [peptides] as [L2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection33.prot.xls]


________________________________________


SELECT [entry no.] as [L3 entry no.],
  [protein] AS [L3 protein],
  [protein probability] AS [L3 protein probability],
  [protein description] AS [L3 protein description],
  [percent coverage] AS [L3 percent coverage],
  [tot indep spectra] AS [L3 tot indep spectra],
  [percent share of spectrum IDs] AS [L3 percent share of spectrum IDs],
  [peptides] as [L3 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection34.prot.xls]


________________________________________


SELECT [entry no.] as [J1 entry no.],
  [protein] AS [J1 protein],
  [protein probability] AS [J1 protein probability],
  [protein description] AS [J1 protein description],
  [percent coverage] AS [J1 percent coverage],
  [tot indep spectra] AS [J1 tot indep spectra],
  [percent share of spectrum IDs] AS [J1 percent share of spectrum IDs],
  [peptides] as [J1 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection38.prot.xls]


________________________________________


SELECT [entry no.] as [J2 entry no.],
  [protein] AS [J2 protein],
  [protein probability] AS [J2 protein probability],
  [protein description] AS [J2 protein description],
  [percent coverage] AS [J2 percent coverage],
  [tot indep spectra] AS [J2 tot indep spectra],
  [percent share of spectrum IDs] AS [J2 percent share of spectrum IDs],
  [peptides] as [J2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection39.prot.xls]


________________________________________


SELECT [entry no.] as [J3 entry no.],
  [protein] AS [J3 protein],
  [protein probability] AS [J3 protein probability],
  [protein description] AS [J3 protein description],
  [percent coverage] AS [J3 percent coverage],
  [tot indep spectra] AS [J3 tot indep spectra],
  [percent share of spectrum IDs] AS [J3 percent share of spectrum IDs],
  [peptides] as [J3 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection40.prot.xls]


________________________________________


SELECT [entry no.] as [M1.2 entry no.],
  [protein] AS [M1.2 protein],
  [protein probability] AS [M1.2 protein probability],
  [protein description] AS [M1.2 protein description],
  [percent coverage] AS [M1.2 percent coverage],
  [tot indep spectra] AS [M1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [M1.2 percent share of spectrum IDs],
  [peptides] as [M1.2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection42.prot.xls]


________________________________________


SELECT 
[entry no.] as [M2.2 entry no.],
  [protein] AS [M2.2 protein],
  [protein probability] AS [M2.2 protein probability],
  [protein description] AS [M2.2 protein description],
  [percent coverage] AS [M2.2 percent coverage],
  [tot indep spectra] AS [M2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [M2.2 percent share of spectrum IDs],
  [peptides] as [M2.2 peptides]  
  FROM [412].[table_interact-2015_June_9_BactDetection43.prot.xls]


________________________________________


SELECT [entry no.] as [M3.2 entry no.],
  [protein] AS [M3.2 protein],
  [protein probability] AS [M3.2 protein probability],
  [protein description] AS [M3.2 protein description],
  [percent coverage] AS [M3.2 percent coverage],
  [tot indep spectra] AS [M3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [M3.2 percent share of spectrum IDs],
  [peptides] as [M3.2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection44.prot.xls]


________________________________________


SELECT [entry no.] as [L1.2 entry no.],
  [protein] AS [L1.2 protein],
  [protein probability] AS [L1.2 protein probability],
  [protein description] AS [L1.2 protein description],
  [percent coverage] AS [L1.2 percent coverage],
  [tot indep spectra] AS [L1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [L1.2 percent share of spectrum IDs],
  [peptides] as [L1.2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection46.prot.xls]


________________________________________


SELECT [entry no.] as [L3.2 entry no.],
  [protein] AS [L3.2 protein],
  [protein probability] AS [L3.2 protein probability],
  [protein description] AS [L3.2 protein description],
  [percent coverage] AS [L3.2 percent coverage],
  [tot indep spectra] AS [L3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [L3.2 percent share of spectrum IDs],
  [peptides] as [L3.2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection48.prot_1.xls]


________________________________________


SELECT [entry no.] as [J1.2 entry no.],
  [protein] AS [J1.2 protein],
  [protein probability] AS [J1.2 protein probability],
  [protein description] AS [J1.2 protein description],
  [percent coverage] AS [J1.2 percent coverage],
  [tot indep spectra] AS [J1.2 tot indep spectra],
  [percent share of spectrum IDs] AS [J1.2 percent share of spectrum IDs],
  [peptides] as [J1.2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection52.prot.xls]


________________________________________


SELECT [entry no.] as [J2.2 entry no.],
  [protein] AS [J2.2 protein],
  [protein probability] AS [J2.2 protein probability],
  [protein description] AS [J2.2 protein description],
  [percent coverage] AS [J2.2 percent coverage],
  [tot indep spectra] AS [J2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [J2.2 percent share of spectrum IDs],
  [peptides] as [J2.2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection53.prot.xls]


________________________________________


SELECT [entry no.] as [J3.2 entry no.],
  [protein] AS [J3.2 protein],
  [protein probability] AS [J3.2 protein probability],
  [protein description] AS [J3.2 protein description],
  [percent coverage] AS [J3.2 percent coverage],
  [tot indep spectra] AS [J3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [J3.2 percent share of spectrum IDs],
  [peptides] as [J3.2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection54.prot.xls]


________________________________________


SELECT [entry no.] as [N2.2 entry no.],
  [protein] AS [N2.2 protein],
  [protein probability] AS [N2.2 protein probability],
  [protein description] AS [N2.2 protein description],
  [percent coverage] AS [N2.2 percent coverage],
  [tot indep spectra] AS [N2.2 tot indep spectra],
  [percent share of spectrum IDs] AS [N2.2 percent share of spectrum IDs],
  [peptides] as [N2.2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection56.prot.xls]


________________________________________


SELECT [entry no.] as [N3.2 entry no.],
  [protein] AS [N3.2 protein],
  [protein probability] AS [N3.2 protein probability],
  [protein description] AS [N3.2 protein description],
  [percent coverage] AS [N3.2 percent coverage],
  [tot indep spectra] AS [N3.2 tot indep spectra],
  [percent share of spectrum IDs] AS [N3.2 percent share of spectrum IDs],
  [peptides] as [N3.2 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection57.prot.xls]


________________________________________


SELECT [entry no.] as [A3.3 entry no.],
  [protein] AS [A3.3 protein],
  [protein probability] AS [A3.3 protein probability],
  [protein description] AS [A3.3 protein description],
  [percent coverage] AS [A3.3 percent coverage],
  [tot indep spectra] AS [A3.3 tot indep spectra],
  [percent share of spectrum IDs] AS [A3.3 percent share of spectrum IDs],
  [peptides] as [A3.3 peptides]
  FROM [412].[table_interact-2015_June_9_BactDetection58.prot.xls]


________________________________________


SELECT [N2 protein], [N2 tot indep spectra], [N2 peptides]
   FROM [412].[interact-2015_June_9_BactDetection22.prot.xls]
  WHERE [N2 tot indep spectra]>1
  
  


________________________________________


SELECT [N3 protein], [N3 tot indep spectra], [N3 peptides]
FROM [412].[interact-2015_June_9_BactDetection25.prot.xls]  
  WHERE [N3 tot indep spectra]>1
  


________________________________________


SELECT [A2 protein] AS [M1 protein], [M1 tot indep spectra], [M1 peptides]
  FROM [412].[interact-2015_June_9_BactDetection26.prot.xls] 
  WHERE [M1 tot indep spectra]>1




________________________________________


SELECT [M2 protein], [M2 tot indep spectra], [M2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection27.prot.xls] 
  WHERE [M2 tot indep spectra]>1




________________________________________


SELECT [M3 protein], [M3 tot indep spectra], [M3 peptides]
  FROM [412].[interact-2015_June_9_BactDetection28.prot.xls] 
  WHERE [M3 tot indep spectra]>1




________________________________________


SELECT [N1 protein], [N1 tot indep spectra], [N1 peptides]
  FROM [412].[interact-2015_June_9_BactDetection30.prot_1.xls] 
  WHERE [N1 tot indep spectra]>1




________________________________________


SELECT [L1 protein], [L1 tot indep spectra], [L1 peptides]
  FROM [412].[interact-2015_June_9_BactDetection32.prot_1.xls] 
  WHERE [L1 tot indep spectra]>1




________________________________________


SELECT [L2 protein], [L2 tot indep spectra], [L2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection33.prot.xls] 
  WHERE [L2 tot indep spectra]>1




________________________________________


SELECT [L3 protein], [L3 tot indep spectra], [L3 peptides]
  FROM [412].[interact-2015_June_9_BactDetection34.prot.xls] 
  WHERE [L3 tot indep spectra]>1




________________________________________


SELECT [J1 protein], [J1 tot indep spectra], [J1 peptides]
  FROM [412].[interact-2015_June_9_BactDetection38.prot.xls] 
  WHERE [J1 tot indep spectra]>1




________________________________________


SELECT [J2 protein], [J2 tot indep spectra], [J2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection39.prot.xls] 
  WHERE [J2 tot indep spectra]>1




________________________________________


SELECT [J3 protein], [J3 tot indep spectra], [J3 peptides]
  FROM [412].[interact-2015_June_9_BactDetection40.prot.xls] 
  WHERE [J3 tot indep spectra]>1




________________________________________


SELECT [M1.2 protein], [M1.2 tot indep spectra], [M1.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection42.prot.xls] 
  WHERE [M1.2 tot indep spectra]>1




________________________________________


SELECT [M2.2 protein], [M2.2 tot indep spectra], [M2.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection43.prot.xls] 
  WHERE [M2.2 tot indep spectra]>1




________________________________________


SELECT [M3.2 protein], [M3.2 tot indep spectra], [M3.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection44.prot.xls] 
  WHERE [M3.2 tot indep spectra]>1




________________________________________


SELECT [L1.2 protein], [L1.2 tot indep spectra], [L1.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection46.prot.xls] 
  WHERE [L1.2 tot indep spectra]>1




________________________________________


SELECT [L3.2 protein], [L3.2 tot indep spectra], [L3.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection48.prot_1.xls] 
  WHERE [L3.2 tot indep spectra]>1




________________________________________


SELECT [J1.2 protein], [J1.2 tot indep spectra], [J1.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection52.prot.xls] 
  WHERE [J1.2 tot indep spectra]>1




________________________________________


SELECT [J2.2 protein], [J2.2 tot indep spectra], [J2.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection53.prot.xls] 
  WHERE [J2.2 tot indep spectra]>1




________________________________________


SELECT [J3.2 protein], [J3.2 tot indep spectra], [J3.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection54.prot.xls] 
  WHERE [J3.2 tot indep spectra]>1




________________________________________


SELECT [N2.2 protein], [N2.2 tot indep spectra], [N2.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection56.prot.xls] 
  WHERE [N2.2 tot indep spectra]>1




________________________________________


SELECT [N3.2 protein], [N3.2 tot indep spectra], [N3.2 peptides]
  FROM [412].[interact-2015_June_9_BactDetection57.prot.xls] 
  WHERE [N3.2 tot indep spectra]>1




________________________________________


SELECT [A3.3 protein], [A3.3 tot indep spectra], [A3.3 peptides]
  FROM [412].[interact-2015_June_9_BactDetection58.prot.xls] 
  WHERE [A3.3 tot indep spectra]>1




________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[Thaps_Rpom_sequence_lenghts.csv]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Thaps_Rpom_sequence_lenghts.csv].Protein
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
  LEFT JOIN [412].[BactDetection A1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.2].[A1.2 protein]
  LEFT JOIN [412].[BactDetection A2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.1].[A2 protein]
  LEFT JOIN [412].[BactDetection A2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.2].[A2.2 protein]
  LEFT JOIN [412].[BactDetection A3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.1].[A3 protein]
  LEFT JOIN [412].[BactDetection A3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.2].[A3.2 protein]
  LEFT JOIN [412].[Bact detection A3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection A3.3].[A3.3 protein]
  LEFT JOIN [412].[BactDetection B1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.1].[B1 protein]
  LEFT JOIN [412].[BactDetection B1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.2].[B1.2 protein]
  LEFT JOIN [412].[BactDetection B2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.1].[B2 protein]
  LEFT JOIN [412].[BactDetection B2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.2].[B2.2 protein]
  LEFT JOIN [412].[BactDetection B3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.1].[B3 protein]
  LEFT JOIN [412].[BactDetection B3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.2].[B3.2 protein]
  LEFT JOIN [412].[BactDetection C1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.1].[C1 protein]
  LEFT JOIN [412].[BactDetection C1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.2].[C1.2 protein]
  LEFT JOIN [412].[BactDetection C2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.1].[C2 protein]
  LEFT JOIN [412].[BactDetection C2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.2].[C2.2 protein]
  LEFT JOIN [412].[BactDetection C3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.1].[C3 protein]
  LEFT JOIN [412].[BactDetection C3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.2].[C3.2 protein]
  LEFT JOIN [412].[BactDetection D1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.1].[D1 protein]
  LEFT JOIN [412].[BactDetection D1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.2].[D1.2 protein]
  LEFT JOIN [412].[BactDetection D2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.1].[D2 protein]
  LEFT JOIN [412].[BactDetection D2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.2].[D2.2 protein]
  LEFT JOIN [412].[BactDetection D3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.1].[D3 protein]
  LEFT JOIN [412].[BactDetection D3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.2].[D3.2 protein]
  LEFT JOIN [412].[BactDetection E1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.1].[E1 protein]
  LEFT JOIN [412].[BactDetection E1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.2].[E1.2 protein]
  LEFT JOIN [412].[BactDetection E2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.1].[E2 protein]
  LEFT JOIN [412].[BactDetection E2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.2].[E2.2 protein]
  LEFT JOIN [412].[BactDetection E3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.1].[E3 protein]
  LEFT JOIN [412].[BactDetection E3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.2].[E3.2 protein]
  LEFT JOIN [412].[BactDetection F1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.1].[F1 protein]
  LEFT JOIN [412].[BactDetection F1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.2].[F1.2 protein]
  LEFT JOIN [412].[BactDetection F1.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.3].[F1.3 protein]
  LEFT JOIN [412].[BactDetection F2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.1].[F2 protein]
  LEFT JOIN [412].[BactDetection F2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.2].[F2.2 protein]
  LEFT JOIN [412].[BactDetection F2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.3].[F2.3 protein]
  LEFT JOIN [412].[BactDetection F3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.1].[F3 protein]
  LEFT JOIN [412].[BactDetection F3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.2].[F3.2 protein]
  LEFT JOIN [412].[BactDetection F3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.3].[F3.3 protein]
  LEFT JOIN [412].[BactDetection G1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.1].[G1 protein]
  LEFT JOIN [412].[BactDetection G1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.2].[G1.2 protein]
  LEFT JOIN [412].[BactDetection G2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.1].[G2 protein]
  LEFT JOIN [412].[BactDetection G2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.2].[G2.2 protein]
LEFT JOIN [412].[BactDetection G3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.1].[G3 protein]
  LEFT JOIN [412].[BactDetection G3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.2].[G3.2 protein]
  LEFT JOIN [412].[BactDetection H1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.1].[H1 protein]
  LEFT JOIN [412].[BactDetection H1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.2].[H1.2 protein]
  LEFT JOIN [412].[BactDetection H2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.1].[H2 protein]
  LEFT JOIN [412].[BactDetection H2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.2].[H2.2 protein]
  LEFT JOIN [412].[BactDetection H2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.3].[H2.3 protein]
  LEFT JOIN [412].[BactDetection H3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.1].[H3 protein]
LEFT JOIN [412].[BactDetection H3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.2].[H3.2 protein]  
  LEFT JOIN [412].[BactDetection H3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.3].[H3.3 protein]
  LEFT JOIN [412].[BactDetection I1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.1].[I1 protein]
  LEFT JOIN [412].[BactDetection I1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.2].[I1.2 protein]
  LEFT JOIN [412].[BactDetection I2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.1].[I2 protein]
  LEFT JOIN [412].[BactDetection I2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.2].[I2.2 protein]
  LEFT JOIN [412].[BactDetection I3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.1].[I3 protein]
  LEFT JOIN [412].[BactDetection I3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.2].[I3.2 protein]
  LEFT JOIN [412].[Bact detection J1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J1].[J1 protein]
  LEFT JOIN [412].[Bact detection J1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J1.2].[J1.2 protein]
  LEFT JOIN [412].[Bact detection J2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J2].[J2 protein]
  LEFT JOIN [412].[Bact detection J2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J2.2].[J2.2 protein]
    LEFT JOIN [412].[Bact detection J3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J3].[J3 protein]
  LEFT JOIN [412].[Bact detection J3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J3.2].[J3.2 protein]
  LEFT JOIN [412].[Bact detection L1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L1].[L1 protein]
  LEFT JOIN [412].[Bact detection L1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L1.2].[L1.2 protein]
  LEFT JOIN [412].[Bact detection L2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L2].[L2 protein]
  LEFT JOIN [412].[Bact detection L3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L3].[L3 protein]
  LEFT JOIN [412].[Bact detection L3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L3.2].[L3.2 protein]
  LEFT JOIN [412].[Bact detection M1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M1].[M1 protein]
  LEFT JOIN [412].[Bact detection M1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M1.2].[M1.2 protein]
  LEFT JOIN [412].[Bact detection M2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M2].[M2 protein]
  LEFT JOIN [412].[Bact detection M2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M2.2].[M2.2 protein]
  LEFT JOIN [412].[Bact detection M3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M3].[M3 protein]
  LEFT JOIN [412].[Bact detection N1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N1].[N1 protein]
  LEFT JOIN [412].[Bact detection N2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N2].[N2 protein]
  LEFT JOIN [412].[Bact detection N2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N2.2].[N2.2 protein]
  LEFT JOIN [412].[Bact detection N3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N3].[N3 protein]
  LEFT JOIN [412].[Bact detection N3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N3.2].[N3.2 protein]
  


________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[Thaps_Rpom_sequence_lenghts.csv]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Thaps_Rpom_sequence_lenghts.csv].Protein
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
  LEFT JOIN [412].[BactDetection A1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.2].[A1.2 protein]
  LEFT JOIN [412].[BactDetection A2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.1].[A2 protein]
  LEFT JOIN [412].[BactDetection A2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.2].[A2.2 protein]
  LEFT JOIN [412].[BactDetection A3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.1].[A3 protein]
  LEFT JOIN [412].[BactDetection A3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.2].[A3.2 protein]
  LEFT JOIN [412].[Bact detection A3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection A3.3].[A3.3 protein]
  LEFT JOIN [412].[BactDetection B1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.1].[B1 protein]
  LEFT JOIN [412].[BactDetection B1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.2].[B1.2 protein]
  LEFT JOIN [412].[BactDetection B2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.1].[B2 protein]
  LEFT JOIN [412].[BactDetection B2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.2].[B2.2 protein]
  LEFT JOIN [412].[BactDetection B3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.1].[B3 protein]
  LEFT JOIN [412].[BactDetection B3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.2].[B3.2 protein]
  LEFT JOIN [412].[BactDetection C1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.1].[C1 protein]
  LEFT JOIN [412].[BactDetection C1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.2].[C1.2 protein]
  LEFT JOIN [412].[BactDetection C2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.1].[C2 protein]
  LEFT JOIN [412].[BactDetection C2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.2].[C2.2 protein]
  LEFT JOIN [412].[BactDetection C3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.1].[C3 protein]
  LEFT JOIN [412].[BactDetection C3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.2].[C3.2 protein]
  LEFT JOIN [412].[BactDetection D1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.1].[D1 protein]
  LEFT JOIN [412].[BactDetection D1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.2].[D1.2 protein]
  LEFT JOIN [412].[BactDetection D2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.1].[D2 protein]
  LEFT JOIN [412].[BactDetection D2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.2].[D2.2 protein]
  LEFT JOIN [412].[BactDetection D3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.1].[D3 protein]
  LEFT JOIN [412].[BactDetection D3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.2].[D3.2 protein]
  LEFT JOIN [412].[BactDetection E1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.1].[E1 protein]
  LEFT JOIN [412].[BactDetection E1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.2].[E1.2 protein]
  LEFT JOIN [412].[BactDetection E2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.1].[E2 protein]
  LEFT JOIN [412].[BactDetection E2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.2].[E2.2 protein]
  LEFT JOIN [412].[BactDetection E3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.1].[E3 protein]
  LEFT JOIN [412].[BactDetection E3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.2].[E3.2 protein]
  LEFT JOIN [412].[BactDetection F1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.1].[F1 protein]
  LEFT JOIN [412].[BactDetection F1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.2].[F1.2 protein]
  LEFT JOIN [412].[BactDetection F1.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.3].[F1.3 protein]
  LEFT JOIN [412].[BactDetection F2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.1].[F2 protein]
  LEFT JOIN [412].[BactDetection F2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.2].[F2.2 protein]
  LEFT JOIN [412].[BactDetection F2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.3].[F2.3 protein]
  LEFT JOIN [412].[BactDetection F3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.1].[F3 protein]
  LEFT JOIN [412].[BactDetection F3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.2].[F3.2 protein]
  LEFT JOIN [412].[BactDetection F3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.3].[F3.3 protein]
  LEFT JOIN [412].[BactDetection G1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.1].[G1 protein]
  LEFT JOIN [412].[BactDetection G1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.2].[G1.2 protein]
  LEFT JOIN [412].[BactDetection G2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.1].[G2 protein]
  LEFT JOIN [412].[BactDetection G2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.2].[G2.2 protein]
LEFT JOIN [412].[BactDetection G3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.1].[G3 protein]
  LEFT JOIN [412].[BactDetection G3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.2].[G3.2 protein]
  LEFT JOIN [412].[BactDetection H1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.1].[H1 protein]
  LEFT JOIN [412].[BactDetection H1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.2].[H1.2 protein]
  LEFT JOIN [412].[BactDetection H2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.1].[H2 protein]
  LEFT JOIN [412].[BactDetection H2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.2].[H2.2 protein]
  LEFT JOIN [412].[BactDetection H2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.3].[H2.3 protein]
  LEFT JOIN [412].[BactDetection H3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.1].[H3 protein]
LEFT JOIN [412].[BactDetection H3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.2].[H3.2 protein]  
  LEFT JOIN [412].[BactDetection H3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.3].[H3.3 protein]
  LEFT JOIN [412].[BactDetection I1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.1].[I1 protein]
  LEFT JOIN [412].[BactDetection I1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.2].[I1.2 protein]
  LEFT JOIN [412].[BactDetection I2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.1].[I2 protein]
  LEFT JOIN [412].[BactDetection I2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.2].[I2.2 protein]
  LEFT JOIN [412].[BactDetection I3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.1].[I3 protein]
  LEFT JOIN [412].[BactDetection I3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.2].[I3.2 protein]
  LEFT JOIN [412].[Bact detection J1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J1].[J1 protein]
  LEFT JOIN [412].[Bact detection J1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J1.2].[J1.2 protein]
  LEFT JOIN [412].[Bact detection J2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J2].[J2 protein]
  LEFT JOIN [412].[Bact detection J2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J2.2].[J2.2 protein]
    LEFT JOIN [412].[Bact detection J3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J3].[J3 protein]
  LEFT JOIN [412].[Bact detection J3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J3.2].[J3.2 protein]
  LEFT JOIN [412].[Bact detection L1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L1].[L1 protein]
  LEFT JOIN [412].[Bact detection L1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L1.2].[L1.2 protein]
  LEFT JOIN [412].[Bact detection L2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L2].[L2 protein]
  LEFT JOIN [412].[Bact detection L3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L3].[L3 protein]
  LEFT JOIN [412].[Bact detection L3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L3.2].[L3.2 protein]
  LEFT JOIN [412].[Bact detection M1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M1].[M1 protein]
  LEFT JOIN [412].[Bact detection M1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M1.2].[M1.2 protein]
  LEFT JOIN [412].[Bact detection M2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M2].[M2 protein]
  LEFT JOIN [412].[Bact detection M2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M2.2].[M2.2 protein]
  LEFT JOIN [412].[Bact detection M3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M3].[M3 protein]
  LEFT JOIN [412].[Bact detection N1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N1].[N1 protein]
  LEFT JOIN [412].[Bact detection N2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N2].[N2 protein]
  LEFT JOIN [412].[Bact detection N2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N2.2].[N2.2 protein]
  LEFT JOIN [412].[Bact detection N3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N3].[N3 protein]
  LEFT JOIN [412].[Bact detection N3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N3.2].[N3.2 protein]
  


________________________________________


SELECT * FROM [412].[Thaps_Rpom_combined_proteins.csv]
  LEFT JOIN [412].[Thaps_Rpom_sequence_lenghts.csv]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Thaps_Rpom_sequence_lenghts.csv].Protein
  LEFT JOIN [412].[BactDetection A1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.1].[A1 protein]
  LEFT JOIN [412].[BactDetection A1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A1.2].[A1.2 protein]
  LEFT JOIN [412].[BactDetection A2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.1].[A2 protein]
  LEFT JOIN [412].[BactDetection A2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A2.2].[A2.2 protein]
  LEFT JOIN [412].[BactDetection A3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.1].[A3 protein]
  LEFT JOIN [412].[BactDetection A3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection A3.2].[A3.2 protein]
  LEFT JOIN [412].[Bact detection A3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection A3.3].[A3.3 protein]
  LEFT JOIN [412].[BactDetection B1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.1].[B1 protein]
  LEFT JOIN [412].[BactDetection B1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B1.2].[B1.2 protein]
  LEFT JOIN [412].[BactDetection B2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.1].[B2 protein]
  LEFT JOIN [412].[BactDetection B2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B2.2].[B2.2 protein]
  LEFT JOIN [412].[BactDetection B3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.1].[B3 protein]
  LEFT JOIN [412].[BactDetection B3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection B3.2].[B3.2 protein]
  LEFT JOIN [412].[BactDetection C1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.1].[C1 protein]
  LEFT JOIN [412].[BactDetection C1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C1.2].[C1.2 protein]
  LEFT JOIN [412].[BactDetection C2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.1].[C2 protein]
  LEFT JOIN [412].[BactDetection C2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C2.2].[C2.2 protein]
  LEFT JOIN [412].[BactDetection C3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.1].[C3 protein]
  LEFT JOIN [412].[BactDetection C3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection C3.2].[C3.2 protein]
  LEFT JOIN [412].[BactDetection D1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.1].[D1 protein]
  LEFT JOIN [412].[BactDetection D1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D1.2].[D1.2 protein]
  LEFT JOIN [412].[BactDetection D2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.1].[D2 protein]
  LEFT JOIN [412].[BactDetection D2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D2.2].[D2.2 protein]
  LEFT JOIN [412].[BactDetection D3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.1].[D3 protein]
  LEFT JOIN [412].[BactDetection D3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection D3.2].[D3.2 protein]
  LEFT JOIN [412].[BactDetection E1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.1].[E1 protein]
  LEFT JOIN [412].[BactDetection E1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E1.2].[E1.2 protein]
  LEFT JOIN [412].[BactDetection E2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.1].[E2 protein]
  LEFT JOIN [412].[BactDetection E2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E2.2].[E2.2 protein]
  LEFT JOIN [412].[BactDetection E3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.1].[E3 protein]
  LEFT JOIN [412].[BactDetection E3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection E3.2].[E3.2 protein]
  LEFT JOIN [412].[BactDetection F1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.1].[F1 protein]
  LEFT JOIN [412].[BactDetection F1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.2].[F1.2 protein]
  LEFT JOIN [412].[BactDetection F1.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F1.3].[F1.3 protein]
  LEFT JOIN [412].[BactDetection F2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.1].[F2 protein]
  LEFT JOIN [412].[BactDetection F2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.2].[F2.2 protein]
  LEFT JOIN [412].[BactDetection F2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F2.3].[F2.3 protein]
  LEFT JOIN [412].[BactDetection F3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.1].[F3 protein]
  LEFT JOIN [412].[BactDetection F3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.2].[F3.2 protein]
  LEFT JOIN [412].[BactDetection F3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection F3.3].[F3.3 protein]
  LEFT JOIN [412].[BactDetection G1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.1].[G1 protein]
  LEFT JOIN [412].[BactDetection G1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G1.2].[G1.2 protein]
  LEFT JOIN [412].[BactDetection G2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.1].[G2 protein]
  LEFT JOIN [412].[BactDetection G2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G2.2].[G2.2 protein]
LEFT JOIN [412].[BactDetection G3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.1].[G3 protein]
  LEFT JOIN [412].[BactDetection G3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection G3.2].[G3.2 protein]
  LEFT JOIN [412].[BactDetection H1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.1].[H1 protein]
  LEFT JOIN [412].[BactDetection H1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H1.2].[H1.2 protein]
  LEFT JOIN [412].[BactDetection H2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.1].[H2 protein]
  LEFT JOIN [412].[BactDetection H2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.2].[H2.2 protein]
  LEFT JOIN [412].[BactDetection H2.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H2.3].[H2.3 protein]
  LEFT JOIN [412].[BactDetection H3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.1].[H3 protein]
LEFT JOIN [412].[BactDetection H3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.2].[H3.2 protein]  
  LEFT JOIN [412].[BactDetection H3.3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection H3.3].[H3.3 protein]
  LEFT JOIN [412].[BactDetection I1.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.1].[I1 protein]
  LEFT JOIN [412].[BactDetection I1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I1.2].[I1.2 protein]
  LEFT JOIN [412].[BactDetection I2.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.1].[I2 protein]
  LEFT JOIN [412].[BactDetection I2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I2.2].[I2.2 protein]
  LEFT JOIN [412].[BactDetection I3.1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.1].[I3 protein]
  LEFT JOIN [412].[BactDetection I3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[BactDetection I3.2].[I3.2 protein]
  LEFT JOIN [412].[Bact detection J1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J1].[J1 protein]
  LEFT JOIN [412].[Bact detection J1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J1.2].[J1.2 protein]
  LEFT JOIN [412].[Bact detection J2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J2].[J2 protein]
  LEFT JOIN [412].[Bact detection J2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J2.2].[J2.2 protein]
    LEFT JOIN [412].[Bact detection J3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J3].[J3 protein]
  LEFT JOIN [412].[Bact detection J3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection J3.2].[J3.2 protein]
  LEFT JOIN [412].[Bact detection L1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L1].[L1 protein]
  LEFT JOIN [412].[Bact detection L1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L1.2].[L1.2 protein]
  LEFT JOIN [412].[Bact detection L2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L2].[L2 protein]
  LEFT JOIN [412].[Bact detection L3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L3].[L3 protein]
  LEFT JOIN [412].[Bact detection L3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection L3.2].[L3.2 protein]
  LEFT JOIN [412].[Bact detection M1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M1].[M1 protein]
  LEFT JOIN [412].[Bact detection M1.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M1.2].[M1.2 protein]
  LEFT JOIN [412].[Bact detection M2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M2].[M2 protein]
  LEFT JOIN [412].[Bact detection M2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M2.2].[M2.2 protein]
  LEFT JOIN [412].[Bact detection M3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M3].[M3 protein]
    LEFT JOIN [412].[Bact detection M3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection M3.2].[M3.2 protein]
  LEFT JOIN [412].[Bact detection N1]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N1].[N1 protein]
  LEFT JOIN [412].[Bact detection N2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N2].[N2 protein]
  LEFT JOIN [412].[Bact detection N2.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N2.2].[N2.2 protein]
  LEFT JOIN [412].[Bact detection N3]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N3].[N3 protein]
  LEFT JOIN [412].[Bact detection N3.2]
  ON [412].[Thaps_Rpom_combined_proteins.csv].Protein=[412].[Bact detection N3.2].[N3.2 protein]
  


________________________________________


SELECT Protein, Description, Length, [A1 tot indep spectra],
  [A1.2 tot indep spectra],
  [A2 tot indep spectra], 
  [A2.2 tot indep spectra],
  [A3 tot indep spectra],
  [A3.2 tot indep spectra],
  [A3.3 tot indep spectra],
  [B1 tot indep spectra],
  [B1.2 tot indep spectra],
  [B2 tot indep spectra],
  [B2.2 tot indep spectra],
  [B3 tot indep spectra],
  [B3.2 tot indep spectra],
  [C1 tot indep spectra],
  [C1.2 tot indep spectra],
  [C2 tot indep spectra],
  [C2.2 tot indep spectra],
  [C3 tot indep spectra],
  [C3.2 tot indep spectra],
  [D1 tot indep spectra],
  [D1.2 tot indep spectra],
  [D2 tot indep spectra],
  [D2.2 tot indep spectra],
  [D3 tot indep spectra],
  [D3.2 tot indep spectra],
  [E1 tot indep spectra],
  [E1.2 tot indep spectra],
  [E2 tot indep spectra],
  [E2.2 tot indep spectra],
  [E3 tot indep spectra],
  [E3.2 tot indep spectra],
  [F1 tot indep spectra],
  [F1.2 tot indep spectra],
  [F1.3 tot indep spectra],
  [F2 tot indep spectra],
  [F2.2 tot indep spectra],
  [F2.3 tot indep spectra],
  [F3 tot indep spectra],
  [F3.2 tot indep spectra],
  [F3.3 tot indep spectra],
  [G1 tot indep spectra],
  [G1.2 tot indep spectra],
  [G2 tot indep spectra],
  [G2.2 tot indep spectra],
  [G3 tot indep spectra],
  [G3.2 tot indep spectra],
  [H1 tot indep spectra],
  [H1.2 tot indep spectra],
  [H2 tot indep spectra],
  [H2.2 tot indep spectra],
  [H2.3 tot indep spectra],
  [H3 tot indep spectra],
  [H3.2 tot indep spectra],
  [H3.3 tot indep spectra],
  [I1 tot indep spectra],
  [I1.2 tot indep spectra],
  [I2 tot indep spectra],
  [I2.2 tot indep spectra],
  [I3 tot indep spectra],
  [I3.2 tot indep spectra],
  [J1 tot indep spectra],
  [J1.2 tot indep spectra],
  [J2 tot indep spectra],
  [J2.2 tot indep spectra],
  [J3 tot indep spectra],
  [J3.2 tot indep spectra],
  [L1 tot indep spectra],
  [L1.2 tot indep spectra],
  [L2 tot indep spectra],
  [L3 tot indep spectra],
  [L3.2 tot indep spectra],
  [M1 tot indep spectra],
  [M1.2 tot indep spectra],
  [M2 tot indep spectra],
  [M2.2 tot indep spectra],
  [M3 tot indep spectra],
  [M3.2 tot indep spectra],
  [N1 tot indep spectra],
  [N2 tot indep spectra],
  [N2.2 tot indep spectra],
  [N3 tot indep spectra],
  [N3.2 tot indep spectra]
  FROM [412].[Bact Detection all data]


________________________________________


SELECT Protein, Description, Length,
  CASE WHEN [A1 tot indep spectra] is NULL THEN 0 ELSE [A1 tot indep spectra] END AS [A1 tot indep spectra],
  CASE WHEN [A1.2 tot indep spectra] is NULL THEN 0 ELSE [A1.2 tot indep spectra] END AS [A1.2 tot indep spectra],
  CASE WHEN [A2 tot indep spectra] is NULL THEN 0 ELSE [A2 tot indep spectra] END AS [A2 tot indep spectra],
  CASE WHEN [A2.2 tot indep spectra] is NULL THEN 0 ELSE [A2.2 tot indep spectra] END AS [A2.2 tot indep spectra],
  CASE WHEN [A3 tot indep spectra] is NULL THEN 0 ELSE [A3 tot indep spectra] END AS [A3 tot indep spectra],
  CASE WHEN [A3.2 tot indep spectra] is NULL THEN 0 ELSE [A3.2 tot indep spectra] END AS [A3.2 tot indep spectra],
  CASE WHEN [A3.3 tot indep spectra] is NULL THEN 0 ELSE [A3.3 tot indep spectra] END AS [A3.3 tot indep spectra],
  CASE WHEN [B1 tot indep spectra] is NULL THEN 0 ELSE [B1 tot indep spectra] END AS [B1 tot indep spectra],
  CASE WHEN [B1.2 tot indep spectra] is NULL THEN 0 ELSE [B1.2 tot indep spectra] END AS [B1.2 tot indep spectra],
  CASE WHEN [B2 tot indep spectra] is NULL THEN 0 ELSE [B2 tot indep spectra] END AS [B2 tot indep spectra],
  CASE WHEN [B2.2 tot indep spectra] is NULL THEN 0 ELSE [B2.2 tot indep spectra] END AS [B2.2 tot indep spectra],
  CASE WHEN [B3 tot indep spectra] is NULL THEN 0 ELSE [B3 tot indep spectra] END AS [B3 tot indep spectra],
  CASE WHEN [B3.2 tot indep spectra] is NULL THEN 0 ELSE [B3.2 tot indep spectra] END AS [B3.2 tot indep spectra],
  CASE WHEN [C1 tot indep spectra] is NULL THEN 0 ELSE [C1 tot indep spectra] END AS [C1 tot indep spectra],
  CASE WHEN [C1.2 tot indep spectra] is NULL THEN 0 ELSE [C1.2 tot indep spectra] END AS [C1.2 tot indep spectra],
  CASE WHEN [C2 tot indep spectra] is NULL THEN 0 ELSE [C2 tot indep spectra] END AS [C2 tot indep spectra],
  CASE WHEN [C2.2 tot indep spectra] is NULL THEN 0 ELSE [C2.2 tot indep spectra] END AS [C2.2 tot indep spectra],
  CASE WHEN [C3 tot indep spectra] is NULL THEN 0 ELSE [C3 tot indep spectra] END AS [C3 tot indep spectra],
  CASE WHEN [C3.2 tot indep spectra] is NULL THEN 0 ELSE [C3.2 tot indep spectra] END AS [C3.2 tot indep spectra],
  CASE WHEN [D1 tot indep spectra] is NULL THEN 0 ELSE [D1 tot indep spectra] END AS [D1 tot indep spectra],
  CASE WHEN [D1.2 tot indep spectra] is NULL THEN 0 ELSE [D1.2 tot indep spectra] END AS [D1.2 tot indep spectra],
  CASE WHEN [D2 tot indep spectra] is NULL THEN 0 ELSE [D2 tot indep spectra] END AS [D2 tot indep spectra],
  CASE WHEN [D2.2 tot indep spectra] is NULL THEN 0 ELSE [D2.2 tot indep spectra] END AS [D2.2 tot indep spectra],
  CASE WHEN [D3 tot indep spectra] is NULL THEN 0 ELSE [D3 tot indep spectra] END AS [D3 tot indep spectra],
  CASE WHEN [D3.2 tot indep spectra] is NULL THEN 0 ELSE [D3.2 tot indep spectra] END AS [D3.2 tot indep spectra],
  CASE WHEN [E1 tot indep spectra] is NULL THEN 0 ELSE [E1 tot indep spectra] END AS [E1 tot indep spectra],
  CASE WHEN [E1.2 tot indep spectra] is NULL THEN 0 ELSE [E1.2 tot indep spectra] END AS [E1.2 tot indep spectra],
  CASE WHEN [E2 tot indep spectra] is NULL THEN 0 ELSE [E2 tot indep spectra] END AS [E2 tot indep spectra],
  CASE WHEN [E2.2 tot indep spectra] is NULL THEN 0 ELSE [E2.2 tot indep spectra] END AS [E2.2 tot indep spectra],
  CASE WHEN [E3 tot indep spectra] is NULL THEN 0 ELSE [E3 tot indep spectra] END AS [E3 tot indep spectra],
  CASE WHEN [E3.2 tot indep spectra] is NULL THEN 0 ELSE [E3.2 tot indep spectra] END AS [E3.2 tot indep spectra],
  CASE WHEN [F1 tot indep spectra] is NULL THEN 0 ELSE [F1 tot indep spectra] END AS [F1 tot indep spectra],
  CASE WHEN [F1.2 tot indep spectra] is NULL THEN 0 ELSE [F1.2 tot indep spectra] END AS [F1.2 tot indep spectra],
  CASE WHEN [F1.3 tot indep spectra] is NULL THEN 0 ELSE [F1.3 tot indep spectra] END AS [F1.3 tot indep spectra],
  CASE WHEN [F2 tot indep spectra] is NULL THEN 0 ELSE [F2 tot indep spectra] END AS [F2 tot indep spectra],
  CASE WHEN [F2.2 tot indep spectra] is NULL THEN 0 ELSE [F2.2 tot indep spectra] END AS [F2.2 tot indep spectra],
  CASE WHEN [F2.3 tot indep spectra] is NULL THEN 0 ELSE [F2.3 tot indep spectra] END AS [F2.3 tot indep spectra],
  CASE WHEN [F3 tot indep spectra] is NULL THEN 0 ELSE [F3 tot indep spectra] END AS [F3 tot indep spectra],
  CASE WHEN [F3.2 tot indep spectra] is NULL THEN 0 ELSE [F3.2 tot indep spectra] END AS [F3.2 tot indep spectra],
  CASE WHEN [F3.3 tot indep spectra] is NULL THEN 0 ELSE [F3.3 tot indep spectra] END AS [F3.3 tot indep spectra],
  CASE WHEN [G1 tot indep spectra] is NULL THEN 0 ELSE [G1 tot indep spectra] END AS [G1 tot indep spectra],
  CASE WHEN [G1.2 tot indep spectra] is NULL THEN 0 ELSE [G1.2 tot indep spectra] END AS [G1.2 tot indep spectra],
  CASE WHEN [G2 tot indep spectra] is NULL THEN 0 ELSE [G2 tot indep spectra] END AS [G2 tot indep spectra],
  CASE WHEN [G2.2 tot indep spectra] is NULL THEN 0 ELSE [G2.2 tot indep spectra] END AS [G2.2 tot indep spectra],
  CASE WHEN [G3 tot indep spectra] is NULL THEN 0 ELSE [G3 tot indep spectra] END AS [G3 tot indep spectra],
  CASE WHEN [G3.2 tot indep spectra] is NULL THEN 0 ELSE [G3.2 tot indep spectra] END AS [G3.2 tot indep spectra],
  CASE WHEN [H1 tot indep spectra] is NULL THEN 0 ELSE [H1 tot indep spectra] END AS [H1 tot indep spectra],
  CASE WHEN [H1.2 tot indep spectra] is NULL THEN 0 ELSE [H1.2 tot indep spectra] END AS [H1.2 tot indep spectra],
  CASE WHEN [H2 tot indep spectra] is NULL THEN 0 ELSE [H2 tot indep spectra] END AS [H2 tot indep spectra],
  CASE WHEN [H2.2 tot indep spectra] is NULL THEN 0 ELSE [H2.2 tot indep spectra] END AS [H2.2 tot indep spectra],
  CASE WHEN [H2.3 tot indep spectra] is NULL THEN 0 ELSE [H2.3 tot indep spectra] END AS [H2.3 tot indep spectra],
  CASE WHEN [H3 tot indep spectra] is NULL THEN 0 ELSE [H3 tot indep spectra] END AS [H3 tot indep spectra],
  CASE WHEN [H3.2 tot indep spectra] is NULL THEN 0 ELSE [H3.2 tot indep spectra] END AS [H3.2 tot indep spectra],
  CASE WHEN [H3.3 tot indep spectra] is NULL THEN 0 ELSE [H3.3 tot indep spectra] END AS [H3.3 tot indep spectra],
  CASE WHEN [I1 tot indep spectra] is NULL THEN 0 ELSE [I1 tot indep spectra] END AS [I1 tot indep spectra],
  CASE WHEN [I1.2 tot indep spectra] is NULL THEN 0 ELSE [I1.2 tot indep spectra] END AS [I1.2 tot indep spectra],
  CASE WHEN [I2 tot indep spectra] is NULL THEN 0 ELSE [I2 tot indep spectra] END AS [I2 tot indep spectra],
  CASE WHEN [I2.2 tot indep spectra] is NULL THEN 0 ELSE [I2.2 tot indep spectra] END AS [I2.2 tot indep spectra],
  CASE WHEN [I3 tot indep spectra] is NULL THEN 0 ELSE [I3 tot indep spectra] END AS [I3 tot indep spectra],
  CASE WHEN [I3.2 tot indep spectra] is NULL THEN 0 ELSE [I3.2 tot indep spectra] END AS [I3.2 tot indep spectra],
  CASE WHEN [J1 tot indep spectra] is NULL THEN 0 ELSE [J1 tot indep spectra] END AS [J1 tot indep spectra],
  CASE WHEN [J1.2 tot indep spectra] is NULL THEN 0 ELSE [J1.2 tot indep spectra] END AS [J1.2 tot indep spectra],
  CASE WHEN [J2 tot indep spectra] is NULL THEN 0 ELSE [J2 tot indep spectra] END AS [J2 tot indep spectra],
  CASE WHEN [J2.2 tot indep spectra] is NULL THEN 0 ELSE [J2.2 tot indep spectra] END AS [J2.2 tot indep spectra],
  CASE WHEN [J3 tot indep spectra] is NULL THEN 0 ELSE [J3 tot indep spectra] END AS [J3 tot indep spectra],
  CASE WHEN [J3.2 tot indep spectra] is NULL THEN 0 ELSE [J3.2 tot indep spectra] END AS [J3.2 tot indep spectra],
  CASE WHEN [L1 tot indep spectra] is NULL THEN 0 ELSE [L1 tot indep spectra] END AS [L1 tot indep spectra],
  CASE WHEN [L1.2 tot indep spectra] is NULL THEN 0 ELSE [L1.2 tot indep spectra] END AS [L1.2 tot indep spectra],
  CASE WHEN [L2 tot indep spectra] is NULL THEN 0 ELSE [L2 tot indep spectra] END AS [L2 tot indep spectra],
  CASE WHEN [L3 tot indep spectra] is NULL THEN 0 ELSE [L3 tot indep spectra] END AS [L3 tot indep spectra],
  CASE WHEN [L3.2 tot indep spectra] is NULL THEN 0 ELSE [L3.2 tot indep spectra] END AS [L3.2 tot indep spectra],
  CASE WHEN [M1 tot indep spectra] is NULL THEN 0 ELSE [M1 tot indep spectra] END AS [M1 tot indep spectra],
  CASE WHEN [M1.2 tot indep spectra] is NULL THEN 0 ELSE [M1.2 tot indep spectra] END AS [M1.2 tot indep spectra],
  CASE WHEN [M2 tot indep spectra] is NULL THEN 0 ELSE [M2 tot indep spectra] END AS [M2 tot indep spectra],
  CASE WHEN [M2.2 tot indep spectra] is NULL THEN 0 ELSE [M2.2 tot indep spectra] END AS [M2.2 tot indep spectra],
  CASE WHEN [M3 tot indep spectra] is NULL THEN 0 ELSE [M3 tot indep spectra] END AS [M3 tot indep spectra],
  CASE WHEN [M3.2 tot indep spectra] is NULL THEN 0 ELSE [M3.2 tot indep spectra] END AS [M3.2 tot indep spectra],
  CASE WHEN [N1 tot indep spectra] is NULL THEN 0 ELSE [N1 tot indep spectra] END AS [N1 tot indep spectra],
  CASE WHEN [N2 tot indep spectra] is NULL THEN 0 ELSE [N2 tot indep spectra] END AS [N2 tot indep spectra],
  CASE WHEN [N2.2 tot indep spectra] is NULL THEN 0 ELSE [N2.2 tot indep spectra] END AS [N2.2 tot indep spectra],
  CASE WHEN [N3 tot indep spectra] is NULL THEN 0 ELSE [N3 tot indep spectra] END AS [N3 tot indep spectra],
  CASE WHEN [N3.2 tot indep spectra] is NULL THEN 0 ELSE [N3.2 tot indep spectra] END AS [N3.2 tot indep spectra]
  FROM [412].[Bact detection all spec counts]


________________________________________


SELECT Protein, 
  SUM ([A1 tot indep spectra]+[A1.2 tot indep spectra]+
  [A2 tot indep spectra]+ 
  [A2.2 tot indep spectra]+
  [A3 tot indep spectra]+
  [A3.2 tot indep spectra]+
  [B1 tot indep spectra]+
  [B1.2 tot indep spectra]+
  [B2 tot indep spectra]+
  [B2.2 tot indep spectra]+
  [B3 tot indep spectra]+
  [B3.2 tot indep spectra]+
  [C1 tot indep spectra]+
  [C1.2 tot indep spectra]+
  [C2 tot indep spectra]+
  [C2.2 tot indep spectra]+
  [C3 tot indep spectra]+
  [C3.2 tot indep spectra]+
  [D1 tot indep spectra]+
  [D1.2 tot indep spectra]+
  [D2 tot indep spectra]+
  [D2.2 tot indep spectra]+
  [D3 tot indep spectra]+
  [D3.2 tot indep spectra]+
  [E1 tot indep spectra]+
  [E1.2 tot indep spectra]+
  [E2 tot indep spectra]+
  [E2.2 tot indep spectra]+
  [E3 tot indep spectra]+
  [E3.2 tot indep spectra]+
  [F1 tot indep spectra]+
  [F1.2 tot indep spectra]+
  [F1.3 tot indep spectra]+
  [F2 tot indep spectra]+
  [F2.2 tot indep spectra]+
  [F2.3 tot indep spectra]+
  [F3 tot indep spectra]+
  [F3.2 tot indep spectra]+
  [F3.3 tot indep spectra]+
  [G1 tot indep spectra]+
  [G1.2 tot indep spectra]+
  [G2 tot indep spectra]+
  [G2.2 tot indep spectra]+
  [G3 tot indep spectra]+
  [G3.2 tot indep spectra]+
  [H1 tot indep spectra]+
  [H1.2 tot indep spectra]+
  [H2 tot indep spectra]+
  [H2.2 tot indep spectra]+
  [H2.3 tot indep spectra]+
  [H3 tot indep spectra]+
  [H3.2 tot indep spectra]+
  [H3.3 tot indep spectra]+
  [I1 tot indep spectra]+
  [I1.2 tot indep spectra]+
  [I2 tot indep spectra]+
  [I2.2 tot indep spectra]+
  [I3 tot indep spectra]+
    [I3.2 tot indep spectra]+
  [A3.3 tot indep spectra]+
  [J1 tot indep spectra]+
  [J1.2 tot indep spectra]+
  [J2 tot indep spectra]+
  [J2.2 tot indep spectra]+
  [J3 tot indep spectra]+
  [J3.2 tot indep spectra]+
  [L1 tot indep spectra]+
  [L1.2 tot indep spectra]+
  [L2 tot indep spectra]+
  [L3 tot indep spectra]+
  [L3.2 tot indep spectra]+
  [M1 tot indep spectra]+
  [M1.2 tot indep spectra]+
  [M2 tot indep spectra]+
  [M2.2 tot indep spectra]+
  [M3 tot indep spectra]+
  [M3.2 tot indep spectra]+
  [N1 tot indep spectra]+
  [N2 tot indep spectra]+
  [N2.2 tot indep spectra]+
  [N3 tot indep spectra]+
  [N3.2 tot indep spectra]) 
  AS [Total SpC]
  FROM [412].[Bact detection spec counts with 0]
GROUP BY Protein


________________________________________


SELECT * FROM [412].[Bact detection spec counts with 0]
  LEFT JOIN [412].[total spc per protein]
  ON [412].[Bact detection spec counts with 0].Protein=[412].[total spc per protein].Protein



________________________________________


SELECT * FROM [412].[Bact detection spec counts with 0]
  LEFT JOIN [412].[total spc per protein]
  ON [412].[Bact detection spec counts with 0].Protein=[412].[total spc per protein].Protein



________________________________________


SELECT * FROM [412].[Bact detection spec counts with 0]
  LEFT JOIN [412].[total spc per protein]
  ON [412].[Bact detection spec counts with 0].Protein=[412].[total spc per protein].Protein



________________________________________


SELECT * FROM [412].[bact detection all spec counts with total]
  WHERE [Total SpC]>0


________________________________________


SELECT Protein,
  SUM([A1 tot indep spectra]+[A1.2 tot indep spectra]) AS A1,
  SUM([A2 tot indep spectra]+[A2.2 tot indep spectra]) AS A2,
  SUM([A3 tot indep spectra]+[A3.2 tot indep spectra]+[A3.3 tot indep spectra]) AS A3,
  SUM([B1 tot indep spectra]+[B1.2 tot indep spectra]) AS B1,
  SUM([B2 tot indep spectra]+[B2.2 tot indep spectra]) AS B2,
  SUM([B3 tot indep spectra]+[B3.2 tot indep spectra]) AS B3,
  SUM([C1 tot indep spectra]+[C1.2 tot indep spectra]) AS C1,
  SUM([C2 tot indep spectra]+[C2.2 tot indep spectra]) AS C2,
  SUM([C3 tot indep spectra]+[C3.2 tot indep spectra]) AS C3,
  SUM([D1 tot indep spectra]+[D1.2 tot indep spectra]) AS D1,
  SUM([D2 tot indep spectra]+[D2.2 tot indep spectra]) AS D2,
  SUM([D3 tot indep spectra]+[D3.2 tot indep spectra]) AS D3,
  SUM([E1 tot indep spectra]+[E1.2 tot indep spectra]) AS E1,
  SUM([E2 tot indep spectra]+[E2.2 tot indep spectra]) AS E2,
  SUM([E3 tot indep spectra]+[E3.2 tot indep spectra]) AS E3,
  SUM([F1 tot indep spectra]+[F1.2 tot indep spectra]+[F1.3 tot indep spectra]) AS F1,
  SUM([F2 tot indep spectra]+[F2.2 tot indep spectra]+[F2.3 tot indep spectra]) AS F2,
  SUM([F3 tot indep spectra]+[F3.2 tot indep spectra]+[F3.3 tot indep spectra]) AS F3,
  SUM([G1 tot indep spectra]+[G1.2 tot indep spectra]) AS G1,
  SUM([G2 tot indep spectra]+[G2.2 tot indep spectra]) AS G2,
  SUM([G3 tot indep spectra]+[G3.2 tot indep spectra]) AS G3,
  SUM([H1 tot indep spectra]+[H1.2 tot indep spectra]) AS H1,
  SUM([H2 tot indep spectra]+[H2.2 tot indep spectra]+[H2.3 tot indep spectra]) AS H2,
  SUM([H3 tot indep spectra]+[H3.2 tot indep spectra]+[H3.3 tot indep spectra]) AS H3,
  SUM([J1 tot indep spectra]+[J1.2 tot indep spectra]) AS J1,
  SUM([J2 tot indep spectra]+[J2.2 tot indep spectra]) AS J2,
  SUM([J3 tot indep spectra]+[J3.2 tot indep spectra]) AS J3,
  SUM([L1 tot indep spectra]+[L1.2 tot indep spectra]) AS L1,
  SUM([L2 tot indep spectra]+[L2 tot indep spectra])/2 AS L2,
  SUM([L3 tot indep spectra]+[L3.2 tot indep spectra]) AS L3,
  SUM([M1 tot indep spectra]+[M1.2 tot indep spectra]) AS M1,
  SUM([M2 tot indep spectra]+[M2.2 tot indep spectra]) AS M2,
  SUM([M3 tot indep spectra]+[M3.2 tot indep spectra]) AS M3,
  SUM([N1 tot indep spectra]+[N1 tot indep spectra])/2 AS N1,
  SUM([N2 tot indep spectra]+[N2.2 tot indep spectra]) AS N2,
  SUM([N3 tot indep spectra]+[N3.2 tot indep spectra]) AS N3
  FROM [412].[bact detection all proteins non-zero spc]
  GROUP BY Protein


________________________________________


SELECT * FROM [412].[bact detection tech reps summed]
  LEFT JOIN [412].[Thaps_Rpom_sequence_lenghts.csv]
  ON [412].[bact detection tech reps summed].Protein=[412].[Thaps_Rpom_sequence_lenghts.csv].Protein
  


________________________________________


SELECT Protein, Length,
  CAST([A1] AS FLOAT)/2 as [A1 avg SpC],
  CAST([A2] AS FLOAT)/2 as [A2 avg SpC],
  CAST([A3] AS FLOAT)/3 as [A3 avg SpC],
  CAST([B1] AS FLOAT)/2 as [B1 avg SpC],
  CAST([B2] AS FLOAT)/2 as [B2 avg SpC],
  CAST([B3] AS FLOAT)/2 as [B3 avg SpC],
  CAST([C1] AS FLOAT)/2 as [C1 avg SpC],
  CAST([C2] AS FLOAT)/2 as [C2 avg SpC],
  CAST([C3] AS FLOAT)/2 as [C3 avg SpC],
  CAST([D1] AS FLOAT)/2 as [D1 avg SpC],
  CAST([D2] AS FLOAT)/2 as [D2 avg SpC],
  CAST([D3] AS FLOAT)/2 as [D3 avg SpC],
  CAST([E1] AS FLOAT)/2 as [E1 avg SpC],
  CAST([E2] AS FLOAT)/2 as [E2 avg SpC],
  CAST([E3] AS FLOAT)/2 as [E3 avg SpC],
  CAST([F1] AS FLOAT)/3 as [F1 avg SpC],
  CAST([F2] AS FLOAT)/3 as [F2 avg SpC],
  CAST([F3] AS FLOAT)/3 as [F3 avg SpC],
  CAST([G1] AS FLOAT)/2 as [G1 avg SpC],
  CAST([G2] AS FLOAT)/2 as [G2 avg SpC],
  CAST([G3] AS FLOAT)/2 as [G3 avg SpC],
  CAST([H1] AS FLOAT)/2 as [H1 avg SpC],
  CAST([H2] AS FLOAT)/3 as [H2 avg SpC],
  CAST([H3] AS FLOAT)/3 as [H3 avg SpC],
  CAST([J1] AS FLOAT)/2 as [J1 avg SpC],
  CAST([J2] AS FLOAT)/2 as [J2 avg SpC],
  CAST([J3] AS FLOAT)/2 as [J3 avg SpC],
  CAST([L1] AS FLOAT)/2 as [L1 avg SpC],
  [L2] AS [L2 avg SpC],
  CAST([L3] AS FLOAT)/2 as [L3 avg SpC],
  CAST([M1] AS FLOAT)/2 as [M1 avg SpC],
  CAST([M2] AS FLOAT)/2 as [M2 avg SpC],
  CAST([M3] AS FLOAT)/2 as [M3 avg SpC],
  [N1] AS [N1 avg SpC],
  CAST([N2] AS FLOAT)/2 as [N2 avg SpC],
  CAST([N3] AS FLOAT)/2 as [N3 avg SpC]
  FROM [412].[Sum tech reps with protein length]


________________________________________


SELECT Protein, Length, [A1 avg SpC],[A2 avg SpC],[A3 avg SpC],
  [B1 avg SpC],
  [B2 avg SpC],
  [B3 avg SpC],
  [C1 avg SpC],
  [C2 avg SpC],
  [C3 avg SpC],
  [D1 avg SpC],
  [D2 avg SpC],
  [D3 avg SpC],
  [E1 avg SpC],
  [E2 avg SpC],
  [E3 avg SpC],
  [F1 avg SpC],
  [F2 avg SpC],
  [F3 avg SpC],
  [G1 avg SpC],
  [G2 avg SpC],
  [G3 avg SpC],
  [H1 avg SpC],
  [H2 avg SpC],
  [H3 avg SpC],
  [J1 avg SpC],
  [J2 avg SpC],
  [J3 avg SpC],
  [L1 avg SpC],
  [L2 avg SpC],
  [L3 avg SpC],
  [M1 avg SpC],
  [M2 avg SpC],
  [M3 avg SpC],
  [N1 avg SpC],
  [N2 avg SpC],
  [N3 avg SpC],
  CAST([A1 avg SpC] AS FLOAT)/[Length] AS [A1 SpC/L],
  CAST([A2 avg SpC] AS FLOAT)/[Length] AS [A2 SpC/L],
  CAST([A3 avg SpC] AS FLOAT)/[Length] AS [A3 SpC/L],
  CAST([B1 avg SpC] AS FLOAT)/[Length] AS [B1 SpC/L],
  CAST([B2 avg SpC] AS FLOAT)/[Length] AS [B2 SpC/L],
  CAST([B3 avg SpC] AS FLOAT)/[Length] AS [B3 SpC/L],
  CAST([C1 avg SpC] AS FLOAT)/[Length] AS [C1 SpC/L],
  CAST([C2 avg SpC] AS FLOAT)/[Length] AS [C2 SpC/L],
  CAST([C3 avg SpC] AS FLOAT)/[Length] AS [C3 SpC/L],
  CAST([D1 avg SpC] AS FLOAT)/[Length] AS [D1 SpC/L],
  CAST([D2 avg SpC] AS FLOAT)/[Length] AS [D2 SpC/L],
  CAST([D3 avg SpC] AS FLOAT)/[Length] AS [D3 SpC/L],
  CAST([E1 avg SpC] AS FLOAT)/[Length] AS [E1 SpC/L],
  CAST([E2 avg SpC] AS FLOAT)/[Length] AS [E2 SpC/L],
  CAST([E3 avg SpC] AS FLOAT)/[Length] AS [E3 SpC/L],
  CAST([F1 avg SpC] AS FLOAT)/[Length] AS [F1 SpC/L],
  CAST([F2 avg SpC] AS FLOAT)/[Length] AS [F2 SpC/L],
  CAST([F3 avg SpC] AS FLOAT)/[Length] AS [F3 SpC/L],
  CAST([G1 avg SpC] AS FLOAT)/[Length] AS [G1 SpC/L],
  CAST([G2 avg SpC] AS FLOAT)/[Length] AS [G2 SpC/L],
  CAST([G3 avg SpC] AS FLOAT)/[Length] AS [G3 SpC/L],
  CAST([H1 avg SpC] AS FLOAT)/[Length] AS [H1 SpC/L],
  CAST([H2 avg SpC] AS FLOAT)/[Length] AS [H2 SpC/L],
  CAST([H3 avg SpC] AS FLOAT)/[Length] AS [H3 SpC/L],
  CAST([J1 avg SpC] AS FLOAT)/[Length] AS [J1 SpC/L],
  CAST([J2 avg SpC] AS FLOAT)/[Length] AS [J2 SpC/L],
  CAST([J3 avg SpC] AS FLOAT)/[Length] AS [J3 SpC/L],
  CAST([L1 avg SpC] AS FLOAT)/[Length] AS [L1 SpC/L],
  CAST([L2 avg SpC] AS FLOAT)/[Length] AS [L2 SpC/L],
  CAST([L3 avg SpC] AS FLOAT)/[Length] AS [L3 SpC/L],
  CAST([M1 avg SpC] AS FLOAT)/[Length] AS [M1 SpC/L],
  CAST([M2 avg SpC] AS FLOAT)/[Length] AS [M2 SpC/L],
  CAST([M3 avg SpC] AS FLOAT)/[Length] AS [M3 SpC/L],
  CAST([N1 avg SpC] AS FLOAT)/[Length] AS [N1 SpC/L],
  CAST([N2 avg SpC] AS FLOAT)/[Length] AS [N2 SpC/L],
  CAST([N3 avg SpC] AS FLOAT)/[Length] AS [N3 SpC/L]
  FROM [412].[bact detection average spc]


________________________________________


SELECT 
  SUM([A1 SpC/L]) AS [SUM A1 SpC/L],
  SUM([A2 SpC/L]) AS [SUM A2 SpC/L],
  SUM([A3 SpC/L]) AS [SUM A3 SpC/L],
  SUM([B1 SpC/L]) AS [SUM B1 SpC/L],
  SUM([B2 SpC/L]) AS [SUM B2 SpC/L],
  SUM([B3 SpC/L]) AS [SUM B3 SpC/L],
  SUM([C1 SpC/L]) AS [SUM C1 SpC/L],
  SUM([C2 SpC/L]) AS [SUM C2 SpC/L],
  SUM([C3 SpC/L]) AS [SUM C3 SpC/L],
  SUM([D1 SpC/L]) AS [SUM D1 SpC/L],
  SUM([D2 SpC/L]) AS [SUM D2 SpC/L],
  SUM([D3 SpC/L]) AS [SUM D3 SpC/L],
  SUM([E1 SpC/L]) AS [SUM E1 SpC/L],
  SUM([E2 SpC/L]) AS [SUM E2 SpC/L],
  SUM([E3 SpC/L]) AS [SUM E3 SpC/L],
  SUM([F1 SpC/L]) AS [SUM F1 SpC/L],
  SUM([F2 SpC/L]) AS [SUM F2 SpC/L],
  SUM([F3 SpC/L]) AS [SUM F3 SpC/L],
  SUM([G1 SpC/L]) AS [SUM G1 SpC/L],
  SUM([G2 SpC/L]) AS [SUM G2 SpC/L],
  SUM([G3 SpC/L]) AS [SUM G3 SpC/L],
  SUM([H1 SpC/L]) AS [SUM H1 SpC/L],
  SUM([H2 SpC/L]) AS [SUM H2 SpC/L],
  SUM([H3 SpC/L]) AS [SUM H3 SpC/L],
  SUM([J1 SpC/L]) AS [SUM J1 SpC/L],
  SUM([J2 SpC/L]) AS [SUM J2 SpC/L],
  SUM([J3 SpC/L]) AS [SUM J3 SpC/L],
  SUM([L1 SpC/L]) AS [SUM L1 SpC/L],
  SUM([L2 SpC/L]) AS [SUM L2 SpC/L],
  SUM([L3 SpC/L]) AS [SUM L3 SpC/L],
  SUM([M1 SpC/L]) AS [SUM M1 SpC/L],
  SUM([M2 SpC/L]) AS [SUM M2 SpC/L],
  SUM([M3 SpC/L]) AS [SUM M3 SpC/L],
  SUM([N1 SpC/L]) AS [SUM N1 SpC/L],
  SUM([N2 SpC/L]) AS [SUM N2 SpC/L],
  SUM([N3 SpC/L]) AS [SUM N3 SpC/L]
  FROM [412].[bact detection SpC-L]


________________________________________


SELECT Protein,
  spc.[A1 SpC/L] / allspc.[SUM A1 SpC/L] AS [NSAF A1],
  spc.[A2 SpC/L] / allspc.[SUM A2 SpC/L] AS [NSAF A2],
  spc.[A3 SpC/L] / allspc.[SUM A3 SpC/L] AS [NSAF A3],
  spc.[B1 SpC/L] / allspc.[SUM B1 SpC/L] AS [NSAF B1],
  spc.[B2 SpC/L] / allspc.[SUM B2 SpC/L] AS [NSAF B2],
  spc.[B3 SpC/L] / allspc.[SUM B3 SpC/L] AS [NSAF B3],
  spc.[C1 SpC/L] / allspc.[SUM C1 SpC/L] AS [NSAF C1],
  spc.[C2 SpC/L] / allspc.[SUM C2 SpC/L] AS [NSAF C2],
  spc.[C3 SpC/L] / allspc.[SUM C3 SpC/L] AS [NSAF C3],
  spc.[D1 SpC/L] / allspc.[SUM D1 SpC/L] AS [NSAF D1],
  spc.[D2 SpC/L] / allspc.[SUM D2 SpC/L] AS [NSAF D2],
  spc.[D3 SpC/L] / allspc.[SUM D3 SpC/L] AS [NSAF D3],
  spc.[E1 SpC/L] / allspc.[SUM E1 SpC/L] AS [NSAF E1],
  spc.[E2 SpC/L] / allspc.[SUM E2 SpC/L] AS [NSAF E2],
  spc.[E3 SpC/L] / allspc.[SUM E3 SpC/L] AS [NSAF E3],
  spc.[F1 SpC/L] / allspc.[SUM F1 SpC/L] AS [NSAF F1],
  spc.[F2 SpC/L] / allspc.[SUM F2 SpC/L] AS [NSAF F2],
  spc.[F3 SpC/L] / allspc.[SUM F3 SpC/L] AS [NSAF F3],
  spc.[G1 SpC/L] / allspc.[SUM G1 SpC/L] AS [NSAF G1],
  spc.[G2 SpC/L] / allspc.[SUM G2 SpC/L] AS [NSAF G2],
  spc.[G3 SpC/L] / allspc.[SUM G3 SpC/L] AS [NSAF G3],
  spc.[H1 SpC/L] / allspc.[SUM H1 SpC/L] AS [NSAF H1],
  spc.[H2 SpC/L] / allspc.[SUM H2 SpC/L] AS [NSAF H2],
  spc.[H3 SpC/L] / allspc.[SUM H3 SpC/L] AS [NSAF H3],
  spc.[J1 SpC/L] / allspc.[SUM J1 SpC/L] AS [NSAF J1],
  spc.[J2 SpC/L] / allspc.[SUM J2 SpC/L] AS [NSAF J2],
  spc.[J3 SpC/L] / allspc.[SUM J3 SpC/L] AS [NSAF J3],
  spc.[L1 SpC/L] / allspc.[SUM L1 SpC/L] AS [NSAF L1],
  spc.[L2 SpC/L] / allspc.[SUM L2 SpC/L] AS [NSAF L2],
  spc.[L3 SpC/L] / allspc.[SUM L3 SpC/L] AS [NSAF L3],
  spc.[M1 SpC/L] / allspc.[SUM M1 SpC/L] AS [NSAF M1],
  spc.[M2 SpC/L] / allspc.[SUM M2 SpC/L] AS [NSAF M2],
  spc.[M3 SpC/L] / allspc.[SUM M3 SpC/L] AS [NSAF M3],
  spc.[N1 SpC/L] / allspc.[SUM N1 SpC/L] AS [NSAF N1],
  spc.[N2 SpC/L] / allspc.[SUM N2 SpC/L] AS [NSAF N2],
  spc.[N3 SpC/L] / allspc.[SUM N3 SpC/L] AS [NSAF N3]
  FROM [412].[bact detection SpC-L] spc,
  [412].[bact detection sum spc.l] allspc


________________________________________


SELECT Protein FROM [412].[Bact detection nsaf]


________________________________________


SELECT [Peptide Count] FROM [412].[Thaps_number_peptide_overlaps_1.csv]


________________________________________


SELECT Protein FROM [412].[bact detection average spc]


________________________________________


SELECT [SUM A1 SpC/L] FROM [412].[bact detection sum spc.l]


________________________________________


SELECT [SUM N1 SpC/L] FROM [412].[bact detection sum spc.l]


________________________________________


SELECT Protein FROM [412].[bact detection SpC-L]


________________________________________


SELECT 
  SUM([A1 SpC/L]) AS [SUM A1 SpC/L],
  SUM([A2 SpC/L]) AS [SUM A2 SpC/L],
  SUM([A3 SpC/L]) AS [SUM A3 SpC/L],
  SUM([B1 SpC/L]) AS [SUM B1 SpC/L],
  SUM([B2 SpC/L]) AS [SUM B2 SpC/L],
  SUM([B3 SpC/L]) AS [SUM B3 SpC/L],
  SUM([C1 SpC/L]) AS [SUM C1 SpC/L],
  SUM([C2 SpC/L]) AS [SUM C2 SpC/L],
  SUM([C3 SpC/L]) AS [SUM C3 SpC/L],
  SUM([D1 SpC/L]) AS [SUM D1 SpC/L],
  SUM([D2 SpC/L]) AS [SUM D2 SpC/L],
  SUM([D3 SpC/L]) AS [SUM D3 SpC/L],
  SUM([E1 SpC/L]) AS [SUM E1 SpC/L],
  SUM([E2 SpC/L]) AS [SUM E2 SpC/L],
  SUM([E3 SpC/L]) AS [SUM E3 SpC/L],
  SUM([F1 SpC/L]) AS [SUM F1 SpC/L],
  SUM([F2 SpC/L]) AS [SUM F2 SpC/L],
  SUM([F3 SpC/L]) AS [SUM F3 SpC/L],
  SUM([G1 SpC/L]) AS [SUM G1 SpC/L],
  SUM([G2 SpC/L]) AS [SUM G2 SpC/L],
  SUM([G3 SpC/L]) AS [SUM G3 SpC/L],
  SUM([H1 SpC/L]) AS [SUM H1 SpC/L],
  SUM([H2 SpC/L]) AS [SUM H2 SpC/L],
  SUM([H3 SpC/L]) AS [SUM H3 SpC/L],
  SUM([J1 SpC/L]) AS [SUM J1 SpC/L],
  SUM([J2 SpC/L]) AS [SUM J2 SpC/L],
  SUM([J3 SpC/L]) AS [SUM J3 SpC/L],
  SUM([L1 SpC/L]) AS [SUM L1 SpC/L],
  SUM([L2 SpC/L]) AS [SUM L2 SpC/L],
  SUM([L3 SpC/L]) AS [SUM L3 SpC/L],
  SUM([M1 SpC/L]) AS [SUM M1 SpC/L],
  SUM([M2 SpC/L]) AS [SUM M2 SpC/L],
  SUM([M3 SpC/L]) AS [SUM M3 SpC/L],
  SUM([N1 SpC/L]) AS [SUM N1 SpC/L],
  SUM([N2 SpC/L]) AS [SUM N2 SpC/L],
  SUM([N3 SpC/L]) AS [SUM N3 SpC/L]
  FROM [412].[bact detection SpC-L]


________________________________________


SELECT Protein,
  spc.[A1 SpC/L] / allspc.[SUM A1 SpC/L] AS [NSAF A1],
  spc.[A2 SpC/L] / allspc.[SUM A2 SpC/L] AS [NSAF A2],
  spc.[A3 SpC/L] / allspc.[SUM A3 SpC/L] AS [NSAF A3],
  spc.[B1 SpC/L] / allspc.[SUM B1 SpC/L] AS [NSAF B1],
  spc.[B2 SpC/L] / allspc.[SUM B2 SpC/L] AS [NSAF B2],
  spc.[B3 SpC/L] / allspc.[SUM B3 SpC/L] AS [NSAF B3],
  spc.[C1 SpC/L] / allspc.[SUM C1 SpC/L] AS [NSAF C1],
  spc.[C2 SpC/L] / allspc.[SUM C2 SpC/L] AS [NSAF C2],
  spc.[C3 SpC/L] / allspc.[SUM C3 SpC/L] AS [NSAF C3],
  spc.[D1 SpC/L] / allspc.[SUM D1 SpC/L] AS [NSAF D1],
  spc.[D2 SpC/L] / allspc.[SUM D2 SpC/L] AS [NSAF D2],
  spc.[D3 SpC/L] / allspc.[SUM D3 SpC/L] AS [NSAF D3],
  spc.[E1 SpC/L] / allspc.[SUM E1 SpC/L] AS [NSAF E1],
  spc.[E2 SpC/L] / allspc.[SUM E2 SpC/L] AS [NSAF E2],
  spc.[E3 SpC/L] / allspc.[SUM E3 SpC/L] AS [NSAF E3],
  spc.[F1 SpC/L] / allspc.[SUM F1 SpC/L] AS [NSAF F1],
  spc.[F2 SpC/L] / allspc.[SUM F2 SpC/L] AS [NSAF F2],
  spc.[F3 SpC/L] / allspc.[SUM F3 SpC/L] AS [NSAF F3],
  spc.[G1 SpC/L] / allspc.[SUM G1 SpC/L] AS [NSAF G1],
  spc.[G2 SpC/L] / allspc.[SUM G2 SpC/L] AS [NSAF G2],
  spc.[G3 SpC/L] / allspc.[SUM G3 SpC/L] AS [NSAF G3],
  spc.[H1 SpC/L] / allspc.[SUM H1 SpC/L] AS [NSAF H1],
  spc.[H2 SpC/L] / allspc.[SUM H2 SpC/L] AS [NSAF H2],
  spc.[H3 SpC/L] / allspc.[SUM H3 SpC/L] AS [NSAF H3],
  spc.[J1 SpC/L] / allspc.[SUM J1 SpC/L] AS [NSAF J1],
  spc.[J2 SpC/L] / allspc.[SUM J2 SpC/L] AS [NSAF J2],
  spc.[J3 SpC/L] / allspc.[SUM J3 SpC/L] AS [NSAF J3],
  spc.[L1 SpC/L] / allspc.[SUM L1 SpC/L] AS [NSAF L1],
  spc.[L2 SpC/L] / allspc.[SUM L2 SpC/L] AS [NSAF L2],
  spc.[L3 SpC/L] / allspc.[SUM L3 SpC/L] AS [NSAF L3],
  spc.[M1 SpC/L] / allspc.[SUM M1 SpC/L] AS [NSAF M1],
  spc.[M2 SpC/L] / allspc.[SUM M2 SpC/L] AS [NSAF M2],
  spc.[M3 SpC/L] / allspc.[SUM M3 SpC/L] AS [NSAF M3],
  spc.[N1 SpC/L] / allspc.[SUM N1 SpC/L] AS [NSAF N1],
  spc.[N2 SpC/L] / allspc.[SUM N2 SpC/L] AS [NSAF N2],
  spc.[N3 SpC/L] / allspc.[SUM N3 SpC/L] AS [NSAF N3]
  FROM [412].[bact detection SpC-L] spc,
  [412].[summed spc-l] allspc


________________________________________


SELECT * 
  FROM [412].[bact detection SpC-L]


________________________________________


SELECT * 
  FROM [412].[bact detection average spc]


________________________________________


SELECT * 
  FROM [412].[Thaps_Rpom_sequence_lenghts.csv]


________________________________________


SELECT * 
  FROM [412].[bact detection tech reps summed]


________________________________________


SELECT * FROM [412].[Bact detection spec counts with 0]


________________________________________


SELECT * FROM [412].[Bact detection spec counts with 0]


________________________________________


SELECT * FROM [412].[Bact detection spec counts with 0]


________________________________________


SELECT * 
  FROM [412].[Bact Detection all data]


________________________________________


select * from [1079].[snapshot bact detection average spc]


________________________________________


SELECT * FROM [412].[Thaps  overlapping peptide]
  LEFT JOIN [412].[Bact detection nsaf all data]
  ON [412].[Thaps  overlapping peptide].Thaps_peptide=[412].[Bact detection nsaf all data].Protein


________________________________________


SELECT * FROM [412].[Thaps  overlapping peptide]
  LEFT JOIN [412].[Bact_detection_nsaf_all_data_with_ID.csv]
  ON [412].[Thaps  overlapping peptide].[Thaps_peptide]=[412].[Bact_detection_nsaf_all_data_with_ID.csv].Protein


________________________________________


SELECT Protein_Name_Thaps FROM [412].[Thaps peptides]


________________________________________


SELECT Protein_Name_Thaps FROM [412].[Rpom Thaps peptide overlap]


________________________________________


SELECT * FROM [412].[Rpom Thaps peptide overlap]
  LEFT JOIN [412].[Bact_detection_nsaf_all_data_with_ID.csv]
  ON [412].[Rpom Thaps peptide overlap].Protein_Name_Thaps=[412].[Bact_detection_nsaf_all_data_with_ID.csv].Protein


________________________________________


SELECT * FROM [412].[Rpom Thaps peptide overlap]
  LEFT JOIN [412].[Bact_detection_nsaf_all_data_with_ID.csv]
  ON [412].[Rpom Thaps peptide overlap].Protein_Name_Rpom=[412].[Bact_detection_nsaf_all_data_with_ID.csv].Protein


________________________________________


SELECT * FROM [412].[Rpom_overlap_peptides_JLMN_1.txt]
  LEFT JOIN [412].[Thaps_overlap_peptides_JLMN_1.txt]
  ON [412].[Rpom_overlap_peptides_JLMN_1.txt].Sequence_Rpom=[412].[Thaps_overlap_peptides_JLMN_1.txt].Sequence_Thaps


________________________________________


SELECT DISTINCT Sequence_Thaps, Protein_Name_Thaps FROM [412].[Thaps_overlap_peptides_JLMN_1.txt]


________________________________________


SELECT DISTINCT Sequence_Thaps FROM [412].[Thaps_overlap_peptides_JLMN_1.txt]


________________________________________


SELECT DISTINCT Sequence_Rpom FROM [412].[Rpom_overlap_peptides_JLMN_1.txt]


________________________________________


SELECT * FROM [412].[Rpom overlap peptides]
  LEFT JOIN [412].[Thaps overlap peptides]
  ON [412].[Rpom overlap peptides].Sequence_Rpom=[412].[Thaps overlap peptides].Sequence_Thaps


________________________________________


SELECT spectrum AS [spectrum27],
  start_scan AS start_scan27,
  expect AS expect27,
  peptide AS peptide27,
  protein AS protein27
  FROM [412].[table_BactDetection27.pep.txt]


________________________________________


SELECT spectrum AS [spectrum26],
  start_scan AS start_scan26,
  expect AS expect26,
  peptide AS peptide26,
  protein AS protein26
  FROM [412].[table_BactDetection26.pep_1.txt]


________________________________________


SELECT spectrum AS [spectrum25],
  start_scan AS start_scan25,
  expect AS expect25,
  peptide AS peptide25,
  protein AS protein25
  FROM [412].[table_BactDetection25.pep.txt]


________________________________________


SELECT spectrum AS [spectrum22],
  start_scan AS start_scan22,
  expect AS expect22,
  peptide AS peptide22,
  protein AS protein22
  FROM [412].[table_BactDetection22.pep.txt]


________________________________________


SELECT spectrum AS [spectrum34],
  start_scan AS start_scan34,
  expect AS expect34,
  peptide AS peptide34,
  protein AS protein34
  FROM [412].[table_BactDetection34.pep_1.txt]


________________________________________


SELECT spectrum AS [spectrum33],
  start_scan AS start_scan33,
  expect AS expect33,
  peptide AS peptide33,
  protein AS protein33
  FROM [412].[table_BactDetection33.pep.txt]


________________________________________


SELECT spectrum AS [spectrum32],
  start_scan AS start_scan32,
  expect AS expect32,
  peptide AS peptide32,
  protein AS protein32
  FROM [412].[table_BactDetection32.pep.txt]


________________________________________


SELECT spectrum AS [spectrum30],
  start_scan AS start_scan30,
  expect AS expect30,
  peptide AS peptide30,
  protein AS protein30
  FROM [412].[table_BactDetection30.pep_3.txt]


________________________________________


SELECT spectrum AS [spectrum28],
  start_scan AS start_scan28,
  expect AS expect28,
  peptide AS peptide28,
  protein AS protein28
  FROM [412].[table_BactDetection28.pep.txt]


________________________________________


SELECT spectrum AS [spectrum43],
  start_scan AS start_scan43,
  expect AS expect43,
  peptide AS peptide43,
  protein AS protein43
  FROM [412].[table_BactDetection43.pep.txt]


________________________________________


SELECT spectrum AS [spectrum42],
  start_scan AS start_scan42,
  expect AS expect42,
  peptide AS peptide42,
  protein AS protein42
  FROM [412].[table_BactDetection42.pep_1.txt]


________________________________________


SELECT spectrum AS [spectrum40],
  start_scan AS start_scan40,
  expect AS expect40,
  peptide AS peptide40,
  protein AS protein40
  FROM [412].[table_BactDetection40.pep.txt]


________________________________________


SELECT spectrum AS [spectrum39],
  start_scan AS start_scan39,
  expect AS expect39,
  peptide AS peptide39,
  protein AS protein39
  FROM [412].[table_BactDetection39.pep.txt]


________________________________________


SELECT spectrum AS [spectrum38],
  start_scan AS start_scan38,
  expect AS expect38,
  peptide AS peptide38,
  protein AS protein38
  FROM [412].[table_BactDetection38.pep_1.txt]


________________________________________


SELECT spectrum AS [spectrum52],
  start_scan AS start_scan52,
  expect AS expect52,
  peptide AS peptide52,
  protein AS protein52
  FROM [412].[table_BactDetection52.pep.txt]


________________________________________


SELECT spectrum AS [spectrum48],
  start_scan AS start_scan48,
  expect AS expect48,
  peptide AS peptide48,
  protein AS protein48
  FROM [412].[table_BactDetection48.pep_2.txt]


________________________________________


SELECT spectrum AS [spectrum46],
  start_scan AS start_scan46,
  expect AS expect46,
  peptide AS peptide46,
  protein AS protein46
  FROM [412].[table_BactDetection46.pep.txt]


________________________________________


SELECT spectrum AS [spectrum44],
  start_scan AS start_scan44,
  expect AS expect44,
  peptide AS peptide44,
  protein AS protein44
  FROM [412].[table_BactDetection44.pep.txt]


________________________________________


SELECT spectrum AS [spectrum58],
  start_scan AS start_scan58,
  expect AS expect58,
  peptide AS peptide58,
  protein AS protein58
  FROM [412].[table_BactDetection58.pep.txt]


________________________________________


SELECT spectrum AS [spectrum57],
  start_scan AS start_scan57,
  expect AS expect57,
  peptide AS peptide57,
  protein AS protein57
  FROM [412].[table_BactDetection57.pep.txt]


________________________________________


SELECT spectrum AS [spectrum56],
  start_scan AS start_scan56,
  expect AS expect56,
  peptide AS peptide56,
  protein AS protein56
  FROM [412].[table_BactDetection56.pep.txt]


________________________________________


SELECT spectrum AS [spectrum54],
  start_scan AS start_scan54,
  expect AS expect54,
  peptide AS peptide54,
  protein AS protein54
  FROM [412].[table_BactDetection54.pep_1.txt]


________________________________________


SELECT spectrum AS [spectrum53],
  start_scan AS start_scan53,
  expect AS expect53,
  peptide AS peptide53,
  protein AS protein53
  FROM [412].[table_BactDetection53.pep.txt]


________________________________________


SELECT start_scan22 FROM [412].[BactDetection22.pep.txt]
  UNION ALL
  SELECT start_scan25 FROM [412].[BactDetection25.pep.txt]
UNION ALL
  SELECT start_scan26 FROM [412].[BactDetection26.pep.txt]
  UNION ALL
  SELECT start_scan27 FROM [412].[BactDetection27.pep.txt]
UNION ALL
  SELECT start_scan28 FROM [412].[BactDetection28.pep.txt]
  UNION ALL
  SELECT start_scan30 FROM [412].[BactDetection30.pep.txt]
UNION ALL
  SELECT start_scan32 FROM [412].[BactDetection32.pep.txt]
UNION ALL
  SELECT start_scan33 FROM [412].[BactDetection33.pep.txt]
UNION ALL
  SELECT start_scan34 FROM [412].[BactDetection34.pep_1.txt]
UNION ALL
  SELECT start_scan38 FROM [412].[BactDetection38.pep.txt]
UNION ALL
  SELECT start_scan39 FROM [412].[BactDetection39.pep.txt]
UNION ALL
  SELECT start_scan40 FROM [412].[BactDetection40.pep.txt]
UNION ALL
  SELECT start_scan42 FROM [412].[BactDetection42.pep_1.txt]
UNION ALL
  SELECT start_scan43 FROM [412].[BactDetection43.pep.txt]
UNION ALL
  SELECT start_scan44 FROM [412].[BactDetection44.pep.txt]
UNION ALL
  SELECT start_scan46 FROM [412].[BactDetection46.pep.txt]
UNION ALL
  SELECT start_scan48 FROM [412].[BactDetection48.pep_2.txt]
UNION ALL
  SELECT start_scan52 FROM [412].[BactDetection52.pep.txt]
UNION ALL
  SELECT start_scan53 FROM [412].[BactDetection53.pep.txt]
UNION ALL
  SELECT start_scan54 FROM [412].[BactDetection54.pep_1.txt]
UNION ALL
  SELECT start_scan56 FROM [412].[BactDetection56.pep.txt]
UNION ALL
  SELECT start_scan57 FROM [412].[BactDetection57.pep.txt]
UNION ALL
  SELECT start_scan58 FROM [412].[BactDetection58.pep.txt]


________________________________________


SELECT start_scan22 AS [scan number] FROM [412].[BactDetection22.pep.txt]
  UNION ALL
  SELECT start_scan25 FROM [412].[BactDetection25.pep.txt]
UNION ALL
  SELECT start_scan26 FROM [412].[BactDetection26.pep.txt]
  UNION ALL
  SELECT start_scan27 FROM [412].[BactDetection27.pep.txt]
UNION ALL
  SELECT start_scan28 FROM [412].[BactDetection28.pep.txt]
  UNION ALL
  SELECT start_scan30 FROM [412].[BactDetection30.pep.txt]
UNION ALL
  SELECT start_scan32 FROM [412].[BactDetection32.pep.txt]
UNION ALL
  SELECT start_scan33 FROM [412].[BactDetection33.pep.txt]
UNION ALL
  SELECT start_scan34 FROM [412].[BactDetection34.pep_1.txt]
UNION ALL
  SELECT start_scan38 FROM [412].[BactDetection38.pep.txt]
UNION ALL
  SELECT start_scan39 FROM [412].[BactDetection39.pep.txt]
UNION ALL
  SELECT start_scan40 FROM [412].[BactDetection40.pep.txt]
UNION ALL
  SELECT start_scan42 FROM [412].[BactDetection42.pep_1.txt]
UNION ALL
  SELECT start_scan43 FROM [412].[BactDetection43.pep.txt]
UNION ALL
  SELECT start_scan44 FROM [412].[BactDetection44.pep.txt]
UNION ALL
  SELECT start_scan46 FROM [412].[BactDetection46.pep.txt]
UNION ALL
  SELECT start_scan48 FROM [412].[BactDetection48.pep_2.txt]
UNION ALL
  SELECT start_scan52 FROM [412].[BactDetection52.pep.txt]
UNION ALL
  SELECT start_scan53 FROM [412].[BactDetection53.pep.txt]
UNION ALL
  SELECT start_scan54 FROM [412].[BactDetection54.pep_1.txt]
UNION ALL
  SELECT start_scan56 FROM [412].[BactDetection56.pep.txt]
UNION ALL
  SELECT start_scan57 FROM [412].[BactDetection57.pep.txt]
UNION ALL
  SELECT start_scan58 FROM [412].[BactDetection58.pep.txt]


________________________________________


SELECT DISTINCT [scan number] FROM [412].[all scan numbers June 9 data]


________________________________________


SELECT * FROM [412].[all distinct scan numbers June 9]
  LEFT JOIN [412].[BactDetection22.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection22.pep.txt].start_scan22
  LEFT JOIN [412].[BactDetection25.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection25.pep.txt].start_scan25
  LEFT JOIN [412].[BactDetection26.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection26.pep.txt].start_scan26
  LEFT JOIN [412].[BactDetection27.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection27.pep.txt].start_scan27
  LEFT JOIN [412].[BactDetection28.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection28.pep.txt].start_scan28
  LEFT JOIN [412].[BactDetection30.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection30.pep.txt].start_scan30
  LEFT JOIN [412].[BactDetection32.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection32.pep.txt].start_scan32
  LEFT JOIN [412].[BactDetection33.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection33.pep.txt].start_scan33
  LEFT JOIN [412].[BactDetection34.pep_1.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection34.pep_1.txt].start_scan34
  LEFT JOIN [412].[BactDetection38.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection38.pep.txt].start_scan38
  LEFT JOIN [412].[BactDetection39.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection39.pep.txt].start_scan39
  LEFT JOIN [412].[BactDetection40.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection40.pep.txt].start_scan40
  LEFT JOIN [412].[BactDetection42.pep_1.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection42.pep_1.txt].start_scan42
  LEFT JOIN [412].[BactDetection43.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection43.pep.txt].start_scan43
  LEFT JOIN [412].[BactDetection44.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection44.pep.txt].start_scan44
  LEFT JOIN [412].[BactDetection46.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection46.pep.txt].start_scan46
  LEFT JOIN [412].[BactDetection48.pep_2.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection48.pep_2.txt].start_scan48
  LEFT JOIN [412].[BactDetection52.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection52.pep.txt].start_scan52
  LEFT JOIN [412].[BactDetection53.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection53.pep.txt].start_scan53
  LEFT JOIN [412].[BactDetection54.pep_1.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection54.pep_1.txt].start_scan54
  LEFT JOIN [412].[BactDetection56.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection56.pep.txt].start_scan56
  LEFT JOIN [412].[BactDetection57.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection57.pep.txt].start_scan57
  LEFT JOIN [412].[BactDetection58.pep.txt]
  ON [412].[all distinct scan numbers June 9].[scan number]=[412].[BactDetection58.pep.txt].start_scan58


________________________________________


SELECT [protein] AS [protein 3FE],
  [protein probability] AS [probability 3FE],
  [tot indep spectra] AS [tot spectra 3FE]
  FROM [412].[table_interact-2015_May_26_Geoduck_09.prot.xls]


________________________________________


SELECT [protein] AS [protein 4FE],
  [protein probability] AS [probability 4FE],
  [tot indep spectra] AS [tot spectra 4FE]
  FROM [412].[table_interact-2015_May_26_Geoduck_10.prot.xls]


________________________________________


SELECT [protein] AS [protein 8FE],
  [protein probability] AS [probability 8FE],
  [tot indep spectra] AS [tot spectra 8FE]
  FROM [412].[table_interact-2015_May_26_Geoduck_11.prot.xls]


________________________________________


SELECT [protein] AS [protein 34FM],
  [protein probability] AS [probability 34FM],
  [tot indep spectra] AS [tot spectra 34FM]
  FROM [412].[table_interact-2015_May_26_Geoduck_13.prot.xls]


________________________________________


SELECT [protein] AS [protein 35FM],
  [protein probability] AS [probability 35FM],
  [tot indep spectra] AS [tot spectra 35FM]
  FROM [412].[table_interact-2015_May_26_Geoduck_14.prot.xls]


________________________________________


SELECT [protein] AS [protein 38FM],
  [protein probability] AS [probability 38FM],
  [tot indep spectra] AS [tot spectra 38FM]
  FROM [412].[table_interact-2015_May_26_Geoduck_15.prot.xls]


________________________________________


SELECT [protein] AS [protein 51FL],
  [protein probability] AS [probability 51FL],
  [tot indep spectra] AS [tot spectra 51FL]
  FROM [412].[table_interact-2015_May_26_Geoduck_17.prot.xls]


________________________________________


SELECT [protein] AS [protein 69FL],
  [protein probability] AS [probability 69FL],
  [tot indep spectra] AS [tot spectra 69FL]
  FROM [412].[table_interact-2015_May_26_Geoduck_18.prot.xls]


________________________________________


SELECT [protein] AS [protein 70FL],
  [protein probability] AS [probability 70FL],
  [tot indep spectra] AS [tot spectra 70FL]
  FROM [412].[table_interact-2015_May_26_Geoduck_19.prot.xls]


________________________________________


SELECT [protein] AS [protein 2ME],
  [protein probability] AS [probability 2ME],
  [tot indep spectra] AS [tot spectra 2ME]
  FROM [412].[table_interact-2015_May_26_Geoduck_23.prot.xls]


________________________________________


SELECT [protein] AS [protein 7ME],
  [protein probability] AS [probability 7ME],
  [tot indep spectra] AS [tot spectra 7ME]
  FROM [412].[table_interact-2015_May_26_Geoduck_24.prot.xls]


________________________________________


SELECT [protein] AS [protein 9ME],
  [protein probability] AS [probability 9ME],
  [tot indep spectra] AS [tot spectra 9ME]
  FROM [412].[table_interact-2015_May_26_Geoduck_25.prot.xls]


________________________________________


SELECT [protein] AS [protein 41MM],
  [protein probability] AS [probability 41MM],
  [tot indep spectra] AS [tot spectra 41MM]
  FROM [412].[table_interact-2015_May_26_Geoduck_27.prot.xls]


________________________________________


SELECT [protein] AS [protein 42MM],
  [protein probability] AS [probability 42MM],
  [tot indep spectra] AS [tot spectra 42MM]
  FROM [412].[table_interact-2015_May_26_Geoduck_28.prot.xls]


________________________________________


SELECT [protein] AS [protein 46MM],
  [protein probability] AS [probability 46MM],
  [tot indep spectra] AS [tot spectra 46MM]
  FROM [412].[table_interact-2015_May_26_Geoduck_29.prot.xls]


________________________________________


SELECT [protein] AS [protein 65ML],
  [protein probability] AS [probability 65ML],
  [tot indep spectra] AS [tot spectra 65ML]
  FROM [412].[table_interact-2015_May_26_Geoduck_31.prot.xls]


________________________________________


SELECT [protein] AS [protein 67ML],
  [protein probability] AS [probability 67ML],
  [tot indep spectra] AS [tot spectra 67ML]
  FROM [412].[table_interact-2015_May_26_Geoduck_32.prot.xls]


________________________________________


SELECT [protein] AS [protein 34FM],
  [protein probability] AS [probability 34FM],
  [tot indep spectra] AS [tot spectra 34FM]
  FROM [412].[table_interact-2015_May_26_Geoduck_37.prot.xls]


________________________________________


SELECT [protein] AS [protein 35FM],
  [protein probability] AS [probability 35FM],
  [tot indep spectra] AS [tot spectra 35FM]
  FROM [412].[table_interact-2015_May_26_Geoduck_38.prot.xls]


________________________________________


SELECT [protein] AS [protein 38FM],
  [protein probability] AS [probability 38FM],
  [tot indep spectra] AS [tot spectra 38FM]
  FROM [412].[table_interact-2015_May_26_Geoduck_39.prot.xls]


________________________________________


SELECT [protein] AS [protein 51FL],
  [protein probability] AS [probability 51FL],
  [tot indep spectra] AS [tot spectra 51FL]
  FROM [412].[table_interact-2015_May_26_Geoduck_41.prot.xls]


________________________________________


SELECT [protein] AS [protein 69FL],
  [protein probability] AS [probability 69FL],
  [tot indep spectra] AS [tot spectra 69FL]
  FROM [412].[table_interact-2015_May_26_Geoduck_42.prot.xls]


________________________________________


SELECT [protein] AS [protein 70FL],
  [protein probability] AS [probability 70FL],
  [tot indep spectra] AS [tot spectra 70FL]
  FROM [412].[table_interact-2015_May_26_Geoduck_43.prot.xls]


________________________________________


SELECT [protein] AS [protein 34FM.2],
  [protein probability] AS [probability 34FM.2],
  [tot indep spectra] AS [tot spectra 34FM.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_37.prot.xls]


________________________________________


SELECT [protein] AS [protein 35FM.2],
  [protein probability] AS [probability 35FM.2],
  [tot indep spectra] AS [tot spectra 35FM.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_38.prot.xls]


________________________________________


SELECT [protein] AS [protein 38FM.2],
  [protein probability] AS [probability 38FM.2],
  [tot indep spectra] AS [tot spectra 38FM.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_39.prot.xls]


________________________________________


SELECT [protein] AS [protein 51FL.2],
  [protein probability] AS [probability 51FL.2],
  [tot indep spectra] AS [tot spectra 51FL.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_41.prot.xls]


________________________________________


SELECT [protein] AS [protein 69FL.2],
  [protein probability] AS [probability 69FL.2],
  [tot indep spectra] AS [tot spectra 69FL.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_42.prot.xls]


________________________________________


SELECT [protein] AS [protein 70FL.2],
  [protein probability] AS [probability 70FL.2],
  [tot indep spectra] AS [tot spectra 70FL.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_43.prot.xls]


________________________________________


SELECT [protein] AS [protein 3FE.2],
  [protein probability] AS [probability 3FE.2],
  [tot indep spectra] AS [tot spectra 3FE.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_45.prot.xls]


________________________________________


SELECT [protein] AS [protein 4FE.2],
  [protein probability] AS [probability 4FE.2],
  [tot indep spectra] AS [tot spectra 4FE.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_46.prot.xls]


________________________________________


SELECT [protein] AS [protein 8FE.2],
  [protein probability] AS [probability 8FE.2],
  [tot indep spectra] AS [tot spectra 8FE.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_47.prot.xls]


________________________________________


SELECT [protein] AS [protein 41MM.2],
  [protein probability] AS [probability 41MM.2],
  [tot indep spectra] AS [tot spectra 41MM.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_51.prot.xls]


________________________________________


SELECT [protein] AS [protein 46MM.2],
  [protein probability] AS [probability 46MM.2],
  [tot indep spectra] AS [tot spectra 46MM.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_53.prot.xls]


________________________________________


SELECT [protein] AS [protein 65ML.2],
  [protein probability] AS [probability 65ML.2],
  [tot indep spectra] AS [tot spectra 65ML.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_55.prot.xls]


________________________________________


SELECT [protein] AS [protein 67ML.2],
  [protein probability] AS [probability 67ML.2],
  [tot indep spectra] AS [tot spectra 67ML.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_56.prot.xls]


________________________________________


SELECT [protein] AS [protein 2ME.2],
  [protein probability] AS [probability 2ME.2],
  [tot indep spectra] AS [tot spectra 2ME.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_59.prot.xls]


________________________________________


SELECT [protein] AS [protein 7ME.2],
  [protein probability] AS [probability 7ME.2],
  [tot indep spectra] AS [tot spectra 7ME.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_60.prot.xls]


________________________________________


SELECT [protein] AS [protein 51FL.3],
  [protein probability] AS [probability 51FL.3],
  [tot indep spectra] AS [tot spectra 51FL.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_66.prot.xls]


________________________________________


SELECT [protein] AS [protein 69FL.3],
  [protein probability] AS [probability 69FL.3],
  [tot indep spectra] AS [tot spectra 69FL.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_67.prot.xls]


________________________________________


SELECT [protein] AS [protein 38FM.3],
  [protein probability] AS [probability 38FM.3],
  [tot indep spectra] AS [tot spectra 38FM.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_69.prot.xls]


________________________________________


SELECT [protein] AS [protein 35FM.3],
  [protein probability] AS [probability 35FM.3],
  [tot indep spectra] AS [tot spectra 35FM.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_70.prot.xls]


________________________________________


SELECT [protein] AS [protein 34FM.3],
  [protein probability] AS [probability 34FM.3],
  [tot indep spectra] AS [tot spectra 34FM.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_71.prot.xls]


________________________________________


SELECT [protein] AS [protein 8FE.3],
  [protein probability] AS [probability 8FE.3],
  [tot indep spectra] AS [tot spectra 8FE.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_73.prot.xls]


________________________________________


SELECT [protein] AS [protein 3FE.3],
  [protein probability] AS [probability 3FE.3],
  [tot indep spectra] AS [tot spectra 3FE.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_74.prot.xls]


________________________________________


SELECT [protein] AS [protein 4FE.3],
  [protein probability] AS [probability 4FE.3],
  [tot indep spectra] AS [tot spectra 4FE.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_74.prot_1.xls]


________________________________________


SELECT [protein] AS [protein 4FE.3],
  [protein probability] AS [probability 4FE.3],
  [tot indep spectra] AS [tot spectra 4FE.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_75.prot.xls]


________________________________________


SELECT [protein] AS [protein 68ML.3],
  [protein probability] AS [probability 68ML.3],
  [tot indep spectra] AS [tot spectra 68ML.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_79.prot.xls]


________________________________________


SELECT [protein] AS [protein 67ML.3],
  [protein probability] AS [probability 67ML.3],
  [tot indep spectra] AS [tot spectra 67ML.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_80.prot.xls]


________________________________________


SELECT [protein] AS [protein 65ML.3],
  [protein probability] AS [probability 65ML.3],
  [tot indep spectra] AS [tot spectra 65ML.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_81.prot.xls]


________________________________________


SELECT [protein] AS [protein 46MM.3],
  [protein probability] AS [probability 46MM.3],
  [tot indep spectra] AS [tot spectra 46MM.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_83.prot.xls]


________________________________________


SELECT [protein] AS [protein 42MM.3],
  [protein probability] AS [probability 42MM.3],
  [tot indep spectra] AS [tot spectra 42MM.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_84.prot.xls]


________________________________________


SELECT [protein] AS [protein 41MM.3],
  [protein probability] AS [probability 41MM.3],
  [tot indep spectra] AS [tot spectra 41MM.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_85.prot.xls]


________________________________________


SELECT [protein] AS [protein 9ME.3],
  [protein probability] AS [probability 9ME.3],
  [tot indep spectra] AS [tot spectra 9ME.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_87.prot.xls]


________________________________________


SELECT [protein] AS [protein 7ME.3],
  [protein probability] AS [probability 7ME.3],
  [tot indep spectra] AS [tot spectra 7ME.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_88.prot.xls]


________________________________________


SELECT [protein] AS [protein 2ME.3],
  [protein probability] AS [probability 2ME.3],
  [tot indep spectra] AS [tot spectra 2ME.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_89.prot.xls]


________________________________________


SELECT [protein] AS [protein 57ML.2],
  [protein probability] AS [probability 57ML.2],
  [tot indep spectra] AS [tot spectra 57ML.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_57.prot.xls]


________________________________________


SELECT [protein] AS [protein 68ML],
  [protein probability] AS [probability 68ML],
  [tot indep spectra] AS [tot spectra 68ML]
  FROM [412].[table_interact-2015_May_26_Geoduck_33.prot.xls]


________________________________________


SELECT [protein] AS [protein 9ME.2],
  [protein probability] AS [probability 9ME.2],
  [tot indep spectra] AS [tot spectra 9ME.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_61.prot.xls]


________________________________________


SELECT [protein] AS [protein 70FL.3],
  [protein probability] AS [probability 70FL.3],
  [tot indep spectra] AS [tot spectra 70FL.3]
  FROM [412].[table_interact-2015_May_26_Geoduck_65.prot.xls]


________________________________________


SELECT * FROM [412].[Geoduck_transcriptome_protein_list]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_09.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_09.prot.xls].[protein 3FE]


________________________________________


SELECT protein AS [protein 42MM.2],
  [protein probability] AS [probability 42MM.2],
  [tot indep spectra] AS [tot spectra 42MM.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_52.prot.xls]


________________________________________


SELECT [protein] AS [protein 68ML.2],
  [protein probability] AS [probability 68ML.2],
  [tot indep spectra] AS [tot spectra 68ML.2]
  FROM [412].[table_interact-2015_May_26_Geoduck_57.prot.xls]


________________________________________


SELECT * FROM [412].[Geoduck_transcriptome_protein_list]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_09.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_09.prot.xls].[protein 3FE]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_10.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_10.prot.xls].[protein 4FE]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_11.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_11.prot.xls].[protein 8FE]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_13.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_13.prot.xls].[protein 34FM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_14.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_14.prot.xls].[protein 35FM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_15.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_15.prot.xls].[protein 38FM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_17.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_17.prot.xls].[protein 51FL]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_18.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_18.prot.xls].[protein 69FL]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_19.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_19.prot.xls].[protein 70FL]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_23.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_23.prot.xls].[protein 2ME]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_24.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_24.prot.xls].[protein 7ME]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_25.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_25.prot.xls].[protein 9ME]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_27.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_27.prot.xls].[protein 41MM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_28.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_28.prot.xls].[protein 42MM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_29.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_29.prot.xls].[protein 46MM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_31.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_31.prot.xls].[protein 65ML]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_32.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_32.prot.xls].[protein 67ML]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_33.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_33.prot.xls].[protein 68ML]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_37.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_37.prot.xls].[protein 34FM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_38.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_38.prot.xls].[protein 35FM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_39.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_39.prot.xls].[protein 38FM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_41.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_41.prot.xls].[protein 51FL.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_42.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_42.prot.xls].[protein 69FL.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_43.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_43.prot.xls].[protein 70FL.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_45.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_45.prot.xls].[protein 3FE.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_46.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_46.prot.xls].[protein 4FE.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_47.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_47.prot.xls].[protein 8FE.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_51.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_51.prot.xls].[protein 41MM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_52.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_52.prot.xls].[protein 42MM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_53.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_53.prot.xls].[protein 46MM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_55.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_55.prot.xls].[protein 65ML.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_56.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_56.prot.xls].[protein 67ML.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_57.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_57.prot.xls].[protein 68ML.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_59.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_59.prot.xls].[protein 2ME.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_60.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_60.prot.xls].[protein 7ME.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_61.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_61.prot.xls].[protein 9ME.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_65.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_65.prot.xls].[protein 70FL.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_66.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_66.prot.xls].[protein 51FL.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_67.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_67.prot.xls].[protein 69FL.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_69.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_69.prot.xls].[protein 38FM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_70.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_70.prot.xls].[protein 35FM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_71.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_71.prot.xls].[protein 34FM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_73.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_73.prot.xls].[protein 8FE.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_74.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_74.prot.xls].[protein 3FE.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_75.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_75.prot.xls].[protein 4FE.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_79.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_79.prot.xls].[protein 68ML.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_80.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_80.prot.xls].[protein 67ML.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_81.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_81.prot.xls].[protein 65ML.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_83.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_83.prot.xls].[protein 46MM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_84.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_84.prot.xls].[protein 42MM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_85.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_85.prot.xls].[protein 41MM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_87.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_87.prot.xls].[protein 9ME.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_88.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_88.prot.xls].[protein 7ME.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_89.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_89.prot.xls].[protein 2ME.3]


________________________________________


SELECT * FROM [412].[Geoduck_transcriptome_protein_list]
  LEFT JOIN [412].[geoduck_protein_length.txt]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[geoduck_protein_length.txt].Protein
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_09.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_09.prot.xls].[protein 3FE]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_10.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_10.prot.xls].[protein 4FE]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_11.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_11.prot.xls].[protein 8FE]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_13.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_13.prot.xls].[protein 34FM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_14.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_14.prot.xls].[protein 35FM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_15.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_15.prot.xls].[protein 38FM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_17.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_17.prot.xls].[protein 51FL]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_18.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_18.prot.xls].[protein 69FL]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_19.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_19.prot.xls].[protein 70FL]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_23.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_23.prot.xls].[protein 2ME]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_24.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_24.prot.xls].[protein 7ME]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_25.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_25.prot.xls].[protein 9ME]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_27.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_27.prot.xls].[protein 41MM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_28.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_28.prot.xls].[protein 42MM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_29.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_29.prot.xls].[protein 46MM]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_31.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_31.prot.xls].[protein 65ML]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_32.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_32.prot.xls].[protein 67ML]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_33.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_33.prot.xls].[protein 68ML]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_37.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_37.prot.xls].[protein 34FM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_38.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_38.prot.xls].[protein 35FM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_39.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_39.prot.xls].[protein 38FM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_41.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_41.prot.xls].[protein 51FL.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_42.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_42.prot.xls].[protein 69FL.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_43.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_43.prot.xls].[protein 70FL.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_45.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_45.prot.xls].[protein 3FE.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_46.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_46.prot.xls].[protein 4FE.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_47.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_47.prot.xls].[protein 8FE.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_51.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_51.prot.xls].[protein 41MM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_52.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_52.prot.xls].[protein 42MM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_53.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_53.prot.xls].[protein 46MM.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_55.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_55.prot.xls].[protein 65ML.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_56.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_56.prot.xls].[protein 67ML.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_57.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_57.prot.xls].[protein 68ML.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_59.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_59.prot.xls].[protein 2ME.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_60.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_60.prot.xls].[protein 7ME.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_61.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_61.prot.xls].[protein 9ME.2]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_65.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_65.prot.xls].[protein 70FL.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_66.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_66.prot.xls].[protein 51FL.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_67.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_67.prot.xls].[protein 69FL.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_69.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_69.prot.xls].[protein 38FM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_70.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_70.prot.xls].[protein 35FM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_71.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_71.prot.xls].[protein 34FM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_73.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_73.prot.xls].[protein 8FE.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_74.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_74.prot.xls].[protein 3FE.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_75.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_75.prot.xls].[protein 4FE.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_79.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_79.prot.xls].[protein 68ML.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_80.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_80.prot.xls].[protein 67ML.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_81.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_81.prot.xls].[protein 65ML.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_83.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_83.prot.xls].[protein 46MM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_84.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_84.prot.xls].[protein 42MM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_85.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_85.prot.xls].[protein 41MM.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_87.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_87.prot.xls].[protein 9ME.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_88.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_88.prot.xls].[protein 7ME.3]
  LEFT JOIN [412].[interact-2015_May_26_Geoduck_89.prot.xls]
  ON [412].[Geoduck_transcriptome_protein_list].[Geoduck protein]=[412].[interact-2015_May_26_Geoduck_89.prot.xls].[protein 2ME.3]


________________________________________


SELECT [Geoduck protein],
  Length,
  [tot spectra 3FE],
  [tot spectra 4FE],
  [tot spectra 8FE],
  [tot spectra 34FM],
  [tot spectra 35FM],
  [tot spectra 38FM],
  [tot spectra 51FL],
  [tot spectra 69FL],
  [tot spectra 70FL],
  [tot spectra 3FE.2],
  [tot spectra 4FE.2],
  [tot spectra 8FE.2],
  [tot spectra 34FM.2],
  [tot spectra 35FM.2],
  [tot spectra 38FM.2],
  [tot spectra 51FL.2],
  [tot spectra 69FL.2],
  [tot spectra 70FL.2],
  [tot spectra 3FE.3],
  [tot spectra 4FE.3],
  [tot spectra 8FE.3],
  [tot spectra 34FM.3],
  [tot spectra 35FM.3],
  [tot spectra 38FM.3],
  [tot spectra 51FL.3],
  [tot spectra 69FL.3],
  [tot spectra 70FL.3],
  [tot spectra 2ME],
  [tot spectra 7ME],
  [tot spectra 9ME],
  [tot spectra 41MM],
  [tot spectra 42MM],
  [tot spectra 46MM],
  [tot spectra 65ML],
  [tot spectra 67ML],
  [tot spectra 68ML],
  [tot spectra 2ME.2],
  [tot spectra 7ME.2],
  [tot spectra 9ME.2],
  [tot spectra 41MM.2],
  [tot spectra 42MM.2],
  [tot spectra 46MM.2],
  [tot spectra 65ML.2],
  [tot spectra 67ML.2],
  [tot spectra 68ML.2],
  [tot spectra 2ME.3],
  [tot spectra 7ME.3],
  [tot spectra 9ME.3],
  [tot spectra 41MM.3],
  [tot spectra 42MM.3],
  [tot spectra 46MM.3],
  [tot spectra 65ML.3],
  [tot spectra 67ML.3],
  [tot spectra 68ML.3]
  FROM [412].[All TPP geoduck transcriptome]


________________________________________


SELECT [Geoduck protein],
  Length,
  CASE WHEN [tot spectra 3FE] is NULL THEN 0 ELSE [tot spectra 3FE] END AS [tot spectra 3FE],
  CASE WHEN [tot spectra 4FE] is NULL THEN 0 ELSE [tot spectra 4FE] END AS [tot spectra 4FE],
  CASE WHEN [tot spectra 8FE] is NULL THEN 0 ELSE [tot spectra 8FE] END AS [tot spectra 8FE],
  CASE WHEN [tot spectra 34FM] is NULL THEN 0 ELSE [tot spectra 34FM] END AS [tot spectra 34FM],
  CASE WHEN [tot spectra 35FM] is NULL THEN 0 ELSE [tot spectra 35FM] END AS [tot spectra 35FM],
  CASE WHEN [tot spectra 38FM] is NULL THEN 0 ELSE [tot spectra 38FM] END AS [tot spectra 38FM],
  CASE WHEN [tot spectra 51FL] is NULL THEN 0 ELSE [tot spectra 51FL] END AS [tot spectra 51FL],
  CASE WHEN [tot spectra 69FL] is NULL THEN 0 ELSE [tot spectra 69FL] END AS [tot spectra 69FL],
  CASE WHEN [tot spectra 70FL] is NULL THEN 0 ELSE [tot spectra 70FL] END AS [tot spectra 70FL],
  CASE WHEN [tot spectra 3FE.2] is NULL THEN 0 ELSE [tot spectra 3FE.2] END AS [tot spectra 3FE.2],
  CASE WHEN [tot spectra 4FE.2] is NULL THEN 0 ELSE [tot spectra 4FE.2] END AS [tot spectra 4FE.2],
  CASE WHEN [tot spectra 8FE.2] is NULL THEN 0 ELSE [tot spectra 8FE.2] END AS [tot spectra 8FE.2],
  CASE WHEN [tot spectra 34FM.2] is NULL THEN 0 ELSE [tot spectra 34FM.2] END AS [tot spectra 34FM.2],
  CASE WHEN [tot spectra 35FM.2] is NULL THEN 0 ELSE [tot spectra 35FM.2] END AS [tot spectra 35FM.2],
  CASE WHEN [tot spectra 38FM.2] is NULL THEN 0 ELSE [tot spectra 38FM.2] END AS [tot spectra 38FM.2],
  CASE WHEN [tot spectra 51FL.2] is NULL THEN 0 ELSE [tot spectra 51FL.2] END AS [tot spectra 51FL.2],
  CASE WHEN [tot spectra 69FL.2] is NULL THEN 0 ELSE [tot spectra 69FL.2] END AS [tot spectra 69FL.2],
  CASE WHEN [tot spectra 70FL.2] is NULL THEN 0 ELSE [tot spectra 70FL.2] END AS [tot spectra 70FL.2],
  CASE WHEN [tot spectra 3FE.3] is NULL THEN 0 ELSE [tot spectra 3FE.3] END AS [tot spectra 3FE.3],
  CASE WHEN [tot spectra 4FE.3] is NULL THEN 0 ELSE [tot spectra 4FE.3] END AS [tot spectra 4FE.3],
  CASE WHEN [tot spectra 8FE.3] is NULL THEN 0 ELSE [tot spectra 8FE.3] END AS [tot spectra 8FE.3],
  CASE WHEN [tot spectra 34FM.3] is NULL THEN 0 ELSE [tot spectra 34FM.3] END AS [tot spectra 34FM.3],
  CASE WHEN [tot spectra 35FM.3] is NULL THEN 0 ELSE [tot spectra 35FM.3] END AS [tot spectra 35FM.3],
  CASE WHEN [tot spectra 38FM.3] is NULL THEN 0 ELSE [tot spectra 38FM.3] END AS [tot spectra 38FM.3],
  CASE WHEN [tot spectra 51FL.3] is NULL THEN 0 ELSE [tot spectra 51FL.3] END AS [tot spectra 51FL.3],
  CASE WHEN [tot spectra 69FL.3] is NULL THEN 0 ELSE [tot spectra 69FL.3] END AS [tot spectra 69FL.3],
  CASE WHEN [tot spectra 70FL.3] is NULL THEN 0 ELSE [tot spectra 70FL.3] END AS [tot spectra 70FL.3],
  CASE WHEN [tot spectra 2ME] is NULL THEN 0 ELSE [tot spectra 2ME] END AS [tot spectra 2ME],
  CASE WHEN [tot spectra 7ME] is NULL THEN 0 ELSE [tot spectra 7ME] END AS [tot spectra 7ME],
  CASE WHEN [tot spectra 9ME] is NULL THEN 0 ELSE [tot spectra 9ME] END AS [tot spectra 9ME],
  CASE WHEN [tot spectra 41MM] is NULL THEN 0 ELSE [tot spectra 41MM] END AS [tot spectra 41MM],
  CASE WHEN [tot spectra 42MM] is NULL THEN 0 ELSE [tot spectra 42MM] END AS [tot spectra 42MM],
  CASE WHEN [tot spectra 46MM] is NULL THEN 0 ELSE [tot spectra 46MM] END AS [tot spectra 46MM],
  CASE WHEN [tot spectra 65ML] is NULL THEN 0 ELSE [tot spectra 65ML] END AS [tot spectra 65ML],
  CASE WHEN [tot spectra 67ML] is NULL THEN 0 ELSE [tot spectra 67ML] END AS [tot spectra 67ML],
  CASE WHEN [tot spectra 68ML] is NULL THEN 0 ELSE [tot spectra 68ML] END AS [tot spectra 68ML],
  CASE WHEN [tot spectra 2ME.2] is NULL THEN 0 ELSE [tot spectra 2ME.2] END AS [tot spectra 2ME.2],
  CASE WHEN [tot spectra 7ME.2] is NULL THEN 0 ELSE [tot spectra 7ME.2] END AS [tot spectra 7ME.2],
  CASE WHEN [tot spectra 9ME.2] is NULL THEN 0 ELSE [tot spectra 9ME.2] END AS [tot spectra 9ME.2],
  CASE WHEN [tot spectra 41MM.2] is NULL THEN 0 ELSE [tot spectra 41MM.2] END AS [tot spectra 41MM.2],
  CASE WHEN [tot spectra 42MM.2] is NULL THEN 0 ELSE [tot spectra 42MM.2] END AS [tot spectra 42MM.2],
  CASE WHEN [tot spectra 46MM.2] is NULL THEN 0 ELSE [tot spectra 46MM.2] END AS [tot spectra 46MM.2],
  CASE WHEN [tot spectra 65ML.2] is NULL THEN 0 ELSE [tot spectra 65ML.2] END AS [tot spectra 65ML.2],
  CASE WHEN [tot spectra 67ML.2] is NULL THEN 0 ELSE [tot spectra 67ML.2] END AS [tot spectra 67ML.2],
  CASE WHEN [tot spectra 68ML.2] is NULL THEN 0 ELSE [tot spectra 68ML.2] END AS [tot spectra 68ML.2],
  CASE WHEN [tot spectra 2ME.3] is NULL THEN 0 ELSE [tot spectra 2ME.3] END AS [tot spectra 2ME.3],
  CASE WHEN [tot spectra 7ME.3] is NULL THEN 0 ELSE [tot spectra 7ME.3] END AS [tot spectra 7ME.3],
  CASE WHEN [tot spectra 9ME.3] is NULL THEN 0 ELSE [tot spectra 9ME.3] END AS [tot spectra 9ME.3],
  CASE WHEN [tot spectra 41MM.3] is NULL THEN 0 ELSE [tot spectra 41MM.3] END AS [tot spectra 41MM.3],
  CASE WHEN [tot spectra 42MM.3] is NULL THEN 0 ELSE [tot spectra 42MM.3] END AS [tot spectra 42MM.3],
  CASE WHEN [tot spectra 46MM.3] is NULL THEN 0 ELSE [tot spectra 46MM.3] END AS [tot spectra 46MM.3],
  CASE WHEN [tot spectra 65ML.3] is NULL THEN 0 ELSE [tot spectra 65ML.3] END AS [tot spectra 65ML.3],
  CASE WHEN [tot spectra 67ML.3] is NULL THEN 0 ELSE [tot spectra 67ML.3] END AS [tot spectra 67ML.3],
  CASE WHEN [tot spectra 68ML.3] is NULL THEN 0 ELSE [tot spectra 68ML.3] END AS [tot spectra 68ML.3]
  FROM [412].[All geoduck spec counts]


________________________________________


SELECT [Geoduck protein],
  SUM([tot spectra 3FE]+
  [tot spectra 4FE]+
  [tot spectra 8FE]+
  [tot spectra 34FM]+
  [tot spectra 35FM]+
  [tot spectra 38FM]+
  [tot spectra 51FL]+
  [tot spectra 69FL]+
  [tot spectra 70FL]+
  [tot spectra 3FE.2]+
  [tot spectra 4FE.2]+
  [tot spectra 8FE.2]+
  [tot spectra 34FM.2]+
  [tot spectra 35FM.2]+
  [tot spectra 38FM.2]+
  [tot spectra 51FL.2]+
  [tot spectra 69FL.2]+
  [tot spectra 70FL.2]+
  [tot spectra 3FE.3]+
  [tot spectra 4FE.3]+
  [tot spectra 8FE.3]+
  [tot spectra 34FM.3]+
  [tot spectra 35FM.3]+
  [tot spectra 38FM.3]+
  [tot spectra 51FL.3]+
  [tot spectra 69FL.3]+
  [tot spectra 70FL.3]+
  [tot spectra 2ME]+
  [tot spectra 7ME]+
  [tot spectra 9ME]+
  [tot spectra 41MM]+
  [tot spectra 42MM]+
  [tot spectra 46MM]+
  [tot spectra 65ML]+
  [tot spectra 67ML]+
  [tot spectra 68ML]+
  [tot spectra 2ME.2]+
  [tot spectra 7ME.2]+
  [tot spectra 9ME.2]+
  [tot spectra 41MM.2]+
  [tot spectra 42MM.2]+
  [tot spectra 46MM.2]+
  [tot spectra 65ML.2]+
  [tot spectra 67ML.2]+
  [tot spectra 68ML.2]+
  [tot spectra 2ME.3]+
  [tot spectra 7ME.3]+
  [tot spectra 9ME.3]+
  [tot spectra 41MM.3]+
  [tot spectra 42MM.3]+
  [tot spectra 46MM.3]+
  [tot spectra 65ML.3]+
  [tot spectra 67ML.3]+
    [tot spectra 68ML.3])
  AS [Total SpC]
  FROM [412].[All geoduck spec counts filled 0]
  GROUP BY [Geoduck protein]


________________________________________


SELECT * FROM [412].[All geoduck spec counts filled 0]
  LEFT JOIN [412].[geoduck total spc]
  ON [412].[All geoduck spec counts filled 0].[Geoduck protein]=[412].[All geoduck spec counts filled 0].[Geoduck protein]


________________________________________


SELECT [Geoduck protein] FROM [412].[geoduck total spc]


________________________________________


SELECT [Geoduck protein] AS protein,
  SUM([tot spectra 3FE]+
  [tot spectra 4FE]+
  [tot spectra 8FE]+
  [tot spectra 34FM]+
  [tot spectra 35FM]+
  [tot spectra 38FM]+
  [tot spectra 51FL]+
  [tot spectra 69FL]+
  [tot spectra 70FL]+
  [tot spectra 3FE.2]+
  [tot spectra 4FE.2]+
  [tot spectra 8FE.2]+
  [tot spectra 34FM.2]+
  [tot spectra 35FM.2]+
  [tot spectra 38FM.2]+
  [tot spectra 51FL.2]+
  [tot spectra 69FL.2]+
  [tot spectra 70FL.2]+
  [tot spectra 3FE.3]+
  [tot spectra 4FE.3]+
  [tot spectra 8FE.3]+
  [tot spectra 34FM.3]+
  [tot spectra 35FM.3]+
  [tot spectra 38FM.3]+
  [tot spectra 51FL.3]+
  [tot spectra 69FL.3]+
  [tot spectra 70FL.3]+
  [tot spectra 2ME]+
  [tot spectra 7ME]+
  [tot spectra 9ME]+
  [tot spectra 41MM]+
  [tot spectra 42MM]+
  [tot spectra 46MM]+
  [tot spectra 65ML]+
  [tot spectra 67ML]+
  [tot spectra 68ML]+
  [tot spectra 2ME.2]+
  [tot spectra 7ME.2]+
  [tot spectra 9ME.2]+
  [tot spectra 41MM.2]+
  [tot spectra 42MM.2]+
  [tot spectra 46MM.2]+
  [tot spectra 65ML.2]+
  [tot spectra 67ML.2]+
  [tot spectra 68ML.2]+
  [tot spectra 2ME.3]+
  [tot spectra 7ME.3]+
  [tot spectra 9ME.3]+
  [tot spectra 41MM.3]+
  [tot spectra 42MM.3]+
  [tot spectra 46MM.3]+
  [tot spectra 65ML.3]+
  [tot spectra 67ML.3]+
    [tot spectra 68ML.3])
  AS [Total SpC]
  FROM [412].[All geoduck spec counts filled 0]
  GROUP BY [Geoduck protein]


________________________________________


SELECT * FROM [412].[All geoduck spec counts filled 0]
  LEFT JOIN [412].[geoduck total spc]
  ON [412].[All geoduck spec counts filled 0].[Geoduck protein]=[412].[geoduck total spc].[protein]


________________________________________


SELECT * FROM [412].[geoduck spec counts with total spc]
  WHERE [Total SpC]>0


________________________________________


SELECT [Geoduck protein],
  SUM([tot spectra 3FE]+[tot spectra 3FE.2]+[tot spectra 3FE.3]) AS [3FE] 
  FROM [412].[Detected geoduck proteins]
    GROUP BY [Geoduck protein]


________________________________________


SELECT [Geoduck protein],
  SUM([tot spectra 3FE]+[tot spectra 3FE.2]+[tot spectra 3FE.3]) AS [3FE],
  SUM([tot spectra 4FE]+[tot spectra 4FE.2]+[tot spectra 4FE.3]) AS [4FE],
  SUM([tot spectra 8FE]+[tot spectra 8FE.2]+[tot spectra 8FE.3]) AS [8FE],
  SUM([tot spectra 34FM]+[tot spectra 34FM.2]+[tot spectra 34FM.3]) AS [34FM],
  SUM([tot spectra 35FM]+[tot spectra 35FM.2]+[tot spectra 35FM.3]) AS [35FM],
  SUM([tot spectra 38FM]+[tot spectra 38FM.2]+[tot spectra 38FM.3]) AS [38FM],
  SUM([tot spectra 51FL]+[tot spectra 51FL.2]+[tot spectra 51FL.3]) AS [51FL],
  SUM([tot spectra 69FL]+[tot spectra 69FL.2]+[tot spectra 69FL.3]) AS [69FL],
  SUM([tot spectra 70FL]+[tot spectra 70FL.2]+[tot spectra 70FL.3]) AS [70FL],
  SUM([tot spectra 2ME]+[tot spectra 2ME.2]+[tot spectra 2ME.3]) AS [2ME],
  SUM([tot spectra 7ME]+[tot spectra 7ME.2]+[tot spectra 7ME.3]) AS [7ME],
  SUM([tot spectra 9ME]+[tot spectra 9ME.2]+[tot spectra 9ME.3]) AS [9ME],
  SUM([tot spectra 41MM]+[tot spectra 41MM.2]+[tot spectra 41MM.3]) AS [41MM],
  SUM([tot spectra 42MM]+[tot spectra 42MM.2]+[tot spectra 42MM.3]) AS [42MM],
  SUM([tot spectra 46MM]+[tot spectra 46MM.2]+[tot spectra 46MM.3]) AS [46MM],
  SUM([tot spectra 65ML]+[tot spectra 65ML.2]+[tot spectra 65ML.3]) AS [65ML],
  SUM([tot spectra 67ML]+[tot spectra 67ML.2]+[tot spectra 67ML.3]) AS [67ML],
  SUM([tot spectra 68ML]+[tot spectra 68ML.2]+[tot spectra 68ML.3]) AS [68ML]  
  FROM [412].[Detected geoduck proteins]
    GROUP BY [Geoduck protein]



________________________________________


SELECT * FROM [412].[geoduck summed tech reps]


________________________________________


SELECT * FROM [412].[geoduck summed tech reps]
  LEFT JOIN [412].[geoduck_protein_length.txt]
  ON [412].[geoduck summed tech reps].[Geoduck protein]=[412].[geoduck_protein_length.txt].protein


________________________________________


SELECT [Geoduck protein], [Length],
  CAST([3FE] AS FLOAT)/3 AS [Avg 3FE]
  FROM [412].[geoduck summed tech reps with length]


________________________________________


SELECT [Geoduck protein], [Length],
  CAST([3FE] AS FLOAT)/3 AS [Avg 3FE],
  CAST([4FE] AS FLOAT)/3 AS [Avg 4FE],
  CAST([8FE] AS FLOAT)/3 AS [Avg 8FE],
  CAST([34FM] AS FLOAT)/3 AS [Avg 34FM],
  CAST([35FM] AS FLOAT)/3 AS [Avg 35FM],
  CAST([38FM] AS FLOAT)/3 AS [Avg 38FM],
  CAST([51FL] AS FLOAT)/3 AS [Avg 51FL],
  CAST([69FL] AS FLOAT)/3 AS [Avg 69FL],
  CAST([70FL] AS FLOAT)/3 AS [Avg 70FL],
  CAST([2ME] AS FLOAT)/3 AS [Avg 2ME],
  CAST([7ME] AS FLOAT)/3 AS [Avg 7ME],
CAST([9ME] AS FLOAT)/3 AS [Avg 9ME],
CAST([41MM] AS FLOAT)/3 AS [Avg 41MM],
CAST([42MM] AS FLOAT)/3 AS [Avg 42MM],
CAST([46MM] AS FLOAT)/3 AS [Avg 46MM],
CAST([65ML] AS FLOAT)/3 AS [Avg 65ML],
CAST([67ML] AS FLOAT)/3 AS [Avg 67ML],
CAST([68ML] AS FLOAT)/3 AS [Avg 68ML]  
  FROM [412].[geoduck summed tech reps with length]


________________________________________


SELECT [Geoduck protein], [Length],
  [Avg 3FE], [Avg 4FE], [Avg 8FE],
  [Avg 34FM], [Avg 35FM], [Avg 38FM],
  [Avg 51FL], [Avg 69FL], [Avg 70FL],
  [Avg 2ME], [Avg 7ME], [Avg 9ME],
  [Avg 41MM], [Avg 42MM], [Avg 46MM],
  [Avg 65ML], [Avg 67ML], [Avg 68ML],
  CAST([Avg 3FE] AS FLOAT)/[Length] AS [3FE SpC/L],
  CAST([Avg 4FE] AS FLOAT)/[Length] AS [4FE SpC/L],
  CAST([Avg 8FE] AS FLOAT)/[Length] AS [8FE SpC/L],
  CAST([Avg 34FM] AS FLOAT)/[Length] AS [34FM SpC/L],
   CAST([Avg 35FM] AS FLOAT)/[Length] AS [35FM SpC/L],
   CAST([Avg 38FM] AS FLOAT)/[Length] AS [38FM SpC/L],
   CAST([Avg 51FL] AS FLOAT)/[Length] AS [51FL SpC/L],
  CAST([Avg 69FL] AS FLOAT)/[Length] AS [69FL SpC/L],
  CAST([Avg 70FL] AS FLOAT)/[Length] AS [70FL SpC/L],
  CAST([Avg 2ME] AS FLOAT)/[Length] AS [2ME SpC/L],
  CAST([Avg 7ME] AS FLOAT)/[Length] AS [7ME SpC/L],
  CAST([Avg 9ME] AS FLOAT)/[Length] AS [9ME SpC/L],
  CAST([Avg 41MM] AS FLOAT)/[Length] AS [41MM SpC/L],
  CAST([Avg 42MM] AS FLOAT)/[Length] AS [42MM SpC/L],
  CAST([Avg 46MM] AS FLOAT)/[Length] AS [46MM SpC/L],
  CAST([Avg 65ML] AS FLOAT)/[Length] AS [65ML SpC/L],
  CAST([Avg 67ML] AS FLOAT)/[Length] AS [67ML SpC/L],
  CAST([Avg 68ML] AS FLOAT)/[Length] AS [68ML SpC/L]
  FROM [412].[geoduck spc averaged]


________________________________________


SELECT SUM([3FE SpC/L]) AS [Sum 3FE SpC/L],
  SUM([4FE SpC/L]) AS [Sum 4FE SpC/L],
  SUM([8FE SpC/L]) AS [Sum 8FE SpC/L],
  SUM([34FM SpC/L]) AS [Sum 34FM SpC/L],
  SUM([35FM SpC/L]) AS [Sum 35FM SpC/L],
  SUM([38FM SpC/L]) AS [Sum 38FM SpC/L],
  SUM([51FL SpC/L]) AS [Sum 51FL SpC/L],
  SUM([69FL SpC/L]) AS [Sum 69FL SpC/L],
  SUM([70FL SpC/L]) AS [Sum 70FL SpC/L],
  SUM([2ME SpC/L]) AS [Sum 2ME SpC/L],
  SUM([7ME SpC/L]) AS [Sum 7ME SpC/L],
  SUM([9ME SpC/L]) AS [Sum 9ME SpC/L],
  SUM([41MM SpC/L]) AS [Sum 41MM SpC/L],
  SUM([42MM SpC/L]) AS [Sum 42MM SpC/L],
  SUM([46MM SpC/L]) AS [Sum 46MM SpC/L],
  SUM([65ML SpC/L]) AS [Sum 65ML SpC/L],
  SUM([67ML SpC/L]) AS [Sum 67ML SpC/L],
  SUM([68ML SpC/L]) AS [Sum 68ML SpC/L]
  FROM [412].[geoduck avgd spc with spc-l]


________________________________________


SELECT SUM([3FE SpC/L]) AS [Sum 3FE SpC/L],
  SUM([4FE SpC/L]) AS [Sum 4FE SpC/L],
  SUM([8FE SpC/L]) AS [Sum 8FE SpC/L],
  SUM([34FM SpC/L]) AS [Sum 34FM SpC/L],
  SUM([35FM SpC/L]) AS [Sum 35FM SpC/L],
  SUM([38FM SpC/L]) AS [Sum 38FM SpC/L],
  SUM([51FL SpC/L]) AS [Sum 51FL SpC/L],
  SUM([69FL SpC/L]) AS [Sum 69FL SpC/L],
  SUM([70FL SpC/L]) AS [Sum 70FL SpC/L],
  SUM([2ME SpC/L]) AS [Sum 2ME SpC/L],
  SUM([7ME SpC/L]) AS [Sum 7ME SpC/L],
  SUM([9ME SpC/L]) AS [Sum 9ME SpC/L],
  SUM([41MM SpC/L]) AS [Sum 41MM SpC/L],
  SUM([42MM SpC/L]) AS [Sum 42MM SpC/L],
  SUM([46MM SpC/L]) AS [Sum 46MM SpC/L],
  SUM([65ML SpC/L]) AS [Sum 65ML SpC/L],
  SUM([67ML SpC/L]) AS [Sum 67ML SpC/L],
  SUM([68ML SpC/L]) AS [Sum 68ML SpC/L]
  FROM [412].[geoduck avgd spc with spc-l]


________________________________________


SELECT [Geoduck Protein],
  spc.[3FE SpC/L]/allspc.[Sum 3FE SpC/L] AS [NSAF 3FE],
  spc.[4FE SpC/L]/allspc.[Sum 4FE SpC/L] AS [NSAF 4FE],
  spc.[8FE SpC/L]/allspc.[Sum 8FE SpC/L] AS [NSAF 8FE],
  spc.[34FM SpC/L]/allspc.[Sum 34FM SpC/L] AS [NSAF 34FM],
  spc.[35FM SpC/L]/allspc.[Sum 35FM SpC/L] AS [NSAF 35FM],
  spc.[38FM SpC/L]/allspc.[Sum 38FM SpC/L] AS [NSAF 38FM],
  spc.[51FL SpC/L]/allspc.[Sum 51FL SpC/L] AS [NSAF 51FL],
  spc.[69FL SpC/L]/allspc.[Sum 69FL SpC/L] AS [NSAF 69FL],
  spc.[70FL SpC/L]/allspc.[Sum 70FL SpC/L] AS [NSAF 70FL],
  spc.[2ME SpC/L]/allspc.[Sum 2ME SpC/L] AS [NSAF 2ME],
  spc.[7ME SpC/L]/allspc.[Sum 7ME SpC/L] AS [NSAF 7ME],
  spc.[9ME SpC/L]/allspc.[Sum 9ME SpC/L] AS [NSAF 9ME],
  spc.[41MM SpC/L]/allspc.[Sum 41MM SpC/L] AS [NSAF 41MM],
  spc.[42MM SpC/L]/allspc.[Sum 42MM SpC/L] AS [NSAF 42MM],
  spc.[46MM SpC/L]/allspc.[Sum 46MM SpC/L] AS [NSAF 46MM],
  spc.[65ML SpC/L]/allspc.[Sum 65ML SpC/L] AS [NSAF 65ML],
  spc.[67ML SpC/L]/allspc.[Sum 67ML SpC/L] AS [NSAF 67ML],
  spc.[68ML SpC/L]/allspc.[Sum 68ML SpC/L] AS [NSAF 68ML]
  FROM [412].[geoduck avgd spc with spc-l] spc, [412].[geoduck summed spc-l] allspc


________________________________________


SELECT * FROM [412].[geoduck spec counts with total spc]
  WHERE [Total SpC]>1


________________________________________


SELECT [Geoduck Protein],
  spc.[3FE SpC/L]/allspc.[Sum 3FE SpC/L] AS [NSAF 3FE],
  spc.[4FE SpC/L]/allspc.[Sum 4FE SpC/L] AS [NSAF 4FE],
  spc.[8FE SpC/L]/allspc.[Sum 8FE SpC/L] AS [NSAF 8FE],
  spc.[34FM SpC/L]/allspc.[Sum 34FM SpC/L] AS [NSAF 34FM],
  spc.[35FM SpC/L]/allspc.[Sum 35FM SpC/L] AS [NSAF 35FM],
  spc.[38FM SpC/L]/allspc.[Sum 38FM SpC/L] AS [NSAF 38FM],
  spc.[51FL SpC/L]/allspc.[Sum 51FL SpC/L] AS [NSAF 51FL],
  spc.[69FL SpC/L]/allspc.[Sum 69FL SpC/L] AS [NSAF 69FL],
  spc.[70FL SpC/L]/allspc.[Sum 70FL SpC/L] AS [NSAF 70FL],
  spc.[2ME SpC/L]/allspc.[Sum 2ME SpC/L] AS [NSAF 2ME],
  spc.[7ME SpC/L]/allspc.[Sum 7ME SpC/L] AS [NSAF 7ME],
  spc.[9ME SpC/L]/allspc.[Sum 9ME SpC/L] AS [NSAF 9ME],
  spc.[41MM SpC/L]/allspc.[Sum 41MM SpC/L] AS [NSAF 41MM],
  spc.[42MM SpC/L]/allspc.[Sum 42MM SpC/L] AS [NSAF 42MM],
  spc.[46MM SpC/L]/allspc.[Sum 46MM SpC/L] AS [NSAF 46MM],
  spc.[65ML SpC/L]/allspc.[Sum 65ML SpC/L] AS [NSAF 65ML],
  spc.[67ML SpC/L]/allspc.[Sum 67ML SpC/L] AS [NSAF 67ML],
  spc.[68ML SpC/L]/allspc.[Sum 68ML SpC/L] AS [NSAF 68ML]
  FROM [412].[geoduck avgd spc with spc-l] spc, [412].[geoduck summed spc-l] allspc


________________________________________


SELECT [Geoduck protein],
  SUM([tot spectra 3FE]+[tot spectra 3FE.2]+[tot spectra 3FE.3]) AS [3FE],
  SUM([tot spectra 4FE]+[tot spectra 4FE.2]+[tot spectra 4FE.3]) AS [4FE],
  SUM([tot spectra 8FE]+[tot spectra 8FE.2]+[tot spectra 8FE.3]) AS [8FE],
  SUM([tot spectra 34FM]+[tot spectra 34FM.2]+[tot spectra 34FM.3]) AS [34FM],
  SUM([tot spectra 35FM]+[tot spectra 35FM.2]+[tot spectra 35FM.3]) AS [35FM],
  SUM([tot spectra 38FM]+[tot spectra 38FM.2]+[tot spectra 38FM.3]) AS [38FM],
  SUM([tot spectra 51FL]+[tot spectra 51FL.2]+[tot spectra 51FL.3]) AS [51FL],
  SUM([tot spectra 69FL]+[tot spectra 69FL.2]+[tot spectra 69FL.3]) AS [69FL],
  SUM([tot spectra 70FL]+[tot spectra 70FL.2]+[tot spectra 70FL.3]) AS [70FL],
  SUM([tot spectra 2ME]+[tot spectra 2ME.2]+[tot spectra 2ME.3]) AS [2ME],
  SUM([tot spectra 7ME]+[tot spectra 7ME.2]+[tot spectra 7ME.3]) AS [7ME],
  SUM([tot spectra 9ME]+[tot spectra 9ME.2]+[tot spectra 9ME.3]) AS [9ME],
  SUM([tot spectra 41MM]+[tot spectra 41MM.2]+[tot spectra 41MM.3]) AS [41MM],
  SUM([tot spectra 42MM]+[tot spectra 42MM.2]+[tot spectra 42MM.3]) AS [42MM],
  SUM([tot spectra 46MM]+[tot spectra 46MM.2]+[tot spectra 46MM.3]) AS [46MM],
  SUM([tot spectra 65ML]+[tot spectra 65ML.2]+[tot spectra 65ML.3]) AS [65ML],
  SUM([tot spectra 67ML]+[tot spectra 67ML.2]+[tot spectra 67ML.3]) AS [67ML],
  SUM([tot spectra 68ML]+[tot spectra 68ML.2]+[tot spectra 68ML.3]) AS [68ML]  
  FROM [412].[Detected geoduck proteins]
    GROUP BY [Geoduck protein]



________________________________________


SELECT Column1 AS protein,
  Column2 AS [swissprot ID],
  Column11 AS evalue
  FROM [412].[table_Trinity.fasta.transdecoder.pep-blastp-uniprot-2.out.txt]


________________________________________


SELECT [Hit-Entry] AS [swissprot ID],
  [Hit-Gene ontology (GO)],
  [Hit-Protein names],
  [Hit-Organism]
  FROM [412].[table_Pgen_uniprot_ID-2.csv]


________________________________________


SELECT Column1 AS Protein,
 Column2 AS SPID,
 Column3 AS evalue FROM [412].[table_geoduck_swissprot_annotation.txt]


________________________________________


SELECT * FROM [412].[geoduck_swissprot_annotation.txt]
  LEFT JOIN [412].[Pgen_uniprot_ID-2.csv]
  ON [412].[geoduck_swissprot_annotation.txt].SPID=[412].[Pgen_uniprot_ID-2.csv].[swissprot ID]


________________________________________


SELECT * FROM [412].[Geoduck transcriptome with SPID descriptions]
  LEFT JOIN [412].[Detected geoduck proteins]
  ON [412].[Geoduck transcriptome with SPID descriptions].Protein=[412].[Detected geoduck proteins].[Geoduck protein]


________________________________________


SELECT * FROM [412].[Geoduck transcriptome with SPID descriptions]
  LEFT JOIN [412].[Detected geoduck proteins]
  ON [412].[Geoduck transcriptome with SPID descriptions].Protein=[412].[Detected geoduck proteins].[Geoduck protein]
  LEFT JOIN [412].[qspec_resultsEMvsEF.txt]
  ON [412].[Geoduck transcriptome with SPID descriptions].Protein=[412].[qspec_resultsEMvsEF.txt].Protein
  LEFT JOIN [412].[qspec_resultsMMvsMF.txt]
  ON [412].[Geoduck transcriptome with SPID descriptions].Protein=[412].[qspec_resultsMMvsMF.txt].Protein
  LEFT JOIN [412].[qspec_resultsLMvsLF_3.txt]
  ON [412].[Geoduck transcriptome with SPID descriptions].Protein=[412].[qspec_resultsLMvsLF_3.txt].Protein
  LEFT JOIN [412].[qspec_resultsEMvsMM.txt]
  ON [412].[Geoduck transcriptome with SPID descriptions].Protein=[412].[qspec_resultsEMvsMM.txt].Protein
  LEFT JOIN [412].[qspec_resultsMMvsLM.txt]
  ON [412].[Geoduck transcriptome with SPID descriptions].Protein=[412].[qspec_resultsMMvsLM.txt].Protein
  LEFT JOIN [412].[qspec_resultsEFvsMF.txt]
  ON [412].[Geoduck transcriptome with SPID descriptions].Protein=[412].[qspec_resultsEFvsMF.txt].Protein
  LEFT JOIN [412].[qspec_resultsMFvsLF.txt]
  ON [412].[Geoduck transcriptome with SPID descriptions].Protein=[412].[qspec_resultsMFvsLF.txt].Protein


________________________________________


SELECT * FROM [412].[1358join.csv]
  JOIN [Prophet_2014_Sept_08_BeringSea08.prot.csv]
  ON [412].[1358join.csv].Protein=[Prophet_2014_Sept_08_BeringSea08.prot.csv].protein


________________________________________


SELECT * FROM [412].[1358join.csv]
  LEFT JOIN [Prophet_2014_Sept_08_BeringSea08.prot.csv]
  ON [412].[1358join.csv].Protein=[Prophet_2014_Sept_08_BeringSea08.prot.csv].protein


________________________________________


SELECT protein AS [protein 4BS insitu],
  [tot indep spectra] AS [tot spectra 4BS insitu],
  [percent coverage] AS [coverage 4BS insitu]
  FROM [412].[table_interact-2014_Sept_08_BeringSea08.prot.xls]


________________________________________


SELECT protein AS [protein 12BS insitu],
  [tot indep spectra] AS [tot spectra 12BS insitu],
  [percent coverage] AS [coverage 12BS insitu]
  FROM [412].[table_interact-2014_Sept_08_BeringSea10.prot.xls]


________________________________________


SELECT protein AS [protein 57BS insitu],
  [tot indep spectra] AS [tot spectra 57BS insitu],
  [percent coverage] AS [coverage 57BS insitu]
  FROM [412].[table_interact-2014_Sept_08_BeringSea14.prot.xls]


________________________________________


SELECT protein AS [protein 46BS insitu],
  [tot indep spectra] AS [tot spectra 46BS insitu],
  [percent coverage] AS [coverage 46BS insitu]
  FROM [412].[table_interact-2014_Sept_08_BeringSea16.prot.xls]


________________________________________


SELECT protein AS [protein 46.2BS insitu],
  [tot indep spectra] AS [tot spectra 46.2BS insitu],
  [percent coverage] AS [coverage 46.2BS insitu]
  FROM [412].[table_interact-2014_Sept_08_BeringSea17.prot.xls]


________________________________________


SELECT protein AS [protein 12BS insitu],
  [tot indep spectra] AS [tot spectra 12BS insitu],
  [percent coverage] AS [coverage 12BS insitu]
  FROM [412].[table_interact-2014_Sept_08_BeringSea19.prot.xls]


________________________________________


SELECT [protein 4BS insitu] FROM [412].[interact-2014_Sept_08_BeringSea08.prot.xls]
  UNION ALL
  SELECT [protein 12BS insitu] FROM [412].[interact-2014_Sept_08_BeringSea10.prot.xls]


________________________________________


SELECT Column1 AS Protein, Column2 as [Length] FROM [412].[table_MOCAT_1341genome_protein_length_1.tabular]


________________________________________


SELECT distinct Protein FROM [412].[allblast]


________________________________________


SELECT distinct Protein, SPID FROM [412].[allblast]


________________________________________


SELECT * FROM [412].[allblast]
  WHERE evalue>1E-10



________________________________________


SELECT probability as [probability BSinit_1],
  spectrum as [spectrum BSinit_1],
  expect as [expect BSinit_1],
 peptide as [peptide BSinit_1],
  protein as [protein BSinit_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea29.pep.xls]


________________________________________


SELECT probability as [probability BSinit_2],
  spectrum as [spectrum BSinit_2],
  expect as [expect BSinit_2],
 peptide as [peptide BSinit_2],
  protein as [protein BSinit_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea30.pep.xls]


________________________________________


SELECT probability as [probability BSiT6_3],
  spectrum as [spectrum BSiT6_3],
  expect as [expect BSiT6_3],
 peptide as [peptide BSiT6_3],
  protein as [protein BSiT6_3]
  FROM [412].[table_interact-2014_Sept_08_BeringSea16.pep.xls4717C]


________________________________________


SELECT probability as [probability BSiT6_4],
  spectrum as [spectrum BSiT6_4],
  expect as [expect BSiT6_4],
 peptide as [peptide BSiT6_4],
  protein as [protein BSiT6_4]
  FROM [412].[table_interact-2014_Sept_08_BeringSea17.pep.xls65F1D]


________________________________________


SELECT probability as [probability BSiT1_3],
  spectrum as [spectrum BSiT1_3],
  expect as [expect BSiT1_3],
 peptide as [peptide BSiT1_3],
  protein as [protein BSiT1_3]
  FROM [412].[table_interact-2014_Sept_08_BeringSea19.pep.xls8E3D2]


________________________________________


SELECT probability as [probability BSiT1_4],
  spectrum as [spectrum BSiT1_4],
  expect as [expect BSiT1_4],
 peptide as [peptide BSiT1_4],
  protein as [protein BSiT1_4]
  FROM [412].[table_interact-2014_Sept_08_BeringSea20.pep.xls0FEF2]


________________________________________


SELECT probability as [probability BSiT0_1],
  spectrum as [spectrum BSiT0_1],
  expect as [expect BSiT0_1],
 peptide as [peptide BSiT0_1],
  protein as [protein BSiT0_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea22.pep.xls29FDE]


________________________________________


SELECT probability as [probability BSiT0_2],
  spectrum as [spectrum BSiT0_2],
  expect as [expect BSiT0_2],
 peptide as [peptide BSiT0_2],
  protein as [protein BSiT0_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea23.pep.xls88189]


________________________________________


SELECT probability as [probability BSiT10_3],
  spectrum as [spectrum BSiT10_3],
  expect as [expect BSiT10_3],
 peptide as [peptide BSiT10_3],
  protein as [protein BSiT10_3]
  FROM [412].[table_interact-2014_Sept_08_BeringSea25.pep.xlsBD1AE]


________________________________________


SELECT probability as [probability BSiT10_4],
  spectrum as [spectrum BSiT10_4],
  expect as [expect BSiT10_4],
 peptide as [peptide BSiT10_4],
  protein as [protein BSiT10_4]
  FROM [412].[table_interact-2014_Sept_08_BeringSea26.pep.xls11319]


________________________________________


SELECT probability as [probability BScT1_1],
  spectrum as [spectrum BScT1_1],
  expect as [expect BScT1_1],
 peptide as [peptide BScT1_1],
  protein as [protein BScT1_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea32.pep.xls84841]


________________________________________


SELECT probability as [probability BScT1_2],
  spectrum as [spectrum BScT1_2],
  expect as [expect BScT1_2],
 peptide as [peptide BScT1_2],
  protein as [protein BScT1_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea33.pep.xls78735]


________________________________________


SELECT 
  probability as [probability BScT6_1],
  spectrum as [spectrum BScT6_1],
  expect as [expect BScT6_1],
 peptide as [peptide BScT6_1],
  protein as [protein BScT6_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea36.pep.xls38A00]


________________________________________


SELECT probability as [probability BScT6_2],
  spectrum as [spectrum BScT6_2],
  expect as [expect BScT6_2],
 peptide as [peptide BScT6_2],
  protein as [protein BScT6_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea37.pep.xls8D37A]


________________________________________


SELECT probability as [probability BScT10_1],
  spectrum as [spectrum BScT10_1],
  expect as [expect BScT10_1],
 peptide as [peptide BScT10_1],
  protein as [protein BScT10_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea38.pep.xlsFD4E4]


________________________________________


SELECT probability as [probability BScT10_2],
  spectrum as [spectrum BScT10_2],
  expect as [expect BScT10_2],
 peptide as [peptide BScT10_2],
  protein as [protein BScT10_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea39.pep.xls89A22]


________________________________________


SELECT probability as [probability S2init_1],
  spectrum as [spectrum S2init_1],
  expect as [expect S2init_1],
 peptide as [peptide S2init_1],
  protein as [protein S2init_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea42.pep.xlsCF38B]


________________________________________


SELECT probability as [probability S2init_2],
  spectrum as [spectrum S2init_2],
  expect as [expect S2init_2],
 peptide as [peptide S2init_2],
  protein as [protein S2init_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea43.pep.xls39637]


________________________________________


SELECT probability as [probability S2cT6_1],
  spectrum as [spectrum S2cT6_1],
  expect as [expect S2cT6_1],
 peptide as [peptide S2cT6_1],
  protein as [protein S2cT6_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea48.pep.xls6319C]


________________________________________


SELECT probability as [probability S2cT6_2],
  spectrum as [spectrum S2cT6_2],
  expect as [expect S2cT6_2],
 peptide as [peptide S2cT6_2],
  protein as [protein S2cT6_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea49.pep.xls553A6]


________________________________________


SELECT probability as [probability S2cT10_1],
  spectrum as [spectrum S2cT10_1],
  expect as [expect S2cT10_1],
 peptide as [peptide S2cT10_1],
  protein as [protein S2cT10_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea50.pep.xlsCDF66]


________________________________________


SELECT probability as [probability S2cT10_2],
  spectrum as [spectrum S2cT10_2],
  expect as [expect S2cT10_2],
 peptide as [peptide S2cT10_2],
  protein as [protein S2cT10_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea51.pep.xlsB8767]


________________________________________


SELECT probability as [probability S2iT1_1],
  spectrum as [spectrum S2iT1_1],
  expect as [expect S2iT1_1],
 peptide as [peptide S2iT1_1],
  protein as [protein S2iT1_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea54.pep.xls9803F]


________________________________________


SELECT probability as [probability S2iT1_2],
  spectrum as [spectrum S2iT1_2],
  expect as [expect S2iT1_2],
 peptide as [peptide S2iT1_2],
  protein as [protein S2iT1_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea55.pep.xls8DBF3]


________________________________________


SELECT probability as [probability S2iT6_1],
  spectrum as [spectrum S2iT6_1],
  expect as [expect S2iT6_1],
 peptide as [peptide S2iT6_1],
  protein as [protein S2iT6_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea56.pep.xls29B24]


________________________________________


SELECT probability as [probability S2iT6_2],
  spectrum as [spectrum S2iT6_2],
  expect as [expect S2iT6_2],
 peptide as [peptide S2iT6_2],
  protein as [protein S2iT6_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea57.pep.xlsFA542]


________________________________________


SELECT probability as [probability S2iT10_1],
  spectrum as [spectrum S2iT10_1],
  expect as [expect S2iT10_1],
 peptide as [peptide S2iT10_1],
  protein as [protein S2iT10_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea58.pep.xls84E87]


________________________________________


SELECT probability as [probability S2iT10_2],
  spectrum as [spectrum S2iT10_2],
  expect as [expect S2iT10_2],
 peptide as [peptide S2iT10_2],
  protein as [protein S2iT10_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea59.pep.xls6E076]


________________________________________


SELECT probability as [probability BSiT1_1],
  spectrum as [spectrum BSiT1_1],
  expect as [expect BSiT1_1],
 peptide as [peptide BSiT1_1],
  protein as [protein BSiT1_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea62.pep.xlsF48F8]


________________________________________


SELECT probability as [probability BSiT1_2],
  spectrum as [spectrum BSiT1_2],
  expect as [expect BSiT1_2],
 peptide as [peptide BSiT1_2],
  protein as [protein BSiT1_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea63.pep.xlsE5585]


________________________________________


SELECT probability as [probability BSiT6_1],
  spectrum as [spectrum BSiT6_1],
  expect as [expect BSiT6_1],
 peptide as [peptide BSiT6_1],
  protein as [protein BSiT6_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea64.pep.xlsE8EB9]


________________________________________


SELECT probability as [probability BSiT6_2],
  spectrum as [spectrum BSiT6_2],
  expect as [expect BSiT6_2],
 peptide as [peptide BSiT6_2],
  protein as [protein BSiT6_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea65.pep.xls11C8C]


________________________________________


SELECT probability as [probability BSiT10_1],
  spectrum as [spectrum BSiT10_1],
  expect as [expect BSiT10_1],
 peptide as [peptide BSiT10_1],
  protein as [protein BSiT10_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea66.pep.xls9C9EA]


________________________________________


SELECT probability as [probability BSiT10_2],
  spectrum as [spectrum BSiT10_2],
  expect as [expect BSiT10_2],
 peptide as [peptide BSiT10_2],
  protein as [protein BSiT10_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea67.pep.xlsF7706]


________________________________________


SELECT * FROM [412].[1341proteome_spec_counts.txt]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea16.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea16.pep.xls].[protein BSiT6_3]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea17.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea17.pep.xls].[protein BSiT6_4]



________________________________________


SELECT probability as [probability BSinit_1],
  spectrum as [spectrum BSinit_1],
  expect as [expect BSinit_1],
 peptide as [peptide BSinit_1],
  protein as [protein BSinit_1]
  FROM [412].[table_interact-2014_Sept_08_BeringSea29.pep.xlsE309D]


________________________________________


SELECT probability as [probability BSinit_2],
  spectrum as [spectrum BSinit_2],
  expect as [expect BSinit_2],
 peptide as [peptide BSinit_2],
  protein as [protein BSinit_2]
  FROM [412].[table_interact-2014_Sept_08_BeringSea30.pep.xlsD7717]


________________________________________


SELECT * FROM [412].[1341proteome_spec_counts.txt]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea16.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea16.pep.xls].[protein BSiT6_3]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea17.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea17.pep.xls].[protein BSiT6_4]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea29.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea29.pep.xls].[protein BSinit_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea30.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea30.pep.xls].[protein BSinit_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea32.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea32.pep.xls].[protein BScT1_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea33.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea33.pep.xls].[protein BScT1_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea36.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea36.pep.xls].[protein BScT6_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea37.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea37.pep.xls].[protein BScT6_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea38.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea38.pep.xls].[protein BScT10_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea39.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea39.pep.xls].[protein BScT10_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea22.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea22.pep.xls].[protein BSiT0_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea23.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea23.pep.xls].[protein BSiT0_2]
LEFT JOIN [412].[interact-2014_Sept_08_BeringSea62.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea62.pep.xls].[protein BSiT1_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea63.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea63.pep.xls].[protein BSiT1_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea19.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea19.pep.xls].[protein BSiT1_3]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea20.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea20.pep.xls].[protein BSiT1_4]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea64.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea64.pep.xls].[protein BSiT6_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea65.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea65.pep.xls].[protein BSiT6_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea66.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea66.pep.xls].[protein BSiT10_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea67.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea67.pep.xls].[protein BSiT10_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea25.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea25.pep.xls].[protein BSiT10_3]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea26.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea26.pep.xls].[protein BSiT10_4] 


________________________________________


SELECT [peptide BSinit_1] FROM [412].[1341proteome peptide files]
  UNION ALL
  SELECT [peptide BSinit_2] FROM [412].[1341proteome peptide files]



________________________________________


SELECT DISTINCT [peptide BSinit_1],
  [peptide BSinit_2],
  [peptide BScT1_1],
  [peptide BScT1_2],
  [peptide BScT6_1],
  [peptide BScT6_2],
  [peptide BScT10_1],
  [peptide BScT10_2],
  [peptide BSiT0_1]
  FROM [412].[1341proteome peptide files]


________________________________________


SELECT [peptide BSinit_1] FROM [412].[interact-2014_Sept_08_BeringSea29.pep.xls]
  UNION ALL
  SELECT [peptide BSinit_2] FROM [412].[interact-2014_Sept_08_BeringSea30.pep.xls]



________________________________________


SELECT [peptide BSinit_1] FROM [412].[interact-2014_Sept_08_BeringSea29.pep.xls]
  UNION ALL
  SELECT [peptide BSinit_2] FROM [412].[interact-2014_Sept_08_BeringSea30.pep.xls]
  UNION ALL
  SELECT [peptide BScT1_1] FROM [412].[interact-2014_Sept_08_BeringSea32.pep.xls]
  UNION ALL
  SELECT [peptide BScT1_2] FROM [412].[interact-2014_Sept_08_BeringSea33.pep.xls]
  UNION ALL
  SELECT [peptide BScT6_1] FROM [412].[interact-2014_Sept_08_BeringSea36.pep.xls]
  UNION ALL
  SELECT [peptide BScT6_2] FROM [412].[interact-2014_Sept_08_BeringSea37.pep.xls]
  UNION ALL
  SELECT [peptide BScT10_1] FROM [412].[interact-2014_Sept_08_BeringSea38.pep.xls]
  UNION ALL
  SELECT [peptide BScT10_2] FROM [412].[interact-2014_Sept_08_BeringSea39.pep.xls]
  UNION ALL
  SELECT [peptide BSiT0_1] FROM [412].[interact-2014_Sept_08_BeringSea22.pep.xls]
  UNION ALL
  SELECT [peptide BSiT0_2] FROM [412].[interact-2014_Sept_08_BeringSea23.pep.xls]
  UNION ALL
  SELECT [peptide BSiT1_1] FROM [412].[interact-2014_Sept_08_BeringSea62.pep.xls]
  UNION ALL
  SELECT [peptide BSiT1_2] FROM [412].[interact-2014_Sept_08_BeringSea63.pep.xls]
UNION ALL
  SELECT [peptide BSiT1_3] FROM [412].[interact-2014_Sept_08_BeringSea19.pep.xls]
  UNION ALL
  SELECT [peptide BSiT1_4] FROM [412].[interact-2014_Sept_08_BeringSea20.pep.xls]
  UNION ALL
  SELECT [peptide BSiT6_1] FROM [412].[interact-2014_Sept_08_BeringSea64.pep.xls]
  UNION ALL
  SELECT [peptide BSiT6_2] FROM [412].[interact-2014_Sept_08_BeringSea65.pep.xls]
  UNION ALL
  SELECT [peptide BSiT6_3] FROM [412].[interact-2014_Sept_08_BeringSea16.pep.xls]
  UNION ALL
  SELECT [peptide BSiT6_4] FROM [412].[interact-2014_Sept_08_BeringSea17.pep.xls]
  UNION ALL
  SELECT [peptide BSiT10_1] FROM [412].[interact-2014_Sept_08_BeringSea66.pep.xls]
  UNION ALL
  SELECT [peptide BSiT10_2] FROM [412].[interact-2014_Sept_08_BeringSea67.pep.xls]
  UNION ALL
  SELECT [peptide BSiT10_3] FROM [412].[interact-2014_Sept_08_BeringSea25.pep.xls]
  UNION ALL
  SELECT [peptide BSiT10_4] FROM [412].[interact-2014_Sept_08_BeringSea26.pep.xls]



________________________________________


SELECT DISTINCT * FROM [412].[all Bering Strait peptides]


________________________________________


SELECT * FROM [412].[1341proteome_spec_counts.txt]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea16.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea16.pep.xls].[protein BSiT6_3]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea17.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea17.pep.xls].[protein BSiT6_4]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea29.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea29.pep.xls].[protein BSinit_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea30.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea30.pep.xls].[protein BSinit_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea32.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea32.pep.xls].[protein BScT1_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea33.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea33.pep.xls].[protein BScT1_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea36.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea36.pep.xls].[protein BScT6_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea37.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea37.pep.xls].[protein BScT6_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea38.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea38.pep.xls].[protein BScT10_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea39.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea39.pep.xls].[protein BScT10_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea22.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea22.pep.xls].[protein BSiT0_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea23.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea23.pep.xls].[protein BSiT0_2]
LEFT JOIN [412].[interact-2014_Sept_08_BeringSea62.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea62.pep.xls].[protein BSiT1_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea63.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea63.pep.xls].[protein BSiT1_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea19.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea19.pep.xls].[protein BSiT1_3]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea20.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea20.pep.xls].[protein BSiT1_4]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea64.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea64.pep.xls].[protein BSiT6_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea65.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea65.pep.xls].[protein BSiT6_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea66.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea66.pep.xls].[protein BSiT10_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea67.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea67.pep.xls].[protein BSiT10_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea25.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea25.pep.xls].[protein BSiT10_3]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea26.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea26.pep.xls].[protein BSiT10_4]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea42.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea42.pep.xls].[protein S2init_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea43.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea43.pep.xls].[protein S2init_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea48.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea48.pep.xls].[protein S2cT6_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea49.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea49.pep.xls].[protein S2cT6_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea50.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea50.pep.xls].[protein S2cT10_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea51.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea51.pep.xls].[protein S2cT10_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea54.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea54.pep.xls].[protein S2iT1_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea55.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea55.pep.xls].[protein S2iT1_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea56.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea56.pep.xls].[protein S2iT6_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea57.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea57.pep.xls].[protein S2iT6_2]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea58.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea58.pep.xls].[protein S2iT10_1]
  LEFT JOIN [412].[interact-2014_Sept_08_BeringSea59.pep.xls]
  ON [412].[1341proteome_spec_counts.txt].PROTID=[412].[interact-2014_Sept_08_BeringSea59.pep.xls].[protein S2iT10_2] 


________________________________________


SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection69.pep.xls]



________________________________________


SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]
   UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection69.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection19.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection70.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection71.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection58.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection23.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection51.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection24.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection52.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection25.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection53.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection27.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection28.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection29.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection17.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection59.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection18.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection60.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection19.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection61.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection45.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection55.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection46.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection56.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection47.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection57.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection79.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection80.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection87.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection88.pep.xls]
UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection89.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection81.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection37.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection73.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection38.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection74.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection39.pep.xls]
 UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection75.pep.xls]
 UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection31.pep.xls]
 UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection83.pep.xls]
 UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection32.pep.xls]
 UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection84.pep.xls]
 UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection33.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection85.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection41.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection65.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection42.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection66.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection43.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection67.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection30.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection22.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection56.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection25.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection57.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection26.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection42.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection27.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection43.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection28.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection44.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection32.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection46.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection33.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection34.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection48.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection38.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection52.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection39.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection53.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection40.pep.xls]
  UNION ALL
 SELECT [peptide] FROM [412].[interact-2015_June_9_BactDetection54.pep.xls]


________________________________________


SELECT DISTINCT [peptide] FROM [412].[bact detection redundant peptides]


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[interact-2015_May_6_Bacteria_Detection9.pep.xls].peptide


________________________________________


SELECT [expect] AS [N2.1 expect],
 [peptide] AS [N2.1 peptide],
 [protein] AS [N2.1 protein] FROM [412].[table_interact-2015_June_9_BactDetection22.pep.xlsDAB45]


________________________________________


SELECT [expect] AS [A1.1 expect],
 [peptide] AS [A1.1 peptide],
 [protein] AS [A1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]


________________________________________


SELECT [expect] AS [A1.1 expect],
 [peptide] AS [A1.1 peptide],
 [protein] AS [A1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]


________________________________________


SELECT [expect] AS [A1.1 expect],
 [peptide] AS [A1.1 peptide],
 [protein] AS [A1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]


________________________________________


SELECT [expect] AS [A1.1 expect],
 [peptide] AS [A1.1 peptide],
 [protein] AS [A1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]


________________________________________


SELECT [expect] AS [C3.2 expect],
 [peptide] AS [C3.2 peptide],
 [protein] AS [C3.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls73F5A]


________________________________________


SELECT [expect] AS [F3.3 expect],
 [peptide] AS [F3.3 peptide],
 [protein] AS [F3.3 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection89.pep.xls17E3A]


________________________________________


SELECT [expect] AS [C2.2 expect],
 [peptide] AS [C2.2 peptide],
 [protein] AS [C2.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xlsC6801]


________________________________________


SELECT [expect] AS [F2.3 expect],
 [peptide] AS [F2.3 peptide],
 [protein] AS [F2.3 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection88.pep.xls92997]


________________________________________


SELECT 
[expect] AS [C1.2 expect],
 [peptide] AS [C1.2 peptide],
 [protein] AS [C1.2 protein]  FROM [412].[table_interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xlsDB98C]


________________________________________


SELECT [expect] AS [F1.3 expect],
 [peptide] AS [F1.3 peptide],
 [protein] AS [F1.3 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection87.pep.xls63472]


________________________________________


SELECT [expect] AS [H3.3 expect],
 [peptide] AS [H3.3 peptide],
 [protein] AS [H3.3 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls2F3AB]


________________________________________


SELECT [expect] AS [H3.2 expect],
 [peptide] AS [H3.2 peptide],
 [protein] AS [H3.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection85.pep.xlsB4AA0]


________________________________________


SELECT [expect] AS [H2.3 expect],
 [peptide] AS [H2.3 peptide],
 [protein] AS [H2.3 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls69D81]


________________________________________


SELECT [expect] AS [H2.2 expect],
 [peptide] AS [H2.2 peptide],
 [protein] AS [H2.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection84.pep.xls6469E]


________________________________________


SELECT [expect] AS [H1.2 expect],
 [peptide] AS [H1.2 peptide],
 [protein] AS [H1.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection83.pep.xlsF558A]


________________________________________


SELECT [expect] AS [F3.2 expect],
 [peptide] AS [F3.2 peptide],
 [protein] AS [F3.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection81.pep.xls33BE1]


________________________________________


SELECT [expect] AS [F2.2 expect],
 [peptide] AS [F2.2 peptide],
 [protein] AS [F2.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection80.pep.xlsB9172]


________________________________________


SELECT [expect] AS [F1.2 expect],
 [peptide] AS [F1.2 peptide],
 [protein] AS [F1.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection79.pep.xls4BF90]


________________________________________


SELECT [expect] AS [G3.2 expect],
 [peptide] AS [G3.2 peptide],
 [protein] AS [G3.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection75.pep.xls5935E]


________________________________________


SELECT [expect] AS [G2.2 expect],
 [peptide] AS [G2.2 peptide],
 [protein] AS [G2.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection74.pep.xls132C9]


________________________________________


SELECT [expect] AS [G1.2 expect],
 [peptide] AS [G1.2 peptide],
 [protein] AS [G1.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection73.pep.xlsCC589]


________________________________________


SELECT [expect] AS [A3.2 expect],
 [peptide] AS [A3.2 peptide],
 [protein] AS [A3.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection71.pep.xls5458B]


________________________________________


SELECT [expect] AS [A2.2 expect],
 [peptide] AS [A2.2 peptide],
 [protein] AS [A2.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection70.pep.xls85970]


________________________________________


SELECT [expect] AS [A1.2 expect],
 [peptide] AS [A1.2 peptide],
 [protein] AS [A1.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection69.pep.xls5DED0]


________________________________________


SELECT [expect] AS [I3.2 expect],
 [peptide] AS [I3.2 peptide],
 [protein] AS [I3.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection67.pep.xls6B88A]


________________________________________


SELECT [expect] AS [I2.2 expect],
 [peptide] AS [I2.2 peptide],
 [protein] AS [I2.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection66.pep.xlsD06DD]


________________________________________


SELECT [expect] AS [I1.2 expect],
 [peptide] AS [I1.2 peptide],
 [protein] AS [I1.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection65.pep.xlsA41B9]


________________________________________


SELECT [expect] AS [D3.2 expect],
 [peptide] AS [D3.2 peptide],
 [protein] AS [D3.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection61.pep.xls1EF35]


________________________________________


SELECT [expect] AS [D2.2 expect],
 [peptide] AS [D2.2 peptide],
 [protein] AS [D2.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection60.pep.xlsC0ACA]


________________________________________


SELECT [expect] AS [D1.2 expect],
 [peptide] AS [D1.2 peptide],
 [protein] AS [D1.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection59.pep.xls402F9]


________________________________________


SELECT [expect] AS [E3.2 expect],
 [peptide] AS [E3.2 peptide],
 [protein] AS [E3.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection57.pep.xls8AB4B]


________________________________________


SELECT [expect] AS [E2.2 expect],
 [peptide] AS [E2.2 peptide],
 [protein] AS [E2.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection56.pep.xlsC4F8F]


________________________________________


SELECT [expect] AS [E1.2 expect],
 [peptide] AS [E1.2 peptide],
 [protein] AS [E1.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection55.pep.xls3A2FA]


________________________________________


SELECT [expect] AS [B3.2 expect],
 [peptide] AS [B3.2 peptide],
 [protein] AS [B3.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection53.pep.xls73AAD]


________________________________________


SELECT [expect] AS [B2.2 expect],
 [peptide] AS [B2.2 peptide],
 [protein] AS [B2.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection52.pep.xls7EA25]


________________________________________


SELECT [expect] AS [B1.2 expect],
 [peptide] AS [B1.2 peptide],
 [protein] AS [B1.2 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection51.pep.xlsE7D2B]


________________________________________


SELECT [expect] AS [E2.1 expect],
 [peptide] AS [E2.1 peptide],
 [protein] AS [E2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection46.pep.xlsC8EAC]


________________________________________


SELECT [expect] AS [E3.1 expect],
 [peptide] AS [E3.1 peptide],
 [protein] AS [E3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection47.pep.xlsC413B]


________________________________________


SELECT [expect] AS [E1.1 expect],
 [peptide] AS [E1.1 peptide],
 [protein] AS [E1.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection45.pep.xls21102]


________________________________________


SELECT [expect] AS [I3.1 expect],
 [peptide] AS [I3.1 peptide],
 [protein] AS [I3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection43.pep.xls929B5]


________________________________________


SELECT [expect] AS [I2.1 expect],
 [peptide] AS [I2.1 peptide],
 [protein] AS [I2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection42.pep.xls860C9]


________________________________________


SELECT [expect] AS [I1.1 expect],
 [peptide] AS [I1.1 peptide],
 [protein] AS [I1.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection41.pep.xls9410E]


________________________________________


SELECT [expect] AS [G3.1 expect],
 [peptide] AS [G3.1 peptide],
 [protein] AS [G3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection39.pep.xls22A12]


________________________________________


SELECT [expect] AS [G2.1 expect],
 [peptide] AS [G2.1 peptide],
 [protein] AS [G2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection38.pep.xlsCF440]


________________________________________


SELECT [expect] AS [G1.1 expect],
 [peptide] AS [G1.1 peptide],
 [protein] AS [G1.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection37.pep.xlsEA91E]


________________________________________


SELECT [expect] AS [H3.1 expect],
 [peptide] AS [H3.1 peptide],
 [protein] AS [H3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection33.pep.xlsE3F75]


________________________________________


SELECT [expect] AS [H2.1 expect],
 [peptide] AS [H2.1 peptide],
 [protein] AS [H2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection32.pep.xlsB3EB3]


________________________________________


SELECT [expect] AS [H1.1 expect],
 [peptide] AS [H1.1 peptide],
 [protein] AS [H1.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection31.pep.xlsD158E]


________________________________________


SELECT [expect] AS [C3.1 expect],
 [peptide] AS [C3.1 peptide],
 [protein] AS [C3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection29.pep.xls8CF38]


________________________________________


SELECT [expect] AS [C2.1 expect],
  [peptide] AS [C2.1 peptide],
  [protein] AS [C2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection28.pep.xls95B4B]


________________________________________


SELECT [expect] AS [C1.1 expect],
  [peptide] AS [C1.1 peptide],
  [protein] AS [C1.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection27.pep.xls5AD75]


________________________________________


SELECT [expect] AS [B3.1 expect],
  [peptide] AS [B3.1 peptide],
  [protein] AS [B3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection25.pep.xlsFF863]


________________________________________


SELECT [expect] AS [B2.1 expect],
  [peptide] AS [B2.1 peptide],
  [protein] AS [B2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection24.pep.xls92DA2]


________________________________________


SELECT [expect] AS [B1.1 expect],
  [peptide] AS [B1.1 peptide],
  [protein] AS [B1.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection23.pep.xlsB00DD]


________________________________________


SELECT [expect] AS [A2.1 expect],
  [peptide] AS [A2.1 peptide],
  [protein] AS [A2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection19.pep.xls9291B]


________________________________________


SELECT [expect] AS [D2.1 expect],
  [peptide] AS [D2.1 peptide],
  [protein] AS [D2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection18.pep.xlsFCE39]


________________________________________


SELECT [expect] AS [D1.1 expect],
  [peptide] AS [D1.1 peptide],
  [protein] AS [D1.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection17.pep.xls19CE8]


________________________________________


SELECT [expect] AS [F3.1 expect],
  [peptide] AS [F3.1 peptide],
  [protein] AS [F3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection15.pep.xlsEA60A]


________________________________________


SELECT [expect] AS [F2.1 expect],
  [peptide] AS [F2.1 peptide],
  [protein] AS [F2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection14.pep.xls6E58B]


________________________________________


SELECT [expect] AS [F1.1 expect],
  [peptide] AS [F1.1 peptide],
  [protein] AS [F1.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection13.pep.xls54155]


________________________________________


SELECT [expect] AS [A3.1 expect],
  [peptide] AS [A3.1 peptide],
  [protein] AS [A3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection11.pep.xls12A17]


________________________________________


SELECT [expect] AS [A2.1 expect],
  [peptide] AS [A2.1 peptide],
  [protein] AS [A2.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Dectection10.pep.xlsE6C2C]


________________________________________


SELECT [expect] AS [D3.1 expect],
  [peptide] AS [D3.1 peptide],
  [protein] AS [D3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection18.pep.xlsFCE39]


________________________________________


SELECT [expect] AS [D3.1 expect],
  [peptide] AS [D3.1 peptide],
  [protein] AS [D3.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection19.pep.xls9291B]


________________________________________


SELECT [expect] AS [A1.1 expect],
  [peptide] AS [A1.1 peptide],
  [protein] AS [A1.1 protein]
  FROM [412].[table_interact-2015_May_6_Bacteria_Detection9.pep.xlsB8AF5]


________________________________________


SELECT [expect] AS [A3.3 expect],
  [peptide] AS [A3.3 peptide],
  [protein] AS [A3.3 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection58.pep.xls96532]


________________________________________


SELECT [expect] AS [N3.2 expect],
  [peptide] AS [N3.2 peptide],
  [protein] AS [N3.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection57.pep.xlsA2578]


________________________________________


SELECT [expect] AS [N2.2 expect],
  [peptide] AS [N2.2 peptide],
  [protein] AS [N2.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection56.pep.xls61899]


________________________________________


SELECT [expect] AS [J3.2 expect],
  [peptide] AS [J3.2 peptide],
  [protein] AS [J3.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection54.pep.xls355B7]


________________________________________


SELECT [expect] AS [J2.2 expect],
  [peptide] AS [J2.2 peptide],
  [protein] AS [J2.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection53.pep.xlsAC0DB]


________________________________________


SELECT [expect] AS [J1.2 expect],
  [peptide] AS [J1.2 peptide],
  [protein] AS [J1.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection52.pep.xlsD66F8]


________________________________________


SELECT [expect] AS [L3.2 expect],
  [peptide] AS [L3.2 peptide],
  [protein] AS [L3.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection48.pep.xls2931F]


________________________________________


SELECT [expect] AS [L1.2 expect],
  [peptide] AS [L1.2 peptide],
  [protein] AS [L1.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection46.pep.xls5C7D2]


________________________________________


SELECT [expect] AS [M3.2 expect],
  [peptide] AS [M3.2 peptide],
  [protein] AS [M3.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection44.pep.xlsFD6B3]


________________________________________


SELECT [expect] AS [M2.2 expect],
  [peptide] AS [M2.2 peptide],
  [protein] AS [M2.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection43.pep.xls5D790]


________________________________________


SELECT [expect] AS [M1.2 expect],
  [peptide] AS [M1.2 peptide],
  [protein] AS [M1.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection42.pep.xlsF4424]


________________________________________


SELECT [expect] AS [J3.1 expect],
  [peptide] AS [J3.1 peptide],
  [protein] AS [J3.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection40.pep.xlsD2D3E]


________________________________________


SELECT [expect] AS [J2.1 expect],
  [peptide] AS [J2.1 peptide],
  [protein] AS [J2.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection39.pep.xlsC6E74]


________________________________________


SELECT [expect] AS [J1.1 expect],
  [peptide] AS [J1.1 peptide],
  [protein] AS [J1.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection38.pep.xlsB7367]


________________________________________


SELECT [expect] AS [L3.1 expect],
  [peptide] AS [L3.1 peptide],
  [protein] AS [L3.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection34.pep.xls4D9DD]


________________________________________


SELECT [expect] AS [L2.1 expect],
  [peptide] AS [L2.1 peptide],
  [protein] AS [L2.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection33.pep.xls3AD35]


________________________________________


SELECT [expect] AS [L1.1 expect],
  [peptide] AS [L1.1 peptide],
  [protein] AS [L1.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection32.pep.xlsD0C9A]


________________________________________


SELECT [expect] AS [N1.2 expect],
  [peptide] AS [N1.2 peptide],
  [protein] AS [N1.2 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection30.pep.xlsEDD0D]


________________________________________


SELECT [expect] AS [M3.1 expect],
  [peptide] AS [M3.1 peptide],
  [protein] AS [M3.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection28.pep.xlsBB2AE]


________________________________________


SELECT [expect] AS [M2.1 expect],
  [peptide] AS [M2.1 peptide],
  [protein] AS [M2.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection27.pep.xls13697]


________________________________________


SELECT [expect] AS [M1.1 expect],
  [peptide] AS [M1.1 peptide],
  [protein] AS [M1.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection26.pep.xls96F45]


________________________________________


SELECT [expect] AS [N3.1 expect],
  [peptide] AS [N3.1 peptide],
  [protein] AS [N3.1 protein]
  FROM [412].[table_interact-2015_June_9_BactDetection25.pep.xlsEE82C]


________________________________________


SELECT [A1.1 peptide] AS peptide FROM [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]
   UNION ALL
 SELECT [A1.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection69.pep.xls]
UNION ALL
 SELECT [A2.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls]
  UNION ALL
 SELECT [A2.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection70.pep.xls]
  UNION ALL
 SELECT [A3.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls]
  UNION ALL
 SELECT [A3.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection71.pep.xls]
  UNION ALL
 SELECT [A3.3 peptide] FROM [412].[interact-2015_June_9_BactDetection58.pep.xls]
  UNION ALL
 SELECT [B1.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection23.pep.xls]
  UNION ALL
 SELECT [B1.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection51.pep.xls]
  UNION ALL
 SELECT [B2.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection24.pep.xls]
UNION ALL
 SELECT [B2.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection52.pep.xls]
  UNION ALL
 SELECT [B3.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection25.pep.xls]
  UNION ALL
 SELECT [B3.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection53.pep.xls]
  UNION ALL
 SELECT [C1.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection27.pep.xls]
  UNION ALL
 SELECT [C1.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls]
UNION ALL
 SELECT [C2.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection28.pep.xls]
  UNION ALL
 SELECT [C2.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls]
  UNION ALL
 SELECT [C3.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection29.pep.xls]
UNION ALL
 SELECT [C3.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls]
UNION ALL
 SELECT [D1.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection17.pep.xls]
  UNION ALL
 SELECT [D1.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection59.pep.xls]
  UNION ALL
 SELECT [D2.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection18.pep.xls]
UNION ALL
 SELECT [D2.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection60.pep.xls]
  UNION ALL
 SELECT [D3.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection19.pep.xls]
  UNION ALL
 SELECT [D3.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection61.pep.xls]
  UNION ALL
 SELECT [E1.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection45.pep.xls]
  UNION ALL
 SELECT [E1.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection55.pep.xls]
  UNION ALL
 SELECT [E2.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection46.pep.xls]
  UNION ALL
 SELECT [E2.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection56.pep.xls]
UNION ALL
 SELECT [E3.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection47.pep.xls]
UNION ALL
 SELECT [E3.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection57.pep.xls]
UNION ALL
 SELECT [F1.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls]
UNION ALL
 SELECT [F1.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection79.pep.xls]
UNION ALL
 SELECT [F2.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls]
UNION ALL
 SELECT [F2.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection80.pep.xls]
UNION ALL
 SELECT [F1.3 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection87.pep.xls]
UNION ALL
 SELECT [F2.3 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection88.pep.xls]
UNION ALL
 SELECT [F3.3 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection89.pep.xls]
  UNION ALL
 SELECT [F3.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls]
  UNION ALL
 SELECT [F3.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection81.pep.xls]
  UNION ALL
 SELECT [G1.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection37.pep.xls]
  UNION ALL
 SELECT [G1.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection73.pep.xls]
  UNION ALL
 SELECT [G2.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection38.pep.xls]
  UNION ALL
 SELECT [G2.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection74.pep.xls]
  UNION ALL
 SELECT [G3.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection39.pep.xls]
 UNION ALL
 SELECT [G3.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection75.pep.xls]
 UNION ALL
 SELECT [H1.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection31.pep.xls]
 UNION ALL
 SELECT [H1.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection83.pep.xls]
 UNION ALL
 SELECT [H2.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection32.pep.xls]
 UNION ALL
 SELECT [H2.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection84.pep.xls]
 UNION ALL
 SELECT [H2.3 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls]
  UNION ALL
 SELECT [H3.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection33.pep.xls]
  UNION ALL
 SELECT [H3.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection85.pep.xls]
  UNION ALL
 SELECT [H3.3 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls]
  UNION ALL
 SELECT [I1.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection41.pep.xls]
  UNION ALL
 SELECT [I1.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection65.pep.xls]
  UNION ALL
 SELECT [I2.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection42.pep.xls]
  UNION ALL
 SELECT [I2.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection66.pep.xls]
  UNION ALL
 SELECT [I3.1 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection43.pep.xls]
  UNION ALL
 SELECT [I3.2 peptide] FROM [412].[interact-2015_May_6_Bacteria_Detection67.pep.xls]
  UNION ALL
 SELECT [N1.2 peptide] FROM [412].[interact-2015_June_9_BactDetection30.pep.xls]
  UNION ALL
 SELECT [N2.1 peptide] FROM [412].[interact-2015_June_9_BactDetection22.pep.xls]
  UNION ALL
 SELECT [N2.2 peptide] FROM [412].[interact-2015_June_9_BactDetection56.pep.xls]
  UNION ALL
 SELECT [N3.1 peptide] FROM [412].[interact-2015_June_9_BactDetection25.pep.xls]
  UNION ALL
 SELECT [N3.2 peptide] FROM [412].[interact-2015_June_9_BactDetection57.pep.xls]
  UNION ALL
 SELECT [M1.1 peptide] FROM [412].[interact-2015_June_9_BactDetection26.pep.xls]
  UNION ALL
 SELECT [M1.2 peptide] FROM [412].[interact-2015_June_9_BactDetection42.pep.xls]
  UNION ALL
 SELECT [M2.1 peptide] FROM [412].[interact-2015_June_9_BactDetection27.pep.xls]
  UNION ALL
 SELECT [M2.2 peptide] FROM [412].[interact-2015_June_9_BactDetection43.pep.xls]
  UNION ALL
 SELECT [M3.1 peptide] FROM [412].[interact-2015_June_9_BactDetection28.pep.xls]
  UNION ALL
 SELECT [M3.2 peptide] FROM [412].[interact-2015_June_9_BactDetection44.pep.xls]
  UNION ALL
 SELECT [L1.1 peptide] FROM [412].[interact-2015_June_9_BactDetection32.pep.xls]
  UNION ALL
 SELECT [L1.2 peptide] FROM [412].[interact-2015_June_9_BactDetection46.pep.xls]
  UNION ALL
 SELECT [L2.1 peptide] FROM [412].[interact-2015_June_9_BactDetection33.pep.xls]
  UNION ALL
 SELECT [L3.1 peptide] FROM [412].[interact-2015_June_9_BactDetection34.pep.xls]
  UNION ALL
 SELECT [L3.2 peptide] FROM [412].[interact-2015_June_9_BactDetection48.pep.xls]
  UNION ALL
 SELECT [J1.1 peptide] FROM [412].[interact-2015_June_9_BactDetection38.pep.xls]
  UNION ALL
 SELECT [J1.2 peptide] FROM [412].[interact-2015_June_9_BactDetection52.pep.xls]
  UNION ALL
 SELECT [J2.1 peptide] FROM [412].[interact-2015_June_9_BactDetection39.pep.xls]
  UNION ALL
 SELECT [J2.2 peptide] FROM [412].[interact-2015_June_9_BactDetection53.pep.xls]
  UNION ALL
 SELECT [J3.1 peptide] FROM [412].[interact-2015_June_9_BactDetection40.pep.xls]
  UNION ALL
 SELECT [J3.2 peptide] FROM [412].[interact-2015_June_9_BactDetection54.pep.xls]


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection9.pep.xls].[A1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection69.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection69.pep.xls].[A1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls].[A2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection70.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection70.pep.xls].[A2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls].[A3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection71.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection71.pep.xls].[A3.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection58.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection58.pep.xls].[A3.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection23.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection23.pep.xls].[B1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection51.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection51.pep.xls].[B1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection24.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection24.pep.xls].[B2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection52.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection52.pep.xls].[B2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection25.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection25.pep.xls].[B3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection53.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection53.pep.xls].[B3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection27.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection27.pep.xls].[C1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls].[C1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection28.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection28.pep.xls].[C2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls].[C2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection29.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection29.pep.xls].[C3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls].[C3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection17.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection17.pep.xls].[D1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection59.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection59.pep.xls].[D1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection18.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection18.pep.xls].[D2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection60.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection60.pep.xls].[D2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection19.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection19.pep.xls].[D3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection61.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection61.pep.xls].[D3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection45.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection45.pep.xls].[E1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection55.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection55.pep.xls].[E1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection46.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection46.pep.xls].[E2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection56.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection56.pep.xls].[E2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection47.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection47.pep.xls].[E3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection57.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection57.pep.xls].[E3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls].[F1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection79.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection79.pep.xls].[F1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection87.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection87.pep.xls].[F1.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls].[F2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection80.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection80.pep.xls].[F2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection88.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection88.pep.xls].[F2.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls].[F3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection81.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection81.pep.xls].[F3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection89.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection89.pep.xls].[F3.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection37.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection37.pep.xls].[G1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection73.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection73.pep.xls].[G1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection38.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection38.pep.xls].[G2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection74.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection74.pep.xls].[G2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection39.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection39.pep.xls].[G3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection75.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection75.pep.xls].[G3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection31.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection31.pep.xls].[H1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection83.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection83.pep.xls].[H1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection32.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection32.pep.xls].[H2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection84.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection84.pep.xls].[H2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls].[H2.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection33.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection33.pep.xls].[H3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection85.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection85.pep.xls].[H3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls].[H3.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection41.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection41.pep.xls].[I1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection65.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection65.pep.xls].[I1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection42.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection42.pep.xls].[I2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection66.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection66.pep.xls].[I2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection43.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection43.pep.xls].[I3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection67.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection67.pep.xls].[I3.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection30.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection30.pep.xls].[N1.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection22.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection22.pep.xls].[N2.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection56.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection56.pep.xls].[N2.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection25.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection25.pep.xls].[N3.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection57.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection57.pep.xls].[N3.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection26.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection26.pep.xls].[M1.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection42.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection42.pep.xls].[M1.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection27.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection27.pep.xls].[M2.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection43.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection43.pep.xls].[M2.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection28.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection28.pep.xls].[M3.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection44.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection44.pep.xls].[M3.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection32.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection32.pep.xls].[L1.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection46.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection46.pep.xls].[L1.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection33.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection33.pep.xls].[L2.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection34.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection34.pep.xls].[L3.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection48.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection48.pep.xls].[L3.2 peptide]
   LEFT JOIN [412].[interact-2015_June_9_BactDetection38.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection38.pep.xls].[J1.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection52.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection52.pep.xls].[J1.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection39.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection39.pep.xls].[J2.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection53.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection53.pep.xls].[J2.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection40.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection40.pep.xls].[J3.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection54.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection54.pep.xls].[J3.2 peptide] 


________________________________________


SELECT * FROM [412].[Rpom Thaps peptide overlap]
  LEFT JOIN [412].[bact detection peptide replicates]
  ON [412].[Rpom Thaps peptide overlap].Sequence_Rpom=[412].[bact detection peptide replicates].peptide


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection9.pep.xls].[A1.1 peptide]


________________________________________


SELECT count(*) FROM [412].[bact detection distinct peptides]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection9.pep.xls].[A1.1 peptide]


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection9.pep.xls].[A1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection69.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection69.pep.xls].[A1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls].[A2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection70.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection70.pep.xls].[A2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls].[A3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection71.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection71.pep.xls].[A3.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection58.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection58.pep.xls].[A3.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection23.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection23.pep.xls].[B1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection51.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection51.pep.xls].[B1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection24.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection24.pep.xls].[B2.1 peptide]


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection52.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection52.pep.xls].[B2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection25.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection25.pep.xls].[B3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection53.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection53.pep.xls].[B3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection27.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection27.pep.xls].[C1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls].[C1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection28.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection28.pep.xls].[C2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls].[C2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection29.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection29.pep.xls].[C3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls].[C3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection17.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection17.pep.xls].[D1.1 peptide]


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection59.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection59.pep.xls].[D1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection18.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection18.pep.xls].[D2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection60.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection60.pep.xls].[D2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection19.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection19.pep.xls].[D3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection61.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection61.pep.xls].[D3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection45.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection45.pep.xls].[E1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection55.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection55.pep.xls].[E1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection46.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection46.pep.xls].[E2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection56.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection56.pep.xls].[E2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection47.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection47.pep.xls].[E3.1 peptide]



________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection57.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection57.pep.xls].[E3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls].[F1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection79.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection79.pep.xls].[F1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection87.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection87.pep.xls].[F1.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls].[F2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection80.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection80.pep.xls].[F2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection88.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection88.pep.xls].[F2.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls].[F3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection81.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection81.pep.xls].[F3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection89.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection89.pep.xls].[F3.3 peptide]


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection37.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection37.pep.xls].[G1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection73.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection73.pep.xls].[G1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection38.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection38.pep.xls].[G2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection74.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection74.pep.xls].[G2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection39.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection39.pep.xls].[G3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection75.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection75.pep.xls].[G3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection31.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection31.pep.xls].[H1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection83.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection83.pep.xls].[H1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection32.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection32.pep.xls].[H2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection84.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection84.pep.xls].[H2.2 peptide]


________________________________________


SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection9.pep.xls].[A1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection69.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection69.pep.xls].[A1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls].[A2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection70.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection70.pep.xls].[A2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls].[A3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection71.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection71.pep.xls].[A3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection58.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection58.pep.xls].[A3.3 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection23.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection23.pep.xls].[B1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection51.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection51.pep.xls].[B1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection24.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection24.pep.xls].[B2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection52.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection52.pep.xls].[B2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection25.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection25.pep.xls].[B3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection53.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection53.pep.xls].[B3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection27.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection27.pep.xls].[C1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls].[C1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection28.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection28.pep.xls].[C2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls].[C2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection29.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection29.pep.xls].[C3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls].[C3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection17.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection17.pep.xls].[D1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection59.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection59.pep.xls].[D1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection18.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection18.pep.xls].[D2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection60.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection60.pep.xls].[D2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection19.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection19.pep.xls].[D3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection61.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection61.pep.xls].[D3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection45.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection45.pep.xls].[E1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection55.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection55.pep.xls].[E1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection46.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection46.pep.xls].[E2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection56.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection56.pep.xls].[E2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection47.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection47.pep.xls].[E3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection57.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection57.pep.xls].[E3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls].[F1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection79.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection79.pep.xls].[F1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection87.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection87.pep.xls].[F1.3 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls].[F2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection80.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection80.pep.xls].[F2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection88.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection88.pep.xls].[F2.3 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls].[F3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection81.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection81.pep.xls].[F3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection89.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection89.pep.xls].[F3.3 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection37.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection37.pep.xls].[G1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection73.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection73.pep.xls].[G1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection38.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection38.pep.xls].[G2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection74.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection74.pep.xls].[G2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection39.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection39.pep.xls].[G3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection75.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection75.pep.xls].[G3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection31.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection31.pep.xls].[H1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection83.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection83.pep.xls].[H1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection32.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection32.pep.xls].[H2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection84.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection84.pep.xls].[H2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls].[H2.3 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection33.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection33.pep.xls].[H3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection85.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection85.pep.xls].[H3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls].[H3.3 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection41.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection41.pep.xls].[I1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection65.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection65.pep.xls].[I1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection42.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection42.pep.xls].[I2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection66.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection66.pep.xls].[I2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection43.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection43.pep.xls].[I3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection67.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection67.pep.xls].[I3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection30.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection30.pep.xls].[N1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection22.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection22.pep.xls].[N2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection56.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection56.pep.xls].[N2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection25.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection25.pep.xls].[N3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection57.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection57.pep.xls].[N3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection26.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection26.pep.xls].[M1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection42.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection42.pep.xls].[M1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection27.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection27.pep.xls].[M2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection43.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection43.pep.xls].[M2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection28.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection28.pep.xls].[M3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection44.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection44.pep.xls].[M3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection32.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection32.pep.xls].[L1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection46.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection46.pep.xls].[L1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection33.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection33.pep.xls].[L2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection34.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection34.pep.xls].[L3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection48.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection48.pep.xls].[L3.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection38.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection38.pep.xls].[J1.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection52.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection52.pep.xls].[J1.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection39.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection39.pep.xls].[J2.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection53.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection53.pep.xls].[J2.2 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection40.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection40.pep.xls].[J3.1 peptide]
UNION ALL
SELECT *
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection54.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection54.pep.xls].[J3.2 peptide] 


________________________________________


SELECT *, 'A1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection9.pep.xls].[A1.1 peptide]
UNION ALL
SELECT *, 'A1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection69.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection69.pep.xls].[A1.2 peptide]
UNION ALL
SELECT *, 'A2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls].[A2.1 peptide]
UNION ALL
SELECT *, 'A2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection70.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection70.pep.xls].[A2.2 peptide]
UNION ALL
SELECT *, 'A3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls].[A3.1 peptide]
UNION ALL
SELECT *, 'A3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection71.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection71.pep.xls].[A3.2 peptide]
UNION ALL
SELECT *, 'A3.3' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection58.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection58.pep.xls].[A3.3 peptide]
UNION ALL
SELECT *, 'B1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection23.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection23.pep.xls].[B1.1 peptide]
UNION ALL
SELECT *, 'B1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection51.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection51.pep.xls].[B1.2 peptide]
UNION ALL
SELECT *, 'B2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection24.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection24.pep.xls].[B2.1 peptide]
UNION ALL
SELECT *, 'B2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection52.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection52.pep.xls].[B2.2 peptide]
UNION ALL
SELECT *, 'B3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection25.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection25.pep.xls].[B3.1 peptide]
UNION ALL
SELECT *, 'B3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection53.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection53.pep.xls].[B3.2 peptide]
UNION ALL
SELECT *, 'C1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection27.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection27.pep.xls].[C1.1 peptide]
UNION ALL
SELECT *, 'C1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls].[C1.2 peptide]
UNION ALL
SELECT *, 'C2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection28.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection28.pep.xls].[C2.1 peptide]
UNION ALL
SELECT *, 'C2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls].[C2.2 peptide]


________________________________________


SELECT *, 'A1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection9.pep.xls].[A1.1 peptide]
UNION ALL
SELECT *, 'A1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection69.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection69.pep.xls].[A1.2 peptide]
UNION ALL
SELECT *, 'A2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls].[A2.1 peptide]
UNION ALL
SELECT *, 'A2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection70.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection70.pep.xls].[A2.2 peptide]
UNION ALL
SELECT *, 'A3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls].[A3.1 peptide]
UNION ALL
SELECT *, 'A3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection71.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection71.pep.xls].[A3.2 peptide]
UNION ALL
SELECT *, 'A3.3' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection58.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection58.pep.xls].[A3.3 peptide]
UNION ALL
SELECT *, 'B1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection23.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection23.pep.xls].[B1.1 peptide]
UNION ALL
SELECT *, 'B1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection51.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection51.pep.xls].[B1.2 peptide]
UNION ALL
SELECT *, 'B2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection24.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection24.pep.xls].[B2.1 peptide]
UNION ALL
SELECT *, 'B2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection52.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection52.pep.xls].[B2.2 peptide]
UNION ALL
SELECT *, 'B3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection25.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection25.pep.xls].[B3.1 peptide]
UNION ALL
SELECT *, 'B3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection53.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection53.pep.xls].[B3.2 peptide]
UNION ALL
SELECT *, 'C1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection27.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection27.pep.xls].[C1.1 peptide]
UNION ALL
SELECT *, 'C1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls].[C1.2 peptide]
UNION ALL
SELECT *, 'C2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection28.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection28.pep.xls].[C2.1 peptide]
UNION ALL
SELECT *, 'C2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls].[C2.2 peptide]
UNION ALL
SELECT *, 'C3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection29.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection29.pep.xls].[C3.1 peptide]
UNION ALL
SELECT *, 'C3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls].[C3.2 peptide]
UNION ALL
SELECT *, 'D1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection17.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection17.pep.xls].[D1.1 peptide]
UNION ALL
SELECT *, 'D1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection59.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection59.pep.xls].[D1.2 peptide]
UNION ALL
SELECT *, 'D2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection18.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection18.pep.xls].[D2.1 peptide]
UNION ALL
SELECT *, 'D2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection60.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection60.pep.xls].[D2.2 peptide]
UNION ALL
SELECT *, 'D3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection19.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection19.pep.xls].[D3.1 peptide]
UNION ALL
SELECT *,'D3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection61.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection61.pep.xls].[D3.2 peptide]
UNION ALL
SELECT *, 'E1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection45.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection45.pep.xls].[E1.1 peptide]
UNION ALL
SELECT *, 'E1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection55.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection55.pep.xls].[E1.2 peptide]
UNION ALL
SELECT *, 'E2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection46.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection46.pep.xls].[E2.1 peptide]
UNION ALL
SELECT *, 'E2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection56.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection56.pep.xls].[E2.2 peptide]
UNION ALL
SELECT *, 'E3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection47.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection47.pep.xls].[E3.1 peptide]
UNION ALL
SELECT *, 'E3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection57.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection57.pep.xls].[E3.2 peptide]
UNION ALL
SELECT *, 'F1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls].[F1.1 peptide]
UNION ALL
SELECT *, 'F1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection79.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection79.pep.xls].[F1.2 peptide]
UNION ALL
SELECT *, 'F1.3' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection87.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection87.pep.xls].[F1.3 peptide]
UNION ALL
SELECT *, 'F2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls].[F2.1 peptide]
UNION ALL
SELECT *, 'F2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection80.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection80.pep.xls].[F2.2 peptide]
UNION ALL
SELECT *, 'F2.3' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection88.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection88.pep.xls].[F2.3 peptide]
UNION ALL
SELECT *, 'F3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls].[F3.1 peptide]
UNION ALL
SELECT *, 'F3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection81.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection81.pep.xls].[F3.2 peptide]
UNION ALL
SELECT *, 'F3.3' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection89.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection89.pep.xls].[F3.3 peptide]
UNION ALL
SELECT *, 'G1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection37.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection37.pep.xls].[G1.1 peptide]
UNION ALL
SELECT *, 'G1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection73.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection73.pep.xls].[G1.2 peptide]
UNION ALL
SELECT *, 'G2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection38.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection38.pep.xls].[G2.1 peptide]
UNION ALL
SELECT *, 'G2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection74.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection74.pep.xls].[G2.2 peptide]
UNION ALL
SELECT *, 'G3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection39.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection39.pep.xls].[G3.1 peptide]
UNION ALL
SELECT *, 'G3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection75.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection75.pep.xls].[G3.2 peptide]
UNION ALL
SELECT *, 'H1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection31.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection31.pep.xls].[H1.1 peptide]
UNION ALL
SELECT *, 'H1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection83.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection83.pep.xls].[H1.2 peptide]
UNION ALL
SELECT *,'H2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection32.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection32.pep.xls].[H2.1 peptide]
UNION ALL
SELECT *, 'H2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection84.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection84.pep.xls].[H2.2 peptide]
UNION ALL
SELECT *, 'H2.3' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls].[H2.3 peptide]
UNION ALL
SELECT *, 'H3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection33.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection33.pep.xls].[H3.1 peptide]
UNION ALL
SELECT *, 'H3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection85.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection85.pep.xls].[H3.2 peptide]
UNION ALL
SELECT *, 'H3.3' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls].[H3.3 peptide]
UNION ALL
SELECT *, 'I1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection41.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection41.pep.xls].[I1.1 peptide]
UNION ALL
SELECT *, 'I1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection65.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection65.pep.xls].[I1.2 peptide]
UNION ALL
SELECT *, 'I2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection42.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection42.pep.xls].[I2.1 peptide]
UNION ALL
SELECT *, 'I2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection66.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection66.pep.xls].[I2.2 peptide]
UNION ALL
SELECT *, 'I3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection43.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection43.pep.xls].[I3.1 peptide]
UNION ALL
SELECT *, 'I3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_May_6_Bacteria_Detection67.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection67.pep.xls].[I3.2 peptide]
UNION ALL
SELECT *, 'N1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection30.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection30.pep.xls].[N1.2 peptide]
UNION ALL
SELECT *, 'N2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection22.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection22.pep.xls].[N2.1 peptide]
UNION ALL
SELECT *, 'N2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection56.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection56.pep.xls].[N2.2 peptide]
UNION ALL
SELECT *, 'N3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection25.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection25.pep.xls].[N3.1 peptide]
UNION ALL
SELECT *, 'N3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection57.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection57.pep.xls].[N3.2 peptide]
UNION ALL
SELECT *, 'M1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection26.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection26.pep.xls].[M1.1 peptide]
UNION ALL
SELECT *, 'M1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection42.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection42.pep.xls].[M1.2 peptide]
UNION ALL
SELECT *, 'M2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection27.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection27.pep.xls].[M2.1 peptide]
UNION ALL
SELECT *, 'M2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection43.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection43.pep.xls].[M2.2 peptide]
UNION ALL
SELECT *, 'M3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection28.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection28.pep.xls].[M3.1 peptide]
UNION ALL
SELECT *, 'M3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection44.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection44.pep.xls].[M3.2 peptide]
UNION ALL
SELECT *, 'L1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection32.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection32.pep.xls].[L1.1 peptide]
UNION ALL
SELECT *, 'L1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection46.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection46.pep.xls].[L1.2 peptide]
UNION ALL
SELECT *, 'L2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection33.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection33.pep.xls].[L2.1 peptide]
UNION ALL
SELECT *, 'L3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection34.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection34.pep.xls].[L3.1 peptide]
UNION ALL
SELECT *, 'L3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection48.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection48.pep.xls].[L3.2 peptide]
UNION ALL
SELECT *, 'J1.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection38.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection38.pep.xls].[J1.1 peptide]
UNION ALL
SELECT *, 'J1.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection52.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection52.pep.xls].[J1.2 peptide]
UNION ALL
SELECT *, 'J2.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection39.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection39.pep.xls].[J2.1 peptide]
UNION ALL
SELECT *, 'J2.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection53.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection53.pep.xls].[J2.2 peptide]
UNION ALL
SELECT *, 'J3.1' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection40.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection40.pep.xls].[J3.1 peptide]
UNION ALL
SELECT *, 'J3.2' as experiment
FROM [412].[bact detection distinct peptides]
JOIN [412].[interact-2015_June_9_BactDetection54.pep.xls] ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection54.pep.xls].[J3.2 peptide] 


________________________________________


SELECT * FROM [412].[bact detection peptides union]
  LEFT JOIN [412].[Rpom Thaps peptide overlap]
  ON [412].[bact detection peptides union].peptide=[412].[Rpom Thaps peptide overlap].Sequence_Rpom


________________________________________


SELECT * FROM [412].[ambiguouspeptides]
  WHERE Unique_ID_Rpom>0


________________________________________


SELECT * FROM [412].[ambiguouspeptides]
  WHERE Unique_ID_Thaps>0


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls].[H2.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection33.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection33.pep.xls].[H3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection85.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection85.pep.xls].[H3.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls].[H3.3 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection41.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection41.pep.xls].[I1.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection65.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection65.pep.xls].[I1.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection42.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection42.pep.xls].[I2.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection66.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection66.pep.xls].[I2.2 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection43.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection43.pep.xls].[I3.1 peptide]
  LEFT JOIN [412].[interact-2015_May_6_Bacteria_Detection67.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_May_6_Bacteria_Detection67.pep.xls].[I3.2 peptide]


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection30.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection30.pep.xls].[N1.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection22.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection22.pep.xls].[N2.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection56.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection56.pep.xls].[N2.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection25.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection25.pep.xls].[N3.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection57.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection57.pep.xls].[N3.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection26.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection26.pep.xls].[M1.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection42.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection42.pep.xls].[M1.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection27.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection27.pep.xls].[M2.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection43.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection43.pep.xls].[M2.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection28.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection28.pep.xls].[M3.1 peptide]


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection44.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection44.pep.xls].[M3.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection32.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection32.pep.xls].[L1.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection46.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection46.pep.xls].[L1.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection33.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection33.pep.xls].[L2.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection34.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection34.pep.xls].[L3.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection48.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection48.pep.xls].[L3.2 peptide]
   LEFT JOIN [412].[interact-2015_June_9_BactDetection38.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection38.pep.xls].[J1.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection52.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection52.pep.xls].[J1.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection39.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection39.pep.xls].[J2.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection53.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection53.pep.xls].[J2.2 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection40.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection40.pep.xls].[J3.1 peptide]
  LEFT JOIN [412].[interact-2015_June_9_BactDetection54.pep.xls]
  ON [412].[bact detection distinct peptides].peptide=[412].[interact-2015_June_9_BactDetection54.pep.xls].[J3.2 peptide] 


________________________________________


SELECT * FROM [412].[Rpom Thaps peptide overlap]
  LEFT JOIN [412].[bact detection peptides 1]
  ON [412].[Rpom Thaps peptide overlap].Sequence_Rpom=[412].[bact detection peptides 1].peptide


________________________________________


SELECT [Protein_Name_Thaps], [Sequence_Thaps], [Unique_ID_Rpom]+[Unique_ID_Thaps] AS [ID sum],
  [NSAF A1]+[NSAF A2]+[NSAF A3]+[NSAF B1]+[NSAF B2]+[NSAF B3]+[NSAF C1]+[NSAF C2]+[NSAF C3]+[NSAF D1]+[NSAF D2]+
  [NSAF D3]+[NSAF E1]+[NSAF E2]+[NSAF E3]+[NSAF F1]+[NSAF F2]+[NSAF F3]+[NSAF G1]+[NSAF G2]+[NSAF G3]+[NSAF H1]+
  [NSAF H2]+[NSAF H3]+[NSAF J1]+[NSAF J2]+[NSAF J3]+[NSAF L1]+[NSAF L2]+[NSAF L3]+[NSAF M1]+[NSAF M2]+[NSAF M3]+
  [NSAF N1]+[NSAF N2]+[NSAF N3] AS [sum NSAF]
  FROM [412].[bact detection data with overlap peptides]


________________________________________


SELECT [Protein_Name_Thaps], [Sequence_Thaps], [Unique_ID_Rpom], [Unique_ID_Thaps],
  [NSAF A1]+[NSAF A2]+[NSAF A3]+[NSAF B1]+[NSAF B2]+[NSAF B3]+[NSAF C1]+[NSAF C2]+[NSAF C3]+[NSAF D1]+[NSAF D2]+
  [NSAF D3]+[NSAF E1]+[NSAF E2]+[NSAF E3]+[NSAF F1]+[NSAF F2]+[NSAF F3]+[NSAF G1]+[NSAF G2]+[NSAF G3]+[NSAF H1]+
  [NSAF H2]+[NSAF H3]+[NSAF J1]+[NSAF J2]+[NSAF J3]+[NSAF L1]+[NSAF L2]+[NSAF L3]+[NSAF M1]+[NSAF M2]+[NSAF M3]+
  [NSAF N1]+[NSAF N2]+[NSAF N3] AS [sum NSAF]
  FROM [412].[bact detection data with overlap peptides]


________________________________________


SELECT * FROM [412].[putative ambiguous thaps peptides with NSAF sum]
  WHERE [sum NSAF]>0


________________________________________


SELECT * FROM [412].[putative ambiguous thaps peptides nonzero nsaf]
  WHERE [Unique_ID_Rpom]>0


________________________________________


SELECT * FROM [412].[putative ambiguous thaps peptides nonzero nsaf]
  WHERE [Unique_ID_Thaps]>0


________________________________________


SELECT [Protein_Name_Rpom], [Sequence_Rpom], [Unique_ID_Rpom], [Unique_ID_Thaps],
  [NSAF A1]+[NSAF A2]+[NSAF A3]+[NSAF B1]+[NSAF B2]+[NSAF B3]+[NSAF C1]+[NSAF C2]+[NSAF C3]+[NSAF D1]+[NSAF D2]+
  [NSAF D3]+[NSAF E1]+[NSAF E2]+[NSAF E3]+[NSAF F1]+[NSAF F2]+[NSAF F3]+[NSAF G1]+[NSAF G2]+[NSAF G3]+[NSAF H1]+
  [NSAF H2]+[NSAF H3]+[NSAF J1]+[NSAF J2]+[NSAF J3]+[NSAF L1]+[NSAF L2]+[NSAF L3]+[NSAF M1]+[NSAF M2]+[NSAF M3]+
  [NSAF N1]+[NSAF N2]+[NSAF N3] AS [sum NSAF]
  FROM [412].[bact detection data with overlap peptides]


________________________________________


SELECT * FROM [412].[putative ambiguous rpom peptides sum NSAF]
  WHERE [sum NSAF]>0


________________________________________


SELECT * FROM [412].[putative ambiguous rpom peptides nonzero nsaf]
  WHERE [Unique_ID_Thaps]>0


________________________________________


SELECT * FROM [412].[putative ambiguous thaps peptides nonzero nsaf]
  LEFT JOIN [412].[putative ambiguous rpom peptides nonzero nsaf]
  ON [412].[putative ambiguous thaps peptides nonzero nsaf].[Unique_ID_Rpom]=[412].[putative ambiguous rpom peptides nonzero nsaf].[Unique_ID_Rpom]


________________________________________


SELECT DISTINCT [Sequence_Thaps] FROM [412].[detected proteins with putative ambiguous peptides]


________________________________________


SELECT * FROM [412].[bact detection redundant peptides]
  WHERE [peptide]='R.FTQAGSEVSALLGR.L'


________________________________________


SELECT * FROM [412].[bact detection distinct peptides]
  WHERE [peptide]='R.FTQAGSEVSALLGR.L'


________________________________________


SELECT * FROM [412].[bact detection data with overlap peptides]
  WHERE [Unique_ID_Thaps]>0


________________________________________


SELECT * FROM [412].[detected_ambiguous_peptides.txt]
  LEFT JOIN [412].[all ambiguous peptides with NSAF]
  ON [412].[detected_ambiguous_peptides.txt].[ambiguous peptide]=[412].[all ambiguous peptides with NSAF].[Sequence_Rpom]


________________________________________


SELECT [A1.1 peptide] AS peptide, [A1.1 protein] AS protein FROM [412].[interact-2015_May_6_Bacteria_Detection9.pep.xls]
   UNION ALL
 SELECT [A1.2 peptide], [A1.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection69.pep.xls]
UNION ALL
 SELECT [A2.1 peptide], [A2.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Dectection10.pep.xls]
  UNION ALL
 SELECT [A2.2 peptide], [A2.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection70.pep.xls]
  UNION ALL
 SELECT [A3.1 peptide], [A3.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Dectection11.pep.xls]
  UNION ALL
 SELECT [A3.2 peptide], [A3.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection71.pep.xls]
  UNION ALL
 SELECT [A3.3 peptide], [A3.3 protein] FROM [412].[interact-2015_June_9_BactDetection58.pep.xls]
  UNION ALL
 SELECT [B1.1 peptide], [B1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection23.pep.xls]
  UNION ALL
 SELECT [B1.2 peptide], [B1.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection51.pep.xls]
  UNION ALL
 SELECT [B2.1 peptide], [B2.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection24.pep.xls]
UNION ALL
 SELECT [B2.2 peptide], [B2.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection52.pep.xls]
  UNION ALL
 SELECT [B3.1 peptide], [B3.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection25.pep.xls]
  UNION ALL
 SELECT [B3.2 peptide], [B3.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection53.pep.xls]
  UNION ALL
 SELECT [C1.1 peptide], [C1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection27.pep.xls]
  UNION ALL
 SELECT [C1.2 peptide], [C1.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection87_15051208724.pep.xls]
UNION ALL
 SELECT [C2.1 peptide], [C2.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection28.pep.xls]
  UNION ALL
 SELECT [C2.2 peptide], [C2.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection88_150512103018.pep.xls]
  UNION ALL
 SELECT [C3.1 peptide], [C3.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection29.pep.xls]
UNION ALL
 SELECT [C3.2 peptide], [C3.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection89_150512121311.pep.xls]
UNION ALL
 SELECT [D1.1 peptide], [D1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection17.pep.xls]
  UNION ALL
 SELECT [D1.2 peptide], [D1.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection59.pep.xls]
  UNION ALL
 SELECT [D2.1 peptide], [D2.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection18.pep.xls]
UNION ALL
 SELECT [D2.2 peptide], [D2.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection60.pep.xls]
  UNION ALL
 SELECT [D3.1 peptide], [D3.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection19.pep.xls]
  UNION ALL
 SELECT [D3.2 peptide], [D3.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection61.pep.xls]
  UNION ALL
 SELECT [E1.1 peptide], [E1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection45.pep.xls]
  UNION ALL
 SELECT [E1.2 peptide], [E1.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection55.pep.xls]
  UNION ALL
 SELECT [E2.1 peptide], [E2.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection46.pep.xls]
  UNION ALL
 SELECT [E2.2 peptide], [E2.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection56.pep.xls]
UNION ALL
 SELECT [E3.1 peptide], [E3.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection47.pep.xls]
UNION ALL
 SELECT [E3.2 peptide], [E3.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection57.pep.xls]
UNION ALL
 SELECT [F1.1 peptide], [F1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Dectection13.pep.xls]
UNION ALL
 SELECT [F1.2 peptide], [F1.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection79.pep.xls]
UNION ALL
 SELECT [F2.1 peptide], [F2.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Dectection14.pep.xls]
UNION ALL
 SELECT [F2.2 peptide], [F2.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection80.pep.xls]
UNION ALL
 SELECT [F1.3 peptide], [F1.3 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection87.pep.xls]
UNION ALL
 SELECT [F2.3 peptide], [F2.3 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection88.pep.xls]
UNION ALL
 SELECT [F3.3 peptide], [F3.3 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection89.pep.xls]
  UNION ALL
 SELECT [F3.1 peptide], [F3.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Dectection15.pep.xls]
  UNION ALL
 SELECT [F3.2 peptide], [F3.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection81.pep.xls]
  UNION ALL
 SELECT [G1.1 peptide], [G1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection37.pep.xls]
  UNION ALL
 SELECT [G1.2 peptide], [G1.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection73.pep.xls]
  UNION ALL
 SELECT [G2.1 peptide], [G2.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection38.pep.xls]
  UNION ALL
 SELECT [G2.2 peptide], [G2.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection74.pep.xls]
  UNION ALL
 SELECT [G3.1 peptide], [G3.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection39.pep.xls]
 UNION ALL
 SELECT [G3.2 peptide], [G3.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection75.pep.xls]
 UNION ALL
 SELECT [H1.1 peptide], [H1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection31.pep.xls]
 UNION ALL
 SELECT [H1.2 peptide], [H1.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection83.pep.xls]
 UNION ALL
 SELECT [H2.1 peptide], [H2.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection32.pep.xls]
 UNION ALL
 SELECT [H2.2 peptide], [H2.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection84.pep.xls]
 UNION ALL
 SELECT [H2.3 peptide], [H2.3 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection84_15051204842.pep.xls]
  UNION ALL
 SELECT [H3.1 peptide], [H3.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection33.pep.xls]
  UNION ALL
 SELECT [H3.2 peptide], [H3.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection85.pep.xls]
  UNION ALL
 SELECT [H3.3 peptide], [H3.3 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection85_150512055136.pep.xls]
  UNION ALL
 SELECT [I1.1 peptide], [I1.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection41.pep.xls]
  UNION ALL
 SELECT [I1.2 peptide], [I1.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection65.pep.xls]
  UNION ALL
 SELECT [I2.1 peptide], [I2.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection42.pep.xls]
  UNION ALL
 SELECT [I2.2 peptide], [I2.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection66.pep.xls]
  UNION ALL
 SELECT [I3.1 peptide], [I3.1 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection43.pep.xls]
  UNION ALL
 SELECT [I3.2 peptide], [I3.2 protein] FROM [412].[interact-2015_May_6_Bacteria_Detection67.pep.xls]
  UNION ALL
 SELECT [N1.2 peptide], [N1.2 protein] FROM [412].[interact-2015_June_9_BactDetection30.pep.xls]
  UNION ALL
 SELECT [N2.1 peptide], [N2.1 protein] FROM [412].[interact-2015_June_9_BactDetection22.pep.xls]
  UNION ALL
 SELECT [N2.2 peptide], [N2.2 protein] FROM [412].[interact-2015_June_9_BactDetection56.pep.xls]
  UNION ALL
 SELECT [N3.1 peptide], [N3.1 protein] FROM [412].[interact-2015_June_9_BactDetection25.pep.xls]
  UNION ALL
 SELECT [N3.2 peptide], [N3.2 protein] FROM [412].[interact-2015_June_9_BactDetection57.pep.xls]
  UNION ALL
 SELECT [M1.1 peptide], [M1.1 protein] FROM [412].[interact-2015_June_9_BactDetection26.pep.xls]
  UNION ALL
 SELECT [M1.2 peptide], [M1.2 protein] FROM [412].[interact-2015_June_9_BactDetection42.pep.xls]
  UNION ALL
 SELECT [M2.1 peptide], [M2.1 protein] FROM [412].[interact-2015_June_9_BactDetection27.pep.xls]
  UNION ALL
 SELECT [M2.2 peptide], [M2.2 protein] FROM [412].[interact-2015_June_9_BactDetection43.pep.xls]
  UNION ALL
 SELECT [M3.1 peptide], [M3.1 protein] FROM [412].[interact-2015_June_9_BactDetection28.pep.xls]
  UNION ALL
 SELECT [M3.2 peptide], [M3.2 protein] FROM [412].[interact-2015_June_9_BactDetection44.pep.xls]
  UNION ALL
 SELECT [L1.1 peptide], [L1.1 protein] FROM [412].[interact-2015_June_9_BactDetection32.pep.xls]
  UNION ALL
 SELECT [L1.2 peptide], [L1.2 protein] FROM [412].[interact-2015_June_9_BactDetection46.pep.xls]
  UNION ALL
 SELECT [L2.1 peptide], [L2.1 protein] FROM [412].[interact-2015_June_9_BactDetection33.pep.xls]
  UNION ALL
 SELECT [L3.1 peptide], [L3.1 protein] FROM [412].[interact-2015_June_9_BactDetection34.pep.xls]
  UNION ALL
 SELECT [L3.2 peptide], [L3.2 protein] FROM [412].[interact-2015_June_9_BactDetection48.pep.xls]
  UNION ALL
 SELECT [J1.1 peptide], [J1.1 protein] FROM [412].[interact-2015_June_9_BactDetection38.pep.xls]
  UNION ALL
 SELECT [J1.2 peptide], [J1.2 protein] FROM [412].[interact-2015_June_9_BactDetection52.pep.xls]
  UNION ALL
 SELECT [J2.1 peptide], [J2.1 protein] FROM [412].[interact-2015_June_9_BactDetection39.pep.xls]
  UNION ALL
 SELECT [J2.2 peptide], [J2.2 protein] FROM [412].[interact-2015_June_9_BactDetection53.pep.xls]
  UNION ALL
 SELECT [J3.1 peptide], [J3.1 protein] FROM [412].[interact-2015_June_9_BactDetection40.pep.xls]
  UNION ALL
 SELECT [J3.2 peptide], [J3.2 protein] FROM [412].[interact-2015_June_9_BactDetection54.pep.xls]


________________________________________


SELECT * FROM [412].[bact detection peptides and proteins]
  WHERE protein IN ('RUEPO')


________________________________________


SELECT peptide FROM [412].[Snapshot of bact detection peptides and proteins]


________________________________________


SELECT * FROM [412].[bact detection peptides and proteins]
  WHERE protein like '%RUEPO%'


________________________________________


SELECT * FROM [412].[rpom peptides and proteins]
  LEFT JOIN [412].[Bact_detection_nsaf_all_data_with_ID.csv]
  ON [412].[rpom peptides and proteins].protein=[412].[Bact_detection_nsaf_all_data_with_ID.csv].Protein


________________________________________


SELECT *,
  [NSAF A1]+[NSAF A2]+[NSAF A3]+[NSAF B1]+[NSAF B2]+[NSAF B3]+[NSAF C1]+[NSAF C2]+[NSAF C3]+[NSAF D1]+[NSAF D2]+
  [NSAF D3]+[NSAF E1]+[NSAF E2]+[NSAF E3]+[NSAF F1]+[NSAF F2]+[NSAF F3]+[NSAF G1]+[NSAF G2]+[NSAF G3]+[NSAF H1]+
  [NSAF H2]+[NSAF H3]+[NSAF J1]+[NSAF J2]+[NSAF J3]+[NSAF L1]+[NSAF L2]+[NSAF L3]+[NSAF M1]+[NSAF M2]+[NSAF M3]+
  [NSAF N1]+[NSAF N2]+[NSAF N3] AS [sum NSAF]
  FROM [412].[rpom peptides and proteins with nsaf]


________________________________________


SELECT * FROM [412].[rpom peptides and proteins with sum nsaf]
  WHERE [sum NSAF]>0


________________________________________


SELECT * FROM [412].[rpom peptides and proteins nonzero nsaf]


________________________________________


SELECT * FROM [412].[rpom peptides and proteins]
  WHERE peptide like '%IPIATSVPR%'


________________________________________


SELECT * FROM [412].[rpom peptides and proteins]
  WHERE peptide like '%YPFLLVDK%'


________________________________________


SELECT DISTINCT * FROM [412].[rpom peptides and proteins]


________________________________________


SELECT * FROM [412].[distinct rpom peptides and proteins]
  LEFT JOIN [412].[Bact_detection_nsaf_all_data_with_ID.csv]
  ON [412].[distinct rpom peptides and proteins].protein=[412].[Bact_detection_nsaf_all_data_with_ID.csv].Protein


________________________________________


SELECT *,
  [NSAF A1]+[NSAF A2]+[NSAF A3]+[NSAF B1]+[NSAF B2]+[NSAF B3]+[NSAF C1]+[NSAF C2]+[NSAF C3]+[NSAF D1]+[NSAF D2]+
  [NSAF D3]+[NSAF E1]+[NSAF E2]+[NSAF E3]+[NSAF F1]+[NSAF F2]+[NSAF F3]+[NSAF G1]+[NSAF G2]+[NSAF G3]+[NSAF H1]+
  [NSAF H2]+[NSAF H3]+[NSAF J1]+[NSAF J2]+[NSAF J3]+[NSAF L1]+[NSAF L2]+[NSAF L3]+[NSAF M1]+[NSAF M2]+[NSAF M3]+
  [NSAF N1]+[NSAF N2]+[NSAF N3] AS [sum NSAF]
  FROM [412].[rpom peptides and proteins with nsaf]


________________________________________


SELECT peptide FROM [412].[bact detection peptide replicates]
  WHERE peptide = '%RMGHAGAIVAGGK%'


________________________________________


SELECT [A1 tot indep spectra], 
  CASE WHEN [A1 tot indep spectra]>0 THEN 1 ELSE 0 END
  FROM [412].[Bact detection all spec counts]


________________________________________


SELECT Protein, [A1 tot indep spectra], 
  CASE WHEN [A1 tot indep spectra]>0 THEN 1 ELSE 0 END
  FROM [412].[Bact detection all spec counts]


________________________________________


SELECT Protein, 
  CASE WHEN [A1 tot indep spectra]>0 THEN 1 ELSE 0 END AS A1
  FROM [412].[Bact detection all spec counts]


________________________________________


SELECT Protein, 
  CASE WHEN [A1 tot indep spectra]>0 THEN 1 ELSE 0 END AS A1,
  CASE WHEN [A1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [A1.2],
  CASE WHEN [A2 tot indep spectra]>0 THEN 1 ELSE 0 END AS A2,
  CASE WHEN [A2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [A2.2],
  CASE WHEN [A3 tot indep spectra]>0 THEN 1 ELSE 0 END AS A3,
  CASE WHEN [A3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [A3.2],
  CASE WHEN [A3.3 tot indep spectra]>0 THEN 1 ELSE 0 END AS [A3.3],
  CASE WHEN [B1 tot indep spectra]>0 THEN 1 ELSE 0 END AS B1,
  CASE WHEN [B1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [B1.2],
  CASE WHEN [B2 tot indep spectra]>0 THEN 1 ELSE 0 END AS B2,
  CASE WHEN [B2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [B2.2],
  CASE WHEN [B3 tot indep spectra]>0 THEN 1 ELSE 0 END AS B3,
  CASE WHEN [B3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [B3.2],
  CASE WHEN [C1 tot indep spectra]>0 THEN 1 ELSE 0 END AS C1,
  CASE WHEN [C1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [C1.2],
  CASE WHEN [C2 tot indep spectra]>0 THEN 1 ELSE 0 END AS C2,
  CASE WHEN [C2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [C2.2],
  CASE WHEN [C3 tot indep spectra]>0 THEN 1 ELSE 0 END AS C3,
  CASE WHEN [C3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [C3.2],
  CASE WHEN [D1 tot indep spectra]>0 THEN 1 ELSE 0 END AS D1,
  CASE WHEN [D1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [D1.2],
  CASE WHEN [D2 tot indep spectra]>0 THEN 1 ELSE 0 END AS D2,
  CASE WHEN [D2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [D2.2],
  CASE WHEN [D3 tot indep spectra]>0 THEN 1 ELSE 0 END AS D3,
  CASE WHEN [D3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [D3.2],
  CASE WHEN [E1 tot indep spectra]>0 THEN 1 ELSE 0 END AS E1,
  CASE WHEN [E1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [E1.2],
  CASE WHEN [E2 tot indep spectra]>0 THEN 1 ELSE 0 END AS E2,
  CASE WHEN [E2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [E2.2],
  CASE WHEN [E3 tot indep spectra]>0 THEN 1 ELSE 0 END AS [E3.2],
  CASE WHEN [F1 tot indep spectra]>0 THEN 1 ELSE 0 END AS F1,
  CASE WHEN [F1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [F1.2],
  CASE WHEN [F1.3 tot indep spectra]>0 THEN 1 ELSE 0 END AS [F1.3],
  CASE WHEN [F2 tot indep spectra]>0 THEN 1 ELSE 0 END AS F2,
  CASE WHEN [F2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [F2.2],
  CASE WHEN [F2.3 tot indep spectra]>0 THEN 1 ELSE 0 END AS [F2.3],
  CASE WHEN [F3 tot indep spectra]>0 THEN 1 ELSE 0 END AS F3,
  CASE WHEN [F3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [F3.2],
  CASE WHEN [F3.3 tot indep spectra]>0 THEN 1 ELSE 0 END AS [F3.3],
  CASE WHEN [G1 tot indep spectra]>0 THEN 1 ELSE 0 END AS G1,
  CASE WHEN [G1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [G1.2],
  CASE WHEN [G2 tot indep spectra]>0 THEN 1 ELSE 0 END AS G2,
  CASE WHEN [G2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [G2.2],
  CASE WHEN [G3 tot indep spectra]>0 THEN 1 ELSE 0 END AS G3,
  CASE WHEN [G3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [G3.2],
  CASE WHEN [H1 tot indep spectra]>0 THEN 1 ELSE 0 END AS H1,
  CASE WHEN [H1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [H1.2],
  CASE WHEN [H2 tot indep spectra]>0 THEN 1 ELSE 0 END AS H2,
  CASE WHEN [H2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [H2.2],
  CASE WHEN [H2.3 tot indep spectra]>0 THEN 1 ELSE 0 END AS [H2.3],
  CASE WHEN [H3 tot indep spectra]>0 THEN 1 ELSE 0 END AS H3,
  CASE WHEN [H3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [H3.2],
  CASE WHEN [H3.3 tot indep spectra]>0 THEN 1 ELSE 0 END AS [H3.3],
  CASE WHEN [I1 tot indep spectra]>0 THEN 1 ELSE 0 END AS I1,
  CASE WHEN [I1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [I1.2],
  CASE WHEN [I2 tot indep spectra]>0 THEN 1 ELSE 0 END AS I2,
  CASE WHEN [I2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [I2.2],
  CASE WHEN [I3 tot indep spectra]>0 THEN 1 ELSE 0 END AS I3,
  CASE WHEN [I3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [I3.2],
  CASE WHEN [J1 tot indep spectra]>0 THEN 1 ELSE 0 END AS J1,
  CASE WHEN [J1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [J1.2],
  CASE WHEN [J2 tot indep spectra]>0 THEN 1 ELSE 0 END AS J2,
  CASE WHEN [J2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [J2.2],
  CASE WHEN [J3 tot indep spectra]>0 THEN 1 ELSE 0 END AS J3,
  CASE WHEN [J3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [J3.2],
  CASE WHEN [L1 tot indep spectra]>0 THEN 1 ELSE 0 END AS L1,
  CASE WHEN [L1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [L1.2],
  CASE WHEN [L2 tot indep spectra]>0 THEN 1 ELSE 0 END AS L2,
  CASE WHEN [L3 tot indep spectra]>0 THEN 1 ELSE 0 END AS L3,
  CASE WHEN [L3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [L3.2],
  CASE WHEN [M1 tot indep spectra]>0 THEN 1 ELSE 0 END AS M1,
  CASE WHEN [M1.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [M1.2],
  CASE WHEN [M2 tot indep spectra]>0 THEN 1 ELSE 0 END AS M2,
  CASE WHEN [M2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [M2.2],
  CASE WHEN [M3 tot indep spectra]>0 THEN 1 ELSE 0 END AS M3,
  CASE WHEN [M3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [M3.2],
  CASE WHEN [M1 tot indep spectra]>0 THEN 1 ELSE 0 END AS M1,
  CASE WHEN [N1 tot indep spectra]>0 THEN 1 ELSE 0 END AS [N1],
  CASE WHEN [N2 tot indep spectra]>0 THEN 1 ELSE 0 END AS N2,
  CASE WHEN [N2.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [N2.2],
  CASE WHEN [N3 tot indep spectra]>0 THEN 1 ELSE 0 END AS N3,
  CASE WHEN [N3.2 tot indep spectra]>0 THEN 1 ELSE 0 END AS [N3.2]
  FROM [412].[Bact detection all spec counts]


________________________________________


SELECT *,
  A1+[A1.2]+A2+[A2.2]+A3+[A3.2]+[A3.3]+B1+[B1.2]+B2+[B2.2]+
  B3+[B3.2]+C1+[C1.2]+C2+[C2.2]+C3+[C3.2]+D1+[D1.2]+D2+
  [D2.2]+D3+[D3.2]+E1+[E1.2]+E2+[E2.2]+[E3.2]+F1+[F1.2]+[F1.3]+
F2+[F2.2]+[F2.3]+F3+[F3.2]+[F3.3]+G1+[G1.2]+G2+[G2.2]+G3+
  [G3.2]+H1+[H1.2]+H2+[H2.2]+[H2.3]+H3+[H3.2]+[H3.3]+I1+
 [I1.2]+I2+[I2.2]+I3+[I3.2]+J1+[J1.2]+J2+[J2.2]+J3+[J3.2]+
 L1+[L1.2]+L2+L3+[L3.2]+M1+[M1.2]+M2+[M2.2]+M3+[M3.2]+M1+[N1]+N2+
 [N2.2]+N3+[N3.2] AS [protein presence]
  FROM [412].[bact detection protein presence]


________________________________________


SELECT Protein FROM [412].[bact detection protein presence summed]
  WHERE [protein presence]=82


________________________________________


SELECT Protein FROM [412].[bact detection protein presence summed] WHERE [protein presence]>82 


________________________________________


SELECT *,
 CASE WHEN [NSAF A1]>0 THEN 1 ELSE 0 END AS A1,
  CASE WHEN [NSAF A2]>0 THEN 1 ELSE 0 END AS A2,
  CASE WHEN [NSAF A3]>0 THEN 1 ELSE 0 END AS A3,
  CASE WHEN [NSAF B1]>0 THEN 1 ELSE 0 END AS B1,
  CASE WHEN [NSAF B2]>0 THEN 1 ELSE 0 END AS B2,
  CASE WHEN [NSAF B3]>0 THEN 1 ELSE 0 END AS B3,
  CASE WHEN [NSAF C1]>0 THEN 1 ELSE 0 END AS C1,
  CASE WHEN [NSAF C2]>0 THEN 1 ELSE 0 END AS C2,
  CASE WHEN [NSAF C3]>0 THEN 1 ELSE 0 END AS C3,
  CASE WHEN [NSAF D1]>0 THEN 1 ELSE 0 END AS D1,
  CASE WHEN [NSAF D2]>0 THEN 1 ELSE 0 END AS D2,
  CASE WHEN [NSAF D3]>0 THEN 1 ELSE 0 END AS D3,
  CASE WHEN [NSAF E1]>0 THEN 1 ELSE 0 END AS E1,
  CASE WHEN [NSAF E2]>0 THEN 1 ELSE 0 END AS E2,
  CASE WHEN [NSAF E3]>0 THEN 1 ELSE 0 END AS [E3.2],
  CASE WHEN [NSAF F1]>0 THEN 1 ELSE 0 END AS F1,
  CASE WHEN [NSAF F2]>0 THEN 1 ELSE 0 END AS F2,
  CASE WHEN [NSAF F3]>0 THEN 1 ELSE 0 END AS F3,
  CASE WHEN [NSAF G1]>0 THEN 1 ELSE 0 END AS G1,
  CASE WHEN [NSAF G2]>0 THEN 1 ELSE 0 END AS G2,
  CASE WHEN [NSAF G3]>0 THEN 1 ELSE 0 END AS G3,
  CASE WHEN [NSAF H1]>0 THEN 1 ELSE 0 END AS H1,
  CASE WHEN [NSAF H2]>0 THEN 1 ELSE 0 END AS H2,
  CASE WHEN [NSAF H3]>0 THEN 1 ELSE 0 END AS H3,
  CASE WHEN [NSAF J1]>0 THEN 1 ELSE 0 END AS J1,
  CASE WHEN [NSAF J2]>0 THEN 1 ELSE 0 END AS J2,
  CASE WHEN [NSAF J3]>0 THEN 1 ELSE 0 END AS J3,
  CASE WHEN [NSAF L1]>0 THEN 1 ELSE 0 END AS L1,
  CASE WHEN [NSAF L2]>0 THEN 1 ELSE 0 END AS L2,
  CASE WHEN [NSAF L3]>0 THEN 1 ELSE 0 END AS L3,
  CASE WHEN [NSAF M1]>0 THEN 1 ELSE 0 END AS M1,
  CASE WHEN [NSAF M2]>0 THEN 1 ELSE 0 END AS M2,
  CASE WHEN [NSAF M3]>0 THEN 1 ELSE 0 END AS M3,
  CASE WHEN [NSAF N1]>0 THEN 1 ELSE 0 END AS [N1],
  CASE WHEN [NSAF N2]>0 THEN 1 ELSE 0 END AS N2,
  CASE WHEN [NSAF N3]>0 THEN 1 ELSE 0 END AS N3
  FROM [412].[rpom peptides and proteins nonzero nsaf]


________________________________________


SELECT *,
 A1+A2+A3+B1+B2+
  B3+C1+C2+C3+D1+D2+
 +D3+E1+E2+F1+
F2+F3+G1+G2+G3+
  H1+H2+H3+J1+J2+J3+
 L1+L2+L3+M1+M2+M3+M1+[N1]+N2+
 N3 AS [protein presence]
  FROM [412].[rpom peptide and protein presence]


________________________________________


SELECT * FROM [412].[rpom peptide and protein presence summed]
  WHERE [protein presence]>36


________________________________________


SELECT * FROM [412].[rpom peptide and protein presence summed]
  WHERE [protein presence]=36


________________________________________


SELECT distinct protein FROM [412].[rpm proteins in all reps]


________________________________________


SELECT *,
 A1+A2+A3+B1+B2+
  B3 AS [low bact abund],
  C1+C2+C3+D1+D2+
 +D3+E1+E2+F1+
F2+F3+G1+G2+G3+
  H1+H2+H3+J1+J2+J3+
 L1+L2+L3+M1+M2+M3+M1+[N1]+N2+
 N3 AS [higher bact abund]
  FROM [412].[rpom peptide and protein presence]


________________________________________


SELECT * FROM [412].[rpom low abundance presence]
  WHERE [low bact abund]=6


________________________________________


SELECT * FROM [412].[rpom low abundance presence]
  WHERE [low bact abund]=6 AND [higher bact abund]=0


________________________________________


SELECT * FROM [412].[rpom low abundance presence]
  WHERE [low bact abund]=6 AND [higher bact abund]=0


________________________________________


SELECT * FROM [412].[rpom low abundance presence]
  WHERE [low bact abund]=6


________________________________________


SELECT * FROM [412].[rpom present in low abundance]
  WHERE [higher bact abund]=0


________________________________________


SELECT * FROM [412].[rpom present in low abundance]
  WHERE [higher bact abund]<5


________________________________________


SELECT * FROM [412].[rpom low abundance presence]
  WHERE [low bact abund]=6 AND [higher bact abund]<10


________________________________________


SELECT distinct protein FROM [412].[rpom present in low abundance]


________________________________________


SELECT * FROM [412].[proteins_sig_axis_1_loadings.txt]
  LEFT JOIN [412].[rpom peptides and proteins]
  ON [412].[proteins_sig_axis_1_loadings.txt].protein=[412].[rpom peptides and proteins].protein



________________________________________


SELECT distinct peptide FROM [412].[proteins and peptides sig for nmds]


________________________________________


SELECT scan FROM [412].[scan_q-value_subarctic_16.csv]
  UNION ALL
  SELECT scan FROM [412].[scan_q-value_mocat_16.csv]
  UNION ALL
  SELECT scan FROM [412].[scan_q-value_envnr_16.csv]
  UNION ALL
  SELECT scan FROM [412].[scan_q-value_mocat_subarctic_16.csv]
  UNION ALL
  SELECT scan FROM [412].[scan_q-value_mocat_envnr_16.csv]



________________________________________


SELECT distinct scan FROM [412].[all scan numbers 16]


________________________________________


SELECT * FROM [412].[distinct scan numbers 16]
  LEFT JOIN [412].[scan_q-value_mocat_16.csv]
ON [412].[distinct scan numbers 16].scan=[412].[scan_q-value_mocat_16.csv].scan
  LEFT JOIN [412].[scan_q-value_envnr_16.csv]
ON [412].[distinct scan numbers 16].scan=[412].[scan_q-value_envnr_16.csv].scan
  LEFT JOIN [412].[scan_q-value_subarctic_16.csv]
ON [412].[distinct scan numbers 16].scan=[412].[scan_q-value_subarctic_16.csv].scan
  LEFT JOIN [412].[scan_q-value_mocat_subarctic_16.csv]
ON [412].[distinct scan numbers 16].scan=[412].[scan_q-value_mocat_subarctic_16.csv].scan
  LEFT JOIN [412].[scan_q-value_mocat_envnr_16.csv]
ON [412].[distinct scan numbers 16].scan=[412].[scan_q-value_mocat_envnr_16.csv].scan



________________________________________


  SELECT SPID
  FROM [1123].[table_fish546_module1_blast_table.txt]
  JOIN [1123].[table_associations_uni_swisspro_012410.tabular]
  ON [1123].[table_fish546_module1_blast_table.txt].SPID=[1123].[table_associations_uni_swisspro_012410.tabular].ID


________________________________________


  SELECT ContigID, SPID, GENEID, evalue
  FROM [1123].[table_fish546_module1_blast_table.txt]
  JOIN [1123].[table_associations_uni_swisspro_012410.tabular]
  ON [1123].[table_fish546_module1_blast_table.txt].SPID=[1123].[table_associations_uni_swisspro_012410.tabular].ID


________________________________________


  SELECT ContigID, SPID, GENEID, evalue
  FROM [1123].[table_fish546_module1_blast_table.txt]
  INNER JOIN [1123].[table_associations_uni_swisspro_012410.tabular]
  ON [1123].[table_fish546_module1_blast_table.txt].SPID=[1123].[table_associations_uni_swisspro_012410.tabular].ID


________________________________________


SELECT * FROM [1123].[table_fish546_module1_blast_table.txt] 
  INNER JOIN [1123].[table_associations_uni_swisspro_012410.tabular]
  ON [1123].[table_fish546_module1_blast_table.txt].SPID=[1123].[table_associations_uni_swisspro_012410.tabular].ID


________________________________________


SELECT * FROM [1123].[table_fish546_module1_blast_table.txt]
  INNER JOIN [1123].[table_associations_uni_swisspro_012410.tabular]
  ON [1123].[table_fish546_module1_blast_table.txt].SPID=[1123].[table_associations_uni_swisspro_012410.tabular].ID



________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =  
         SUBSTRING(allCG.GroupID, 
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =  
         SUBSTRING(allCG.GroupID, 
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT * FROM [1123].[fish546_module1_blast_table] INNER JOIN [1123].[associations_uni_swisspro_012410] ON [1123].[fish546_module1_blast_table].SPID=[1123].[associations_uni_swisspro_012410].ID



________________________________________


SELECT * FROM [1123].[table_fish546_module1_blast_table.txt]


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =  
         SUBSTRING(allCG.GroupID, 
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =  
         SUBSTRING(allCG.GroupID, 
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT * FROM [1123].[SaveQ]


________________________________________


SELECT * FROM [1123].[associations_uni_swisspro_012410]


________________________________________


SELECT * FROM [1045].[PIZZA]


________________________________________


SELECT ID, Symbol FROM [1123].[Billy]


________________________________________


SELECT ID, Symbol, Aspect FROM [1123].[Billy]


________________________________________


  SELECT [GO ID] FROM [1123].[table_fish546_module1_blast_table.txt] 
  INNER JOIN [1123].[table_associations_uni_swisspro_012410.tabular]
  ON [1123].[table_fish546_module1_blast_table.txt].SPID=[1123].[table_associations_uni_swisspro_012410.tabular].ID


________________________________________


SELECT Taxon FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT SPID FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT [GO ID] FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT Taxon,[GO ID] FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT SPID,[GO Name] FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT SPID,[GO Name],Aspect FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


  SELECT * FROM [1123].[fish546 Module 2 Joining Tables] 
  INNER JOIN [1123].[GO_to_GOslim]
  ON [1123].[fish546 Module 2 Joining Tables].[GO ID]=[1123].[GO_to_GOslim].GO_id


________________________________________


SELECT ContigID,SPID,[GO ID],term,GOSlim_bin,aspect FROM [1123].[fish546_mod3_slim]


________________________________________


SELECT ContigID,SPID,[GO ID],term,GOSlim_bin,aspect FROM [1123].[fish546_mod3_slim]


________________________________________


SELECT ContigID,SPID,[GO ID],term,GOSlim_bin,aspect FROM [1123].[fish546_mod3_slim]
  Where aspect LIKE 'Process'
  


________________________________________


  SELECT * FROM [1123].[fish546_module1_blast_table] 
  INNER JOIN [1123].[associations_uni_swisspro_012410]
  ON [1123].[fish546_module1_blast_table].SPID=[1123].[associations_uni_swisspro_012410].ID


________________________________________


SELECT * FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT SPID FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT SPID,GENEID FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT [GO ID] FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT Evidence,[GO ID] FROM [1123].[fish546 Module 2 Joining Tables]


________________________________________


SELECT * FROM [1123].[table_fish546_module1_blast_table.txt]
  INNER JOIN [1123].[table_associations_uni_swisspro_012410.tabular]
  ON [1123].[table_fish546_module1_blast_table.txt].SPID=[1123].[table_associations_uni_swisspro_012410.tabular].ID


________________________________________


SELECT * FROM [1123].[fish546_module1_blast_table]
  INNER JOIN [1123].[associations_uni_swisspro_012410]
  ON [1123].[fish546_module1_blast_table].SPID=[1123].[associations_uni_swisspro_012410].ID


________________________________________


SELECT * FROM [1123].[fish546_module1_blast_table]
  LEFT JOIN [1123].[associations_uni_swisspro_012410]
  ON [1123].[fish546_module1_blast_table].SPID=[1123].[associations_uni_swisspro_012410].ID


________________________________________


SELECT Column2 FROM [354].[gp_association.goa_uniprot]


________________________________________


SELECT * FROM [1123].[SP.txt]


________________________________________


SELECT * FROM [1123].[fish546_module1_blast_table] 
  INNER JOIN [354].[gp_association.goa_uniprot]
  ON [1123].[fish546_module1_blast_table].SPID=[354].[gp_association.goa_uniprot ].Column2


________________________________________


SELECT * FROM [1123].[fish546_module1_blast_table] 
  INNER JOIN [354].[gp_association.goa_uniprot]
  ON [1123].[fish546_module1_blast_table].SPID=[354].[gp_association.goa_uniprot ].Column2


________________________________________


SELECT * FROM [1123].[fish546_module1_blast_table] 
  INNER JOIN [354].[gp_association.goa_uniprot]
  ON [1123].[fish546_module1_blast_table].SPID=[354].[gp_association.goa_uniprot ].Column2


________________________________________


SELECT ContigID,SPID,GENEID,evalue,Column4 FROM [1123].[fish546 module 2 : Blast and GOA join]


________________________________________


SELECT * FROM [fish546 module 2 blast; GO]
 


________________________________________


SELECT * FROM [fish546 module 2 blast; GO]
  Left JOIN [associations_uni_swisspro_012410]
  ON [1123].[fish546 module 2 blast; GO].Column4=[1123].[associations_uni_swisspro_012410].[GO ID]

 


________________________________________


SELECT * FROM [fish546 module 2 blast; GO]
  Left JOIN [associations_uni_swisspro_012410]
  ON [1123].[fish546 module 2 blast; GO].Column4=[1123].[associations_uni_swisspro_012410].[GO ID]

 


________________________________________


SELECT Column2,Column5 FROM [1123].[Fasta_stats_1]


________________________________________


SELECT column1,Column2,Column5 FROM [1123].[Fasta_stats_1]


________________________________________


SELECT
  *
FROM
  [fish546_module1_blast_table]




________________________________________


SELECT
  *
FROM
 [354].[gp_association.goa_uniprot]


________________________________________


SELECT
  *
FROM
 [354].[gp_association.goa_uniprot]


________________________________________


SELECT
  *
FROM
 [fish546_module1_blast_table]
  




________________________________________


SELECT
  *
FROM
 [fish546_module1_blast_table]





________________________________________


SELECT
  *
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2





________________________________________


SELECT
  *
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column2 = [associations_uni_swisspro_012410].[GO ID]
 





________________________________________


SELECT
  *
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]
 





________________________________________


SELECT
  SPID
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]
 





________________________________________


SELECT
  *
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]
 





________________________________________


SELECT
  *
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]
Left join
  [GO_to_GOslim]
    ON [354].[gp_association.goa_uniprot].Column4 = [GO_to_GOslim].GO_id





________________________________________


SELECT
  ContigID,SPID,Column4,term,GOSlim_bin
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]
Left join
  [GO_to_GOslim]
    ON [354].[gp_association.goa_uniprot].Column4 = [GO_to_GOslim].GO_id





________________________________________


SELECT
  ContigID,SPID,Column4,term,GOSlim_bin,[GO_to_GOslim].aspect
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]
Left join
  [GO_to_GOslim]
    ON [354].[gp_association.goa_uniprot].Column4 = [GO_to_GOslim].GO_id





________________________________________


SELECT
  *
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]





________________________________________


SELECT
  *
FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2





________________________________________


SELECT
  ContigID,SPID,evalue,Column4
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2





________________________________________


SELECT
  ContigID,SPID,evalue,Column4,[associations_uni_swisspro_012410].[GO ID]
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]





________________________________________


SELECT
  ContigID,SPID,evalue,Column4,[associations_uni_swisspro_012410].[GO Name]
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]





________________________________________


SELECT
  ContigID,SPID,evalue,Column4,[associations_uni_swisspro_012410].[GO Name]
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Inner join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]





________________________________________


SELECT
  ContigID,SPID,evalue,Column4,[associations_uni_swisspro_012410].[GO Name]
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Right join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]





________________________________________


SELECT
  ContigID,SPID,evalue,Column4,[associations_uni_swisspro_012410].[GO Name]
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column4
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]





________________________________________


SELECT
  ContigID,SPID,evalue,Column4
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2




________________________________________


SELECT
  ContigID,SPID,evalue,Column4
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column4




________________________________________


SELECT
  ContigID,SPID,evalue,Column4
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2




________________________________________


SELECT
  ContigID,SPID,evalue,Column4
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]




________________________________________


SELECT
  ContigID,SPID,evalue,Column4
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]
    AND fish546_module1_blast_table.SPID = [associations_uni_swisspro_012410].[ID]




________________________________________


SELECT
  *
  FROM
 [fish546_module1_blast_table]
Left join
   [354].[gp_association.goa_uniprot]
    ON fish546_module1_blast_table.SPID = [354].[gp_association.goa_uniprot].Column2
Left join
  [associations_uni_swisspro_012410]
    ON [354].[gp_association.goa_uniprot].Column4 = [associations_uni_swisspro_012410].[GO ID]
    AND fish546_module1_blast_table.SPID = [associations_uni_swisspro_012410].[ID]




________________________________________


SELECT c2 FROM [1123].[fish546_module4_blast.csv]


________________________________________


SELECT * FROM [1123].[fish546_module4_blast_v2.csv] 
  INNER JOIN [354].[gp_association.goa_uniprot]
  ON [1123].[fish546_module4_blast_v2.csv].c2=[354].[gp_association.goa_uniprot ].Column2


________________________________________


SELECT * FROM [1123].[fish546_module4_blast_v2.csv] 
  INNER JOIN [354].[gp_association.goa_uniprot]
  ON [1123].[fish546_module4_blast_v2.csv].c2=[354].[gp_association.goa_uniprot ].Column2


________________________________________


SELECT * FROM [1123].[table_fish546TJGR_mRNA_int_mCpG_2]


________________________________________


SELECT * FROM [1123].[fish546TJGR_mRNA_int_mCpG_2]


________________________________________


SELECT * FROM [1123].[fish546TJGR_mRNA_int_mCpG_2]
  INNER JOIN [1123].[fish546TJGR_CDS_int_mCpG_2]
  ON [1123].[fish546TJGR_mRNA_int_mCpG_2].ID=[1123].[fish546TJGR_CDS_int_mCpG_2].ID


________________________________________


Select Count (mCpGcount) FROM [1123].[fish546TJGR_CDS_int_mCpG_2]


________________________________________


Select sum (mCpGcount) FROM [1123].[fish546TJGR_CDS_int_mCpG_2]


________________________________________


Select Sum (mCpGcount) FROM [1123].[fish546TJGR_CDS_int_mCpG_2]


________________________________________


Select ID, SUM(mCpGcount) FROM [1123].[fish546TJGR_CDS_int_mCpG_2]
  Group by ID

  



________________________________________


Select ID, avg(mCpGcount) FROM [1123].[fish546TJGR_CDS_int_mCpG_2]
  Group by ID


________________________________________


Select ID, avg(mCpGcount),sum(mCpGcount) FROM [1123].[fish546TJGR_CDS_int_mCpG_2]
  Group by ID


________________________________________


Select ID, avg(mCpGcount),min(mCpGcount),max(mCpGcount),sum(mCpGcount) FROM [1123].[fish546TJGR_CDS_int_mCpG_2]
  Group by ID


________________________________________


Select ID, avg(mCpGcount),min(mCpGcount),max(mCpGcount),sum(mCpGcount),count(mCpGcount) FROM [1123].[fish546TJGR_CDS_int_mCpG_2]
  Group by ID


________________________________________


Select ID From [1123].[fish546TJGR_mRNA_int_mCpG_2] 


________________________________________


Select * From [1123].[fish546TJGR_mRNA_int_mCpG_2] 
  Inner join [1123].[Stats_CDS_int_mCpG]
  ON [1123].[fish546TJGR_mRNA_int_mCpG_2].ID=[1123].[Stats_CDS_int_mCpG].ID



________________________________________


Select * From [1123].[fish546TJGR_mRNA_int_mCpG_2] 
  Inner join [1123].[Stats_CDS_int_mCpG]
  ON [1123].[fish546TJGR_mRNA_int_mCpG_2].ID=[1123].[Stats_CDS_int_mCpG].ID



________________________________________


Select * From [1123].[fish546TJGR_mRNA_int_mCpG_2]   Inner join [1123].[Stats_CDS_int_mCpG]
  ON [1123].[fish546TJGR_mRNA_int_mCpG_2].ID=[1123].[Stats_CDS_int_mCpG].ID




________________________________________


Select ID, avg(NOmCpGcount),min(NOmCpGcount),max(NOmCpGcount),sum(NOmCpGcount),count(NOmCpGcount) FROM [1123].[fish546TJGR_CDS_int_NOmCpG_2]  
  Group by ID



________________________________________


Select * From [1123].[fish546TJGR_mRNA_int_mCpG_2]   Inner join [1123].[Stats_CDS_int_mCpG]
  ON [1123].[fish546TJGR_mRNA_int_mCpG_2].ID=[1123].[Stats_CDS_int_mCpG].ID



________________________________________


Select * From [1123].[fish546TJGR_mRNA_int_mCpG_2]   




________________________________________


Select * From [1123].[fish546TJGR_mRNA_int_mCpG_2],[1123].[Stats_CDS_int_mCpG]




________________________________________


Select * From [1123].[Stats_CDS_int_mCpG]




________________________________________


Select * From [1123].[fish546TJGR_mRNA_int_mCpG_2]   Inner join [1123].[Stats_CDS_int_mCpG]
  ON [1123].[fish546TJGR_mRNA_int_mCpG_2].ID=[1123].[Stats_CDS_int_mCpG].ID



________________________________________


Select * From [1123].[fish546TJGR_mRNA_int_NOmCpG_2]   Inner join [1123].[Stats_CDS_int_NOmCpG]
  ON [1123].[fish546TJGR_mRNA_int_NOmCpG_2].ID=[1123].[Stats_CDS_int_NOmCpG].ID



________________________________________


Select * From [1123].[fish546TJGR_mRNA_int_mCpG_2]   Inner join [1123].[Stats_CDS_int_mCpG]
  ON [1123].[fish546TJGR_mRNA_int_mCpG_2].ID=[1123].[Stats_CDS_int_mCpG].ID




________________________________________


SELECT * FROM [1123].[mCpG data table]
  INNER Join  [1123].[NON_mCpG data table]
  ON [1123].[mCpG data table].ID=[1123].[NON_mCpG data table].ID



________________________________________


SELECT * FROM [1123].[mCpG data table]
  INNER Join  [1123].[NON_mCpG data table]
  ON [1123].[mCpG data table].ID=[1123].[NON_mCpG data table].ID



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS]



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS]



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] Where (CDScount) > 2



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] Where "SUM mRNA" > 2



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] Where "SUM mRNA" > 10



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] Where "SUM mRNA" > 10 and CDScount = 9



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] Where "SUM mRNA" > 100



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] Where "SUM mRNA" > 100 and "Percent mCpG (CDS)" > 90
  



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] 
  Where "SUM mRNA" > 100 
  and "Percent mCpG (CDS)" > 90
  



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] 
  Where "SUM mRNA" > 100 
  and "Percent mCpG (CDS)" > 90
  and "Percent mCpG (Intron)" < 20

  



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] 
  Where "SUM mRNA" > 100 
  and "Percent mCpG (CDS)" > 90
  and "Percent mCpG (Intron)" < 50

  



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] 
  Where "SUM mRNA" > 100 
  and "Ratio mCDS/mIntron" >2

  



________________________________________


SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS] 
  Where "SUM mRNA" > 100 
  and "Ratio mCDS/mIntron" > 3

  



________________________________________


Select * From [1123].[TJGR_Gene_SPID_evalue_Description]   
  Inner join [1123].[AggCo Oyster Bisulfite mRNA and CDS]  
  ON [1123].[TJGR_Gene_SPID_evalue_Description].Column1=[1123].[AggCo Oyster Bisulfite mRNA and CDS].ID




________________________________________


Select Column5 From [1123].[TJGR_Gene_SPID_evalue_Description]   
  Inner join [1123].[AggCo Oyster Bisulfite mRNA and CDS]  
  ON [1123].[TJGR_Gene_SPID_evalue_Description].Column1=[1123].[AggCo Oyster Bisulfite mRNA and CDS].ID




________________________________________


Select * From [1123].[TJGR_Gene_SPID_evalue_Description]   
  Inner join [1123].[AggCo Oyster Bisulfite mRNA and CDS]  
  ON [1123].[TJGR_Gene_SPID_evalue_Description].Column1=[1123].[AggCo Oyster Bisulfite mRNA and CDS].ID




________________________________________


Select * From [1123].[TJGR_Gene_SPID_evalue_Description]   
  Inner join [1123].[AggCo Oyster Bisulfite mRNA and CDS]  
  ON [1123].[TJGR_Gene_SPID_evalue_Description].Column1=[1123].[AggCo Oyster Bisulfite mRNA and CDS].ID
  
  SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS]   Where "SUM mRNA" > 100 
  and "Ratio mCDS/mIntron" > 3





________________________________________


Select * From [1123].[TJGR_Gene_SPID_evalue_Description]   
  Inner join [1123].[AggCo Oyster Bisulfite mRNA and CDS]  
  ON [1123].[TJGR_Gene_SPID_evalue_Description].Column1=[1123].[AggCo Oyster Bisulfite mRNA and CDS].ID

  SELECT * FROM [1123].[AggCo Oyster Bisulfite mRNA and CDS]   Where "SUM mRNA" > 100 
  and "Ratio mCDS/mIntron" > 3





________________________________________


Select * From [1123].[TJGR_Gene_SPID_evalue_Description]
  Inner join [1123].[AggCo Oyster Bisulfite mRNA and CDS]  
  ON [1123].[TJGR_Gene_SPID_evalue_Description].Column1=[1123].[AggCo Oyster Bisulfite mRNA and CDS].ID






________________________________________


SELECT * FROM [1123].[BSoysterGENE]   Where "SUM mRNA" > 100 
  and "Ratio mCDS/mIntron" > 3



________________________________________


SELECT * FROM [1123].[BSoysterGENE]   
  Where "SUM mRNA" > 100 
  and "Ratio mCDS/mIntron" > 3
    and "CDScount" > 20




________________________________________


SELECT * FROM [1123].[BSoysterGENE]     
  Where "SUM mRNA" > 100 
  and "Ratio mCDS/mIntron" > 3



________________________________________


SELECT * FROM [1123].[BSoysterGENE]     
  Where "SUM mRNA" > 100 
  and "Percent mCpG (CDS)" > 75
  and "Percent mCpG (Intron)" < 25



________________________________________


SELECT * FROM [1123].[BSoysterGENE]     
  Where "SUM mRNA" > 100 
  and "Percent mCpG (CDS)" < 75
  and "Percent mCpG (Intron)" > 25



________________________________________


SELECT .1 FROM [1123].[table_MG_alldata1059.txt]


________________________________________


SELECT (".") FROM [1123].[table_MG_alldata1059.txt]


________________________________________


SELECT * FROM [1123].[table_MG_alldata1059.txt]


________________________________________


SELECT ("Mgo") FROM [1123].[MG_alldata1059_MBD-bisulfiteGILL]


________________________________________


SELECT Mgo
  FROM [1123].[MG_alldata1059_MBD-bisulfiteGILL]


________________________________________


SELECT Mgo,Hem
  FROM [1123].[MG_alldata1059_MBD-bisulfiteGILL]


________________________________________


SELECT Mgo,"."
  FROM [1123].[MG_alldata1059_MBD-bisulfiteGILL]


________________________________________


SELECT ".",Mgo
  FROM [1123].[MG_alldata1059_MBD-bisulfiteGILL]


________________________________________


Select * From [1123].[BSoysterGENE]   
  Left join [1123].[Mgo Expression (RPKM)]
  ON [1123].[BSoysterGENE].ID=[1123].[Mgo Expression (RPKM)]."."



________________________________________


Select * From [1123].[BSoysterGENE]   
  inner join [1123].[Mgo Expression (RPKM)]
  ON [1123].[BSoysterGENE].ID=[1123].[Mgo Expression (RPKM)]."."



________________________________________


Select * From [1123].[BSoysterGENE]   
  full join [1123].[Mgo Expression (RPKM)]
  ON [1123].[BSoysterGENE].ID=[1123].[Mgo Expression (RPKM)]."."



________________________________________


Select * From [1123].[BSoysterGENE]   
  right join [1123].[Mgo Expression (RPKM)]
  ON [1123].[BSoysterGENE].ID=[1123].[Mgo Expression (RPKM)]."."



________________________________________


Select * From [1123].[BSoysterGENE]   
 left join [1123].[Mgo Expression (RPKM)]
  ON [1123].[BSoysterGENE].ID=[1123].[Mgo Expression (RPKM)]."."



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       


________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Percent mCpG (CDS)"> 75
  and "Percent mCpG (Intron)" < 25
  and "Mgo" > 10



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Percent mCpG (CDS)" > 75
  and "Percent mCpG (Intron)" < 25
  and "Mgo" > 10



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Percent mCpG (CDS)" > 75
  and "Percent mCpG (Intron)" < 25
  and "Mgo" > 2



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Percent mCpG (CDS)" > 75
  and "Percent mCpG (Intron)" < 25
  and "Mgo" > .1



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > .1



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 20



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 20
  and "CDScount" > 50



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 20
  and "CDScount" > 30



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 20
  and "CDScount" > 20
  and "Percent mCpG (CDS)" > 75



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 20
  and "CDScount" > 20
  and "Percent mCpG (CDS)" > 75



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 20
  and "CDScount" > 20
  and "Ratio mCDS/mIntron" > 2



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 20
  and "CDScount" > 1
  and "Ratio mCDS/mIntron" > 2



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 20
  and "Ratio mCDS/mIntron" > 2



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 20
  and "Ratio mCDS/mIntron" > 1.5



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 10
  and "Ratio mCDS/mIntron" > 1.5



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 10
  and "Percent mCpG (mRNA)" < 20



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 5
  and "Percent mCpG (mRNA)" < 20



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 5
  and "Percent mCpG (CDS)" < 20



________________________________________


SELECT * FROM [1123].[BSoysterGENE_wMgoExpression]       
  Where "SUM mRNA" > 100 
  and "Mgo" > 5
  and "Percent mCpG (CDS)" < 10



________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]
  


________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]
  Where Column15 < 100


________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where Column8 >20



________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where Column8 > 20



________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where "Column8" > 1


________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where "Column13" > 20


________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where "Column12" < 20


________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where "Column12" < 20


________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where "Column12" > 20


________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where "Column10" > 20


________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where "Column10" > 10


________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where "Column10" > 20


________________________________________


SELECT * FROM [1123].[table_MgoTophat_cover_CDS_split_B]
  Where "Column10" > 20


________________________________________


SELECT * FROM [1123].[table_mCpG_5x50_closest_MgoSNP]
  Where Column17 < 1



________________________________________


SELECT * FROM [1123].[table_mCpG_5x50_closest_MgoSNP]



________________________________________


SELECT * FROM [1123].[table_mCpG_5x50_closest_MgoSNP]
Where Column17 < 1


________________________________________


SELECT * FROM [1123].[table_mCpG_5x50_closest_MgoSNP]
Where Column17 < 1


________________________________________


SELECT * FROM [1123].[table_TJGR_mRNA_intersect_mCpGovSNP]


________________________________________


SELECT * FROM [1123].[table_TJGR_mRNA_intersect_mCpGovSNP]
  Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_TJGR_mRNA_intersect_mCpGovSNP].Column9=[1123].[TJGR_Gene_SPID_evalue_Description].Column1

  



________________________________________


SELECT * FROM [1123].[mRNA_intersect_mCpGovSNP with gene names]
  Where Column10 > 1



________________________________________


SELECT * FROM [1123].[table_TJGR_mRNA_intersect_mCpGovSNP]
  Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_TJGR_mRNA_intersect_mCpGovSNP].Column9=[1123].[TJGR_Gene_SPID_evalue_Description].Column1

    Where Column10 > 1




________________________________________


SELECT * FROM [1123].[table_TJGR_mRNA_intersect_mCpGovSNP]
  Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_TJGR_mRNA_intersect_mCpGovSNP].Column9=[1123].[TJGR_Gene_SPID_evalue_Description].Column1

    Where Column10 > 10




________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt] 
  Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_Description].Column1

  




________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt] 
  Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_Description].Column1

  Where Column14 = 0




________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt] 
  Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_Description].Column1

  Where Column14 > 0




________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt] 
  Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_Description].Column1




________________________________________


SELECT * FROM [1123].[CpGMeth_clusters_100_4_v9_90_closest_mRNA gene]
  Where Column15 = 0
  


________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]   Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_Description].Column1

  




________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]   Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_Description].Column1

  

Where Column15 = 0


________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]   Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]
  ON [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_Description].Column1

Where Column15 < 100


________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]   Left JOIN [1123].[TJGR_Gene_SPID_evalue_Description]  ON [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_Description].Column1


Where Column15 < 100






________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]
  Left join [1123].[TJGR_Gene_SPID_evalue_GO_bigfile]
  on [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_GO_bigfile].Column1



________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]
  Left join [1123].[TJGR_Gene_SPID_evalue_GO_bigfile]
  on [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_GO_bigfile].Column1
  
  Where Column15 < 100



________________________________________


SELECT * FROM [1123].[CpGMeth_clusters_100_4_v9_90_closest_mRNA LESS100]


________________________________________


SELECT Column5 FROM [1123].[CpGMeth_clusters_100_4_v9_90_closest_mRNA LESS100]


________________________________________



SELECT Protein FROM [412].[Skyline peptide areas for sql.txt]
  



________________________________________



SELECT Protein, count(Low1) FROM [412].[Skyline peptide areas for sql.txt]
  Group by Protein



________________________________________


SELECT Protein, count(Low1) FROM [412].[Skyline peptide areas for sql.txt]
  Group by Protein


________________________________________


SELECT Protein, max(Low1) FROM [412].[Skyline peptide areas for sql.txt]
  Group by Protein


________________________________________


SELECT Protein, min
  
  
  
  (Low1) FROM [412].[Skyline peptide areas for sql.txt]
  Group by Protein


________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Ratio mCDS/mIntron" > 2



________________________________________


SELECT Column2 FROM [1123].[BSoysterGENE]
  Where "Ratio mCDS/mIntron" > 2



________________________________________


SELECT Column2 FROM [1123].[BSoysterGENE]
  Where "Ratio mCDS/mIntron" > 2


________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Ratio mCDS/mIntron" > 2


________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100


________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (mRNA)" > 90




________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (mRNA)" > 90
  and "Percent mCpG (Intron)" < 20




________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (CDS)" > 90
  and "Percent mCpG (Intron)" < 20




________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (CDS)" > 80
  and "Percent mCpG (Intron)" < 20




________________________________________


SELECT Column4 FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (CDS)" > 80
  and "Percent mCpG (Intron)" < 20




________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (mRNA)" > 80





________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (mRNA)" > 90





________________________________________


SELECT Column4 FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (mRNA)" > 90





________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (mRNA)" > 90





________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (Intron)" > 80
  and "Percent mCpG (CDS)" < 20




________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 100
  and "Percent mCpG (Intron)" > 70
  and "Percent mCpG (CDS)" < 30




________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 20
  and "Percent mCpG (Intron)" > 70
  and "Percent mCpG (CDS)" < 30




________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 20
  and "Percent mCpG (Intron)" > 80
  and "Percent mCpG (CDS)" < 20




________________________________________


SELECT Column2 FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 20
  and "Percent mCpG (Intron)" > 80
  and "Percent mCpG (CDS)" < 20




________________________________________


SELECT * FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID




________________________________________


SELECT * FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

WHere Mgo > 100


________________________________________


SELECT "Percent mCpG (mRNA)","Percent mCpG (CDS)" FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

WHere Mgo > 100


________________________________________


SELECT "Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)" FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

WHere Mgo > 100


________________________________________


SELECT "Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)",
 swissprot
 
  FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

WHere Mgo > 100


________________________________________


SELECT "Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)",
 swissprot, "Sum mRNA"
 
  FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

WHere Mgo > 100


________________________________________


SELECT "Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)",
 swissprot, "Sum mRNA"
 
  FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

WHere Mgo > 0


________________________________________


SELECT "Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)",
 swissprot, "Sum mRNA"
 
  FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

  WHere Mgo > 0
  and "Sum mRNA" > 50



________________________________________


SELECT ID,"Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)",
 swissprot, "Sum mRNA"
 
  FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

  WHere Mgo > 0
  and "Sum mRNA" > 50



________________________________________


SELECT ID,"Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)",
 swissprot, "Sum mRNA", Mgo
 
  FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

  WHere Mgo > 0
  and "Sum mRNA" > 50



________________________________________


SELECT ID,"Ratio mCDS/mIntron","Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)",
 swissprot, "Sum mRNA", Mgo
 
  FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

  WHere Mgo > 0
  and "Sum mRNA" > 50



________________________________________


SELECT ID,"Ratio mCDS/mIntron",CDScount,"Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)",
 swissprot, "Sum mRNA", Mgo
 
  FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

  WHere Mgo > 1
  and "Sum mRNA" > 50


________________________________________


SELECT ID,"Ratio mCDS/mIntron",CDScount,"Percent mCpG (mRNA)","Percent mCpG (CDS)","Percent mCpG (Intron)",
 swissprot, "Sum mRNA", Mgo
 
  FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
   LEft JOIN [1123].[Zhang_etal_SuppTable14]
  ON [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab].ID=[1123].[Zhang_etal_SuppTable14].GeneID

  WHere "Sum mRNA" > 50


________________________________________


SELECT Column2 FROM [1123].[table_TJGR_Gene_SPID_evalue_Description.txt]


________________________________________


SELECT Column2 FROM [1123].[table_TJGR_Gene_SPID_evalue_Description.txt]


________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]
  Left join [1123].[TJGR_Gene_SPID_evalue_GO_bigfile]
  on [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_GO_bigfile].Column1
  
  Where Column15 < 100



________________________________________


SELECT * FROM [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt]
  Left join [1123].[TJGR_Gene_SPID_evalue_GO_bigfile]
  on [1123].[table_CpGMeth_clusters_100_4_v9_90_closest_mRNA.txt].Column13=[1123].[TJGR_Gene_SPID_evalue_GO_bigfile].Column1
  
  Where Column15 < 100



________________________________________


SELECT * FROM [1123].[CpGMeth_clusters_100_4_v9_90_closest_mRNA gene]



________________________________________


SELECT * FROM [1123].[CpGMeth_clusters_100_4_v9_90_closest_mRNA gene]



________________________________________


SELECT * FROM [1123].[CpGMeth_clusters_100_4_v9_90_closest_mRNA gene]
Where Column15 <100


________________________________________


SELECT Column21 FROM [1123].[CpGMeth_clusters_100_4_v9_90_closest_mRNA gene]
Where Column15 <100


________________________________________


SELECT Column21 FROM [1123].[CpGMeth_clusters_100_4_v9_90_closest_mRNA gene]
Where Column15 < 100


________________________________________


SELECT * FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]


________________________________________


SELECT * FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
  Where "SUM mRNA" > 50 



________________________________________


SELECT * FROM [1123].[table_AggCo Oyster Bisulfite mRNA and CDS.tab]
  Where "SUM mRNA" > 50  
  and "Percent mCpG (mRNA)" > 80



________________________________________


SELECT * FROM [1123].[mRNA_intersect_mCpGovSNP with gene names]


________________________________________


SELECT * FROM [1123].[mRNA_intersect_mCpGovSNP with gene names]


________________________________________


SELECT Column21 FROM [1123].[mRNA_intersect_mCpGovSNP with gene names]



________________________________________


SELECT * FROM [1123].[BSoysterGENE]


________________________________________


SELECT * FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 50
  and "Percent mCpG (CDS)" > 80
  and "Percent mCpG (Intron)" < 20





________________________________________


SELECT Column2 FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 50
  and "Percent mCpG (CDS)" > 80
  and "Percent mCpG (Intron)" < 20





________________________________________


SELECT Column2 FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 50
  and "Percent mCpG (mRNA)" > 80






________________________________________


SELECT Column2 FROM [1123].[BSoysterGENE]
  Where "Sum mRNA" > 50
  and "Percent mCpG (mRNA)" < 80







________________________________________


SELECT * FROM [1123].[BSoysterGENE]  Where "Sum mRNA" > 50
  and "Percent mCpG (mRNA)" > 80



________________________________________


SELECT * FROM [1123].[BSoysterGENE]  Where "Sum mRNA" > 50
  and "Percent mCpG (mRNA)" < 20
  



________________________________________


SELECT Column2 FROM [1123].[BSoysterGENE]  Where "Sum mRNA" > 50
  and "Percent mCpG (mRNA)" < 20



________________________________________


SELECT * FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]


________________________________________


SELECT * FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Where Column10 >100



________________________________________


SELECT * FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Where Column14 > 2



________________________________________


SELECT Column1,Column4,Column5,Column14 FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Where Column14 > 2



________________________________________


SELECT * FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Where Column14 > 2



________________________________________


SELECT Column9, sum(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Group by Column9



________________________________________


SELECT Column9, sum(Column14),count(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Group by Column9



________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Group by Column9



________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),min(column14),max(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Group by Column9



________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),min(column14),max(Column14),avg(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Group by Column9



________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),varp(column14),min(column14),max(Column14),avg(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Group by Column9



________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),varp(column14),stdev(column14),min(column14),max(Column14),avg(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Group by Column9



________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),stdev(column14),min(column14),max(Column14),avg(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Group by Column9



________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),avg(Column14),stdev(column14),min(column14),max(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]
  Group by Column9



________________________________________


SELECT * FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]




________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),avg(Column14),stdev(column14),min(column14),max(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]  Group by Column9




________________________________________


SELECT * FROM [1123].[Gil_Exp_coverage_CDS_SummaryStats]


________________________________________


SELECT * FROM [1123].[Gil_Exp_coverage_CDS_SummaryStats]
  Where Column4 >0



________________________________________


SELECT * FROM [1123].[Gil_Exp_coverage_CDS_SummaryStats]
  Where Column4 >0



________________________________________


SELECT * FROM [1123].[Gill_exp_cds_summ_avgg0]


________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),avg(Column14),stdev(column14),min(column14),max(Column14) FROM [1123].[table_TJGR_Gil_Exp_TH_coverage_CDS.csv]  Group by Column9



________________________________________


SELECT * FROM [1123].[table_TJGR_CDS_intersect_gillMBDmCpG]


________________________________________


SELECT Column1, sum(Column10) FROM [1123].[table_TJGR_CDS_intersect_gillMBDmCpG]
  Group by Column1



________________________________________


SELECT * FROM [1123].[table_TJGR_CDS_intersect_gillMBDmCpG]


________________________________________


SELECT Column9, sum(Column10) FROM [1123].[table_TJGR_CDS_intersect_gillMBDmCpG]
  Group by Column9



________________________________________


SELECT Column9, sum(Column10) FROM [1123].[table_TJGR_CDS_intersect_allCpG]
  Group by Column9
  



________________________________________


SELECT * FROM [1123].[table_TJGR_mRNA_intersect_allCpG]   
  LEft JOIN [1123].[table_TJGR_mRNA_intersect_gillMBDmCpG]
  ON [1123].[table_TJGR_mRNA_intersect_allCpG].Column9=[1123].[table_TJGR_mRNA_intersect_gillMBDmCpG].Column9



________________________________________


SELECT * FROM [1123].[Join_mRNA_allCG_mCpG]



________________________________________


SELECT Column9,Column10,Column101 FROM [1123].[Join_mRNA_allCG_mCpG]



________________________________________


Select * From [1123].[table_TJGR_Gill_percentMeth_gene.txt]   
  Inner join [1123].[table_TJGR_Gil_cov_CDS_stats_cv.txt]
  ON [1123].[table_TJGR_Gil_cov_CDS_stats_cv.txt].ID=[1123].[table_TJGR_Gil_cov_CDS_stats_cv.txt].ID




________________________________________


SELECT * FROM [1123].[TJGR_Gill_meth_CDSexpression_gene]


________________________________________


SELECT * FROM [1123].[TJGR_Gill_meth_CDSexpression_gene]
  Where sum > 10



________________________________________


SELECT * FROM [1123].[TJGR_Gill_meth_CDSexpression_gene]
  Where sum > 10
  and CG >10



________________________________________


Select * From [1123].[table_TJGR_Gill_percentMeth_gene.txt]   
  Inner join [1123].[table_TJGR_Gil_cov_CDS_stats_cv.txt]
  ON [1123].[table_TJGR_Gill_percentMeth_gene.txt].ID=[1123].[table_TJGR_Gil_cov_CDS_stats_cv.txt].ID



________________________________________


SELECT * FROM [1123].[table_TJGR_Gil_cov_CDS_stats_cv.txt]


________________________________________


SELECT * FROM [1123].[TJGR_Gill_meth_CDSexpression_gene]


________________________________________


SELECT * FROM [1123].[TJGR_Gill_meth_CDSexpression_gene]
  Where CG > 10



________________________________________


SELECT GENEID
  FROM [1123].[table_Table S14.csv]


________________________________________


SELECT GENEID,Gil
  FROM [1123].[table_Table S14.csv]


________________________________________


SELECT GENEID,Gil,swissprot
  FROM [1123].[table_Table S14.csv]


________________________________________



Select * From [1123].[Zhang_Gil]   
  Inner join [1123].[TJGR_Gill_meth_CDSexpression_gene]
  ON [1123].[Zhang_Gil].GENEID=[1123].[TJGR_Gill_meth_CDSexpression_gene].ID




________________________________________


SELECT * FROM [1123].[Gill_Done]


________________________________________


SELECT * FROM [1123].[Gill_Done]
  Where Gil > 10
  and CG >10



________________________________________


SELECT * FROM [1123].[Gill_Done]
  Where Gil > 10
  and CG > 10
  and CDScount > 3



________________________________________


SELECT * FROM [1123].[Gill_Done]
  Where Gil > 10
  and CG > 10
  and CDScount > 3



________________________________________


SELECT * FROM [1123].[Gill_Done]




________________________________________


Select * From [1123].[Gill_Done_2]




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth <20
  




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth <20
  and Gil >10
  




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth <20
  and Gil >10
  and CG >10 




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth >80
  and Gil >10
  and CG >10 




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth > 50
  and Gil >10
  and CG >10 




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth > 50
  and Gil >10
  and CG >10 
  and CDScount >3




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth > 50
  and CG >10 
  and CDScount >3




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth > 50
  and CG >10 
  and CDScount >3




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth > 50
  and CG >10 
  and CDScount >3




________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth > 50
  and CG >10 
  and CDScount >3



________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth < 20
  and CG >10 
  and CDScount >3



________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth > 20
  and CG >10 
  and CDScount = 4



________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth > 20
  and CG >10 
  and CDScount = 10



________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth < 40
  and CG >10 
  and CDScount = 10



________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth < 40
  and CG >10 
  and CDScount = 10



________________________________________


Select * From [1123].[Gill_Done_2]
  Where Percent_Meth > 60
  and CG >10 
  and CDScount = 10



________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),avg(Column14),stdev(column14),min(column14),max(Column14) 
  FROM [1123].[table_TJGR_MgoTophat_coverage_CDS.txt]  
  Group by Column9



________________________________________


SELECT Column9, sum(Column14),count(Column14),var(column14),avg(Column14),stdev(column14),min(column14),max(Column14) 
  FROM [1123].[table_TJGR_MgoTophat_coverage_CDS.txt]  
  Group by Column9



________________________________________


SELECT * FROM [1123].[table_TJGR_mRNA_intersect_allCpG]



________________________________________


SELECT * FROM [1123].[table_fish546TJGR_mRNA_int_mCpG_2]



________________________________________


Select * From [1123].[table_fish546TJGR_mRNA_int_mCpG_2] 
  Inner join [1123].[table_TJGR_mRNA_intersect_allCpG]
  ON [1123].[table_fish546TJGR_mRNA_int_mCpG_2].ID=[1123].[table_TJGR_mRNA_intersect_allCpG].Column9




________________________________________


SELECT * FROM [1123].[table_untitled (4).txt]


________________________________________


SELECT * FROM [1123].[table_untitled (4).txt]
  Where Percent_Meth >1
  



________________________________________


SELECT * FROM [1123].[table_untitled (4).txt]
  Where Percent_Meth > 50
  
  



________________________________________


Select * From [1123].[table_TJGR_Sperm_Methylation_info_gene.txt]
  Inner join [1123].[table_MgoTophat_coverage_CDS_summ_cv]
  ON [1123].[table_TJGR_Sperm_Methylation_info_gene.txt].ID=[1123].[table_MgoTophat_coverage_CDS_summ_cv].ID





________________________________________


SELECT * FROM [1123].[MgoTophat_coverage_CDS_summ_cv]
  Where cv >10


________________________________________


SELECT * FROM [1123].[MgoTophat_coverage_CDS_summ_cv]
  Where cv > 1


________________________________________


SELECT * FROM [1123].[MgoTophat_coverage_CDS_summ_cv]
  Where CDScount >20


________________________________________


SELECT * FROM [1123].[table_mod7_blastout_sp.txt]
   LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [1123].[table_mod7_blastout_sp.txt].Column3=[354].[SPID_GOnumber.txt].A0A000




________________________________________


SELECT * FROM [1123].[table_mod7_blastout_sp.txt]   LEFT JOIN [354].[SPID_GOnumber.txt]
  ON [1123].[table_mod7_blastout_sp.txt].Column3=[354].[SPID_GOnumber.txt].A0A000




________________________________________


SELECT * FROM [1352].[goslim_generic.obo]
  



________________________________________


SELECT A0A000 as SPID FROM [354].[SPID_GOnumber.txt]


________________________________________


SELECT A0A000 as SPID,"GO:0003824" as GOID FROM [354].[SPID_GOnumber.txt]


________________________________________


SELECT * FROM [354].[gp_association.goa_uniprot]


________________________________________


SELECT SPID FROM [1123].[ETS Annotated Proteins]


________________________________________


SELECT SPID FROM [1123].[ETS Annotated Proteins]


________________________________________


SELECT * FROM [354].[TJGR_Gene_SPID_evalue_Description.txt]


________________________________________


SELECT Column1 as ID FROM [354].[TJGR_Gene_SPID_evalue_Description.txt]


________________________________________


SELECT * FROM [354].[TJGR_Gene_SPID_evalue_Description.txt]


________________________________________


SELECT Column1 as CGI_ID, Column2 as SPID, Column3 as evalue, Column5 as Description FROM [354].[TJGR_Gene_SPID_evalue_Description.txt]


________________________________________


SELECT * FROM [1123].[table_QPX_Experiment_UniqueReads_simple.txt]
  Left JOIN [1123].[QPX_CLC_experiment_Kal_tab.txt]
  ON [1123].[table_QPX_Experiment_UniqueReads_simple.txt]."Feature ID"=[1123].[QPX_CLC_experiment_Kal_tab.txt]."Feature ID"



________________________________________


SELECT * FROM [1123].[table_QPX_Experiment_UniqueReads_simple.txt] reads


  LEFT JOIN [1123].[QPX_CLC_experiment_Kal_tab.txt] clc
  ON reads."Feature ID" = clc."Feature ID"


________________________________________


SELECT * FROM [1123].[QPX_Experiment_UniqueReads_simple.txt] reads


  LEFT JOIN [1123].[QPX_CLC_experiment_Kal_tab.txt] clc
  ON reads."Feature ID" = clc."Feature ID"


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)] cgsp
  LEFT JOIN [1123].[associations_uni_swisspro_012410] ass
  ON cgsp.SPID = ass.ID


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)] cgsp
  LEFT JOIN [1123].[associations_uni_swisspro_012410] ass
  ON cgsp.SPID = ass.ID
  

  



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)] cgsp
  LEFT JOIN [1123].[associations_uni_swisspro_012410] ass
  ON cgsp.SPID = ass.ID
    
  LEFT JOIN [1123].[GO_to_GOslim] slim
  on ass."GO ID" = slim.GO_id


  



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)] cgsp
  LEFT JOIN [1123].[SPID and GO Numbers] ass
  ON cgsp.SPID = ass.SPID
    
  LEFT JOIN [1123].[GO_to_GOslim] slim
  on ass."GOID" = slim.GO_id


  



________________________________________


SELECT CGI_ID FROM [1123].[qDOD_Cgigas_GO_GOslim]


________________________________________


SELECT aspect
  FROM [1123].[qDOD_Cgigas_GO_GOslim]


________________________________________


SELECT *
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where aspect='P'



________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where aspect='P'



________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where aspect='P'

  
  



________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE 's%'

  
  



________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE 'stress%'

  
  



________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%stress%'

  
  



________________________________________


SELECT Description,evalue,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where GOSlim_bin LIKE '%stress%'

 
  



________________________________________


SELECT Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where GOSlim_bin LIKE '%stress%'

 
  



________________________________________


SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where GOSlim_bin LIKE '%stress%'

 
  



________________________________________


SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where GOSlim_bin LIKE '%stress%'

 
  



________________________________________


SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where term LIKE '%immune%'




________________________________________


SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where Description LIKE '%interleuk%'


________________________________________


SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where Description LIKE '%prosta%'


________________________________________


SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where Description LIKE '%myo%'


________________________________________


SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where Description LIKE '%myostatin%'


________________________________________


SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where Description LIKE '%gdf%'


________________________________________


SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where Description LIKE '%DMNT%'


________________________________________



SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where term LIKE '%methyl%'
  OR
  term LIKE '%histone%'

  



________________________________________



SELECT cgslim.CGI_ID,Description,evalue,SPID,GOID,term,GOSlim_bin,sequence
  FROM [1123].[qDOD_Cgigas_GO_GOslim] cgslim
 
 LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] cgf
  on cgslim.CGI_ID = cgf.CGI_ID
  
  Where term LIKE '%methyl%'
  OR
  term LIKE '%epigen%'

  



________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%stress%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%stress%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%stress%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%stress%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%stress%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%stress%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%death%'


________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences]
  Where ProteinSeq LIKE '%MIR%'



________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences]
  Where ProteinSeq LIKE '%Steven%'



________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences]
  Where ProteinSeq LIKE '%Emma%'



________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences]
  Where ProteinSeq LIKE '%Mackenzie%'



________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences]
  Where ProteinSeq LIKE '%Mac%'



________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences]
  Where ProteinSeq LIKE '%Claire%'



________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences]
  Where ProteinSeq LIKE '%Beyer%'



________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences]
  Where ProteinSeq LIKE '%Steven%'



________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences] pro  
  Left Join [1123].[qDOD_Cgigas_GO_GOslim] cgslim
  
  on pro.CGI_ID = cgslim.CGI_ID
    Where ProteinSeq LIKE '%Steven%'



________________________________________


SELECT * FROM [1123].[qDOD_Protein_Sequences] pro  
  Left Join [1123].[qDOD_Cgigas_GO_GOslim] cgslim
  
  on pro.CGI_ID = cgslim.CGI_ID
  
    Where ProteinSeq LIKE '%Claire%'



________________________________________


SELECT * FROM [1123].[qDOD_scaffold_sequence.txt]
  Where Column1 = 'scaffold29146'



________________________________________


SELECT * FROM [1123].[qDOD_scaffold_sequence.txt]
  Where Column1 = 'scaffold920'



________________________________________


SELECT * FROM [1123].[qDOD_scaffold_sequence.txt]
  Where Column1 = 'scaffold500'



________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%stress%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where Description LIKE '%growth%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%growth%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where GOSlim_bin LIKE '%repro%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where term LIKE '%repro%'


________________________________________


SELECT CGI_ID,evalue,Description,SPID,GOID,term,GOSlim_bin
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where term LIKE '%growth%'


________________________________________


SELECT * FROM [1123].[table_Supplemental Table1 .txt]
  



________________________________________


SELECT * FROM [1123].[table_Supplemental Table1 .txt]
  
Where "Feature ID" = '%c10100'


________________________________________


SELECT * FROM [1123].[table_Supplemental Table1 .txt]
  
Where "Feature ID" LIKE '%c10100'


________________________________________


SELECT * FROM [1123].[BiGO_CG_Gal_17]
  Where Column5 > 0
  



________________________________________


SELECT * FROM [1123].[DMR2] dmr2
  left join [1123].[SPID and GO Numbers] ass
  on dmr2.Column4 = ass.SPID


________________________________________


SELECT * FROM [1123].[DMR2] dmr2
  left join [1123].[SPID and GO Numbers] ass
  on dmr2.Column4 = ass.SPID
  
  left join [1123].[GO_to_GOslim] slim
  on ass."GOID" = slim.GO_id



________________________________________


SELECT * FROM [1123].[DMR2] dmr2
  left join [1123].[SPID and GO Numbers] ass
  on dmr2.Column4 = ass.SPID
  
  left join [1123].[GO_to_GOslim] slim
  on ass."GOID" = slim.GO_id



________________________________________


SELECT count(GOslim_bin) FROM [1123].[dmr with GO slim]
GROUP BY GOslim_bin
  



________________________________________


SELECT GOslim_bin,count(GOslim_bin) FROM [1123].[dmr with GO slim]
GROUP BY GOslim_bin
  



________________________________________


SELECT GOslim_bin,count(GOslim_bin) FROM [1123].[dmr with GO slim]
Where aspect ='P'

  GROUP BY GOslim_bin
  



________________________________________


SELECT * FROM [412].[3 peps per protein areas averaged]


________________________________________


SELECT * FROM [1123].[qDOD_RepeatProteinMask_v9]
  where Method = 'WUBlastX'
  
  


________________________________________


SELECT * FROM [1123].[table_qDOD_RepeatProteinMask_v9.txt]
  Where Method = 'WUBlastx'



________________________________________


SELECT A0A183 FROM [1123].[SPID_and_Description]


________________________________________


SELECT [1123].[SPID_and_Description].A0A183
  FROM [1123].[SPID_and_Description]



________________________________________


SELECT [1123].[SPID_and_Description].A0A183
  FROM [1123].[SPID_and_Description]



________________________________________


SELECT [1123].[SPID_and_Description].A0A183
  FROM [1123].[SPID_and_Description]



________________________________________


SELECT [1123].[SPID_and_Description].A0A183 as new
  FROM [1123].[SPID_and_Description]



________________________________________


SELECT [1123].[SPID_and_Description].A0A183 as SPID,[1123].[SPID_and_Description]."Late cornified envelope protein 6A" as Description
  FROM [1123].[SPID_and_Description]



________________________________________


SELECT * FROM [1123].[meth_combinedCG_mRNA.txt]
  Left Join [1123].[qDOD_gene_length]
  on [1123].[meth_combinedCG_mRNA.txt].Column1=[1123].[qDOD_gene_length].gID
  
  


________________________________________


SELECT Column1, (Column3 / length) FROM [1123].[meth_combinedCG_mRNA.txt]
  Left Join [1123].[qDOD_gene_length]
  on [1123].[meth_combinedCG_mRNA.txt].Column1=[1123].[qDOD_gene_length].gID
  
  


________________________________________


SELECT Column1, Column3, length, (Column3 / length) FROM [1123].[meth_combinedCG_mRNA.txt]
  Left Join [1123].[qDOD_gene_length]
  on [1123].[meth_combinedCG_mRNA.txt].Column1=[1123].[qDOD_gene_length].gID
  
  


________________________________________


SELECT Column1, Column3, length, (Column3 / length),Column5 FROM [1123].[meth_combinedCG_mRNA.txt]
  Left Join [1123].[qDOD_gene_length]
  on [1123].[meth_combinedCG_mRNA.txt].Column1=[1123].[qDOD_gene_length].gID
  
  


________________________________________


SELECT Column1, Column3, length, (round(Column3 / length,0)),Column5 FROM [1123].[meth_combinedCG_mRNA.txt]
  Left Join [1123].[qDOD_gene_length]
  on [1123].[meth_combinedCG_mRNA.txt].Column1=[1123].[qDOD_gene_length].gID
  
  


________________________________________


SELECT Column1, Column3, length, (round(Column3 / length,3)),Column5 FROM [1123].[meth_combinedCG_mRNA.txt]
  Left Join [1123].[qDOD_gene_length]
  on [1123].[meth_combinedCG_mRNA.txt].Column1=[1123].[qDOD_gene_length].gID
  
  


________________________________________


SELECT Column1, Column3, length, ((Column3 / length)*100),Column5 FROM [1123].[meth_combinedCG_mRNA.txt]
  Left Join [1123].[qDOD_gene_length]
  on [1123].[meth_combinedCG_mRNA.txt].Column1=[1123].[qDOD_gene_length].gID
  
  


________________________________________


SELECT Column1, Column3, length, Column5 FROM [1123].[meth_combinedCG_mRNA.txt]
  Left Join [1123].[qDOD_gene_length]
  on [1123].[meth_combinedCG_mRNA.txt].Column1=[1123].[qDOD_gene_length].gID
  
  


________________________________________


SELECT * FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,(Column3*1.00000000) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,(Column3*1.00000000),(length*1.000000000) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,(Column3*2.000),(length*1.000000000) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,(Column3*2.000),(round(length,0)) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,(Column3*2.000),(round(length,2)) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,(Column3*2.000),(round(length,5)) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,(Column3*2.000),(round(length,.1)) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,((Column3*100)/(length*1000)) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,((Column3*100)/(length*100)) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,((Column3*1000)/(length*1000)) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,((Column3*10000)/(length*10000)) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,((Column3^10000)/(length^10000)) FROM [1123].[Oyster Genes with CG ratio per loci]


________________________________________


SELECT *,CAST(Column3 AS FLOAT)/length FROM [1123].[Oyster Genes with CG ratio per loci]




________________________________________


SELECT *,(CAST(Column3 AS FLOAT)/length)*100 FROM [1123].[Oyster Genes with CG ratio per loci]




________________________________________


SELECT Column1,(CAST(Column3 AS FLOAT)/length)*100,Column3,length,Column5
  FROM [1123].[Oyster Genes with CG ratio per loci]




________________________________________


SELECT Column1 as ID,(CAST(Column3 AS FLOAT)/length)*100,Column3,length,Column5
  FROM [1123].[Oyster Genes with CG ratio per loci]




________________________________________


SELECT Column1 as ID,Column3 as CGloc,length,Column5
  FROM [1123].[Oyster Genes with CG ratio per loci]




________________________________________


SELECT Column1 as ID,Column3 as CGloc,length,(CAST(Column3 AS FLOAT)/length)*100 as CG_fracloc,Column5 as methratio
  FROM [1123].[Oyster Genes with CG ratio per loci]




________________________________________


SELECT Column1, Column3, Column5,length FROM [1123].[meth_combinedCG_mRNA.txt]
  Left Join [1123].[qDOD_gene_length]
  on [1123].[meth_combinedCG_mRNA.txt].Column1=[1123].[qDOD_gene_length].gID
  


________________________________________


SELECT * FROM [1123].[meth_combinedCG_mRNA.txt] mr
  left join [1123].[table_qDOD_gene_length.txt] lg
  on mr.Column1 = lg.gID


________________________________________


SELECT * FROM [1123].[meth_combinedCG_mRNA.txt] mr
  left join [1123].[table_qDOD_gene_length.txt] lg
  on mr.Column1 = lg.gID
 LEFT JOIN [1123].[qDOD_Cgigas_GO_GOslim] slim
  on lg.gID = slim."CGI_ID"


________________________________________


SELECT * FROM [1123].[meth_combinedCG_mRNA.txt] mr
  left join [1123].[table_qDOD_gene_length.txt] lg
  on mr.Column1 = lg.gID
 LEFT JOIN [1123].[qDOD_Cgigas_GO_GOslim] slim
  on lg.gID = slim."CGI_ID"


________________________________________


SELECT * FROM [1123].[meth_combinedCG_mRNA.txt] mr
  left join [1123].[table_qDOD_gene_length.txt] lg
  on mr.Column1 = lg.gID
 LEFT JOIN [1123].[qDOD_Cgigas_GO_GOslim] slim
  on lg.gID = slim."CGI_ID"
 LEFT JOIN [1123].[qDOD_oyster_gene_exon_number] ex
  on lg.gID = ex.CGI_ID



________________________________________


SELECT * FROM [1123].[meth_combinedCG_mRNA.txt] mr
  left join [1123].[table_qDOD_gene_length.txt] lg
  on mr.Column1 = lg.gID
 LEFT JOIN [1123].[qDOD_Cgigas_GO_GOslim] slim
  on lg.gID = slim."CGI_ID"
 LEFT JOIN [1123].[qDOD_oyster_gene_exon_number] ex
  on lg.gID = ex.CGI_ID



________________________________________


SELECT * FROM [1123].[meth_combinedCG_mRNA.txt] mr
  left join [1123].[table_qDOD_gene_length.txt] lg
  on mr.Column1 = lg.gID
 LEFT JOIN [1123].[qDOD_Cgigas_GO_GOslim] slim
  on lg.gID = slim."CGI_ID"
 LEFT JOIN [1123].[qDOD_oyster_gene_exon_number] ex
  on lg.gID = ex.CGI_ID
  LEFT JOIN [1123].[qDOD_Zhang_Gil_gene_RNA-seq] exp
  on lg.gID = exp."Feature ID"


________________________________________


SELECT Column3 FROM [1123].[Making Pictures]


________________________________________


SELECT Column3 as Position
  FROM [1123].[Making Pictures]


________________________________________


SELECT Column1 as Gene_ID, Column3 as Position
  FROM [1123].[Making Pictures]


________________________________________


SELECT Column1 as Gene_ID, Column3 as Position,
  Column5 as Meth_ratio, length, GOSlim_bin
  FROM [1123].[Making Pictures]


________________________________________


SELECT Column1 as Gene_ID, Column3 as Position,
  Column5 as Meth_ratio, length, GOSlim_bin
  FROM [1123].[Making Pictures]
  
  Where length > 2000



________________________________________


SELECT Column1 as Gene_ID, Column3 as Position,
  Column5 as Meth_ratio, length, GOSlim_bin
  FROM [1123].[Making Pictures]
  
  Where length > 500


________________________________________


SELECT LEN(sequence) As please
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT LEN(sequence_gg) As Length
  FROM [1123].[TJGR_genomic_gene.txt]


________________________________________


SELECT * FROM [1123].[qDOD_gene_length]
  Where length > 1000



________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where Len(sequence_gg) > 1000



________________________________________


SELECT Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where Len(sequence_gg) > 1000



________________________________________


SELECT *,Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where Len(sequence_gg) > 1000



________________________________________


SELECT gID,Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where Len(sequence_gg) > 1000



________________________________________


SELECT *,Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like 
  '%CGI%'
  
  



________________________________________


SELECT *,Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10000001%'
  
  



________________________________________


SELECT 
 Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10000001%'
  
  



________________________________________


SELECT 
 Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10000060%'
  
  



________________________________________


SELECT 
 Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10000087%'
  
  



________________________________________


SELECT 
 Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10000090%'
  
  



________________________________________


SELECT 
 Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10000115%'
  
  



________________________________________


SELECT 
 Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10000060%'
  
  



________________________________________


SELECT 
 Len(sequence_gg) FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10000162%'
  
  



________________________________________


SELECT 
 Len(sequence) FROM [1123].[qDOD_Cgigas_gene_fasta]
  Where CGI_ID like '%CGI_10000162%'
  
  



________________________________________


SELECT 
 Len(sequence) FROM [1123].[qDOD_Cgigas_gene_fasta]
  Where CGI_ID like '%CGI_10000162%'
  
  



________________________________________


SELECT *
  FROM [1123].[TJGR_genomic_gene.txt] go
  LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] g
  on go.gID = g.CGI_ID


________________________________________


SELECT gID, len(sequence_gg)
  FROM [1123].[TJGR_genomic_gene.txt] go
  LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] g
  on go.gID = g.CGI_ID


________________________________________


SELECT gID, len(sequence_gg), len(sequence)
  FROM [1123].[TJGR_genomic_gene.txt] go
  LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] g
  on go.gID = g.CGI_ID


________________________________________


SELECT gID, len(sequence_gg), len(sequence)
  FROM [1123].[TJGR_genomic_gene.txt] go
  LEFT JOIN [1123].[qDOD_Cgigas_gene_fasta] g
  on go.gID = g.CGI_ID
  Where len(sequence_gg) > 1000



________________________________________


SELECT * FROM [1123].[meth_combinedCG_mRNA.txt] cg
  left join [1123].[TJGR_genomic_gene.txt] gg
  on cg.Column1 = gg.gID



________________________________________


SELECT Column1, Column2 as Location, Column5 as Meth_ratio, Len(sequence_gg) as Sequence_Length FROM [1123].[meth_combinedCG_mRNA.txt] cg
  left join [1123].[TJGR_genomic_gene.txt] gg
  on cg.Column1 = gg.gID



________________________________________


SELECT Column1, Column2 as Location, 
  Column5 as Meth_ratio, 
  Len(sequence_gg) as Sequence_Length
  FROM [1123].[meth_combinedCG_mRNA.txt] cg
  left join [1123].[TJGR_genomic_gene.txt] gg
  on cg.Column1 = gg.gID



________________________________________


SELECT Column1, Column2 as Location, 
  Column5 as Meth_ratio, 
  Len(sequence_gg) as Sequence_Length
  FROM [1123].[meth_combinedCG_mRNA.txt] cg
  left join [1123].[TJGR_genomic_gene.txt] gg
  on cg.Column1 = gg.gID



________________________________________


SELECT * FROM [1123].[Gill Methratio with genomic seq length]


________________________________________


SELECT *,(CAST(Location AS FLOAT)/Sequence_Length)*100 FROM [1123].[Gill Methratio with genomic seq length]


________________________________________


SELECT *,(CAST(Location AS FLOAT)/Sequence_Length)*100 as mCG_locale_frac FROM [1123].[Gill Methratio with genomic seq length]


________________________________________


SELECT * FROM [1123].[Gill Methratio with mCG_locale_fraction] mg
  Left join [1123].[qDOD_Cgigas_GO_GOslim] slim
  on mg.Column1 = slim.CGI_ID




________________________________________


SELECT * FROM [1123].[Gill Methratio with mCG_locale_fraction] mg
  Left join [1123].[qDOD_Cgigas_GO_GOslim] slim
  on mg.Column1 = slim.CGI_ID
  Where aspect = 'P'




________________________________________


SELECT Column1,Location,Meth_ratio,Sequence_Length,mCG_locale_frac,term,GOSlim_bin
  FROM [1123].[Gill Methratio with mCG_locale_fraction] mg
  Left join [1123].[qDOD_Cgigas_GO_GOslim] slim
  on mg.Column1 = slim.CGI_ID
  Where aspect = 'P'




________________________________________


SELECT * FROM [1123].[Methratio with GO]
  Where term like '%stress%'
  


________________________________________


SELECT * FROM [1123].[Methratio with GO]


________________________________________


SELECT * FROM [1123].[Methratio with GO]
  where Sequence_Length like ' '



________________________________________


SELECT * FROM [1123].[Methratio with GO]
  where Sequence_Length like '10'



________________________________________


SELECT * FROM [1123].[Methratio with GO]




________________________________________


SELECT * FROM [1123].[Methratio with GO]
Where term like 'stress'



________________________________________


SELECT * FROM [1123].[Methratio with GO]
Where term like '%stress%'



________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID = 'CGI_10006842'
  



________________________________________


SELECT * FROM [1123].[Methratio with GO]
Where term like '%stress%'



________________________________________


SELECT * FROM [1123].[Methratio with GO]
Where term like '%stress%'



________________________________________


SELECT * FROM [1123].[Methratio with GO]
Where term like '%stress%'



________________________________________


SELECT CGI_ID,len(sequence) FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT CGI_ID,len(sequence) as CDS_length FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%6842%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10000002%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%10000002%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%2%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%42%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%842%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_10006842%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%CGI_100006842%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%06842%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%06842'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like 'CGI_10006842'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like 'CGI_10000001'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like 'CGI_10000088'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%10006842'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID = '%10006842'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID = 'CGI_10006842'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID = 'CGI_10000088'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID = 'CGI_10006842'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID = '%10006842'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID = '%0006842'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID = '%0006842%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%0006842%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%842%'


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  Where gID like '%6842%'


________________________________________


SELECT * FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
  where gID like 'CGI_10006842'



________________________________________


SELECT * FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
  where gID like 'CGI_10006842'



________________________________________


SELECT * FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
  where gID like '%006842'



________________________________________


SELECT Column1, cast(Column2 as float) as Location, 
  Column5 as Meth_ratio, 
  Len(sequence_gg) as Sequence_Length
  FROM [1123].[meth_combinedCG_mRNA.txt] cg
  left join [1123].[TJGR_genomic_gene.txt] gg
  on cg.Column1 = gg.gID



________________________________________


SELECT count(*) FROM [1123].[BiGO_betty_plain_methratio_v1.txt]


________________________________________


SELECT count(*) 
  FROM (
    select * from 
    [1123].[BiGO_betty_plain_methratio_v1.txt]
    where pos > 500
    
  ) x



________________________________________


SELECT top 1 * FROM [1123].[New table snapshot]


________________________________________


SELECT top 1 * FROM [1123].[New table snapshot]


________________________________________


SELECT top 1 * FROM [1123].[New table snapshot]


________________________________________


SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  where Context = '__CG_'
  


________________________________________


SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  where Context like '__CG_'
  


________________________________________


Select * from

(SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  where Context like '__CG_') awe
  


________________________________________


Select count (*) from

(SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  where Context like '__CG_') awe
  


________________________________________


SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  where Context like '__CG_'
  and CT_count > 10
  
  


________________________________________


SELECT 
 chr as Seqname, 'methratio' as Source, 'CpG' as Feature,
  pos as Start, (pos + 1) as [End], ratio as Score, Strand, '.' as Frame, '.' as [Group] 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  where Context like '__CG_'
  and CT_count > 10
  
  


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 1, CHARINDEX(';', Column9)-1)
       END AS Column9
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 1, CHARINDEX(';', Column9)-1)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-1)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-1)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-2)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-4)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-1)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-18)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-12)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-6)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-7)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column9,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-8)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-8)
       END AS ColumnNew
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-8)
       END AS Column9
   FROM [1123].[table_oysterv9_CDS.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 8, CHARINDEX(';', Column9)-8)
       END AS Column9
   FROM [1123].[oyster_v9_mRNA GFF]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-8)
       END AS Column9
   FROM [1123].[oyster_v9_mRNA GFF]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[oyster_v9_mRNA GFF]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-3)
       END AS Column9
   FROM [1123].[oyster_v9_mRNA GFF]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[oyster_v9_mRNA GFF]


________________________________________


SELECT cds.Column9,cds.Column3
  FROM [1123].[oyster_v9_CDS GFF] cds
  


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT mRNA.Column1
  FROM [1123].[oyster_v9_CDS GFF] cds
  Left join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9



________________________________________


SELECT cds.*, mRNA.Column4
  FROM [1123].[oyster_v9_CDS GFF] cds
  Left join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9



________________________________________


SELECT cds.Column1,
  cds.Column2,
  cds.Column3,
  cds.Column4 - mRNA.Column4 +1
  FROM [1123].[oyster_v9_CDS GFF] cds
  Left join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9



________________________________________


SELECT cds.Column1,
  cds.Column2,
  cds.Column3,
  cds.Column4 - mRNA.Column4 +1 as Start,
  cds.Column5 - mRNA.Column4 +1 as [End]
  FROM [1123].[oyster_v9_CDS GFF] cds
  Left join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9



________________________________________


SELECT cds.Column1,
  cds.Column2,
  cds.Column3,
  cds.Column4 - mRNA.Column4 +1 as Start,
  cds.Column5 - mRNA.Column4 +1 as [End],
  cds.Column6
  FROM [1123].[oyster_v9_CDS GFF] cds
  Left join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9



________________________________________


Select Count (*) from
(SELECT cds.Column1,
  cds.Column2,
  cds.Column3,
  cds.Column4 - mRNA.Column4 +1 as Start,
  cds.Column5 - mRNA.Column4 +1 as [End],
  cds.Column6
  FROM [1123].[oyster_v9_CDS GFF] cds
  Left join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9) aw



________________________________________


SELECT * FROM [materialized_Snapshot of Oyster CDS GFF]


________________________________________


SELECT * FROM [1123].[Snapshot of Oyster CDS GFF]


________________________________________


SELECT * 
  FROM [1123].[Snapshot of Oyster CDS GFF] cds
  LEFT Join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9


________________________________________


SELECT cds.Column1 
  FROM [1123].[Snapshot of Oyster CDS GFF] cds
  LEFT Join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9


________________________________________


SELECT cds.*, mRNA.Column7, mRNA.Column9
  FROM [1123].[Snapshot of Oyster CDS GFF] cds
  LEFT Join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9


________________________________________


SELECT cds.*, mRNA.Column4 as mRNA_start, mRNA.Column5 as mRNA_end
  FROM [1123].[Snapshot of Oyster CDS GFF] cds
  LEFT Join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT Column1,
  Column2,
  Column3,
  Column4,
  Column5,
  Column6,
  Column7,
  Column8,
  CASE WHEN CHARINDEX(';', Column9) = 0
            THEN Column9
            ELSE SUBSTRING(Column9, 4, CHARINDEX(';', Column9)-4)
       END AS Column9
   FROM [1123].[table_oysterv9_mRNA.txt]


________________________________________


SELECT cds.*, 
  mRNA.Column4 as mRNA_start, 
  mRNA.Column5 as mRNA_end
  FROM [1123].[Snapshot of Oyster CDS GFF] cds
  LEFT Join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9


________________________________________


SELECT * 
  
  FROM [1123].[CDS GFF with Gene start and end] cd


________________________________________


SELECT *,
 Column4 + Column5 as New 
  
  FROM [1123].[CDS GFF with Gene start and end] cd


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column7
  Else Column4 + Column5
  END as PLS
  
  FROM [1123].[CDS GFF with Gene start and end] cd


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - Column5
  Else Column4 + Column5
  END as PLS
  
  FROM [1123].[CDS GFF with Gene start and end] cd


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else Column4 + Column5
  END as PLS
  
  FROM [1123].[CDS GFF with Gene start and end] cd


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5 +1
  END as PLS
  
  FROM [1123].[CDS GFF with Gene start and end] cd


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as PLS
  
  FROM [1123].[CDS GFF with Gene start and end] cd


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as PLS
  
  FROM [1123].[CDS GFF with Gene start and end] cd

  Order by Column1



________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as PLS
  
  FROM [1123].[CDS GFF with Gene start and end] cd

  Order by Column9



________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as PLS
  
  FROM [1123].[CDS GFF with Gene start and end] cd

  Order by Column5



________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as PLS
  
  FROM [1123].[CDS GFF with Gene start and end] cd

  Order by Column1 DESC



________________________________________


SELECT cds.*, 
  mRNA.Column4 as mRNA_start, 
  mRNA.Column5 as mRNA_end
  FROM [1123].[Snapshot of CDS GFF] cds
  LEFT Join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9


________________________________________


SELECT cds.*, 
  mRNA.Column4 as mRNA_start, 
  mRNA.Column5 as mRNA_end
  FROM [1123].[Snapshot of CDS GFF] cds
  LEFT Join [1123].[oyster_v9_mRNA GFF] mRNA
  on cds.Column9 = mRNA.Column9
  
  Order by Column1 Desc



________________________________________


SELECT * FROM 
  [1123].[CDS GFF with Gene start and stop] cd


________________________________________


SELECT *,
 
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5
  END as PLS 
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5
  END as PLS 
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc




________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5
  END as New_Start
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc




________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4
  END as New_Start,
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5
  END as New_End
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc




________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5
  END as New_End
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column4 




________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5
  END as New_End
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes




________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5
  END as New_End
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 +1
  END as New_End
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
  Case when Column7 = '+'
  then Column5 - Column4
  Else Column4 - Column5
  END as exon_size
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size  -- trying to check arithmetic
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size  -- trying to check arithmetic
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size  -- trying to check arithmetic
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty
  where context like '__CG_'


________________________________________


SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty
  where context like '__CG_' --_=single character wildcard


________________________________________


Select Count (*) from
  
  (SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty
    where context like '__CG_' --_=single character wildcard
  ) boop


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size  -- trying to check arithmetic
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


SELECT *,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size  -- trying to check arithmetic
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column1,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size  -- trying to check arithmetic
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column1,
  cd.Column2,
  cd.Column3,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size  -- trying to check arithmetic
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column9,
  cd.Column2,
  cd.Column3,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size  -- trying to check arithmetic
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column9,
  cd.Column2,
  cd.Column3,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
 Column5 - Column4
  as exon_size  -- trying to check arithmetic
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column9,
  cd.Column2,
  cd.Column3,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
cd.Column8
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column9,
  cd.Column2,
  cd.Column3,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
cd.Column6
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column9,
  cd.Column2,
  cd.Column3,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
cd.Column6,
cd.Column7
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column9,
  cd.Column2,
  cd.Column3,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
cd.Column6,
cd.Column7,
cd.Column6 as frame,
cd.Column6 as comment
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column9 as Seq,
  cd.Column2,
  cd.Column3,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as New_Start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as New_End,
  
cd.Column6,
cd.Column7,
cd.Column6 as frame,
cd.Column6 as comment
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT cd.Column9 as seqname,
  cd.Column2 as source,
  cd.Column3 as feature,
 Case when Column7 = '+'
  then Column4 - mRNA_start + 1
  Else mRNA_end - Column4 + 1
  END as start,
  
  Case when Column7 = '+'
  then Column5 - mRNA_start + 1
  Else mRNA_end - Column5 + 1
  END as [end],
  
cd.Column6 as score,
cd.Column7 as strand,
cd.Column6 as frame, -- 
cd.Column6 as attribute
  
  FROM 
  [1123].[CDS GFF with Gene start and stop] cd
  

  Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT
cd.Column9 as seqname,  
cd.Column2 as source,  
cd.Column3 as feature, 

Case when Column7 = '+'
then Column4 - mRNA_start + 1
Else mRNA_end - Column4 + 1
END as start,

Case when Column7 = '+'
then Column5 - mRNA_start + 1
Else mRNA_end - Column5 + 1
END as [end],

cd.Column6 as score,  
cd.Column7 as strand,  
cd.Column6 as frame,  
cd.Column6 as attribute  

FROM 
[1123].[CDS GFF with Gene start and stop] cd

Order by Column1 Desc, Column9 --makes it easy to see big genes



________________________________________


SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty 
  where context like '__CG_' --_=single character wildcard


________________________________________


SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty 
  where context like '__CG_' --_=single character wildcard
  and
  CT_Count > 9



________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty 
  where context like '__CG_' --_=single character wildcard
  and
  CT_Count > 9



________________________________________


SELECT
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].[BiGill_methratio_gene_genomic_F.txt] bg
where 
context like '__CG_' --_=single character wildcard
and
CT_Count > 9
  




________________________________________


SELECT * 
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)] des
on gff.seqname = des.CGI_ID


________________________________________


SELECT 
 seqname 
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)] des
on gff.seqname = des.CGI_ID


________________________________________


SELECT 
 seqname,
 start,
 score 
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)] des
on gff.seqname = des.CGI_ID


________________________________________


SELECT 
 seqname,
 start,
 score,
 SPID
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)] des
on gff.seqname = des.CGI_ID


________________________________________


SELECT 
 seqname,
 start,
 score,
 SPID
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
 



________________________________________


SELECT 
 seqname,
 start,
 score,
 SPID,
 term,
 GOSlim_bin,
 aspect
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
 



________________________________________


SELECT 
 seqname,
 start,
 score,
 SPID,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 



________________________________________


SELECT 
 seqname,
 start,
 score,
 SPID,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length Desc



________________________________________


SELECT 
 seqname,
 start as CpG_pos,
 score,
 SPID,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length Desc



________________________________________


SELECT 
 seqname,
 start as CpG_pos,
 score as methratio,
 SPID,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length Desc



________________________________________


SELECT 
 seqname,
 start as CpG_pos,
  CAST(start AS FLOAT)/(mRNA.column5 - mRNA.column4) as Rel_CpG_pos,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length Desc



________________________________________


SELECT 
 seqname,
 start as CpG_pos,
  CAST(start AS FLOAT)/(mRNA.column5 - mRNA.column4) as Rel_CpG_pos,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length asc



________________________________________


SELECT 
 seqname,
 start as CpG_pos,
  CAST(start AS FLOAT)/(mRNA.column5 - mRNA.column4)*100 as Rel_CpG_pos,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length asc



________________________________________


SELECT 
 seqname,
 start as CpG_pos,
  CAST(start AS FLOAT)/(mRNA.column5 - mRNA.column4)*100 as Rel_CpG_pos,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length asc



________________________________________


SELECT 
 seqname,
 start as CpG_pos,
  CAST(start AS FLOAT(1))/(mRNA.column5 - mRNA.column4)*100 as Rel_CpG_pos,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length asc



________________________________________


SELECT 
 seqname,
 start as CpG_pos,
  CAST(start AS FLOAT(1))/(mRNA.column5 - mRNA.column4)*100 as Rel_CpG_pos,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length desc



________________________________________


SELECT 
 seqname,
 start as CpG_pos,
  CAST(start AS FLOAT(1))/(mRNA.column5 - mRNA.column4)*100 as Rel_CpG_pos,
 score as methratio,
 term,
 GOSlim_bin,
 aspect,
 mRNA.column5 - mRNA.column4 as mRNA_length 
  
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
  left join [1123].[qDOD_Cgigas_GO_GOslim] des
  on gff.seqname = des.CGI_ID
  left join [1123].[oyster_v9_mRNA GFF] mRNA
  on gff.seqname = mRNA.Column9
 
  Order by mRNA_length desc



________________________________________


SELECT 
    seqname,
    start as CpG_pos,
    CAST(start AS FLOAT(1))/(mRNA.column5 - mRNA.column4)*100 as Rel_CpG_pos,
    score as methratio,
    term,
    GOSlim_bin,
    aspect,
    mRNA.column5 - mRNA.column4 as mRNA_length 
  
    FROM [1123].[BiGill_methratio_Gene_Genomic_GFF] gff
    left join [1123].[qDOD_Cgigas_GO_GOslim] des
    on gff.seqname = des.CGI_ID
    left join [1123].[oyster_v9_mRNA GFF] mRNA
    on gff.seqname = mRNA.Column9
 
    Order by mRNA_length desc


________________________________________


SELECT * 
  FROM [1123].[table_BiGill_Gene_Methratio_VD_rmdup.csv]
Where aspect = 'P'


________________________________________


SELECT 
 seqname,
 Rel_CpG_pos,
 methratio,
 GOSlim_bin 
  FROM [1123].[table_BiGill_Gene_Methratio_VD_rmdup.csv]
Where aspect = 'P'


________________________________________


SELECT distinct
 seqname,
 Rel_CpG_pos,
 methratio,
 GOSlim_bin 
  FROM [1123].[table_BiGill_Gene_Methratio_VD_rmdup.csv]
Where aspect = 'P'


________________________________________


SELECT
 seqname,
 Rel_CpG_pos,
 methratio,
 GOSlim_bin 
  FROM [1123].[table_BiGill_Gene_Methratio_VD_rmdup.csv]
Where aspect = 'P'


________________________________________


Select Count (*) from
  (SELECT
 seqname,
 Rel_CpG_pos,
 methratio,
 GOSlim_bin 
  FROM [1123].[table_BiGill_Gene_Methratio_VD_rmdup.csv]
  Where aspect = 'P'
  ) foo



________________________________________


Select Count (*) from
  (SELECT distinct
 seqname,
 Rel_CpG_pos,
 methratio,
 GOSlim_bin 
  FROM [1123].[table_BiGill_Gene_Methratio_VD_rmdup.csv]
  Where aspect = 'P'
  ) foo



________________________________________


SELECT distinct
 seqname,
 Rel_CpG_pos,
 methratio,
 GOSlim_bin 
  FROM [1123].[table_BiGill_Gene_Methratio_VD_rmdup.csv]
  Where aspect = 'P'



________________________________________


SELECT * FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty where context like '__CG_' --_=single character wildcard


________________________________________


Select count (*) from

(SELECT * FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty 
  where context like '__CG_' --_=single character wildcard
) boo


________________________________________


  SELECT
    cd.Column9 as seqname,  
    cd.Column2 as source,  
    cd.Column3 as feature, 
   
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else mRNA_end - Column4 + 1
    END as start,
  
    Case when Column7 = '+'
    then Column5 - mRNA_start + 1
    Else mRNA_end - Column5 + 1
    END as [end],
  
    cd.Column6 as score,  
    cd.Column7 as strand,  
    cd.Column6 as frame,  
    cd.Column6 as attribute  
  
    FROM 
    [1123].[CDS GFF with Gene start and stop] cd
   
    Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


  SELECT
    cd.Column9 as seqname,  
    cd.Column2 as source,  
    cd.Column3 as feature, 
   
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else mRNA_end - Column4 + 1
    END as start,
    
    Column4 - mRNA_start + 1 as newstart,
  
    Case when Column7 = '+'
    then Column5 - mRNA_start + 1
    Else mRNA_end - Column5 + 1
    END as [end],
  
    cd.Column6 as score,  
    cd.Column7 as strand,  
    cd.Column6 as frame,  
    cd.Column6 as attribute  
  
    FROM 
    [1123].[CDS GFF with Gene start and stop] cd
   
    Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


  SELECT
    cd.Column9 as seqname,  
    cd.Column2 as source,  
    cd.Column3 as feature, 
   
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else mRNA_end - Column4 + 1
    END as start,
    
    Column4 - mRNA_start + 1 as newstart,
  
    Case when Column7 = '+'
    then Column5 - mRNA_start + 1
    Else mRNA_end - Column5 + 1
    END as [end],
    
    Column5 - mRNA_start + 1 as newend,
  
    cd.Column6 as score,  
    cd.Column7 as strand,  
    cd.Column6 as frame,  
    cd.Column6 as attribute  
  
    FROM 
    [1123].[CDS GFF with Gene start and stop] cd
   
    Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


  SELECT
    cd.Column9 as seqname,  
    cd.Column2 as source,  
    cd.Column3 as feature, 
   
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else mRNA_end - Column4 + 1
    END as start,
    
    Column4 - mRNA_start + 1 as newstart,
    
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else Column4 - mRNA_end + 1
    END as nesxstart,
  
    Case when Column7 = '+'
    then Column5 - mRNA_start + 1
    Else mRNA_end - Column5 + 1
    END as [end],
    
    Column5 - mRNA_start + 1 as newend,
  
    cd.Column6 as score,  
    cd.Column7 as strand,  
    cd.Column6 as frame,  
    cd.Column6 as attribute  
  
    FROM 
    [1123].[CDS GFF with Gene start and stop] cd
   
    Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


  SELECT
    cd.Column9 as seqname,  
    cd.Column2 as source,  
    cd.Column3 as feature, 
   
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else mRNA_end - Column4 + 1
    END as start,
    
    Column4 - mRNA_start + 1 as newstart,
    
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else mRNA_end - Column5 + 1
    END as nesxstart,
  
    Case when Column7 = '+'
    then Column5 - mRNA_start + 1
    Else mRNA_end - Column5 + 1
    END as [end],
    
    Column5 - mRNA_start + 1 as newend,
  
    cd.Column6 as score,  
    cd.Column7 as strand,  
    cd.Column6 as frame,  
    cd.Column6 as attribute  
  
    FROM 
    [1123].[CDS GFF with Gene start and stop] cd
   
    Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


  SELECT
    cd.Column9 as seqname,  
    cd.Column2 as source,  
    cd.Column3 as feature, 
   
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else mRNA_end - Column4 + 1
    END as start,
    
    Column4 - mRNA_start + 1 as newstart,
    
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else mRNA_end - Column5 + 1
    END as nesxstart,
  
    Case when Column7 = '+'
    then Column5 - mRNA_start + 1
    Else mRNA_end - Column5 + 1
    END as [end],
    
    Column5 - mRNA_start + 1 as newend,
    
    Case when Column7 = '+'
    then Column5 - mRNA_start + 1
    Else mRNA_end - Column4 + 1
    END as newsxend,
  
    cd.Column6 as score,  
    cd.Column7 as strand,  
    cd.Column6 as frame,  
    cd.Column6 as attribute  
  
    FROM 
    [1123].[CDS GFF with Gene start and stop] cd
   
    Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


  SELECT
    cd.Column9 as seqname,  
    cd.Column2 as source,  
    cd.Column3 as feature, 
    
    Case when Column7 = '+'
    then Column4 - mRNA_start + 1
    Else mRNA_end - Column5 + 1
    END as start,
  
    Case when Column7 = '+'
    then Column5 - mRNA_start + 1
    Else mRNA_end - Column4 + 1
    END as [end],
  
    cd.Column6 as score,  
    cd.Column7 as strand,  
    cd.Column6 as frame,  
    cd.Column6 as attribute  
  
    FROM 
    [1123].[CDS GFF with Gene start and stop] cd
   
    Order by Column1 Desc, Column9 --makes it easy to see big genes


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].[BiGill_methratio_gene_genomic_F.txt] bg
where 
context like '__CG_' --_=single character wildcard
and
CT_Count > 9


________________________________________


SELECT * 
FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty 
where context like '__CG_' --_=single character wildcard


________________________________________


Select Count (*) from
  (
SELECT * 
FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty 
where context like '__CG_' --_=single character wildcard
  ) boop


________________________________________


Select Count (*) from
  (
SELECT * 
FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty 
  ) boop


________________________________________



SELECT * 
FROM [1123].[BiGO_betty_plain_methratio_v1.txt] betty 




________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[BiGill_methratio_v9_A.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count > 9


________________________________________


SELECT seqname FROM [1123].[BiGill_methratio_v9_A_GFF]


________________________________________


SELECT * 
  FROM [1123].[BiGill_methratio_v9_A.txt]
  Order by rev_G_count Desc
  



________________________________________


SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count > 9
  


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count > 9
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where eff_CT_count > 9
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where eff_CT_count >=10
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=10
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=10
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  and context like '__CG_'
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  and context like '__CG_'
  and strand = '-'
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  and context like '__CG_'
  and strand = '+'
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  and context like '__CA_'
  and strand = '+'
  ) pls


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[BiGO_betty_plain_methratio_v1.txt] betty 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >=5


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[BiGill_methratio_v9_A.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5


________________________________________


SELECT 
chr as seqname,  
pos as start,
pos + 1 as [end],
'CpG' as feature, 
ratio as score  

FROM [1123].     
[BiGill_methratio_v9_A.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5


________________________________________


SELECT 
chr as seqname,  
pos as start,
pos + 1 as [end],
'CG' as feature, 
ratio as score  

FROM [1123].     
[BiGill_methratio_v9_A.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5


________________________________________


SELECT 
chr as seqname,  
pos - 1 as start,
pos + 1 as [end],
'CG' as feature, 
ratio as score  

FROM [1123].     
[BiGill_methratio_v9_A.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5


________________________________________


SELECT 
chr as seqname,  
pos - 1 as start,
pos + 1 as [end], -- compensating for going to zero-based?
'CG' as feature, 
ratio as score  

FROM [1123].     
[BiGill_methratio_v9_A.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5


________________________________________


SELECT * FROM [1123].[Mgo_RNAseq_transcript]


________________________________________


SELECT * FROM [1123].[Mgo_RNAseq_transcript]


________________________________________


SELECT
  Chromosome,
  "Chromosome region start",
  "Chromosome region end"
  
  FROM [1123].[Mgo_RNAseq_transcript]


________________________________________


SELECT *,
  Chromosome,
  "Chromosome region start",
  "Chromosome region end"
  
  FROM [1123].[Mgo_RNAseq_transcript]


________________________________________


SELECT *,
  Chromosome,
  "Chromosome region start",
  "Chromosome region end",
  "Feature ID",
  "Expression Values"
  
  FROM [1123].[Mgo_RNAseq_transcript]
  



________________________________________


SELECT
  Chromosome,
  "Chromosome region start",
  "Chromosome region end",
  "Feature ID",
  "Expression Values"
  
  FROM [1123].[Mgo_RNAseq_transcript]
  
Order by "Expression Values"


________________________________________


SELECT
  Chromosome,
  "Chromosome region start",
  "Chromosome region end",
  "Feature ID",
  "Expression Values"
  
  FROM [1123].[Mgo_RNAseq_transcript]
  
Order by "Expression Values" Desc


________________________________________


SELECT
  Chromosome,
  "Chromosome region start",
  "Chromosome region end",
  'exon' as Feature,
  "Expression Values"
  
  FROM [1123].[Mgo_RNAseq_transcript]
  
Order by "Expression Values" Desc


________________________________________


SELECT
  Chromosome,
  "Chromosome region start" - 1 as start,
  "Chromosome region end",
  'exon' as Feature,
  "Expression Values"
  
  FROM [1123].[Mgo_RNAseq_transcript]
  
Order by "Expression Values" Desc


________________________________________


SELECT 
chr as seqname,  
pos - 1 as start, -- compensating for going to zero-based?
pos + 1 as [end], 
'CG' as feature, 
ratio as score  

FROM [1123].     
[BiGO_betty_plain_methratio_v1.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5


________________________________________


SELECT * 
  FROM [1123].[qDOD_Zhang_Gil_gene_RNA-seq]


________________________________________


SELECT 
 Chromosome as feature,
 "Chromosome region start" - 1 as start,
 "Chromosome region end" as [end],
 RPKM 
  
  FROM [1123].[qDOD_Zhang_Gil_gene_RNA-seq]


________________________________________


SELECT 
 Chromosome as feature,
 "Chromosome region start" - 1 as start,
 "Chromosome region end" as [end],
  'gene' as feature,
 RPKM 
  
  FROM [1123].[qDOD_Zhang_Gil_gene_RNA-seq]


________________________________________


SELECT 
 Chromosome,
 "Chromosome region start" - 1 as start,
 "Chromosome region end" as [end],
  'gene' as feature,
 RPKM 
  
  FROM [1123].[qDOD_Zhang_Gil_gene_RNA-seq]


________________________________________


SELECT 
Chromosome,
 "Chromosome region start" - 1 as start,
 "Chromosome region end" as [end],
'gene' as feature,
RPKM as Mgo_RPKM
  FROM [1123].[qDOD_Zhang_Mgo_gene_RNA-seq]


________________________________________


SELECT CAS001,
CASE WHEN CAS001=2 THEN 'NM'
     WHEN CAS001=1 THEN 'M'
     WHEN CAS001=0 THEN 'U' END
AS CAS001MethStat
FROM [412].[summed presence absence fragment peaks]


________________________________________


SELECT
Column2 - 1 as NewColumn  
  
FROM [267].[Methylated_CG_BED_WholeGenome.bed]


________________________________________


SELECT
Column2 - 1 as NewColumn,  
Column3 + 1 as AnotherNewColumn  
FROM [267].[Methylated_CG_BED_WholeGenome.bed]


________________________________________


SELECT 
  count(CAS001MethStat)
  
  
  FROM [412].[primer 1 methylation status]


________________________________________


SELECT 
  count(CAS001MethStat)

  
  FROM [412].[primer 1 methylation status]
  
    Where CAS001MethStat like 'U'


________________________________________


SELECT 
  Count(*)
  
  
  FROM [412].[primer 1 methylation status]


________________________________________


SELECT 
  Count(*)
  
  
  FROM [412].[primer 1 methylation status]
  
  group by CAS001



________________________________________


SELECT 
*
  
  
  
  FROM [412].[primer 1 methylation status]
  




________________________________________


SELECT *,
1 as Column1  
  
  FROM [1123].[Zhang_Mgo_gene_RNA-seq_IGV]


________________________________________


SELECT *,
'Emp' + CAST(start as varchar(16))   
  
  FROM [1123].[Zhang_Mgo_gene_RNA-seq_IGV]


________________________________________


SELECT *,
('EMP'+right('00'+CONVERT([varchar](5),[start]),(5)))

  FROM [1123].[Zhang_Mgo_gene_RNA-seq_IGV]


________________________________________


SELECT *,
('EMP'+right('00'+CONVERT([varchar](5),[start]),(5))) as newcol

  FROM [1123].[Zhang_Mgo_gene_RNA-seq_IGV]


________________________________________


SELECT *,
('EMP'+right('00'+CONVERT([varchar](5),[start]),(5))) as newcol
,
ROW_NUMBER ()
OVER (PARTITION BY [start] ORDER BY [end] DESC) AS [new col name]
  FROM [1123].[Zhang_Mgo_gene_RNA-seq_IGV]


________________________________________


SELECT count(*)  
  
  
  FROM [1123].[sr primer 1 methylation status.csv]


________________________________________


SELECT count(*)  
  
  
  FROM [1123].[sr primer 1 methylation status.csv]
  
  group by ID



________________________________________


SELECT count(CAS001MethStat)  
  
  
  FROM [1123].[sr primer 1 methylation status.csv]
  
  group by ID



________________________________________


SELECT * 
  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID" 
  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID",
 clc."Experiment - Fold Change (original values)" 
  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID",
 clc."Experiment - Fold Change (original values)", 
 clc."400 - Means",
 clc."1000 - Means" 

  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID",
 ex."Feature ID",
 clc."Baggerley's 1358: 1000 vs 400 original values - P-value",
 ex."P-value", 
 clc."Experiment - Fold Change (original values)", 
 ex."Fold Change (original values)", 
 clc."400 - Means",
 clc."1000 - Means"

  

  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID" as CLCID,
 ex."Feature ID",
 clc."Baggerley's 1358: 1000 vs 400 original values - P-value",
 ex."P-value", 
 clc."Experiment - Fold Change (original values)", 
 ex."Fold Change (original values)", 
 clc."400 - Means",
 clc."1000 - Means"

  

  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID" as CLCID,
 ex."Feature ID" as SuppID,
 clc."Baggerley's 1358: 1000 vs 400 original values - P-value" as CLCp,
 ex."P-value" as SuppP, 
 clc."Experiment - Fold Change (original values)" as CLCfold, 
 ex."Fold Change (original values)" as SuppFold, 
 clc."400 - Means",
 clc."1000 - Means"

  

  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID" as CLCID,
 ex."Feature ID" as SuppID,
 clc."Baggerley's 1358: 1000 vs 400 original values - P-value" as CLCp,
 ex."P-value" as SuppP, 
 clc."Experiment - Fold Change (original values)" as CLCfold, 
 ex."Fold Change (original values)" as SuppFold, 
 clc."400 - Means",
 ex.RPKM as SuppRPKM, 
 clc."1000 - Means",
 ex.RPKM1 as SuppRPKM1 

  

  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID" as CLCID,
 ex."Feature ID" as SuppID,
 clc."Baggerley's 1358: 1000 vs 400 original values - P-value" as CLCp,
 ex."P-value" as SuppP, 
 clc."Experiment - Fold Change (original values)" as CLCfold, 
 ex."Fold Change (original values)" as SuppFold, 
 clc."400 - Means",
 ex.RPKM1 as SuppRPKM1, 
 clc."1000 - Means",
 ex.RPKM as SuppRPKM 

  

  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID" as CLCID,
 ex."Feature ID" as SuppID,
 ex."Target description", 
 clc."Baggerley's 1358: 1000 vs 400 original values - P-value" as CLCp,
 ex."P-value" as SuppP, 
 clc."Experiment - Fold Change (original values)" as CLCfold, 
 ex."Fold Change (original values)" as SuppFold, 
 clc."400 - Means",
 ex.RPKM1 as SuppRPKM1, 
 clc."1000 - Means",
 ex.RPKM as SuppRPKM 

  

  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID" as CLCID,
 ex."Feature ID" as SuppID,
 ex."Target description",
 ex."GO enrichment",
 ex."GO biological process",
 clc."Baggerley's 1358: 1000 vs 400 original values - P-value" as CLCp,
 ex."P-value" as SuppP, 
 clc."Experiment - Fold Change (original values)" as CLCfold, 
 ex."Fold Change (original values)" as SuppFold, 
 clc."400 - Means",
 ex.RPKM1 as SuppRPKM1, 
 clc."1000 - Means",
 ex.RPKM as SuppRPKM 

  

  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT
 clc."Feature ID" as CLCID,
 ex."Feature ID" as SuppID,
 ex."Target description",
 ex."GO enrichment",
 ex."GO biological process",
 clc."Baggerley's 1358: 1000 vs 400 original values - P-value" as CLCp,
 ex."P-value" as SuppP, 
 clc."Experiment - Fold Change (original values)" as CLCfold, 
 ex."Fold Change (original values)" as SuppFold, 
 clc."400 - Means" as CLC400,
 ex.RPKM1 as SuppRPKM1, 
 clc."1000 - Means" as CLC1000,
 ex.RPKM as SuppRPKM 

  

  
FROM [1123].[table_CLC_Ruphi_400_1000.csv]clc

left join  [1123].[table_Ruphi_RNAseq_supp.csv]ex
  on clc.[Feature ID] = ex.[Feature ID]


________________________________________


SELECT * 
  FROM [1123].[CLCvExcel_RuphiRNAseq]
  
  Where "GO enrichment" like $



________________________________________


SELECT * 
  FROM [1123].[CLCvExcel_RuphiRNAseq]
  
  Where "GO enrichment" like '*'



________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=10
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
    *, 
    cast (ratio as float) as score 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  and context like '__CG_'
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  and context like '__CG_'
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  and context like '__CG_'
  and ratio like 'NA' 
  ) pls


________________________________________


Select count(*) from
  (
SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  and context like '__CG_'
  and ratio <> 'NA' 
  ) pls


________________________________________



SELECT 
  * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  Where CT_count >=5
  and context like '__CG_'
  and ratio <> 'NA' 

  




________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  
  where Organism like '_oy_'



________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  
  where Organism like '_gig_'



________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  
  where Organism like '_rat_'



________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  
  where Organism like '_pon_'



________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  
  where Organism like '_.gigas_'



________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  
  where Organism like 'gas'



________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  
  where Organism like 'rat'
  
  



________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "date ordered" like '_2013'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "date ordered" like '_7'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Organism" like 'man'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Organism" like 'human'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Organism" like 'C.gigas'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Organism" like '_gigas'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Organism" like '%gigas'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Organism" like '%gigas'
  or
  Organism like '%oyst%'



________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Organism" like '%gigas'
  or
  Organism like '%oyst%'
  ANd
  "Designed By" like 'Brad%'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Organism" like '%gigas'
  or
  Organism like '%oyst%'
AND
  "Designed By" like 'Brad%'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Organism" like '%gigas'
AND
  "Designed By" like 'Brad%'


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Designed By" like 'Brad%'
  


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Designed By" like '%chi%'
  


________________________________________


SELECT * 
  FROM [1123].[RobertsLab_PrimerDatabase]
  Where "Designed By" like '%Chi%'
  


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[BiGO_betty_plain_methratio_v1.txt] betty 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count > 4


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[BiGO_betty_plain_methratio_v1.txt] betty 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count > 4


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score, 
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[BiGO_betty_plain_methratio_v1.txt] betty 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5

  


________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
WHERE [ratio] <> 'NA'



________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
WHERE [ratio] <> 'NA'



________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score, 
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[clean_BiGo_methratio_v1] betty 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5
and cast(ratio as float) >= 0.500


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score, 
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[clean_BiGo_methratio_v1] betty 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5
and cast(ratio as float) >= 0.500


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score, 
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[clean_BiGo_methratio_v1] betty 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5
and ratio >= 0.500


________________________________________


SELECT Count (*)
  From 
  (
SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score, 
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[clean_BiGo_methratio_v1] 
where 
context like '__CG_' --modified respectively for 
and
CT_Count >= 5
  and ratio >= 0.500) betty


________________________________________


SELECT Count (*)
  From 
  (
SELECT 
*
FROM [1123].     
[clean_BiGo_methratio_v1] 
where 
context like '__CG_' --modified respectively for 
and
CT_Count >= 5
  and ratio >= 0.500) betty


________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[clean_BiGo_methratio_v1] 
where 
context like '__CA_' --modified respectively for 
and
CT_Count >= 5
and ratio >= 0.500)
betty


________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[clean_BiGo_methratio_v1] 
where 
context like '__CC_' --modified respectively for 
and
CT_Count >= 5
and ratio >= 0.500)
betty


________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[clean_BiGo_methratio_v1] 
where 
context like '__CT_' --modified respectively for 
and
CT_Count >= 5
and ratio >= 0.500)
betty


________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[clean_BiGo_methratio_v1] 
where 
context like '__CT_' --modified respectively for 
and
CT_Count >= 5
and ratio =0)
betty


________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[clean_BiGo_methratio_v1] 
where 
context like '__CT_' --modified respectively for 
and
CT_Count >= 5
and ratio = 0)
betty


________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[clean_BiGo_methratio_v1] 
where 
context like '__CA_' --modified respectively for 
and
CT_Count >= 5
and ratio = 0)
betty


________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[clean_BiGo_methratio_v1] 
where 
context like '__CG_' --modified respectively for 
and
CT_Count >= 5
and ratio = 0)
betty


________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[clean_BiGo_methratio_v1] 
where 
context like '__CC_' --modified respectively for 
and
CT_Count >= 5
and ratio = 0)
betty


________________________________________


SELECT  
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
cast(ratio as float) as score,  
strand,  
'.' as frame,  
'.' as attribute
FROM [1123].     
[BiGill_methratio_v9_A.txt] 

where 
context like '__CG_'
and CT_Count >= 5 
and ratio <> 'NA'  


________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
FROM [1123].[BiGill_methratio_v9_A.txt]
WHERE [ratio] <> 'NA'


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,   
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[clean_BiGill_methratio_v9_A] 
where 
context like '__CG_'
and
  CT_Count >= 5 


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,   
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].     
[clean_BiGill_methratio_v9_A] 
where 
context like '__CG_'
and
  CT_Count >= 5 
and
 ratio >= 0.500


________________________________________


SELECT
["Feature ID"] as ID  
  
 FROM [1123].[table_solid0078_20091105_RobertsLab_GE_F3 trimmed RNA-Seq.txt]


________________________________________


SELECT
["Feature ID"] as ID,
["Unique gene reads"] as UniqueReads,
["Total gene reads"] as TotalReads,
["RPKM"] as RPKM  
 
  
 FROM [1123].[table_solid0078_20091105_RobertsLab_GE_F3 trimmed RNA-Seq.txt]


________________________________________


SELECT * 
  FROM [1123].[solid0078_20091105_RobertsLab_GE_F3 trimmed RNA-Seq.txt]
  
  Where UniqueReads > 10
  



________________________________________


Select * from
 [1123].[solid0078_20091105_RobertsLab_GE_F3 trimmed RNA-Seq.txt]
  


________________________________________


Select * from
 [1123].[solid0078_20091105_RobertsLab_GE_F3 trimmed RNA-Seq.txt]oshv
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]des
 on oshv.ID = des.CGI_ID
  
  


________________________________________


Select * from
 [1123].[solid0078_20091105_RobertsLab_GE_F3 trimmed RNA-Seq.txt]oshv
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]des
 on oshv.ID = des.CGI_ID
  
  where UniqueReads >=10


________________________________________


Select * from
 [1123].[solid0078_20091105_RobertsLab_GE_F3 trimmed RNA-Seq.txt]oshv
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]des
 on oshv.ID = des.CGI_ID
  
  where UniqueReads >=10


________________________________________


SELECT Distinct * 
  
  FROM [1123].[qDOD_Cgigas_GO_GOslim]


________________________________________


SELECT * 
  FROM [1123].[Cgigas Larvae RNA-Seq OsHV UR10]ur
  left join
  [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]ds
  on
  ur.ID = ds.CGI_ID



________________________________________


SELECT 
  ID,
  SPID1,
  GOID,
  term
  FROM [1123].[Cgigas Larvae RNA-Seq OsHV UR10]ur
  left join
  [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]ds
  on
  ur.ID = ds.CGI_ID



________________________________________


SELECT DISTINCT
  ID,
  SPID1,
  GOID,
  term
  FROM [1123].[Cgigas Larvae RNA-Seq OsHV UR10]ur
  left join
  [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]ds
  on
  ur.ID = ds.CGI_ID



________________________________________


SELECT DISTINCT
  ID,
  SPID1,
  GOID,
  term,
  aspect
  FROM [1123].[Cgigas Larvae RNA-Seq OsHV UR10]ur
  left join
  [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]ds
  on
  ur.ID = ds.CGI_ID



________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].[clean_BiGo_methratio_v1] betty 
where 
context like '__CG_' 
and
CT_Count >= 5
and
ratio > 0.5



________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].[clean_BiGo_methratio_v1]
where 
context like '__CG_' 
and
CT_Count >= 5
and
ratio > 0.5



________________________________________


SELECT 
 Column1 as ContigID,
 Column5 as SPID,
 Column17 as evalue 
  
  FROM [1123].[table_lft_BlackAbalone_v3_swissprot_blastout_d]


________________________________________


SELECT * 
  FROM [1123].[lft_BlackAbalone_v3_swissprot_blastout_d]d
  left join
  [1123].[SPID and GO Numbers]go
  on
  d.SPID = go.SPID
  



________________________________________


SELECT distinct * 
  FROM [1123].[lft_BlackAbalone_v3_swissprot_blastout_d]d
  left join
  [1123].[SPID and GO Numbers]go
  on
  d.SPID = go.SPID
  



________________________________________


SELECT distinct * 
  FROM [1123].[lft_BlackAbalone_v3_swissprot_blastout_d]d
  left join
  [1123].[SPID and GO Numbers]go
  on
  d.SPID = go.SPID
  
 


________________________________________


SELECT distinct * 
  FROM [1123].[lft_BlackAbalone_v3_swissprot_blastout_d]d
  left join
  [1123].[SPID and GO Numbers]go
  on
  d.SPID = go.SPID
  left join 
  [1123].[GO_to_GOslim]slim
  on 
  go.GOID = slim.GO_id
 


________________________________________


SELECT distinct * 
  FROM [1123].[lft_BlackAbalone_v3_swissprot_blastout_d]d
  left join
  [1123].[SPID and GO Numbers]go
  on
  d.SPID = go.SPID
  left join 
  [1123].[GO_to_GOslim]slim
  on 
  go.GOID = slim.GO_id
  
  
 


________________________________________


SELECT Distinct 
  * 
  FROM [1123].[SPID and GO Numbers]


________________________________________


SELECT Distinct
  ContigID,
  GOSlim_bin
  
  FROM [1123].[lft_BlackAbalone_v3_GO]
  Where aspect like 'P'
  
  



________________________________________


SELECT Distinct
  ContigID,
  GOSlim_bin,
  evalue
  
  FROM [1123].[lft_BlackAbalone_v3_GO]
  Where aspect like 'P'
  
  



________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].[clean_BiGo_methratio_v1]
where 
context like '__CG_' 
and
CT_Count >= 5




________________________________________


SELECT Distinct
  ContigID,
  GOSlim_bin,
  evalue
  FROM [1123].[lft_BlackAbalone_v3_GO]
  Where aspect like 'P'


________________________________________


SELECT Distinct
  ContigID,
  GOSlim_bin,
  evalue
  FROM [1123].[lft_BlackAbalone_v3_GO]
  Where aspect like 'P'
  and 
  evalue < 1E-10



________________________________________


SELECT Distinct
  ContigID,
  GOSlim_bin,
  evalue
  FROM [1123].[lft_BlackAbalone_v3_GO]
  Where 
  evalue < 1E-10
  
  



________________________________________


SELECT Distinct
  ContigID,
  SPID
  FROM [1123].[lft_BlackAbalone_v3_GO]
  Where 
  evalue < 1E-10
  
  



________________________________________


SELECT Distinct
  ContigID,
  GOSlim_bin,
  evalue
  FROM [1123].[lft_BlackAbalone_v3_GO]
  Where aspect like 'P'


________________________________________


SELECT 
chr as seqname, 
ratio as score
FROM [1123].[clean_BiGo_methratio_v1]
where 
context like '__CG_' 
and
CT_Count >= 5


________________________________________


SELECT distinct 
  * FROM [412].[ProtPep for all oysters.txt]


________________________________________


SELECT PeptideSequence,
  sum([11_01 TotalArea]) as [11_01 TotalArea]

  
  
  
  FROM [412].[pep peak areas all oysters.txt]
  
  Group by PeptideSequence



________________________________________


SELECT * FROM [1123].[OAMS_SkylineData.csv]
  Where 
 PrecursorCharge = 2 
  and
 Fragmention like
  'precursor'
  



________________________________________


Select PeptideSequence,
  count(*) as cnt
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]
HAVING COUNT (*) = 1
  






________________________________________


Select PeptideSequence,
  count(*) as cnt
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]
HAVING COUNT (*) = 1
  






________________________________________


Select PeptideSequence,
  count(*) as cnt
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]
HAVING COUNT (*) = 2
  






________________________________________


Select PeptideSequence,
  count(*) as cnt
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]
HAVING COUNT (*) > 2
  






________________________________________


Select PeptideSequence
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]
  HAVING COUNT (*) = 1






________________________________________


Select PeptideSequence,
  count(*) as cnt
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]
  HAVING COUNT (*) = 1






________________________________________


SELECT COUNT (*)
FROM
(
Select PeptideSequence,
  count(*) as cnt
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]
  HAVING COUNT (*) = 1
  ) go






________________________________________


SELECT COUNT (*)
FROM
(
Select PeptideSequence,
  count(*) as cnt
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]
  HAVING COUNT (*) > 1
  ) go






________________________________________


SELECT COUNT (*)
FROM
(
Select Distinct PeptideSequence
from [1123].[OAMS_Skyline_p2_c_]
  ) go






________________________________________


Select Count (*) 
  from
(
SELECT * 
  FROM 
  [412].[pep peak areas all oysters2.txt]
)
go
  


________________________________________


Select Count (*) 
  from
(
SELECT PeptideSequence,
  Count (*) as cnt 
  FROM 
  [412].[pep peak areas all oysters2.txt]
Group by PeptideSequence
  Having Count (*) > 1
)
go
  


________________________________________


SELECT * FROM [412].[peptide peak areas with protein associations] WHERE [peptide sequence] IN
  (SELECT [peptide sequence]
    FROM [412].[peptide peak areas with protein associations]
    GROUP BY [peptide sequence]
    HAVING COUNT (*) <2)



________________________________________



Select PeptideSequence,
  count(*) as cnt
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]
HAVING COUNT (*) > 2


________________________________________



Select PeptideSequence,
  count(*) as cnt
from [1123].[OAMS_Skyline_p2_c_]
GROUP BY [PeptideSequence]




________________________________________


SELECT 
  Column1 as Column1
  
  
  FROM [1123].[table_Cgigas_v9_intron.gff]


________________________________________


SELECT 
  Column1 as Column1,
  Column2 as Column2,
  'intron' as Column3
  
  
  FROM [1123].[table_Cgigas_v9_intron.gff]


________________________________________


SELECT 
  Column1 as Column1,
  Column2 as Column2,
  'intron' as Column3,
  Column4 as Column4,
  Column5 as Column5,
  '.' as Column6,
  Column7 as Column7,
  Column8 as Column8,
  Column9 as Column9
  
  FROM [1123].[table_Cgigas_v9_intron.gff]


________________________________________


SELECT 
  Column1 as Column1,
  'flankbed' as Column2,
  Column3 as Column3,
  Column4 as Column4,
  Column5 as Column5,
  '.' as Column6,
  Column7 as Column7,
  Column8 as Column8,
  Column9 as Column9
  
  
  

  FROM [1123].[table_Cgigas_v9_1k5p_gene_promoter.gff]


________________________________________


SELECT
cd.Column9 as seqname,  
cd.Column2 as source,  
cd.Column3 as feature, 

Case when Column7 = '+'
then Column4 - mRNA_start + 1
Else mRNA_end - Column4 + 1
END as start
  


FROM 
[1123].[CDS GFF with Gene start and stop] cd


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].[clean_BiGo_methratio_v1]
where 
context like '__CG_' 
and
CT_Count >= 5
and
ratio > 0.5


________________________________________


SELECT * FROM [1123].[clean_BiGo_methratio_v1] 
where 
context like '__CG_' 
and
CT_Count >= 5
and ratio >= 0.500 


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute  

FROM [1123].[clean_BiGo_methratio_v1]
where 
context like '__CG_' 
and
CT_Count >= 5
and
ratio >= 0.5


________________________________________


SELECT 
 ["Chromosome region start"] 
  
  FROM [1123].[table_BiGoRNAseq_exon_exp_1.txt]


________________________________________


SELECT
 ["Chromosome"] as seqname,
 'CLC_RNAseq' as source,
 'TranscriptExp' as feature, 
 ["Chromosome region start"] as start,
  ["Chromosome region start"] as [end],
  ["RPKM"] as score,
  '.' as strand,
   '.' as frame,
   ["Gene name"] as attribute
  FROM [1123].[table_BiGoRNAseq_exon_exp_1.txt]


________________________________________


SELECT
 ["Chromosome"] as seqname,
 'CLC_RNAseq' as source,
 'TranscriptExp' as feature, 
 ["Chromosome region start"] as start,
  ["Chromosome region start"] as [end],
  ["RPKM"] as score,
  '.' as strand,
   '.' as frame,
   ["Gene name"] as attribute
  FROM [1123].[table_BiGoRNAseq_exon_exp_1.txt]


________________________________________


SELECT
 ["Chromosome"] as seqname,
 ["Chromosome region start"] as start,
  ["Chromosome region start"] as [end],
  ["RPKM"] as score
  FROM [1123].[table_BiGoRNAseq_exon_exp_1.txt]


________________________________________


SELECT
 ["Chromosome"] as seqname,
 ["Chromosome region start"] as start,
  ["Chromosome region start"] as [end],
  'tr_expression' as feature,
  ["RPKM"] as score
  
  FROM [1123].[table_BiGoRNAseq_exon_exp_1.txt]


________________________________________


SELECT
 ["Chromosome"] as seqname,
 ["Chromosome region start"] as start,
  ["Chromosome region end"] as [end],
  'tr_expression' as feature,
  ["RPKM"] as score
  
  FROM [1123].[table_BiGoRNAseq_exon_exp_1.txt]


________________________________________


SELECT Count (*)
 From
 (  
 Select
   * from
  [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]
  ) ns
    

  
  



________________________________________


SELECT Count (*)
 From
 (  
 Select
   * from
  [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]
  ) ns
    Group by Column14

  
  



________________________________________


SELECT Count (*)
 From
 (  
 Select
   Column14 from
  [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]
  ) ns
    Group by Column14

  
  



________________________________________


SELECT Count (*)
 From
 (  
 Select
   column13,
   Column14 from
  [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]
  ) ns
    Group by Column14

  
  



________________________________________


SELECT Count (Column13)
 From
 (  
 Select
   column13,
   Column14 from
  [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]
  ) ns
    Group by Column14

  
  



________________________________________


SELECT [Column14], count([Column11])
 From

  [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]

    Group by Column14

  
  



________________________________________


SELECT [Column14], count([Column1])
 From
[1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]
Group by Column14

  
  



________________________________________


SELECT [Column14], count([Column1])
 From
[1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]
Group by Column14

  
  


________________________________________


SELECT Column1,
  Column13,
  Column2
  
  
  FROM [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]


________________________________________


SELECT Column1,
  Column13,
  Column2
  
  
  FROM [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]


________________________________________


SELECT Column1,
  Column13
  
  
  FROM [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]


________________________________________


SELECT Column1,
  Column13
  
  
  FROM [1123].[BiGo_RNAseq_unmapped_nt_blastout_taxa2]


________________________________________


SELECT Distinct
  A0A000 as SPID,"GO:0003824" as GOID FROM [354].[SPID_GOnumber.txt]


________________________________________


SELECT * FROM [748].[BlkAb_DESeq_SPID]


________________________________________


SELECT * 
  FROM [748].[BlkAb_DESeq_SPID]de
  left join [1123].[lft_BlackAbalone_v3_nt_blastout_taxa3]lft
  on
  de.id = lft.Column1



________________________________________


SELECT 
 id,
 foldchange,
 pval,
 de.Column3,
 evalue,
 Column13 as GeneDes 
  FROM [748].[BlkAb_DESeq_SPID]de
  left join [1123].[lft_BlackAbalone_v3_nt_blastout_taxa3]lft
  on
  de.id = lft.Column1



________________________________________


SELECT 
 id,
 foldchange,
 pval,
 de.Column3 as SPID,
 evalue,
 Column13 as GeneDes 
  FROM [748].[BlkAb_DESeq_SPID]de
  left join [1123].[lft_BlackAbalone_v3_nt_blastout_taxa3]lft
  on
  de.id = lft.Column1



________________________________________


SELECT 
 id,
 foldchange,
 pval,
 de.Column3 as SPID,
 evalue,
 Column13 as NCBI_nt_Des
  
  FROM [748].[BlkAb_DESeq_SPID]de
  left join [1123].[lft_BlackAbalone_v3_nt_blastout_taxa3]lft
  on
  de.id = lft.Column1



________________________________________


SELECT 
 id,
 foldchange,
 pval,
 de.Column3 as SPID,
 evalue,
 Column13 as NCBI_nt_Des
  
  FROM [748].[BlkAb_DESeq_SPID]de
  left join [1123].[lft_BlackAbalone_v3_nt_blastout_taxa3]lft
  on
  de.id = lft.Column1


________________________________________


SELECT 
 id,
 foldchange,
 pval,
 Column13 as NCBI_nt_Des
  
  FROM [748].[BlackAB_DESeq.txt]de
  left join [1123].[lft_BlackAbalone_v3_nt_blastout_taxa3]lft
  on
  de.id = lft.Column1


________________________________________


SELECT 
 id,
 foldchange,
 pval,
 Column13 as NCBI_nt_Des
  
  FROM [748].[BlackAB_DESeq.txt]de
  left join [1123].[lft_BlackAbalone_v3_nt_blastout_taxa3]lft
  on
  de.id = lft.Column1


________________________________________


SELECT Column1,
 Column4,
 Column5,
 'BiGillExonExp' as Column4
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  Column10 / Column12 as Cov_bp
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  (Column10 / Column12)*1000 as Cov_bp
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  (Column10 / Column12)*100 as Cov_bp
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  (Column10 / Column12)*10 as Cov_bp
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  (Column10 / Column12) as Cov_bp
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  (Column10 / Column12) as feat_bp
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  (Column10 / Column12) as feat_bp
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  (Column10 / Column12)*100 as feat_bp
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  ((cast([Column10]as float)/(cast([Column12]as float))))
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  ((cast([Column10]as float)/(cast([Column12]as float))))*10
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  ((cast([Column10]as float)/(cast([Column12]as float))))*1000
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  ((cast([Column10]as float)/(cast([Column12]as float)))) as feat_bp
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT Column1 as seqid,
 Column4 as start,
 Column5 as [end],
 'BiGillExonExp' as Feature,
  ((cast([Column10]as float)/(cast([Column12]as float)))) as feat_bp,
  Column9 as Gene
  FROM [1123].[BiGill_ThBAM_cov_exon_2.txt]


________________________________________


SELECT 
  sum(feat_bp)
  
  FROM [1123].[BiGill_RNAseq_exon]
  
  Group by Gene



________________________________________


SELECT 
  sum(feat_bp),
  count(feat_bp)
  
  FROM [1123].[BiGill_RNAseq_exon]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  count(feat_bp),
  sum(feat_bp)

  
  FROM [1123].[BiGill_RNAseq_exon]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  count(feat_bp),
  sum(feat_bp)

  
  FROM [1123].[BiGill_RNAseq_exon]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  count(feat_bp),
  stdev(feat_bp),
  sum(feat_bp)
  

  
  FROM [1123].[BiGill_RNAseq_exon]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  count(feat_bp) as count,
  stdev(feat_bp) as sd,
  sum(feat_bp) as sum,
  (stdev(feat_bp))/(sum(feat_bp)) as cv
  
  FROM [1123].[BiGill_RNAseq_exon]
  Group by Gene

Having  sum(feat_bp) > 0
    



________________________________________


SELECT 
  Gene,
  count(feat_bp) as count,
  stdev(feat_bp) as sd,
  sum(feat_bp) as sum,
  (stdev(feat_bp))/(sum(feat_bp)) as cv
  
  FROM [1123].[BiGill_RNAseq_exon]
  Group by Gene

  Having sum(feat_bp) > 0
    



________________________________________


SELECT 
  Gene,
  count(feat_bp) as count,
  stdev(feat_bp) as sd,
  sum(feat_bp) as sum,
  (stdev(feat_bp))/(sum(feat_bp)) as cv
  
  FROM [1123].[BiGill_RNAseq_exon]
  Group by Gene

  Having sum(feat_bp) > 0


________________________________________


SELECT 
 Column1,
 Column4,
 Column4, 
 'BiGill_cgM' as feature,
 Column6 
  
  
  FROM [1123].[Cgigas_gill_HTbisulfiteSeq_CG_methylated.txt]


________________________________________


SELECT 
 Column1,
 Column4,
 Column4, 
 'BiGill_cgM' as feature,
 Column6 
  
  
  FROM [1123].[Cgigas_gill_HTbisulfiteSeq_CG_methylated.txt]


________________________________________


SELECT * FROM [412].[NSAF based on avg SpC with SPIDs]
LEFT JOIN [354].[SPID_GOnumber.txt]
ON [412].[NSAF based on avg SpC with SPIDs].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT Distinct * FROM [412].[NSAF based on avg SpC with SPIDs]
LEFT JOIN [354].[SPID_GOnumber.txt]
ON [412].[NSAF based on avg SpC with SPIDs].SPID=[354].[SPID_GOnumber.txt].A0A000


________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
Where CGI_ID =
  'CGI_10011651'


________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
Where CGI_ID =
  'CGI_10023379'


________________________________________


SELECT * FROM [412].[NSAF based on avg SpC with SPIDs]


________________________________________


SELECT * 
  FROM [1123].[TJGR_CCD_domain_concise_Superfamily_def]
  where 
  Definition like '%repeat%'
  


________________________________________


SELECT * 
  FROM [1123].[TJGR_CCD_domain_concise_Superfamily_def]
  where 
  Definition like '%CpG%'
  


________________________________________


SELECT * 
  FROM [1123].[TJGR_CCD_domain_concise_Superfamily_def]
  where 
  Definition like '%CpG%'
  


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10006040'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10006040'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10006403'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10003515'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10006323'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10009035'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10015357'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10015360'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10004145'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10004144
  '



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10004144'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10004146'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10015174'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10004181'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10003883'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10008718'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10008719'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10008720'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10013762'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10011969'



________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = 'Vitello%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = 'Vitello_'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = 'Vitello%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = '%vitello%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = '%Vitello%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = '%estro%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = '%Estro%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = 'Estro%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = 'Estro_'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description = 'Act%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where description like 'Act%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where Description like 'Vitell%'


________________________________________


SELECT * FROM 
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  Where Description like 'Super%'


________________________________________


SELECT distinct * FROM [412].[NSAF averages, 5-fold, SPID, enriched]


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]


________________________________________


SELECT *
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF]g
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  g.seqname = sp.CGI_ID


________________________________________


SELECT *
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF]g
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  g.seqname = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[ExpressedGene_methstats]g
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  g.ID = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[ExpressedGene_methstats]g
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  g.ID = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[BiGill_pro_island1u_intersect_mCpG_mod.txt]pls
  left join
  [1123].[qDOD_Zhang_Gil_gene_RNA-seq]z
  on
  pls.Column9 = z.[Feature ID]


________________________________________


SELECT * FROM [1123].[BiGill_pro_island1u_intersect_mCpG_mod.txt]pls
  left join
  [1123].[qDOD_Zhang_Gil_gene_RNA-seq]z
  on
  pls.Column9 = z.[Feature ID]


________________________________________


SELECT * FROM [1123].[BiGill_pro_island1u_intersect_mCpG_mod.txt]pls
  left join
  [1123].[qDOD_Zhang_Gil_gene_RNA-seq]z
  on
  pls.Column9 = z.[Feature ID]


________________________________________


SELECT * FROM [1123].[BiGill_pro_island1u_intersect_mCpG_mod.txt]
  
  where Column9 = 'CGI_10000009'
  



________________________________________


SELECT * FROM [1123].[qDOD_Zhang_Gil_gene_RNA-seq]
  
  where [Feature ID] = 'CGI_10000009'
  



________________________________________


SELECT * FROM [1123].[qDOD_Zhang_Gil_gene_RNA-seq]
  
  where [Feature ID] = 'CGI_10003231'
  



________________________________________


SELECT * FROM [1123].[qDOD_Zhang_Gil_gene_RNA-seq]
  
  where [Feature ID] = 'CGI_10000009'
  



________________________________________


SELECT * FROM [1123].[qDOD_Zhang_Gil_gene_RNA-seq]
  
  where [Feature ID] = 'CGI_10000009 '
  



________________________________________


SELECT * FROM   [1123].[BiGill_pro_island1u_intersect_mCpG_mod.txt]pls
  left join
  [1123].[ExpressedGeneGil.txt]z
  on
  pls.Column9 = z.ID


________________________________________


SELECT * FROM   [1123].[BiGill_pro_island1u_intersect_mCpG_mod.txt]pls
  left join
  [1123].[ExpressedGeneGil.txt]z
  on
  pls.Column9 = z.ID


________________________________________


Select * from
[1123].[solid0078_20091105_RobertsLab_GE_F3 trimmed RNA-Seq.txt]oshv
left join
[1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]des
on oshv.ID = des.CGI_ID


________________________________________


SELECT DISTINCT
ID,
SPID1,
GOID,
term,
aspect
FROM [1123].[Cgigas Larvae RNA-Seq OsHV UR10]ur
left join
[1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]ds
on
ur.ID = ds.CGI_ID
  


________________________________________


SELECT * FROM [1123].[TJGR_prom_subgene_CGcount.txt]p
LEFT Join
  [1123].[BiGo_prom_subgene_mCGcount.txt]m
on
  p.Column9 = m.Column9


________________________________________


SELECT p.Column1 FROM [1123].[TJGR_prom_subgene_CGcount.txt]p
LEFT Join
  [1123].[BiGo_prom_subgene_mCGcount.txt]m
on
  p.Column9 = m.Column9


________________________________________


SELECT p.Column1,p.Column9,p.Column10 FROM [1123].[TJGR_prom_subgene_CGcount.txt]p
LEFT Join
  [1123].[BiGo_prom_subgene_mCGcount.txt]m
on
  p.Column9 = m.Column9


________________________________________


SELECT p.Column1,
  p.Column9 as Gene,
  p.Column10 
  
  FROM [1123].[TJGR_prom_subgene_CGcount.txt]p
LEFT Join
  [1123].[BiGo_prom_subgene_mCGcount.txt]m
on
  p.Column9 = m.Column9


________________________________________


SELECT p.Column1 as Scaffold,
  p.Column9 as GeneID,
  p.Column10 as CGcount,
  m.Column10 as mCGcount
  
  FROM [1123].[TJGR_prom_subgene_CGcount.txt]p
LEFT Join
  [1123].[BiGo_prom_subgene_mCGcount.txt]m
on
  p.Column9 = m.Column9


________________________________________


SELECT p.Column1 as Scaffold,
  p.Column9 as GeneID,
  p.Column10 as CGcount,
  m.Column10 as mCGcount,
  Case when p.Column10 = '0'
  then m.Column10
  Else m.Column10/p.Column10
 END as PerMeth
  
  FROM [1123].[TJGR_prom_subgene_CGcount.txt]p
LEFT Join
  [1123].[BiGo_prom_subgene_mCGcount.txt]m
on
  p.Column9 = m.Column9


________________________________________


SELECT 
  p.Column9 as GeneID,
  p.Column10 as CGcount,
  m.Column10 as mCGcount,
  Case when p.Column10 = '0'
  then m.Column10
  Else m.Column10/p.Column10
 END as PerMeth
  
  FROM [1123].[TJGR_prom_subgene_CGcount.txt]p
LEFT Join
  [1123].[BiGo_prom_subgene_mCGcount.txt]m
on
  p.Column9 = m.Column9


________________________________________


SELECT 
  p.Column9 as GeneID,
  p.Column10 as CGcount,
  m.Column10 as mCGcount,
  Case when p.Column10 = '0'
  then m.Column10
  Else (m.Column10/p.Column10)
 END as PerMeth
  
  FROM [1123].[TJGR_prom_subgene_CGcount.txt]p
LEFT Join
  [1123].[BiGo_prom_subgene_mCGcount.txt]m
on
  p.Column9 = m.Column9


________________________________________


SELECT 
  p.Column9 as GeneID,
  p.Column10 as CGcount,
  m.Column10 as mCGcount,
  Case when p.Column10 = '0'
  then m.Column10
  Else (m.Column10/p.Column10)
 END as PerMeth

  FROM [1123].[TJGR_prom_subgene_CGcount.txt]p
LEFT Join
  [1123].[BiGo_prom_subgene_mCGcount.txt]m
on
  p.Column9 = m.Column9


________________________________________


SELECT *
  FROM [1123].[BiGo_prom_subgene_PerMeth.txt]pr
  left join
  [1123].[BiGo_RNAseq_genes]exp
  on
  pr.GeneID = exp.["Feature ID"]


________________________________________


SELECT *
  FROM [1123].[BiGo_prom_subgene_PerMeth.txt]pr
  left join
  [1123].[BiGo_RNAseq_genes]exp
  on
  pr.GeneID = exp.["Feature ID"]


________________________________________


SELECT *
  FROM [1123].[table_BiGo_gene_PerMeth.txt]gene
  left join
  [1123].[BiGo_RNAseq_genes]exp
  on
  gene.GeneID = exp.["Feature ID"]


________________________________________


SELECT *
  FROM [1123].[table_BiGo_gene_PerMeth.txt]gene
  left join
  [1123].[BiGo_RNAseq_genes]exp
  on
  gene.GeneID = exp.["Feature ID"]


________________________________________


SELECT *
  FROM [1123].[table_BiGo_pro_island1u_intersect_mCpG_slm.csv]pr_is
  left join
  [1123].[BiGo_RNAseq_genes]exp
  on
  pr_is.Column1 = exp.["Feature ID"]


________________________________________


SELECT * FROM [1123].[table_Table S14.csv]


________________________________________


SELECT *
  FROM [1123].[table_BiGo_pro_island1u_intersect_mCpG_slm.csv]pr_is
  left join
  [1123].[BiGo_RNAseq_genes]exp
  on
  pr_is.Column1 = exp.["Feature ID"]


________________________________________


SELECT 
  id,
  foldChange,
  pval,
  blast.Column3,
  Column11 as evalue
  FROM [748].[BlackAB_DESeq.txt]d
  left join
  [748].[BlackAbalone_Contigs_v3_BLAST.txt]blast
  on d.id=blast.Column1


________________________________________


SELECT 
  id,
  foldChange,
  pval,
  blast.Column3,
  Column11 as evalue
  FROM [748].[BlackAB_DESeq.txt]d
  left join
  [748].[BlackAbalone_Contigs_v3_BLAST.txt]blast
  on d.id=blast.Column1
  where Column11 < 1E-10



________________________________________


SELECT *
  FROM [1123].[BiGill_methratio_Gene_Genomic_GFF]g
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  g.seqname = sp.CGI_ID


________________________________________


SELECT *
  FROM [1123].[table_OA_enrich445C9]g
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  g.Genes = sp.CGI_ID


________________________________________


SELECT *
  FROM [1123].[table_OA_enrich445C9]g
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  g.Genes = sp.SPID


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute

FROM [1123].     
[BiGo_lar_M3] m3
where 
context like '__CG_' --_=single character wildcard
and
CT_Count > 9


________________________________________


SELECT 
chr as seqname,  
'methratio' as source,  
'CpG' as feature, 
pos as start,
pos + 1 as [end],
ratio as score,  
strand,  
'.' as frame,  
'.' as attribute

FROM [1123].     
[BiGo_lar_M3] m3
where 
context like '__CG_' --_=single character wildcard
and
  CT_Count > 9
  and 
ratio <> 'NA'


________________________________________



  SELECT 
chr as seqname,  
pos - 1 as start, -- compensating for going to zero-based
pos + 1 as [end], 
'CG' as feature, 
ratio as score

FROM [1123].     
[BiGO_betty_plain_methratio_v1.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5



________________________________________



  SELECT 
chr as seqname,  
pos - 1 as start, -- compensating for going to zero-based
pos + 1 as [end], 
'CG' as feature, 
ratio as score

FROM [1123].     
[BiGO_betty_plain_methratio_v1.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5


________________________________________



  SELECT 
chr as seqname,  
pos - 1 as start, -- compensating for going to zero-based
pos + 1 as [end], 
'CG' as feature, 
ratio as score

FROM [1123].     
[BiGO_betty_plain_methratio_v1.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
    CT_Count >= 5




________________________________________


SELECT COUNT (*)
FROM
(


SELECT * FROM [1123].[BiGo_lar_M3]
  
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_M3] 
Where CT_count >= 5
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_M3] 
Where CT_count < 5
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * 
  FROM [1123].[BiGill_methratio_v9_A.txt]
 
  ) alias



________________________________________


SELECT COUNT (*)
FROM
(
SELECT * 
  FROM [1123].[BiGill_methratio_v9_A.txt]
where context like '__CG_'
  ) alias



________________________________________


SELECT COUNT (*)
FROM
(
SELECT * 
  FROM [1123].[BiGill_methratio_v9_A.txt]
where context like '__CG_'
  and
  CT_count >= 5
  ) alias



________________________________________


SELECT COUNT (*)
FROM
(
SELECT * 
  FROM [1123].[BiGill_methratio_v9_A.txt]

  ) alias



________________________________________


SELECT COUNT (*)
FROM
(
SELECT * 
  FROM [1123].[BiGill_methratio_v9_A.txt]
where CT_count < 5
) alias



________________________________________


SELECT COUNT (*)
FROM
(
SELECT * 
  FROM [1123].[clean_BiGo_methratio_v1]
  
  ) alis



________________________________________


SELECT COUNT (*)
FROM
(
SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  
  ) alis


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * 
  FROM [1123].[clean_BiGo_methratio_v1]
 where CT_count <5  
  ) alis



________________________________________


SELECT COUNT (*)
FROM
(
SELECT * 
  FROM [1123].[BiGO_betty_plain_methratio_v1.txt]
  where CT_count <5
  ) alis


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_M3] 
Where CT_count >= 5
  and
context like '__CG_'
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_M3] 
Where 
strand = '-'
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_M3] 
Where 
strand = '+'
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_M3] 
Where 
CT_count >= 5
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_M3] 
Where 
CT_count >= 5
  and
  strand = '+'
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_M3] 
Where 
CT_count >= 5
  and
  context like '__CG_'
  and
  ratio = '0.000'
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_M3] 
Where 
CT_count >= 5
  and
  context like '__CG_'
  and
  ratio <> '0.000'
  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT 
  * FROM [1123].[BiGo_lar_F]
  
)al



________________________________________


SELECT COUNT (*)
FROM
(
SELECT 
  * FROM [1123].[BiGo_lar_F]
 where
 CT_count <5 
)al



________________________________________


SELECT COUNT (*)
FROM
(
SELECT 
  * FROM [1123].[BiGo_lar_F]
 where
 CT_count >=5 
)al



________________________________________


SELECT COUNT (*)
FROM
(
SELECT 
  * FROM [1123].[BiGo_lar_F]
 where
 CT_count >=5 
  and 
  context like '__CG_'
)al



________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_T3D3] 


  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[BiGo_lar_T3D3] 
  where CT_count >= 5

  ) alias


________________________________________


SELECT COUNT (*)
FROM
(
SELECT
  * FROM [1123].[BiGo_lar_M3]
  
)m3



________________________________________


SELECT COUNT (*)
FROM
(
SELECT
  * FROM [1123].[BiGo_lar_M3]
  where
  CT_count > 20
  and 
  context like '__CG_'
)m3



________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
FROM [1123].[BiGo_lar_M3]
WHERE [ratio] <> 'NA'


________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
FROM [1123].[BiGo_lar_M3]
  WHERE [ratio] <> 'NA'
  and
  context like '__CG_'
  and 
  CT_count >= 5



________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
FROM [1123].[BiGo_lar_M3]
  WHERE [ratio] <> 'NA'
  and
  context like '__CG_'
  and 
  CT_count >= 5



________________________________________


SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio = 0
  



________________________________________


SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio > 0
  



________________________________________


SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio =0.333 
  



________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio = 0.333 
  
  )m3


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio = 0
  
  )m3


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio > 0
  and 
  ratio < 0.25
  
  )m3


________________________________________


SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio > 0
  and 
  ratio < 0.25


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio >= 0.25
  and 
  ratio < 0.5
  
  )m3


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio >= 0.5
  and 
  ratio < 0.75
  
  )m3


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio >= .75
 
  
  )m3


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio >= 0
  and
  ratio <=1
 
  
  )m3


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
  where
  ratio > 0
  and
  ratio <=1
 
  
  )m3


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
 
 
  
  )m3


________________________________________


SELECT COUNT (*)
FROM
(
SELECT * FROM [1123].[_BiGoM3cg5]
  where
ratio >= 0.25
 and
 ratio < 0.5 
  )m3


________________________________________


SELECT COUNT (*)
FROM
(
SELECT
  * FROM [1123].[BiGo_lar_T3D3]
  
)m3



________________________________________


SELECT COUNT (*)
FROM
(
SELECT
  * FROM [1123].[BiGo_lar_T3D3]
  
)m3



________________________________________


Select count (*)
  from
  (
    SELECT * FROM [1123].[BiGo_lar_T3D3]
  )t3d3



________________________________________


SELECT * 
  FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5



________________________________________


Select count (*)
  from
  (
SELECT * FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
  
  )d



________________________________________


Select count (*)
  from
  (
SELECT (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
  
  )d



________________________________________


Select distinct count (*)
  from
  (
SELECT (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
  
  )d



________________________________________


Select count (*)
 from 
  (
SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
  
  ) alias



________________________________________


SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5


________________________________________


Select count (*)
 from 
  (
SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
  
  ) alias



________________________________________


Select count (*)
 from 
  (
SELECT (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
  
  ) alias



________________________________________


Select count (*)
 from 
  (
SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
  
  ) alias



________________________________________


Select count (*)
 from 
  (
SELECT (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
  
  ) alias



________________________________________


Select count (*)
 from 
  (
SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
  
  ) alias



________________________________________


Select count (*)
 from 
  (
SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
    and
    ["RPKM"] > 20
  
  ) alias



________________________________________


Select count (*)
 from 
  (
SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5
    and
    ["RPKM"] > 40
  
  ) alias



________________________________________



SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5


________________________________________



SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5


________________________________________



SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5


________________________________________



SELECT distinct (["Gene name"]) FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Transcripts annotated"] > 5


________________________________________


SELECT ["Gene Name"]

  
  FROM [1123].[BiGill_RNAseq_exon]
  Group by ["Gene name"]



________________________________________


SELECT ["Gene Name"]

  
  FROM [1123].[BiGill_RNAseq_exon]
  Group by ["Gene name"]



________________________________________


SELECT ["Gene Name"] as gene

  
  FROM [1123].[BiGill_RNAseq_exon]
  Group by ["Gene name"]



________________________________________


SELECT ["Gene Name"] as Gene,
  ["Exons"] as exons

  
  FROM [1123].[BiGill_RNAseq_exon]




________________________________________


SELECT ["Gene Name"] as Gene,
  ["Exons"] as exons,
  ["Expression values"] as RPKM
  
  FROM [1123].[BiGill_RNAseq_exon]




________________________________________


SELECT ["Gene Name"] as Gene,
  ["Exons"] as exons,
  ["Transcripts annotated"] as RPKM
  
  FROM [1123].[BiGill_RNAseq_exon]




________________________________________


SELECT ["Gene Name"] as Gene,
  ["Transcripts annotated"] as exons,
  ["Expression values"] as RPKM
  
  FROM [1123].[BiGill_RNAseq_exon]




________________________________________


SELECT ["Gene Name"] as Gene,
  ["Transcripts annotated"] as exons,
  ["Expression values"] as rpkm
  
  FROM [1123].[BiGill_RNAseq_exon]




________________________________________


SELECT ["Gene Name"] as Gene,
  ["Transcripts annotated"] as exons,
  ["Expression values"] as cds_rpkm
  
  FROM [1123].[BiGill_RNAseq_exon]




________________________________________


SELECT ["Gene Name"] as Gene,
  ["Transcripts annotated"] as exons,
  ["Expression values"] as cds_rpkm,
  ["Relative RPKM"] as cds_relrpkm
  
  FROM [1123].[BiGill_RNAseq_exon]




________________________________________


SELECT ["Gene Name"] as Gene,
  ["Transcripts annotated"] as exons,
  ["Expression values"] as cds_rpkm,
  ["Relative RPKM"] as cds_relrpkm
  
  FROM [1123].[BiGill_RNAseq_exon]





________________________________________


SELECT 
  min(exons)
  
  FROM [1123].[_BiGill RNAseq clean]
  Group by Gene



________________________________________


SELECT 
  Gene,
  min(exons)
  
  FROM [1123].[_BiGill RNAseq clean]
  Group by Gene



________________________________________


SELECT 
  Gene,
  min(exons),
  max(exons)
  
  FROM [1123].[_BiGill RNAseq clean]
  Group by Gene



________________________________________


SELECT 
  Gene,
  min(exons) as NumEx,
  max(cds_rpkm) as maxRPKM
  
  FROM [1123].[_BiGill RNAseq clean]
  Group by Gene



________________________________________


SELECT 
  Gene,
  min(exons) as NumEx,
  max(cds_rpkm) as maxRPKM,
  min(cds_rpkm) as minRPKM
  
  FROM [1123].[_BiGill RNAseq clean]
  Group by Gene



________________________________________


SELECT 
  Gene,
  min(exons) as NumEx,
  max(cds_rpkm) as maxRPKM,
  min(cds_rpkm) as minRPKM,
  avg(cds_rpkm) as avgRPKM
  
  FROM [1123].[_BiGill RNAseq clean]
  Group by Gene



________________________________________


SELECT 
  Gene,
  min(exons) as NumEx,
  max(cds_rpkm) as maxRPKM,
  min(cds_rpkm) as minRPKM,
  avg(cds_rpkm) as avgRPKM,
  var(cds_rpkm) as varRPKM
  
  
  FROM [1123].[_BiGill RNAseq clean]
  Group by Gene



________________________________________


SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM >0



________________________________________


SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM >0
  and 
  NumEx >5 


________________________________________


SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM >0
  and 
  NumEx >5 
  and
  NumEx <20



________________________________________


SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM >5
  and 
  NumEx >5 
  and
  NumEx <20



________________________________________


Select count (*)
  from
(
SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM >5
  and 
  NumEx >5 
  and
  NumEx <20
  )aliea


________________________________________


Select count (*)
  from
(
SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  )aliea


________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20




________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM < 10




________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM < 100




________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM < 200




________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM >500




________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM < 200




________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM > 1000




________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM > 1000




________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM > 20000




________________________________________



SELECT *
  
  FROM [1123].[_Bigill exon rpkm]
  
  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM > 50000




________________________________________


SELECT *

  FROM [1123].[_Bigill exon rpkm]

  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM > 50000


________________________________________


SELECT *

  FROM [1123].[_Bigill exon rpkm]

  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM > 50000


________________________________________


SELECT *

  FROM [1123].[_Bigill exon rpkm]

  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM > 200


________________________________________


SELECT *

  FROM [1123].[_Bigill exon rpkm]

  where
  avgRPKM > 10
  and 
  NumEx >5 
  and
  NumEx <20
  and 
  varRPKM < 200


________________________________________


SELECT * 
FROM [1123].[_bigill_var.csv]b
LEFT JOIN [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
ON b.Gene=sp.CGI_ID




________________________________________


SELECT * 
FROM [1123].[_bigill_var.csv]b
LEFT JOIN [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
ON b.Gene=sp.CGI_ID




________________________________________


SELECT * FROM [1123].[BiGill_RNAseq_exon]
  
  where
  ["Gene Name"] like 'CGI*'



________________________________________


SELECT * FROM [1123].[BiGill_RNAseq_exon]
  
  where
  ["Gene Name"] like 'CGI%'



________________________________________


SELECT * FROM [1123].[BiGill_RNAseq_exon]
  
  where
  ["Gene Name"] like 'CGI_10026148'



________________________________________


SELECT * FROM [1123].[BiGill_RNAseq_exon]
  
  where
  ["Gene Name"] like 'CGI_10024475'



________________________________________


SELECT * FROM [1123].[BiGill_RNAseq_exon]
  
  where
  ["Gene Name"] like 'CGI_10026597'



________________________________________


SELECT * FROM [1123].[BiGill_RNAseq_exon]
  
  where
  ["Gene Name"] like 'CGI_10010090'



________________________________________


SELECT * FROM [1123].[BiGill_RNAseq_exon]
  
  where
  ["Gene Name"] like 'CGI_10026148'



________________________________________


SELECT * 
  FROM [1123].[BiGill_exonexp_gene.txt]
  
  where count > 6



________________________________________


SELECT * 
  FROM [1123].[BiGill_exonexp_gene.txt]
  
  where count > 6
  and 
  count < 50


________________________________________


SELECT * 
  FROM [1123].[BiGill_exonexp_gene.txt]
  
  where count > 6
  and 
  count < 50

  



________________________________________


SELECT * 
  FROM [1123].[BiGill_exonexp_gene.txt]
  
  where count > 5
  and 
  count < 50
  and 
  sum > 10
  



________________________________________


SELECT * 
  FROM [1123].[BiGill_exonexp_gene.txt]
  
  where count > 5
  and 
  count < 50
  and 
  sum > 100
  



________________________________________


SELECT * 
  FROM [1123].[BiGill_exonexp_gene.txt]
  
  where count > 5
  and 
  count < 50
  and 
  sum > 100
  


________________________________________


SELECT * FROM [1123].[BiGoRNAseq_exon_exp_1]
  
  where ["Gene name"] like 'CGI%'
  
  


________________________________________


SELECT * FROM [1123].[BiGoRNAseq_exon_exp_1]
  
  where ["Gene name"] like 'CGI_10009854'
  
  


________________________________________


SELECT * FROM [1123].[BiGoRNAseq_exon_exp_1]
  
  where ["Gene name"] like 'CGI_10006796'
  
  


________________________________________


SELECT * FROM [1123].[BiGoRNAseq_exon_exp_1]
  
  where ["Gene name"] like 'CGI_10008589'
  
  


________________________________________


SELECT * FROM [1123].[BiGoRNAseq_exon_exp_1]
  
  where ["Gene name"] like 'CGI_10014148'
  
  


________________________________________


SELECT * FROM [1123].[BiGoRNAseq_exon_exp_1]
  
  where ["Gene name"] like 'CGI_10028140'
  
  


________________________________________


SELECT * FROM [1123].[BiGoRNAseq_exon_exp_1]
  
  where ["Gene name"] like 'CGI_10007702'
  
  


________________________________________


SELECT len(sequence)
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT len(sequence)- len(REPLACE(sequence, 'C', ''))
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as C,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as G,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as CG,
  sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as C,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as G,
  len(sequence)- len(REPLACE(sequence, 'CG', '')) as CG,
  sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as C,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as G,
  len(sequence)- len(REPLACE(sequence, 'CG', '')) as CG,
  sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as C,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as G,
  (len(sequence)- len(REPLACE(sequence, 'CG', '')))/2 as CG,
  sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as C,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as G,
  (len(sequence)- len(REPLACE(sequence, 'CG', '')))/2 as CG,
  len(sequence)- len(REPLACE(sequence, 'CG', '')) as CG,

  sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as C,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as G,
  (len(sequence)- len(REPLACE(sequence, 'CG', '')))/2 as CG,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CG,

  sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  len(sequence)- len(REPLACE(sequence, 'G', ''))/len(sequence)- len(REPLACE(sequence, 'C', '')) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) * len(sequence)- len(REPLACE(sequence, 'C', '')) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) / len(sequence)- len(REPLACE(sequence, 'C', '')) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) / (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CpGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  Column1,
  len(Column2)- len(REPLACE(Column2, 'N', '')) as Ncount

FROM [1123].[qDOD_scaffold_sequence.txt]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CpGcount,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CpGcount,
  (len(sequence)- len(REPLACE(sequence, 'CG', ' '))) / ((len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))))
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CpGcount,
  (len(sequence)- len(REPLACE(sequence, 'CG', ' '))) / ((len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', '')))) as pls,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CpGcount,
  (len(sequence)- len(REPLACE(sequence, 'CG', ' '))) / ((len(sequence)- len(REPLACE(sequence, 'G', ''))) * (len(sequence)- len(REPLACE(sequence, 'C', '')))) as pls,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CpGcount,
  (len(sequence)- len(REPLACE(sequence, 'CG', ' '))) / (((len(sequence)- len(REPLACE(sequence, 'G', ''))) * (len(sequence)- len(REPLACE(sequence, 'C', ''))))) as pls,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT 
  CGI_ID,
  len(sequence)- len(REPLACE(sequence, 'C', '')) as Ccount,
  len(sequence)- len(REPLACE(sequence, 'G', '')) as Gcount,
  (len(sequence)- len(REPLACE(sequence, 'G', ''))) + (len(sequence)- len(REPLACE(sequence, 'C', ''))) as C_Gcount,
  len(sequence)- len(REPLACE(sequence, 'CG', ' ')) as CpGcount,
  len(sequence) as sequence_len,
sequence
  FROM [1123].[qDOD_Cgigas_gene_fasta]


________________________________________


SELECT Gene, min(exons) as NumEx, max(cds_rpkm) as maxRPKM, min(cds_rpkm) as minRPKM FROM [1123].[_BiGill RNAseq clean] Group by Gene


________________________________________


SELECT Gene, 
  min(exons) as NumEx,
  max(cds_rpkm) as maxRPKM, 
  min(cds_rpkm) as minRPKM 
  FROM [1123].[_BiGill RNAseq clean] 
  Group by Gene


________________________________________


SELECT * FROM [1123].[_Bigill exon rpkm]


________________________________________


SELECT * FROM [1123].[_Bigill exon rpkm]
  
  where minRPKM >0



________________________________________


SELECT * FROM [1123].[_Bigill exon rpkm]
  
  where minRPKM > 0
  and 
  NumEx > 5



________________________________________


SELECT * FROM [1123].[_Bigill exon rpkm]
  
  where minRPKM > 0
  and 
  NumEx > 4



________________________________________


SELECT * FROM [1123].[_Bigill exon rpkm]
  
  where minRPKM > 0
  and 
  NumEx > 4



________________________________________


SELECT * 
  FROM 
  [1123].[_BiGill RNaEXON min 4]ps
  left join 
  [1123].[_bigill percent methtxt]m
  on
  ps.Gene = m.ID


________________________________________


SELECT * 
  FROM 
  [1123].[_BiGill RNaEXON min 4]ps
  left join 
  [1123].[_bigill percent methtxt]m
  on
  ps.Gene = m.ID


________________________________________


SELECT 
  min(exons)
  
  FROM [1123].[_BiGill RNAseq clean]
  
  Group by Gene



________________________________________


SELECT 
  min(exons),
  max(exons) as Exon#
  
  FROM [1123].[_BiGill RNAseq clean]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  max(exons) as Exon#
  
  FROM [1123].[_BiGill RNAseq clean]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  max(exons) as Exon#,
  stdev(cds_rpkm)
  
  FROM [1123].[_BiGill RNAseq clean]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  max(exons) as Exon#,
  stdev(cds_rpkm),
  avg(cds_rpkm)
  
  FROM [1123].[_BiGill RNAseq clean]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  max(exons) as Exon#,
  stdev(cds_rpkm) as stdevExp,
  avg(cds_rpkm) as avgExp
  
  FROM [1123].[_BiGill RNAseq clean]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  max(exons) as Exon#,
  stdev(cds_rpkm) as stdevExp,
  avg(cds_rpkm) as avgExp,
  avg(cds_relrpkm)
  
  FROM [1123].[_BiGill RNAseq clean]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  max(exons) as Exon#,
  stdev(cds_rpkm) as stdevExp,
  avg(cds_rpkm) as avgExp
  
  FROM [1123].[_BiGill RNAseq clean]
  
  Group by Gene



________________________________________


SELECT 
  Gene,
  max(exons) as Exon#,
  stdev(cds_rpkm) as stdevExp,
  avg(cds_rpkm) as avgExp,
  max(cds_rpkm) as maxExp,
  min(cds_rpkm) as minExp  
    
  
  FROM [1123].[_BiGill RNAseq clean]
  
  Group by Gene



________________________________________


SELECT 
 *
  FROM [1123].[_BiGill_exon_stdev_avg]
Where
  Exon# >4



________________________________________


SELECT 
 *
  FROM [1123].[_BiGill_exon_stdev_avg]
Where
  Exon# > 4
  and 
  minExp > 0



________________________________________


SELECT * 
  
  FROM [1123].[_Bigill exon minexp]


________________________________________


SELECT * 
  
  FROM [1123].[_Bigill exon minexp]ex
 left join
  [1123].[_bigill percent methtxt]me
  on
  ex.Gene = me.ID



________________________________________


SELECT * 
  
  FROM [1123].[_Bigill exon minexp]ex
 left join
  [1123].[_bigill percent methtxt]me
  on
  ex.Gene = me.ID



________________________________________


SELECT * 
  
  FROM [1123].[_Bigill exon minexp]ex
 left join
  [1123].[_bigill percent methtxt]me
  on
  ex.Gene = me.ID



________________________________________


SELECT * 
  FROM [1123].[_BiGillExp_withMeth]me
  left join
  [1123].[TJGR_Gene_SPID_evalue_Description]id
  on
  me.Gene = id.Column1



________________________________________


SELECT * 
  FROM [1123].[_BiGillExp_withMeth]me
  left join
  [1123].[TJGR_Gene_SPID_evalue_Description]id
  on
  me.Gene = id.Column1
left join
  [1123].[BiGill_RNAseq_exon]lo
  on
  me.Gene = lo.["Gene name"]


________________________________________


SELECT * 
  FROM [1123].[_BiGillExp_withMeth]me
  left join
  [1123].[TJGR_Gene_SPID_evalue_Description]id
  on
  me.Gene = id.Column1
left join
  [1123].[BiGill_RNAseq_exon]lo
  on
  me.Gene = lo.["Gene name"]


________________________________________


SELECT
 ["Chromosome"] as seqid,
 ["Chromosome region start"] as start,
 ["Chromosome region end"] as [end],
 'exon_exp' as feature 
  
  FROM [1123].[BiGill_RNAseq_exon]


________________________________________


SELECT
 ["Chromosome"] as seqid,
 ["Chromosome region start"] as start,
 ["Chromosome region end"] as [end],
 'exon_exp' as feature,
  ["RPKM"] as rpkm
  
  FROM [1123].[BiGill_RNAseq_exon]


________________________________________


SELECT
 ["Chromosome"] as seqid,
 ["Chromosome region start"] as start,
 ["Chromosome region end"] as [end],
 'exon_exp' as feature,
  ["RPKM"] as rpkm
  
  FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Chromosome"] like 'scaffold1261'



________________________________________


SELECT
 ["Chromosome"] as seqid,
 ["Chromosome region start"] as start,
 ["Chromosome region end"] as [end],
 'exon_exp' as feature,
  ["RPKM"] as rpkm
  
  FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Chromosome"] like 'scaffold1261'



________________________________________


SELECT
 ["Chromosome"] as seqid,
 ["Chromosome region start"] as start,
 ["Chromosome region end"] as [end],
 'exon_exp' as feature,
  ["RPKM"] as rpkm
  
  FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Chromosome"] like 'scaffold44006'



________________________________________


SELECT
 ["Chromosome"] as seqid,
 ["Chromosome region start"] as start,
 ["Chromosome region end"] as [end],
 'exon_exp' as feature,
  ["RPKM"] as rpkm
  
  FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Chromosome"] like 'scaffold44006'
  



________________________________________


SELECT
 ["Chromosome"] as seqid,
 ["Chromosome region start"] as start,
 ["Chromosome region end"] as [end],
 'exon_exp' as feature,
  ["RPKM"] as rpkm
  
  FROM [1123].[BiGill_RNAseq_exon]
  
  where ["Chromosome"] like 'scaffold1261'
  



________________________________________


SELECT * FROM [1123].[table_qDOD_Cgigas_gene_fasta3F84B]


________________________________________


SELECT Distinct * FROM [1123].[qDOD_Cgigas_GO_GOslim]


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count
FROM [1123].[BiGo_lar_M3]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
 chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
 C_count as C_count,
  C_count/CT_count as freqC  
  
  
  FROM [1123].[_M3methylkit_s1]


________________________________________


SELECT  
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
  freqC as freqC,
    1-freqC as freqT
  
  FROM [1123].[_M3mehthykit_step2]


________________________________________


SELECT  
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
  freqC as freqC,
    1-freqC as freqT
  
  FROM [1123].[_M3mehthykit_step2]


________________________________________


SELECT  
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
  freqC as freqC,
    1-freqC as freqT
  
  FROM [1123].[_M3mehthykit_step2]


________________________________________


SELECT  
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
  freqC as freqC,
    1-freqC as freqT
  
  FROM [1123].[_M3mehthykit_step2]


________________________________________


SELECT  
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
  freqC as freqC,
    1-freqC as freqT
  
  FROM [1123].[_M3mehthykit_step2]


________________________________________


SELECT  
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
  freqC as freqC

  FROM [1123].[_M3mehthykit_step2]


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count
FROM [1123].[BiGo_lar_T3D3]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
 chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
 C_count as C_count,
  C_count/CT_count as freqC
  FROM [1123].[_T3D3_methylkit_s1]


________________________________________


SELECT  
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
  freqC as freqC
  FROM [1123].[_T3D3_methylkit_s2]


________________________________________


Select count (*)
  From
  (
SELECT * FROM [1123].[qDOD_Cgigas_GO_GOslim]
  )ali


________________________________________


Select count (*)
  From
  (
SELECT distinct * FROM [1123].[qDOD_Cgigas_GO_GOslim]
  )ali


________________________________________


Select count (*)
  From
  (
SELECT distinct * FROM [1123].[qDOD_Cgigas_GO_GOslim]
  )ali


________________________________________


Select count (*)
  From
  (
SELECT distinct * FROM [1123].[qDOD_Cgigas_GO_GOslim]
  )ali


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count
FROM [1123].[BiGo_lar_T3D5]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'




________________________________________


SELECT 
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
 C_count as C_count,
  C_count/CT_count as freqC
  FROM [1123].[_T3D3_methylkit_s1]


________________________________________


  SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


  SELECT 
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
 C_count as C_count,
  C_count/CT_count as freqC
FROM [1123].[_M1_methykit_step1]


________________________________________



  SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count
FROM [1123].[BiGo_lar_T1D3]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'



________________________________________


  SELECT 
  chr as chr,
  start as start,
  strand as strand,
  CT_count as CT_count,
 C_count as C_count,
  C_count/CT_count as freqC
FROM [1123].[_methylkit_T1D3_step1]


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC
  
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC
  
FROM [1123].[BiGo_lar_M3]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  CGI_ID,
  term,
  GOSlim_bin
  
  FROM [1123].[qDOD_Cgigas_GO_GOslim]


________________________________________


SELECT 
  CGI_ID,
  term,
  GOSlim_bin
  
  FROM [1123].[qDOD_Cgigas_GO_GOslim]
  
  Where aspect =
  'P'



________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGill_methratio_v9_A.txt]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr as chr,
  pos as start,
  chr + '_' as t,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr as chr,
  pos as start,
  chr + '_' as chr_start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr as chr,
  pos as start,
  chr,'_' as chr_start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr as chr,
  pos as start,
  chr + '_' as chr_start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr as chr,
  pos as start,
  chr + '_' + strand as chr_start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr as chr,
  pos as start,
  chr + '_' + (cast (pos as varchar)) as chr_start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr + '_' + (cast (pos as varchar)) as chr_start,
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr + '_' + (cast (pos as varchar)) as chr_start,
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr + '_' + (cast (pos as varchar)) as chr_start,
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M1]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr + '_' + (cast (pos as varchar)) as chr_start,
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_T1D3]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr + '_' + (cast (pos as varchar)) as chr_start,
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_T1D5]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr + '_' + (cast (pos as varchar)) as chr_start,
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_M3]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr + '_' + (cast (pos as varchar)) as chr_start,
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_T3D3]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT 
  chr + '_' + (cast (pos as varchar)) as chr_start,
  chr as chr,
  pos as start,
  '+' as strand,
  cast (CT_count as float) as CT_count,
  cast (C_count as float) as C_count,
  cast (C_count as float) / cast (CT_count as float) as freqC,
  1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
  
FROM [1123].[BiGo_lar_T3D5]
  where 
context like '__CG_'
and
  CT_Count >= 5 
and 
  ratio <> 'NA'


________________________________________


SELECT * 
FROM [1123].[_BiGo_lar_nonred_ID.txt]id
LEFT JOIN [1123].[_BiGo_lar_M3_hack]M3
ON id.[chr_start]=M3.[chr_start]




________________________________________


SELECT * 
FROM [1123].[_BiGo_lar_nonred_ID.txt]id
LEFT JOIN [1123].[_BiGo_lar_M1_hack]M1
ON id.[chr_start]=M1.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T1D3_hack]T1D3
ON id.[chr_start]=T1D3.[chr_start]


________________________________________


SELECT * 
FROM [1123].[_BiGo_lar_nonred_ID.txt]id
LEFT JOIN [1123].[_BiGo_lar_M1_hack]M1
ON id.[chr_start]=M1.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T1D3_hack]T1D3
ON id.[chr_start]=T1D3.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T1D5_hack]T1D5
ON id.[chr_start]=T1D5.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_M3_hack]M3
ON id.[chr_start]=M3.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T3D3_hack]T3D3
ON id.[chr_start]=T3D3.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T3D5_hack]T3D5
ON id.[chr_start]=T3D5.[chr_start]


________________________________________


SELECT * 
FROM [1123].[_BiGo_lar_nonred_ID.txt]id
LEFT JOIN [1123].[_BiGo_lar_M1_hack]M1
ON id.[chr_start]=M1.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T1D3_hack]T1D3
ON id.[chr_start]=T1D3.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T1D5_hack]T1D5
ON id.[chr_start]=T1D5.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_M3_hack]M3
ON id.[chr_start]=M3.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T3D3_hack]T3D3
ON id.[chr_start]=T3D3.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T3D5_hack]T3D5
ON id.[chr_start]=T3D5.[chr_start]


________________________________________


SELECT * 
FROM [1123].[_BiGo_lar_nonred_ID.txt]id
LEFT JOIN [1123].[_BiGo_lar_M1_hack]M1
ON id.[chr_start]=M1.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T1D3_hack]T1D3
ON id.[chr_start]=T1D3.[chr_start]
LEFT JOIN [1123].[_BiGo_lar_T1D5_hack]T1D5
ON id.[chr_start]=T1D5.[chr_start]


________________________________________


SELECT * 
FROM [1123].[BiGo_lar_nonred_ID split]id
LEFT JOIN [1123].[_BiGo_lar_M1_hack]M1
ON id.[chr]=M1.[chr] AND id.[start]=M1.[start]


________________________________________


SELECT * 
FROM [1123].[BiGo_lar_nonred_ID split]id
LEFT JOIN [1123].[_BiGo_lar_M1_hack]M1
ON id.[chr]=M1.[chr] AND id.[start]=M1.[start]
LEFT JOIN [1123].[_BiGo_lar_T1D3_hack]T1D3
ON id.[chr]=T1D3.[chr] AND id.[start]=T1D3.[start]
LEFT JOIN [1123].[_BiGo_lar_T1D5_hack]T1D5
ON id.[chr]=T1D5.[chr] AND id.[start]=T1D5.[start]
LEFT JOIN [1123].[_BiGo_lar_M3_hack]M3
ON id.[chr]=M3.[chr] AND id.[start]=M3.[start]
LEFT JOIN [1123].[_BiGo_lar_T3D3_hack]T3D3
ON id.[chr]=T3D3.[chr] AND id.[start]=T3D3.[start]
LEFT JOIN [1123].[_BiGo_lar_T3D5_hack]T3D5
ON id.[chr]=T3D5.[chr] AND id.[start]=T3D5.[start]


________________________________________


SELECT * FROM [1123].[_BiGo_lar_joineddata_sums.csv]
  where CountingCs = 6



________________________________________


SELECT * FROM [1123].[_BiGo_lar_joineddata_sums.csv]
  where CountingCs = 6
  and
  SummingCs > 0



________________________________________


SELECT * FROM [1123].[_BiGo_lar_joineddata_sums.csv]
  where CountingCs = 6
  and
  SummingCs > 0



________________________________________


SELECT * FROM [1123].[_BiGo_lar_joineddata_sums.csv]
  where CountingCs = 6
  and
  SummingCs > 0



________________________________________


set rowcount 10
SELECT *
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]




________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where Description like 'AMP-activated protein kinase'
  


________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where Description like 'AMP-activated'
  


________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where Description like '%AMP-activated%'
  


________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where Description like 'AMP-activated%'
  


________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where Description like '%AMP-activated%'
  


________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where Description like '%MP-activated%'
  


________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where Description like '%AMP-activated%'
  


________________________________________


SELECT * 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where Description like '%AMP-activated%'
  


________________________________________


SELECT * FROM [1123].[qDOD_v9_gene]
  where Column9 like '%CGI_10003983%'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Protein ID] like 'CGI_10003983'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Protein ID] like '%03983'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Protein ID] like 'CGI_10010273'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Protein ID] like 'CGI_10000033'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Protein ID] like 'CGI_10010275'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Protein ID] like 'CGI_10025389'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Gene Name] like '%AMP-activated protein kinase%'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Gene Name] like '%AMP-activated protein kinase%'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Gene Name] like '%AMP-activated protein kinase%'



________________________________________


SELECT * FROM [1123].[OABS_ETS_S3]
Where [Gene Name] like '%AMP-activated protein kinase%'



________________________________________


SELECT * FROM [1123].[Cgigas Larvae RNA-Seq OsHV]
  where ID like 'CGI_10025389'


________________________________________


SELECT * FROM [1123].[Cgigas Larvae RNA-Seq OsHV]
  where ID like 'CGI_10003983'


________________________________________


SELECT * FROM [1123].[Cgigas Larvae RNA-Seq OsHV]
  where ID like 'CGI_10003983'


________________________________________


SELECT 
chr as seqname,  
pos - 1 as start, -- compensating for going to zero-based
pos + 1 as [end], 
'CG' as feature, 
ratio as score

FROM [1123].     
[EY_mixmethratio_3.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5





________________________________________


SELECT 
chr as seqname,  
pos - 1 as start, -- compensating for going to zero-based
pos + 1 as [end], 
'CG' as feature, 
ratio as score

FROM [1123].     
[EY_mixmethratio_3.txt] yel 
where 
context like '__CG_' --_=single character wildcard
and
CT_Count >= 5



________________________________________


SELECT * FROM [1123].[DMRmgavery_mRNA_annotated]dmr
  left join
  [1123].[TJGR_CCD_domain_concise_Superfamily_def]sf
  on dmr.gene_CGI = sf.CGI_ID
  



________________________________________


SELECT * FROM [1123].[DMRmgavery_mRNA_annotated]dmr
  left join
  [1123].[TJGR_CCD_domain_concise_Superfamily_def]sf
  on dmr.gene_CGI = sf.CGI_ID
  



________________________________________


SELECT * FROM [1123].[DMRmgavery_mRNA_annotated]dmr
  left join
  [1123].[qDOD_Cgigas_GO_GOslim]sf
  on dmr.gene_CGI = sf.CGI_ID
  



________________________________________


SELECT * FROM [1123].[DMRmgavery_mRNA_annotated]dmr
  left join
  [1123].[qDOD_Cgigas_GO_GOslim]sf
  on dmr.gene_CGI = sf.CGI_ID
  



________________________________________


SELECT distinct * FROM [1123].[DMRmgavery_mRNA_annotated]dmr
  left join
  [1123].[qDOD_Cgigas_GO_GOslim]sf
  on dmr.gene_CGI = sf.CGI_ID
  



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where CGI_ID like '27416'



________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where CGI_ID like 'CGI_10027416'



________________________________________


SELECT [chr]
     , CAST([pos] as INTEGER) as [pos]
     , [strand]
     , [context]
     , CAST([ratio] as FLOAT) as [ratio]
     , CAST([eff_CT_count] as INTEGER) as [eff_CT_count]
     , CAST([C_count] as INTEGER) as [C_count]
     , CAST([CT_count] as INTEGER) as [CT_count]
     , CAST([rev_G_count] as INTEGER) as [rev_G_count]
     , CAST([CI_lower] as FLOAT) as [CI_lower]
     , CAST([CI_upper] as FLOAT) as [CI_upper]
  FROM [1123].[BiGo_mito_methratio_A.txt]
  WHERE [ratio] <> 'NA'



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CG_' --modified respectively for CA, CT, CC
and
CT_Count >= 5
and ratio >= 0.500) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CA_' --modified respectively for CA, CT, CC
and
CT_Count >= 5
and ratio >= 0.500) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CC_' --modified respectively for CA, CT, CC
and
CT_Count >= 5
and ratio >= 0.500) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CT_' --modified respectively for CA, CT, CC
and
CT_Count >= 5
and ratio >= 0.500) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CT_' --modified respectively for CA, CT, CC
and
CT_Count >= 5
and ratio > 0) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CG_' --modified respectively for CA, CT, CC
and
CT_Count >= 5
and ratio > 0) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CG_' --modified respectively for CA, CT, CC
and
CT_Count >= 5
and ratio = 0) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CT_' --modified respectively for CA, CT, CC
and
CT_Count >= 5
and ratio = 0) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CA_' --modified respectively for CA, CT, CC
and
CT_Count >= 5
and ratio = 0) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CG_' --modified respectively for CA, CT, CC
and
  CT_Count >= 5)
-- ratio = 0) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CG_' --modified respectively for CA, CT, CC
and
  CT_Count >= 5
and ratio = 0) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__C__' --modified respectively for CA, CT, CC
and
  CT_Count >= 5)
--and ratio = 0) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__C__' --modified respectively for CA, CT, CC
and
  CT_Count >= 5
and ratio = 0) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__CG_' --modified respectively for CA, CT, CC
and
  CT_Count >= 5
and ratio >= 0.500) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_mito_cleam] 
where 
context like '__C__' --modified respectively for CA, CT, CC
and
  CT_Count >= 5
and ratio >= 0.500) --modified respectively for zero methylation (= 0.000 )
betty



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_RNAseq_genes] 
where 
  ["RPKM"] > 0)
bety
  



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_RNAseq_genes] 
where 
  ["RPKM"] = 0)
bety
  



________________________________________


SELECT Count (*) From 
(
SELECT 
*
FROM [1123].[BiGo_RNAseq_genes] 
where 
  ["RPKM"] > 0)
bety
  



________________________________________


SELECT * 
FROM 
[1255].[Oly_Blast_uniprot_swissprot.txt]blast
LEFT JOIN 
[1045].[UniprotProtNamesReviewed_yes20130610]des 
on  
blast.Column3 = des.SPID  


________________________________________


SELECT * 
FROM 
[1255].[Oly_Blast_uniprot_swissprot.txt]blast
Left Join 
[1045].[UniprotProtNamesReviewed_yes20130610]unp 
on
blast.Column3 = unp.SPID


________________________________________


SELECT *    
FROM     
[1255].[Oly_Blast_uniprot_swissprot.txt]blast   
Left Join 
[1045].[UniprotProtNamesReviewed_yes20130610]unp 
on
blast.Column3 = unp.SPID


________________________________________


SELECT
  "2800 avg NSAF"
  FROM [1123].[ETS_oaTable_S3]


________________________________________


SELECT
  "2800 avg NSAF",
  "400 avg NSAF",
  "Gene Name"
  FROM [1123].[ETS_oaTable_S3]


________________________________________


SELECT * 
  FROM [1123].[1358_uniprot_blastx_out]
  


________________________________________


SELECT * 
  FROM [1123].[1358_uniprot_blastx_out]
  blast Left Join [1045].[UniprotProtNamesReviewed_yes20130610]unp 
on blast.Column3 = unp.SPID


________________________________________


SELECT * FROM [1123].[1358_uniprot_blastx_out]
  blast Left Join [1045].[UniprotProtNamesReviewed_yes20130610]unp 
on blast.Column3 = unp.SPID


________________________________________


SELECT * FROM [1123].[1358_uniprot_blastx_out]
  blast Left Join [1045].[UniprotProtNamesReviewed_yes20130610]unp 
on blast.Column3 = unp.SPID


________________________________________


SELECT * FROM [1123].[scratchblast_out]blast Left Join [1045].[UniprotProtNamesReviewed_yes20130610]unp ON blast.Column3 = unp.SPID


________________________________________


SELECT * FROM [1123].[scratchblast_out]blast Left Join [1045].[UniprotProtNamesReviewed_yes20130610]unp ON blast.Column3 = unp.SPID


________________________________________


SELECT * FROM [1123].[scratchblast_out]blast Left Join [1045].[UniprotProtNamesReviewed_yes20130610]unp ON blast.Column3 = unp.SPID


________________________________________


SELECT * FROM [1123].[scratchblast_out]blast Left Join [1045].[UniprotProtNamesReviewed_yes20130610]unp ON blast.Column3 = unp.SPID
  Left Join [1123].[SPID and GO Numbers]go ON unp.SPID = go.SPID


________________________________________


SELECT * FROM [1123].[scratchblast_out]blast Left Join [1045].[UniprotProtNamesReviewed_yes20130610]unp ON blast.Column3 = unp.SPID
  Left Join [1123].[SPID and GO Numbers]go ON unp.SPID = go.SPID
  Left Join [1123].[GO_to_GOslim]slim ON unp.SPID = go.SPID



________________________________________


SELECT * FROM [1123].[scratchblast_out]blast Left Join [1123].[uniprot-reviewed_wGO_010714]unp ON blast.Column3 = unp.Entry Left Join [1123].[SPID and GO Numbers]go ON unp.Entry = go.SPID Left Join [1123].[GO_to_GOslim]slim ON unp.Entry = go.SPID


________________________________________


SELECT * FROM [1123].[scratchblast_out]blast Left Join [1123].[uniprot-reviewed_wGO_010714]unp ON blast.Column3 = unp.Entry Left Join [1123].[SPID and GO Numbers]go ON unp.Entry = go.SPID Left Join [1123].[GO_to_GOslim]slim ON slim.GO_id = go.GOID


________________________________________


SELECT Distinct
  Column1 as query, 
  Column3 as SPID,
  Column13 as evalue,
  GOSlim_bin
  
  FROM [1123].[scratchjoin_slim]


________________________________________


SELECT Distinct
  Column1 as query, 
  Column3 as SPID,
  GOSlim_bin
  
  FROM [1123].[scratchjoin_slim]


________________________________________


SELECT Distinct
  Column1 as query, 
  Column3 as SPID,
  GOSlim_bin
  FROM [1123].[scratchjoin_slim]
  Where aspect = 'P'
  



________________________________________


SELECT count (*)
From
(
SELECT
GOSlim_bin  
from  
[1123].[PieTest]
)pie 

  



________________________________________



SELECT
GOSlim_bin,
  COUNT(GOSlim_bin)  
from  
[1123].[PieTest]

  Group by
  GOSlim_bin
  



________________________________________


SELECT * FROM [594].[OGOP2]
  
 Where [gig1] like ' ' 


________________________________________


SELECT * FROM [594].[OGOP2]
  
 Where [gig1] like '%
  ' 


________________________________________


SELECT * FROM [594].[OGOP2]
  
 Where gig1 = 'CGI%'
  
 


________________________________________


SELECT * FROM [594].[OGOP2]
  
 Where gig1 like
  'CGI%'
  
 


________________________________________


SELECT * FROM [594].[OGOP2]
  
 Where gig1 like 'CGI%'
  
 


________________________________________


SELECT * FROM [594].[OGOP2]
  
 Where gig1 like '%'
  
 


________________________________________


SELECT * FROM [412].[mouse blast with treatments]
  Where OA = '*'



________________________________________


SELECT * FROM [412].[mouse blast with treatments]
  Where OA like '*'



________________________________________


SELECT * FROM [412].[mouse blast with treatments]
  Where OA like '%'



________________________________________


SELECT * FROM [412].[mouse blast with treatments]
  Where OA like '%'



________________________________________


SELECT * FROM [1255].[Olympia Oyster Uniprot_swissprot with SPID]
  where 
  Status = 'reviewed'
  



________________________________________


SELECT * FROM [1255].[Olympia Oyster Uniprot_swissprot with SPID]
  where 
  Status = 'reviewed'
  



________________________________________


SELECT * FROM [1255].[Olympia Oyster Uniprot_swissprot with SPID]
  where 
  Status = 'reviewed'
  



________________________________________


SELECT * FROM [1255].[Olympia Oyster Uniprot_swissprot with SPID]
  where 
  Status = 'reviewed'
  



________________________________________


SELECT * FROM [1255].[Olympia Oyster Uniprot_swissprot with SPID]
  where 
  Status = 'reviewed'
  



________________________________________


SELECT * FROM [1123].[fish546_OlyMFdeg.txt]deg
  left join
[1255].[Olympia Oyster Uniprot_swissprot with SPID]id
on
  deg.Column1 = id.Column1



________________________________________


SELECT * FROM [1123].[fish546_OlyMFdeg.txt]deg
  left join
[1255].[Olympia Oyster Uniprot_swissprot with SPID]id
on
  deg.Column1 = id.Column1



________________________________________


SELECT * FROM [412].[Joined PNitzschia Files]


________________________________________


SELECT * FROM [412].[Joined PNitzschia Files]


________________________________________


SELECT * FROM [412].[Joined PNitzschia Files]


________________________________________


SELECT * FROM [1123].[fish546_DEgene_out]deg
left join 
[1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp 
on
  deg.gene_name = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[fish546_DEgene_out]deg
left join 
[1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp 
on
  deg.gene_name = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[fish546_DEgene_out]deg left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp on deg.gene_name = sp.CGI_ID


________________________________________


SELECT SPID FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_GO]
  where term like '%gly%'


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_GO]
  where 
  term like '%gly%'
  or
  term like '%immune%'



________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_GO]
  where 
  term like '%gly%'
  or
  term like '%immune%'



________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_GO]
  where 
  term like '%gly%'
  or
  term like '%immune%'
  or
    term like '%catab%'



________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_GO]
  where 
  term like '%1341pl%'


________________________________________


SELECT distinct * 
  FROM [1123].[lft_BlackAbalone_v3_swissprot_blastout_d]d
  left join
  [1123].[uniprot-reviewed_wGO_010714]go
  on
  d.SPID = go.Entry


________________________________________


SELECT * FROM [748].[BlackAbalone_contig_GOSlim_BP]


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_tab]fa
  left join [1123].[lft_CLC_count]clc
  on
  fa.contigID=clc."Feature ID"
  
  
  


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_tab]fa
  left join 
  [1123].[lft_CLC_count]clc
  on
  fa.contigID=clc."Feature ID"
  left join 
  [748].[BlackAB_DESeq_fold_pvalue.csv]de
  on
  fa.contigID=de.id
  left join
  [748].[lft_BlackAbalone_sp_go_path.csv]sp
  on
  fa.contigID=sp.ContigID

  


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_tab]fa
  left join 
  [1123].[lft_CLC_count]clc
  on
  fa.contigID=clc."Feature ID"
  left join 
  [748].[BlackAB_DESeq_fold_pvalue.csv]de
  on
  fa.contigID=de.id
  left join
  [748].[lft_BlackAbalone_sp_go_path.csv]sp
  on
  fa.contigID=sp.ContigID

  


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where 
  sequence like '%ATTT%'


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where 
  sequence like '%ATTT%'
  and 
  [Gene ontology (GO)] like '%immune%'



________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where 
  [Gene ontology (GO)] like '%immune%'
  or
  [Gene ontology (GO)] like '%glycolysis%'




________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where 
  [Gene ontology (GO)] like '%immune%'
  or
  [Gene ontology (GO)] like '%glycolysis%'




________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where 
  [Gene ontology (GO)] like '%immune%'
  or
  [Gene ontology (GO)] like '%glycolysis%'
  and
  Status like 'reviewed'
 




________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where 
  foldChange > 2
  and
  Status like 'reviewed'
 




________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where 
  foldChange > 2




________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where 
  pval < .05




________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where 
  pval < .05
  and 
  [Gene ontology (GO)] like '%immune%'




________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where
  foldChange > 1.5


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where
  foldChange > 2


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where
  foldChange < 2


________________________________________


SELECT * FROM [1123].[lft_BlackAbalone_v3_genehunt]
  where
  foldChange < 0.5


________________________________________


SELECT *
  ,
Column1,Column2
  
  FROM [1123].[filt_methratio_CgM1]


________________________________________


SELECT *
  ,
'Column1','Column2'
  
  FROM [1123].[filt_methratio_CgM1]


________________________________________


SELECT *
  ,
"Column1",'Column2'
  
  FROM [1123].[filt_methratio_CgM1]


________________________________________


SELECT * FROM [1123].[filt_methratio_CgM1_id]
  where
  Column6 = 'NA'
  


________________________________________


SELECT * FROM [1123].[scratch_methratio_out]
  where 
  ratio = 'NA'


________________________________________


SELECT * FROM [1123].[scratch_methratio_out]
  where 
  ratio = 'NA'
  and 
  C_count > 0



________________________________________


SELECT * FROM [1123].[scratch_methratio_out]
  where 
  ratio = 'NA'
  and 
  C_count > 0
  and 
 eff_CT_count <> 0


________________________________________


SELECT * FROM [267].[commonloci_final]
  where
  [T3D3_start] > 0.5


________________________________________


SELECT * FROM [267].[commonloci_final]
  where
  [T3D3_meth] = 'NA'
  


________________________________________


SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth >0.5


________________________________________


SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth > 0.5
  and 
  M3_meth > 0.5



________________________________________


SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth > 0.5
  and 
  M3_meth > 0.5
  and 
  T1D3_meth > 0.5
  and
  T1D5_meth > 0.5
  and
  T3D3_meth > 0.5
  and
  T3D5_meth > 0.5
  



________________________________________


Select count (*) from
(SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth > 0.5
  and 
  M3_meth > 0.5
  and 
  T1D3_meth > 0.5
  and
  T1D5_meth > 0.5
  and
  T3D3_meth > 0.5
  and
  T3D5_meth > 0.5) alias
  



________________________________________


Select count (*) from
(SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth > 0.5
  and 
  M3_meth = 0
  and 
  T1D3_meth > 0.5
  and
  T1D5_meth > 0.5
  and
  T3D3_meth = 0
  and
  T3D5_meth = 0) alias
  



________________________________________


Select count (*) from
(SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth > 0.5
  and 
  M3_meth < 0.5
  and 
  T1D3_meth > 0.5
  and
  T1D5_meth > 0.5
  and
  T3D3_meth < 0.5
  and
  T3D5_meth < 0.5) alias
  



________________________________________


SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth > 0.5
  and 
  M3_meth < 0.5
  and 
  T1D3_meth > 0.5
  and
  T1D5_meth > 0.5
  and
  T3D3_meth < 0.5
  and
  T3D5_meth < 0.5
  



________________________________________


SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth > .8
  and 
  M3_meth > .8
  and 
  T1D3_meth = 0
  and
  T1D5_meth = 0
  and
  T3D3_meth = 0
  and
  T3D5_meth = 0
  



________________________________________


SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth > .8
  and 
  M3_meth > .8
  and 
  T1D3_meth < 0.5
  and
  T1D5_meth < 0.5
  and
  T3D3_meth < 0.5
  and
  T3D5_meth < 0.5
  



________________________________________


SELECT * FROM [267].[commonloci_final_noNAs.csv]
  where
  M1_meth > .5
  and 
  M3_meth > .5
  and 
  T1D3_meth < 0.5
  and
  T1D5_meth < 0.5
  and
  T3D3_meth < 0.5
  and
  T3D5_meth < 0.5
  



________________________________________


SELECT
  loci_id,
  M1vM3,
M1vT1D3,
M1vT1D5,
M3vT3D3,
M3vT3D5,
T1D3vT1D5,
T1D3vT3D3,
T1D5vT3D5
  
  FROM [267].[DMRs_AllLoci_PairwiseComparisons]


________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
  M1vM3 <> ' '



________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
  M1vM3 <> ' '
  and
  M1vT1D3 = ' '



________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
  M1vM3 <> ' '
  and
  M1vT1D3 like ' '



________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where

  M1vT1D3 like ' '



________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
 M1vT1D3 = ' '



________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
 M1vT1D3 <> ' '



________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
 M1vT1D3 <> ' '
and 
  M1vT1D5 = ''


________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
 M1vT1D3 <> ' '
and 
  M1vT1D5 = ''
 


________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
 M1vT1D3 <> ' '
and 
  M1vT1D5=''
 


________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
 M1vT1D3 <> ' '
and 
  M1vT1D5=null
 


________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR]
  where
 M1vT1D3 <> ' '
and 
  M1vT1D5 = null
 


________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR2]
  where
  M1vM3 <> '-'
  



________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR2]
  where
  M1vM3 <> '-'
  and
  M1vT1D3 = '-'
  and
M1vT1D5 = '-'
  and
M3vT3D3 = '-'
  and
M3vT3D5 = '-'
  and
T1D3vT1D5 = '-'
  and
T1D3vT3D3 = '-'
  and
T1D5vT3D5 = '-'
  



________________________________________


SELECT * FROM [1123].[BiGoLarvae_DMR2]
  where
M1vM3 <> '-'
  and
M1vT1D3 = '-'
  and
M1vT1D5 = '-'
  and
M3vT3D3 <> '-'
  and
M3vT3D5 <> '-'
  and
T1D3vT1D5 = '-'
  and
T1D3vT3D3 = '-'
  and
T1D5vT3D5 = '-'
  



________________________________________


SELECT * FROM [1123].[BiGoRNA_genetable_clc]clc
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  clc.["Name"]=sp.CGI_ID
  


________________________________________


SELECT * FROM [1123].[BiGoRNA_genetable_clc]clc
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  clc.["Name"]=sp.CGI_ID
  left join
  [1123].[uniprot-reviewed_wGO_010714]up
  on
  sp.SPID=up.Entry
  


________________________________________


SELECT * FROM [1123].[BiGoRNA_genetable_clc]clc
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  clc.["Name"]=sp.CGI_ID
  left join
  [1123].[uniprot-reviewed_wGO_010714]up
  on
  sp.SPID=up.Entry


________________________________________


SELECT * FROM [1123].[GPL11353_array]ar
  left join [1123].[Cgigas_EST_NCBI_040414_cl]est
  on
  ar.GB_ACC=est.Column5
  


________________________________________


SELECT * FROM [1123].[GPL11353_array]ar
  join [1123].[Cgigas_EST_NCBI_040414_cl]est
  on
  ar.GB_ACC=est.Column5
  


________________________________________


SELECT * FROM [1123].[GPL11353_array]ar
  inner join [1123].[Cgigas_EST_NCBI_040414_cl]est
  on
  ar.GB_ACC=est.Column5
  


________________________________________


SELECT * FROM [1123].[GPL11353_array]ar
  right join [1123].[Cgigas_EST_NCBI_040414_cl]est
  on
  ar.GB_ACC=est.Column5
  


________________________________________


SELECT * FROM [1123].[Cgigas_EST_NCBI_040414_cl]est
  where
  Column5='CU995582'


________________________________________


SELECT * FROM [1123].[Cgigas_EST_NCBI_040414_cl]est
  where
  Column5 = 'FQ662477'


________________________________________


SELECT * FROM [1123].[GPL11353_array]ar
  left join [1123].[Cgigas_EST_NCBI_040414_cl]est
  on
  ar.GB_ACC=est.Column5


________________________________________


SELECT * FROM [1123].[GPL11353_array]ar
  left join [1123].[Cgigas_EST_NCBI_040414_cl]est
  on
  ar.GB_ACC=est.Column5


________________________________________


SELECT ProbeName,GB_ACC,Description,Column7 FROM [1123].[GPL11353_array]ar
  left join [1123].[Cgigas_EST_NCBI_040414_cl]est
  on
  ar.GB_ACC=est.Column5


________________________________________


SELECT ProbeName,GB_ACC,Column7 as sequence,Description FROM [1123].[GPL11353_array]ar
  left join [1123].[Cgigas_EST_NCBI_040414_cl]est
  on
  ar.GB_ACC=est.Column5


________________________________________


SELECT * FROM [1123].[GPL11353_array]ar
  left join
  [1123].[Cg_Sigenae6_transcriptome]v6
  on
  ar.ContigName=v6.Column1


________________________________________


SELECT * FROM [1123].[GPL11353_array]ar
  left join
  [1123].[Cg_Sigenae6_transcriptome]v6
  on
  ar.ContigName=v6.Column1


________________________________________


SELECT Column1,Column3 FROM [1123].[GPL11353_array]ar
  left join
  [1123].[Cg_Sigenae6_transcriptome]v6
  on
  ar.ContigName=v6.Column1


________________________________________


SELECT * FROM [1123].[BiGoRNA_array_v6]rna
  left join
  [1123].[GPL11353_array]arr
  on 
  rna.Sig_No=arr.ContigName


________________________________________


SELECT * FROM [1123].[BiGoRNA_array_v6]rna
  left join
  [1123].[GPL11353_array]arr
  on 
  rna.Sig_No=arr.ContigName



________________________________________


SELECT * FROM [1123].[BiGoRNAseq_GPL11353_v6ref]
  where
  RPKM > 200


________________________________________


SELECT * FROM [1123].[BiGoRNAseq_GPL11353_v6ref]
  where
  RPKM > 2000


________________________________________


SELECT * FROM [1123].[Dheilly_SexSpecific_File_S1]
  where
  [Mean Males] > [Mean Females]


________________________________________


Select count (*)
  From
  (
SELECT * FROM [267].[CGannot_Ensembl_feat_IDColumn_FINAL]
  where
  M1coverage <> ' '
  
)alias



________________________________________


SELECT * FROM [267].[CGannot_Ensembl_feat_IDColumn_FINAL]
  where
  M1coverage <> ' '




________________________________________


SELECT * FROM [267].[CGannot_Ensembl_feat_IDColumn_FINAL]
  where
  M1coverage > 2




________________________________________


SELECT * FROM [1123].[Dheilly_SexSpecific_File_S1]
  where 
  [Mean Males] > [Mean Females]


________________________________________


SELECT * FROM [1123].[BiGo_mito_cleam]
  Where
  context like '__CG_' --_=single character wildcard




________________________________________


SELECT * FROM [1123].[BiGo_mito_cleam]
  Where
  context like '__CG_' --_=single character wildcard
  and
  CT_Count >= 5




________________________________________


SELECT * FROM [1123].[BiGo_mito_cleam]
  Where
  context like '__CG_' --_=single character wildcard
  and
  CT_Count >= 5
  and 
  ratio = 0




________________________________________


SELECT * FROM [1123].[BiGo_mito_cleam]
  Where
  context like '__CG_' --_=single character wildcard
  and
  CT_Count >= 5
  and 
  ratio = 0




________________________________________


SELECT * FROM [1123].[BiGo_mito_cleam]
  Where
  context like '__CG_' --_=single character wildcard
  and
  CT_Count >= 5
  and 
  ratio > 0.5




________________________________________


Select count (*)
from
  (
  SELECT * FROM [1123].[BiGo_mito_cleam]
)alias



________________________________________


Select count (*)
from
  (
  SELECT * FROM [1123].[BiGo_mito_cleam]
where CT_count >= 5)alias



________________________________________


Select count (*)
from
  (
  SELECT * FROM [1123].[BiGo_mito_cleam]
where CT_count >= 5 and context like '__CG_')alias



________________________________________


Select count (*)
from
  (
  SELECT * FROM [1123].[BiGo_mito_cleam]
where CT_count >= 5)alias



________________________________________


SELECT * FROM [267].[CGannot_Ensembl_feat_IDColumn_FINAL]
  where
  M1ratio > 0
  and
  M3ratio > 0 


________________________________________


SELECT * FROM [267].[CGannot_Ensembl_feat_IDColumn_FINAL]
  Where M1ratio <> ' '


________________________________________


SELECT * FROM [267].[CGannot_Ensembl_feat_IDColumn_FINAL]
  Where M1ratio <> ' '
  and M3ratio <> ' '



________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 left join
  [1123].[filt3_M3]m3
  on
  m1.Column1=m3.Column1
  



________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.Column1=m3.Column1
  



________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.Column1=m3.Column1
  



________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.Column1=m3.Column1


________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.Column1=m3.Column1


________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.M1ID=m3.M3ID
  


________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.M1ID=m3.M3ID
  


________________________________________


SELECT *
  ,CONCAT (Column1,'_', Column4) AS ChrStart
FROM [1123].[CGannot_Ensembl_feat]



________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.M1ID=m3.M3ID
  left join
    [1123].[CG_Ensembl_featurejoin]cg
  on
    m1.M1ID=cg.ChrStart


________________________________________


SELECT * FROM [1123].[CGannot_Ensembl_feat]
  where Column1 like 'C12806'


________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.M1ID=m3.M3ID
  left join
    [1123].[CG_Ensembl_featurejoin]cg
  on
    m1.M1ID=cg.ChrStart


________________________________________


SELECT * FROM [1123].[filt3_M3]
  where
  M3ratio = 'NA'
  



________________________________________


SELECT * FROM [1123].[filt3_M3]
  where
  M3ratio = 0
  



________________________________________


SELECT * FROM [1123].[filt3_M3]
  where
  M3ratio > 0
  



________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.M1ID=m3.M3ID
  left join
    [1123].[CG_Ensembl_featurejoin]cg
    on
    m1.M1ID=cg.ChrStart


________________________________________


SELECT * FROM [1123].[filt3M1_M3_CGfeature]
  where M1ratio > 0



________________________________________


SELECT * FROM [1123].[filt3M1_M3_CGfeature]
  where M1ratio > 0.5



________________________________________


SELECT * FROM [1123].[filt3M1_M3_CGfeature]
  where M1ratio > 0.5
  and
  M3ratio > 0.5



________________________________________


SELECT * FROM [1123].[filt3_M1]m1
 join
  [1123].[filt3_M3]m3
  on
  m1.M1ID=m3.M3ID
  where
  M1ratio > 0.5
  and
  M3ratio > 0.5



________________________________________


SELECT * FROM [1123].[filt3_M1]m1
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID

  



________________________________________


SELECT * FROM [1123].[filt3_M1]m1
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio 
  
  FROM [1123].[filt3_M1]m1
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio >= 0.5
  and 
  T1D5ratio >= 0.5


________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio >= 0.5
  and 
  T1D5ratio >= 0.5
  and 
  M3ratio = 0
  and 
  T3D3ratio = 0
  and 
  T3D5ratio = 0



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio >= 0.5
  and 
  T1D5ratio >= 0.5
  and 
  M3ratio < 0.5
  and 
  T3D3ratio < 0.5
  and 
  T3D5ratio < 0.5



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio >= 0.5
  and 
  T1D5ratio >= 0.5
  and 
  M3ratio >= 0.5
  and 
  T3D3ratio >= 0.5
  and 
  T3D5ratio >= 0.5



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.8
  and 
  T1D3ratio >= 0.8
  and 
  T1D5ratio >= 0.8
  and 
  M3ratio >= 0.8
  and 
  T3D3ratio >= 0.8
  and 
  T3D5ratio >= 0.8



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio = 0
  and 
  T1D3ratio = 0
  and 
  T1D5ratio = 0
  and 
  M3ratio = 0
  and 
  T3D3ratio = 0
  and 
  T3D5ratio = 0



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio = 0
  and 
  T1D5ratio >= 0.5
  and 
  M3ratio >= 0.5
  and 
  T3D3ratio = 0
  and 
  T3D5ratio >= 0.5



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio = 0
  and 
  T1D5ratio = 0
  and 
  M3ratio >= 0.5
  and 
  T3D3ratio = 0
  and 
  T3D5ratio = 0



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio > 0
  and 
  T1D3ratio = 0
  and 
  T1D5ratio = 0
  and 
  M3ratio > 0
  and 
  T3D3ratio = 0
  and 
  T3D5ratio = 0



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio > 0.3
  and 
  T1D3ratio = 0
  and 
  T1D5ratio = 0
  and 
  M3ratio > 0.3
  and 
  T3D3ratio = 0
  and 
  T3D5ratio = 0



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio > 0.1
  and 
  T1D3ratio = 0
  and 
  T1D5ratio = 0
  and 
  M3ratio > 0.1
  and 
  T3D3ratio = 0
  and 
  T3D5ratio = 0



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio = 1
  and 
  T1D3ratio = 1
  and 
  T1D5ratio = 1
  and 
  M3ratio = 1
  and 
  T3D3ratio = 1
  and 
  T3D5ratio = 1



________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio = 1
  and 
  T1D3ratio = 0
  and 
  T1D5ratio = 1
  


________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio > 0.8
  and 
  T1D3ratio < 0.2
  and 
  T1D5ratio > 0.8
  


________________________________________


SELECT M1ID,M1ratio,M3ratio,T1D3ratio,T1D5ratio,T3D3ratio,T3D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio > 0.5
  and 
  T1D3ratio < 0.2
  and 
  T1D5ratio > 0.5
  


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,m1ratio + T1D3ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio >= 0.5
  and 
  T1D5ratio >= 0.5
  and 
  M3ratio < 0.5
  and 
  T3D3ratio < 0.5
  and 
  T3D5ratio < 0.5


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,(m1ratio + T1D3ratio + T1D5ratio)
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio >= 0.5
  and 
  T1D5ratio >= 0.5
  and 
  M3ratio < 0.5
  and 
  T3D3ratio < 0.5
  and 
  T3D5ratio < 0.5


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,((m1ratio + T1D3ratio + T1D5ratio)/3)
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio >= 0.5
  and 
  T1D5ratio >= 0.5
  and 
  M3ratio < 0.5
  and 
  T3D3ratio < 0.5
  and 
  T3D5ratio < 0.5


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,((m1ratio + T1D3ratio + T1D5ratio)/3) as mean_1lin
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio >= 0.5
  and 
  T1D3ratio >= 0.5
  and 
  T1D5ratio >= 0.5
  and 
  M3ratio < 0.5
  and 
  T3D3ratio < 0.5
  and 
  T3D5ratio < 0.5


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,((m1ratio + T1D3ratio + T1D5ratio)/3) as mean_1lin
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
 


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,((m1ratio + T1D3ratio + T1D5ratio)/3) as mean_1lin,
  (Select max(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) as [Max]
  
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
 


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,((m1ratio + T1D3ratio + T1D5ratio)/3) as mean_1lin,
  (Select stdev(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) as [Max]
  
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
 


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,((m1ratio + T1D3ratio + T1D5ratio)/3) as mean_1lin,
  (Select stdev(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) as [stdev]
  
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
 


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,((m1ratio + T1D3ratio + T1D5ratio)/3) as mean_1lin,
  (Select stdev(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) as [stdev],
  (Select stdev(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) / ((m1ratio + T1D3ratio + T1D5ratio)/3) as CI
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio > 0
  
 


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,((m1ratio + T1D3ratio + T1D5ratio)/3) as mean_1lin,
  (Select stdev(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) as [stdev],
    (Select var(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) as [var],
  (Select stdev(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) / ((m1ratio + T1D3ratio + T1D5ratio)/3) as CI
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio > 0
  
 


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio,((m1ratio + T1D3ratio + T1D5ratio)/3) as mean_1lin,
  (Select stdev(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) as [stdev],
    (Select var(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) as [var],
  (Select stdev(v) from (values (M1ratio), (T1D3ratio), (T1D5ratio)) as value(v)) / ((m1ratio + T1D3ratio + T1D5ratio)/3) as cv
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'
  and 
  M1ratio > 0
  
 


________________________________________


SELECT M1ID,M1ratio,T1D3ratio,T1D5ratio
FROM [1123].[filt3_M1]m1 
  join
  [1123].[filt3_M3]m3
  on 
  m1.M1ID=m3.M3ID
  join
  [1123].[filt3_T1D3]t1d3
  on 
  m1.M1ID=t1d3.T1D3ID
    join
  [1123].[filt3_T1D5]t1d5
  on 
  m1.M1ID=t1d5.T1D5ID
  join
  [1123].[filt3_T3D3]t3d3
  on 
  m1.M1ID=t3d3.T3D3ID
join
  [1123].[filt3_T3D5]t3d5
  on 
  m1.M1ID=t3d5.T3D5ID
  where
  [M1coverage] >= '5'
  and 
  [M3coverage] >= '5'
  and
  [T1D3coverage] >= '5'
  and
  [T1D5coverage] >= '5'
  and
  [T3D3coverage] >= '5'
  and
  [T3D5coverage] >= '5'

  
 


________________________________________


SELECT * FROM [1123].[Snapshot of mRNA taxid6580 joined_uniprot_sprot2]




________________________________________


SELECT * FROM [materialized_Snapshot_mRNA taxid6580 joined_uniprot_sprot2]


________________________________________


SELECT * FROM [626].[mRNA taxid6580 joined_uniprot_sprot2]
  where aspect like 'P'


________________________________________


SELECT * FROM [626].[mRNA taxid6580 joined_uniprot_sprot2]
  where aspect = 'P'


________________________________________


SELECT * FROM [1123].[Cgigas_HSarray_hypo_genes]hypo
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  hypo.Gene = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_1000000'




________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10000001'




________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID = 'CGI_10011518'




________________________________________


SELECT * FROM [1123].[Cgigas_ensembl_tsv22]ts
  left join
  [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]go
  on 
  ts.gene_stable_id = go.CGI_ID


________________________________________


SELECT * FROM [1123].[Cgigas_ensembl_tsv22]ts
  left join
  [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]go
  on 
  ts.gene_stable_id = go.CGI_ID


________________________________________


SELECT * FROM [1123].[filt_YE_mix_22smCG5x]m
  left join
  [1123].[filt_YE_control_22smCG5x]c
  on 
  m.scaffm=c.scaffc


________________________________________


SELECT * FROM [1123].[filt_YE_mix_22smCG5x]m
  left join
  [1123].[filt_YE_control_22smCG5x]c
  on 
  m.scaffm=c.scaffc
  where scaffc <> ' '


________________________________________


SELECT * FROM [1123].[filt_YE_mix_22smCG5x]m
  left join
  [1123].[filt_YE_control_22smCG5x]c
  on 
  m.scaffm=c.scaffc
  where scaffc <> ' '



________________________________________


SELECT * FROM [1123].[filt_YE_control_22smCG3x]c
  left join
  [1123].[filt_YE_mix_22smCG3x]m
  on
  c.Column1=m.Column1


________________________________________


SELECT * FROM [1123].[filt_YE_control_22smCG3x]c
  left join
  [1123].[filt_YE_mix_22smCG3x]m
  on
  c.Column1=m.Column1
  


________________________________________


SELECT * FROM [1123].[filt_YE_control_22smCG3x]c
  left join
  [1123].[filt_YE_mix_22smCG3x]m
  on
  c.Column1=m.Column1
  where m.Column1 <> ' '


________________________________________


SELECT * FROM [1123].[sqlrT1D5.txt]t1d5
  left join
  [1123].[sqlrM3.txt]m3
  on 
  t1d5.T1D5loci=m3.M3loci
  


________________________________________


SELECT * FROM [1123].[sqlrT1D5.txt]t1d5
  left join
  [1123].[sqlrM3.txt]m3
  on 
  t1d5.T1D5loci=m3.M3loci

  
  


________________________________________


SELECT *, 
 T1D5ratio + M3ratio as new
  FROM [1123].[sqlrT1D5.txt]t1d5
  left join
  [1123].[sqlrM3.txt]m3
  on 
  t1d5.T1D5loci=m3.M3loci

  
  


________________________________________


SELECT *, 
 T1D5ratio + M3ratio as Mean 
  FROM [1123].[sqlrT1D5.txt]t1d5
  left join
  [1123].[sqlrM3.txt]m3
  on 
  t1d5.T1D5loci=m3.M3loci
  

  
  


________________________________________


SELECT * 
  FROM [1123].[sqlrT1D5.txt]t1d5
  left join
  [1123].[sqlrM3.txt]m3
  on 
  t1d5.T1D5loci=m3.M3loci
  

  
  


________________________________________


SELECT * FROM [1123].[sqlr_M1.txt]m1
  left join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.M1loci=t1d5.T1D5loci


________________________________________


SELECT * FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.M1loci=t1d5.T1D5loci


________________________________________


SELECT * FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.M1loci=t1d5.T1D5loci
  inner join
  [1123].[sqlr_T3D3.txt]t3d3
  on m1.M1loci=t3d3.T3D3loci


________________________________________


SELECT *
  FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.M1loci=t1d5.T1D5loci
  inner join
  [1123].[sqlr_T3D3.txt]t3d3
  on m1.M1loci=t3d3.T3D3loci


________________________________________


SELECT 
  cast (M1ratio as float) as M1ratio,
  cast (T1D3ratio as float) as T1D3ratio,
  cast (T1D5ratio as float) as T1D5ratio,
  cast (mean as float) as mean

  
  FROM [1123].[cg_lineage_1]


________________________________________


SELECT 
  'mean'+'T1D5' as nice
  
  FROM [1123].[_cast_lineage_1]


________________________________________


SELECT 
 [mean]+[T1D5ratio] as nice
  
  FROM [1123].[_cast_lineage_1]


________________________________________


SELECT *,
 [mean]+[T1D5ratio] as nice
  
  FROM [1123].[_cast_lineage_1]


________________________________________


SELECT *,
 [M1ratio]+[T1D3ratio]+[T1D5ratio] as nice
  
  FROM [1123].[_cast_lineage_1]


________________________________________


SELECT *,
 [M1ratio]+[T1D3ratio]+[T1D5ratio]/3 as nice
  
  FROM [1123].[_cast_lineage_1]


________________________________________


SELECT *,
  cast (M1ratio as float) as M1ratio,
  cast (T1D3ratio as float) as T1D3ratio,
  cast (T1D5ratio as float) as T1D5ratio,
  cast (mean as float) as mean

  
  FROM [1123].[cg_lineage_1]


________________________________________


SELECT loci,
  cast (M1ratio as float) as M1ratio,
  cast (T1D3ratio as float) as T1D3ratio,
  cast (T1D5ratio as float) as T1D5ratio,
  cast (mean as float) as mean

  
  FROM [1123].[cg_lineage_1]


________________________________________


SELECT *,
 [M1ratio]+[T1D3ratio]+[T1D5ratio] 
  
  
  FROM [1123].[_cast_lineage_1]


________________________________________


SELECT *,
  ([M1ratio]+[T1D3ratio]+[T1D5ratio])/3 as new 
  
  
  FROM [1123].[_cast_lineage_1]


________________________________________


SELECT *,
  ([M1ratio]+[T1D3ratio]+[T1D5ratio])/3 as mean_chk
  
  FROM [1123].[_cast_lineage_1]
  
  where
  [M1ratio]-[mean] > 0


________________________________________


SELECT *,
  ([M1ratio]+[T1D3ratio]+[T1D5ratio])/3 as mean_chk
  
  FROM [1123].[_cast_lineage_1]
  
  where
  [M1ratio]-[mean] <.2


________________________________________


SELECT *,
  ([M1ratio]+[T1D3ratio]+[T1D5ratio])/3 as mean_chk
  
  FROM [1123].[_cast_lineage_1]
  
  where
  [M1ratio]-[mean] <.2
  and
    [T1D3ratio]-[mean] <.2
  and
  [T1D5ratio]-[mean] <.2

  


________________________________________


SELECT *,
  ([M1ratio]+[T1D3ratio]+[T1D5ratio])/3 as mean_chk
  
  FROM [1123].[_cast_lineage_1]
  
  where
  [M1ratio]-[mean] < abs('0.20')
  and
    [T1D3ratio]-[mean] <.2
  and
  [T1D5ratio]-[mean] <.2

  


________________________________________


SELECT *,
  ([M1ratio]+[T1D3ratio]+[T1D5ratio])/3 as mean_chk
  
  FROM [1123].[_cast_lineage_1]
  
  where
  [M1ratio]-[mean] < abs(0.20)
  and
    [T1D3ratio]-[mean] <.2
  and
  [T1D5ratio]-[mean] <.2

  


________________________________________


SELECT *,
  ([M1ratio]+[T1D3ratio]+[T1D5ratio])/3 as mean_chk
  
  FROM [1123].[_cast_lineage_1]
  
  where
  [M1ratio]-[mean] < abs(0.20)
  and
  [T1D3ratio]-[mean] < abs(.2)
  and
  [T1D5ratio]-[mean] < abs(.2)

  


________________________________________


SELECT *
  FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.loci=t1d5.loci
  inner join
  [1123].[sqlr_T1D3.txt]t1d3
  on m1.loci=t1d3.loci


________________________________________


SELECT *,
  M1ratio
  FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.loci=t1d5.loci
  inner join
  [1123].[sqlr_T1D3.txt]t1d3
  on m1.loci=t1d3.loci


________________________________________


SELECT *,
  [M1ratio]+[T1D5ratio]
  FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.loci=t1d5.loci
  inner join
  [1123].[sqlr_T1D3.txt]t1d3
  on m1.loci=t1d3.loci


________________________________________


SELECT *,
  [M1ratio]+[T1D5ratio]+[T1D5ratio]
  FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.loci=t1d5.loci
  inner join
  [1123].[sqlr_T1D3.txt]t1d3
  on m1.loci=t1d3.loci


________________________________________


SELECT *,
  ([M1ratio]+[T1D5ratio]+[T1D5ratio])/3 as mean1
  FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.loci=t1d5.loci
  inner join
  [1123].[sqlr_T1D3.txt]t1d3
  on m1.loci=t1d3.loci


________________________________________


SELECT *,
  ([M1ratio]+[T1D5ratio]+[T1D5ratio])/3 as mean1
  FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.loci=t1d5.loci
  inner join
  [1123].[sqlr_T1D3.txt]t1d3
  on m1.loci=t1d3.loci
  where
  [M1ratio]-(([M1ratio]+[T1D5ratio]+[T1D5ratio])/3) < abs(.2)
  


________________________________________


SELECT *,
  ([M1ratio]+[T1D5ratio]+[T1D5ratio])/3 as mean1
  FROM [1123].[sqlr_M1.txt]m1
  inner join
  [1123].[sqlr_T1D5.txt]t1d5
  on m1.loci=t1d5.loci
  inner join
  [1123].[sqlr_T1D3.txt]t1d3
  on m1.loci=t1d3.loci
  where
  [M1ratio]-(([M1ratio]+[T1D3ratio]+[T1D5ratio])/3) < abs(.2)
  and
  [T1D3ratio]-(([M1ratio]+[T1D3ratio]+[T1D5ratio])/3) < abs(.2)
  and
  [T1D5ratio]-(([M1ratio]+[T1D3ratio]+[T1D5ratio])/3) < abs(.2)

  
  
  


________________________________________


SELECT *,
  ([M3ratio]+[T3D5ratio]+[T3D5ratio])/3 as mean3
  FROM [1123].[sqlr_M3.txt]m3
  inner join
  [1123].[sqlr_T3D5.txt]t3d5
  on m3.loci=t3d5.loci
  inner join
  [1123].[sqlr_T3D3.txt]t3d3
  on m3.loci=t3d3.T3D3loci
  where
  [M3ratio]-(([M3ratio]+[T3D3ratio]+[T3D5ratio])/3) < abs(.2)
  and
  [T3D3ratio]-(([M3ratio]+[T3D3ratio]+[T3D5ratio])/3) < abs(.2)
  and
  [T3D5ratio]-(([M3ratio]+[T3D3ratio]+[T3D5ratio])/3) < abs(.2)

  
  


________________________________________


SELECT *,
  ([M3ratio]+[T3D5ratio]+[T3D5ratio])/3 as mean3
  FROM [1123].[sqlr_M3.txt]m3
  inner join
  [1123].[sqlr_T3D5.txt]t3d5
  on m3.loci=t3d5.loci
  inner join
  [1123].[sqlr_T3D3.txt]t3d3
  on m3.loci=t3d3.loci
  where
  [M3ratio]-(([M3ratio]+[T3D3ratio]+[T3D5ratio])/3) < abs(.2)
  and
  [T3D3ratio]-(([M3ratio]+[T3D3ratio]+[T3D5ratio])/3) < abs(.2)
  and
  [T3D5ratio]-(([M3ratio]+[T3D3ratio]+[T3D5ratio])/3) < abs(.2)



________________________________________


SELECT * FROM [1123].[sq_cglarv_lineage_1.txt]c1
  inner join
  [1123].[sq_cglarv_lineage_3.txt]c3
  on 
  c1.loci1=c3.loci3




________________________________________


SELECT * FROM [1123].[sq_cglarv_lineage_1.txt]c1
  inner join
  [1123].[sq_cglarv_lineage_3.txt]c3
  on 
  c1.loci1=c3.loci3
  where abs(mean1 - mean3) <= 0.3



________________________________________


SELECT *,
 abs(mean1 - mean3)
  FROM [1123].[sq_cglarv_lineage_1.txt]c1
  inner join
  [1123].[sq_cglarv_lineage_3.txt]c3
  on 
  c1.loci1=c3.loci3
  where abs(mean1 - mean3) <= 0.3



________________________________________


SELECT *,
 abs(mean1 - mean3) as meandiff
  FROM [1123].[sq_cglarv_lineage_1.txt]c1
  inner join
  [1123].[sq_cglarv_lineage_3.txt]c3
  on 
  c1.loci1=c3.loci3
  where abs(mean1 - mean3) <= 0.3



________________________________________


SELECT *,
 abs(mean1 - mean3) as meandiff
  FROM [1123].[sq_cglarv_lineage_1.txt]c1
  inner join
  [1123].[sq_cglarv_lineage_3.txt]c3
  on 
  c1.loci1=c3.loci3
  where abs(mean1 - mean3) >= 0.3



________________________________________


SELECT *,
 abs(mean1 - mean3) as meandiff
  FROM [1123].[sq_cglarv_lineage_1.txt]c1
  inner join
  [1123].[sq_cglarv_lineage_3.txt]c3
  on 
  c1.loci1=c3.loci3
  where abs(mean1 - mean3) = 0



________________________________________


SELECT *,
 abs(mean1 - mean3) as meandiff
  FROM [1123].[sq_cglarv_lineage_1.txt]c1
  inner join
  [1123].[sq_cglarv_lineage_3.txt]c3
  on 
  c1.loci1=c3.loci3
  where abs(mean1 - mean3) = 0
  and mean1 = 0



________________________________________



SELECT *, ([M1ratio]+[T1D5ratio]+[T1D5ratio])/3 as mean1 
  FROM [1123].[sqlr_M1.txt]m1 inner join [1123].[sqlr_T1D5.txt]t1d5 
  on m1.loci=t1d5.loci inner join [1123].[sqlr_T1D3.txt]t1d3 on m1.loci=t1d3.loci 
  



________________________________________



SELECT *, ([M1ratio]+[T1D5ratio]+[T1D5ratio])/3 as mean1 
  FROM [1123].[sqlr_M1.txt]m1 inner join [1123].[sqlr_T1D5.txt]t1d5 
  on m1.loci=t1d5.loci inner join [1123].[sqlr_T1D3.txt]t1d3 on m1.loci=t1d3.loci 
  



________________________________________



SELECT *, ([M1ratio]+[T1D5ratio]+[T1D5ratio])/3 as mean1 
  FROM [1123].[sqlr_M1.txt]m1 inner join [1123].[sqlr_T1D5.txt]t1d5 
  on m1.loci=t1d5.loci inner join [1123].[sqlr_T1D3.txt]t1d3 on m1.loci=t1d3.loci 
  



________________________________________


SELECT * FROM [1123].[br_cglarv_sperm.txt]sperm inner join
  [1123].[br_cglarv_day3.txt]d3 on sperm.loci=d3.loci inner join 
  [1123].[br_cglarv_day5.txt]d5 on sperm.loci=d5.loci


________________________________________


SELECT * FROM [1123].[br_cglarv_sperm.txt]sperm inner join
  [1123].[br_cglarv_day3.txt]d3 on sperm.loci=d3.loci inner join 
  [1123].[br_cglarv_day5.txt]d5 on sperm.loci=d5.loci
  where
  abs(sperm.mean_sperm-d3.mean_day3) > 0.3


________________________________________


SELECT * FROM [1123].[br_cglarv_sperm.txt]sperm inner join
  [1123].[br_cglarv_day3.txt]d3 on sperm.loci=d3.loci inner join 
  [1123].[br_cglarv_day5.txt]d5 on sperm.loci=d5.loci
  where
  abs(sperm.mean_sperm-d3.mean_day3) > 0.3
  or 
  abs(sperm.mean_sperm-d5.mean_day5) > 0.3
  or 
  abs(d3.mean_day3-d5.mean_day5) > 0.3




________________________________________


SELECT *,
 sperm.mean_sperm-d3.mean_day3 as 1358
  FROM [1123].[br_cglarv_sperm.txt]sperm inner join
  [1123].[br_cglarv_day3.txt]d3 on sperm.loci=d3.loci inner join 
  [1123].[br_cglarv_day5.txt]d5 on sperm.loci=d5.loci
  where
  abs(sperm.mean_sperm-d3.mean_day3) > 0.3
  or 
  abs(sperm.mean_sperm-d5.mean_day5) > 0.3
  or 
  abs(d3.mean_day3-d5.mean_day5) > 0.3




________________________________________


SELECT *,
 sperm.mean_sperm-d3.mean_day3 as 's-3'
  FROM [1123].[br_cglarv_sperm.txt]sperm inner join
  [1123].[br_cglarv_day3.txt]d3 on sperm.loci=d3.loci inner join 
  [1123].[br_cglarv_day5.txt]d5 on sperm.loci=d5.loci
  where
  abs(sperm.mean_sperm-d3.mean_day3) > 0.3
  or 
  abs(sperm.mean_sperm-d5.mean_day5) > 0.3
  or 
  abs(d3.mean_day3-d5.mean_day5) > 0.3




________________________________________


SELECT *,
 sperm.mean_sperm-d3.mean_day3 as 's-3',
 sperm.mean_sperm-d5.mean_day5 as 's-5',
 d3.mean_day3-d5.mean_day5 as '3-5'
  FROM [1123].[br_cglarv_sperm.txt]sperm inner join
  [1123].[br_cglarv_day3.txt]d3 on sperm.loci=d3.loci inner join 
  [1123].[br_cglarv_day5.txt]d5 on sperm.loci=d5.loci
  where
  abs(sperm.mean_sperm-d3.mean_day3) > 0.3
  or 
  abs(sperm.mean_sperm-d5.mean_day5) > 0.3
  or 
  abs(d3.mean_day3-d5.mean_day5) > 0.3




________________________________________


SELECT *,
 sperm.mean_sperm-d3.mean_day3 as 's-3',
 sperm.mean_sperm-d5.mean_day5 as 's-5',
 d3.mean_day3-d5.mean_day5 as '3-5'
  FROM [1123].[br_cglarv_sperm.txt]sperm inner join
  [1123].[br_cglarv_day3.txt]d3 on sperm.loci=d3.loci inner join 
  [1123].[br_cglarv_day5.txt]d5 on sperm.loci=d5.loci
  where
  abs(sperm.mean_sperm-d3.mean_day3) > 0.3
  or 
  abs(sperm.mean_sperm-d5.mean_day5) > 0.3
  or 
  abs(d3.mean_day3-d5.mean_day5) > 0.3




________________________________________


SELECT *,
 sperm.mean_sperm-d3.mean_day3 as 's-3',
 sperm.mean_sperm-d5.mean_day5 as 's-5',
 d3.mean_day3-d5.mean_day5 as '3-5'
  FROM [1123].[br_cglarv_sperm.txt]sperm inner join
  [1123].[br_cglarv_day3.txt]d3 on sperm.loci=d3.loci inner join 
  [1123].[br_cglarv_day5.txt]d5 on sperm.loci=d5.loci
  where
  abs(sperm.mean_sperm-d3.mean_day3) > 0.4
  or 
  abs(sperm.mean_sperm-d5.mean_day5) > 0.4
  or 
  abs(d3.mean_day3-d5.mean_day5) > 0.4




________________________________________


SELECT * FROM [1123].[gene_intersect_DML_dev_wb_b.txt]dev
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on 
  dev.Column13=sp.CGI_ID


________________________________________


SELECT * FROM [1123].[gene_intersect_DML_dev_wb_b.txt]dev
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on 
  dev.Column13=sp.CGI_ID
  left join [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]slim
  on 
  dev.Column13=slim.CGI_ID


________________________________________


SELECT * FROM [1123].[gene_intersect_DML_dev_wb_b.txt]dev
  left join [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on 
  dev.Column13=sp.CGI_ID
  left join [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]slim
  on 
  dev.Column13=slim.CGI_ID
  where 
  [aspect] = 'P'
  


________________________________________


SELECT * FROM [1123].[gene_intersect_DML_dev_wb_b.txt]dev
  left join [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]slim
  on 
  dev.Column13=slim.CGI_ID
  where 
  [aspect] = 'P'
  


________________________________________


SELECT * FROM [1123].[gene_intersect_DML_dev_wb_b.txt]dev
  left join [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]slim
  on 
  dev.Column13=slim.CGI_ID
  where 
  [aspect] = 'P'
  


________________________________________


SELECT * FROM [1123].[gene_intersect_TE_c2g.txt]te
  left join [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]slim 
  on te.CGI_ID=slim.CGI_ID where [aspect] = 'P'


________________________________________


SELECT Distinct CGI_ID, GOslim_bin, aspect
  FROM [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]


________________________________________


SELECT Distinct CGI_ID, GOslim_bin, aspect
  FROM [1123].[qDOD_Cgigas_GOslim_DISTINCT]


________________________________________


SELECT * FROM [1123].[gene_intersect_TE_c2g.txt]te
  left join [1123].[qDOD_Cgigas_GOslim_DISTINCT]slim
  on te.CGI_ID=slim.CGI_ID


________________________________________


SELECT * FROM [1123].[Dheilly_SexSpecific_File_S1]s1
  left join
  [1123].[Sig6_blastn_Sig9]ss
  on 
  s1.[Genbank Acc]=ss.Column4



________________________________________


SELECT * FROM [1123].[Dheilly_SexSpecific_File_S1]s1
  left join
  [1123].[Sig6_blastn_Sig9]ss
  on 
  s1.[Genbank Acc]=ss.Column4



________________________________________


SELECT * FROM [1123].[Dheilly_SexSpecific_File_S1]s1
  left join
  [1123].[Sig6_blastn_Sig9]ss
  on 
  s1.[Genbank Acc]=ss.Column4



________________________________________


SELECT * FROM [1123].[Dheilly_SexSpecific_File_S1]s1
  left join
  [1123].[Sig6_blastn_Sig9]ss
  on 
  s1.[Genbank Acc]=ss.Column4



________________________________________


SELECT * FROM [823].[DMRvisAnnotated_CGIstats_TJGRGeneSPID_1.csv]dml
 left join
  [1123].[Dheilly_S1_v9_join ]s19
  on 
  dml.gene_ID=s19.Column2


________________________________________


SELECT * FROM [823].[DMRvisAnnotated_CGIstats_TJGRGeneSPID_1.csv]dml
 left join
  [1123].[Dheilly_S1_v9_join ]s19
  on 
  dml.gene_ID=s19.Column2



________________________________________


SELECT * FROM [823].[DMRvisAnnotated_CGIstats_TJGRGeneSPID_1.csv]dml
 left join
  [1123].[Dheilly_S1_v9_join]s19
  on 
  dml.gene_ID=s19.Column2



________________________________________


SELECT * FROM [823].[DMRvisAnnotated_CGIstats_TJGRGeneSPID_1.csv]dml
 left join
  [1123].[Dheilly_S1_v9_join]s19
  on 
  dml.gene_ID=s19.Column2



________________________________________


SELECT * FROM [1123].[Dheilly_DiffGametogenesis_File_S2]s2
  left join
  [1123].[Sig6_blastn_Sig9]ss
  on
  s2.Genebank=ss.Column4


________________________________________


SELECT * FROM [1123].[Dheilly_DiffGametogenesis_File_S2]s2
  left join
  [1123].[Sig6_blastn_Sig9]ss
  on
  s2.Genebank=ss.Column4


________________________________________


SELECT * FROM [823].[DMRvisAnnotated_CGIstats_TJGRGeneSPID_1.csv]dml
  left join 
  [1123].[Dheilly_s2_sig6sig9_join]s2
  on
  dml.gene_ID=s2.Column2


________________________________________


SELECT * FROM [823].[DMRvisAnnotated_CGIstats_TJGRGeneSPID_1.csv]dml
  left join 
  [1123].[Dheilly_s2_sig6sig9_join]s2
  on
  dml.gene_ID=s2.Column2


________________________________________


SELECT * FROM 
  [823].[DMRvisAnnotated_CGIstats_TJGRGeneSPID_1.csv]
  where Fgo > Mgo
  


________________________________________


SELECT * FROM 
  [823].[DMRvisAnnotated_CGIstats_TJGRGeneSPID_1.csv]
  where Fgo < Mgo
  


________________________________________


SELECT * FROM 
  [823].[DMRvisAnnotated_CGIstats_TJGRGeneSPID_1.csv]
  where Fgo / Mgo > 2
  


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  where 
  Pathway like '%Fermentation%'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  Pathway like 'immune'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  Pathway like '%immune%'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  Pathway like 'apoptosis'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  Pathway like '%apoptosis%'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  Pathway like 'cell'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  Pathway like '%cell%'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  [Protein names] like '%interle%'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry
  Where
  [Protein names] like '%interle%'


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  left join
  [1123].[SPID and GO Numbers]go
 on
 blast.Column3=go.SPID


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  left join
  [1123].[SPID and GO Numbers]go
 on
 blast.Column3=go.SPID
  left join
  [1123].[GO_to_GOslim]slim
  on
  go.GOID=slim.GO_id


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  left join
  [1123].[SPID and GO Numbers]go
 on
 blast.Column3=go.SPID
  left join
  [1123].[GO_to_GOslim]slim
  on
  go.GOID=slim.GO_id
  where 
  aspect = 'P'


________________________________________


SELECT * FROM [1123].[Phel_deseq2_sig_results_c]sig
  left join
  [94].[Phel_clc_blastx_uniprot_sprot_sqlready_1.tab]bla
  on 
  sig.Column1=bla.Column1


________________________________________


SELECT * FROM [1123].[Phel_deseq2_sig_results_c]sig
  left join
  [94].[Phel_clc_blastx_uniprot_sprot_sqlready_1.tab]bla
  on 
  sig.Column1=bla.Column1


________________________________________


SELECT * FROM [299].[seastar_clc_uniprot_sprot_2.tab]blast
  Left join
  [1123].[uniprot-reviewed_wGO_010714]unp
  on
  blast.Column3=unp.Entry


________________________________________


SELECT * FROM [1123].[Phel_sig_normalized_exp]sig
  left join 
 [1123].[Phel_clc_wID_info]des
 on
 sig.contig=des.Column1


________________________________________


SELECT 
 Contig 
  
  FROM [1123].[Phel_sig_normalized_exp]sig
  left join 
 [1123].[Phel_clc_wID_info]des
 on
 sig.contig=des.Column1


________________________________________


SELECT 
 Contig,
  [Protein names]
  
  FROM [1123].[Phel_sig_normalized_exp]sig
  left join 
 [1123].[Phel_clc_wID_info]des
 on
 sig.contig=des.Column1


________________________________________


SELECT 
 Contig,
  HK_CF2,
  HK_CF35,
  HK_CF70,
  V_CF26,
  V_CF34,
V_CF71, 
  [Protein names]
  
  FROM [1123].[Phel_sig_normalized_exp]sig
  left join 
 [1123].[Phel_clc_wID_info]des
 on
 sig.contig=des.Column1


________________________________________


SELECT 
[Protein names],
  HK_CF2,
  HK_CF35,
  HK_CF70,
  V_CF26,
  V_CF34,
V_CF71, 
  Contig
  
  
  FROM [1123].[Phel_sig_normalized_exp]sig
  left join 
 [1123].[Phel_clc_wID_info]des
 on
 sig.contig=des.Column1


________________________________________


SELECT * FROM [1123].[Phel_uniprot_sprot_sq.tab]phel
  left join
  [1123].[uniprot-reviewed_wGO_010714]des
  on
  phel.Column3=des.Entry


________________________________________


SELECT *, ([M1ratio]+[M3ratio])/2 as meanmales
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 
  where [M1ratio]-(([M1ratio]+[M3ratio])/2) < abs(.2) 
  and [M3ratio] - (([M1ratio]+[M3ratio])/2) < abs(.2) 


________________________________________


SELECT *, ([M1ratio]+[M3ratio])/2 as meanmales
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 
  where [M1ratio]-(([M1ratio]+[M3ratio])/2) < abs(.2) 
  and [M3ratio] - (([M1ratio]+[M3ratio])/2) < abs(.2) 

    


________________________________________


SELECT *, ([M1ratio]+[M3ratio])/2 as meanmales
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 


    


________________________________________


SELECT *, ([M1ratio]+[M3ratio])/2 as meanmales
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 
  where [M1ratio]-(([M1ratio]+[M3ratio])/2) > abs(.2) 

    


________________________________________


SELECT *, ([M1ratio]+[M3ratio])/2 as meanmales
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 
  where [M1ratio]-(([M1ratio]+[M3ratio])/2) > abs(.2) 
  or [M3ratio] - (([M1ratio]+[M3ratio])/2) > abs(.2) 

    


________________________________________


SELECT *, ([M1ratio]-[M3ratio])/2 as difference
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 

    


________________________________________


SELECT *, ([M1ratio]-[M3ratio])/2 as diff
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 
  where (([M1ratio]-[M3ratio])/2) > abs(.2)

    


________________________________________


SELECT *, ([M1ratio]-[M3ratio])/2 as diff
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 
  where (([M1ratio]-[M3ratio])/2) > (.2)

    


________________________________________


SELECT *, ([M1ratio]-[M3ratio]) as diff
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 
  where (([M1ratio]-[M3ratio])) > (.2)


    


________________________________________


SELECT *, ([M1ratio]-[M3ratio]) as diff
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 


    


________________________________________


SELECT *, ([M1ratio]-[M3ratio]) as diff
  FROM [267].[M1.txt] 
  inner join [267].[M3.txt] on [267].[M1.txt].loci=[267].[M3.txt].loci 
  where (([M1ratio]-[M3ratio])) > (.2)
  or (([M1ratio]-[M3ratio])) < (-.2)


    


________________________________________


SELECT * FROM [1123].[TE_WUBonly_CGI_b.txt]b
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on 
  b.ID=sp.SPID


________________________________________


SELECT * FROM [1123].[TE_WUBonly_CGI_b.txt]b
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on 
  b.ID like sp.SPID


________________________________________


SELECT * FROM [1123].[TE_WUBonly_CGI_b.txt]b
  inner join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on 
  b.ID like sp.SPID


________________________________________


SELECT * FROM [1123].[TE_WUBonly_CGI_b.txt]b
  inner join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on 
  b.ID = sp.SPID


________________________________________


SELECT * FROM [1123].[TE_WUBonly_CGI_b.txt]b
  inner join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on 
  b.ID = sp.SPID


________________________________________


SELECT * FROM [1123].[TE_WUBonly_CGI_b.txt]b
  inner join
  [1123].[SNAPSHOT]sp
  on 
  b.ID = sp.SPID


________________________________________


SELECT * 
FROM [1123].[Cgigas Larvae RNA-Seq OsHV UR10]ur
left join
[1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]ds
on
ur.ID = ds.CGI_ID


________________________________________


SELECT * 
FROM [1123].[TE_WUBonly_CGI_b.txt]b
left join
[1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]ds
on
b.ID = ds.CGI_ID


________________________________________


SELECT * from [1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]




________________________________________


SELECT * 
FROM [1123].[TE_WUBonly_CGI_b.txt]b
left join
[1123].[qDOD_Cgigas_GOslim_DISTINCT]ds
on
b.ID = ds.CGI_ID


________________________________________


SELECT * from [1123].[qDOD_Cgigas_GOslim_DISTINCT]




________________________________________


SELECT * from [1123].[qDOD_Cgigas_GOslim_DISTINCT]




________________________________________


SELECT * from [1123].[qDOD_Cgigas_GOslim_DISTINCT]




________________________________________


SELECT * from [1123].[qDOD_Cgigas_GOslim_DISTINCT]




________________________________________


SELECT * from [1123].[qDOD_Cgigas_GOslim_DISTINCT]




________________________________________


SELECT * from [1123].[qDOD_Cgigas_GOslim_DISTINCT]




________________________________________


SELECT * from [1123].[qDOD_Cgigas_GOslim_DISTINCT]




________________________________________


SELECT * from [1123].[qDOD_Cgigas_GOslim_DISTINCT]




________________________________________


SELECT * from [1123].[qDOD_Cgigas_GOslim_DISTINCT]




________________________________________


SELECT * FROM [1123].[merc_slim]sl
  left join
  [1123].[merc_ID_CpG_1.tab]cpg
  on
  sl.Column1=cpg.Column1
  


________________________________________


SELECT * FROM [1123].[Phel_uniprot_sprot_sql.tab]


________________________________________


SELECT * FROM [1123].[Phel_uniprot_sprot_sql.tab]phel
left join 
[1123].[uniprot-reviewed_wGO_010714]des 
on phel.Column3=des.Entry
  



________________________________________


SELECT * FROM [1123].[Phel_uniprot_sprot_sql.tab]phel
left join 
[1123].[uniprot-reviewed_wGO_010714]des 
on phel.Column3=des.Entry
  



________________________________________


SELECT * FROM [1123].[Phel_uniprot_sprot_sql.tab]phel
left join 
[1123].[uniprot-reviewed_wGO_010714]des 
on phel.Column3=des.Entry
  



________________________________________


SELECT * FROM [1123].[Phel_uniprot_sprot_sql.tab]phel
left join 
[1123].[uniprot-reviewed_wGO_010714]des 
on phel.Column3=des.Entry
  



________________________________________


SELECT * FROM [1045].[UniprotProtNamesReviewed_yes20130610]
  where 
  GeneName = 'eys spam CG33955'
  


________________________________________


SELECT * FROM [1045].[UniprotProtNamesReviewed_yes20130610]
  where 
  ProteinName = '%immune%'
  


________________________________________


SELECT * FROM [1045].[UniprotProtNamesReviewed_yes20130610]
  where 
  ProteinName = '%corn%'
  


________________________________________


SELECT * FROM [1045].[UniprotProtNamesReviewed_yes20130610]
  where 
  ProteinName like'%corn%'
  


________________________________________


SELECT * FROM [1045].[UniprotProtNamesReviewed_yes20130610]
  where 
  ProteinName like '%immune%'
  


________________________________________


SELECT Column1, term, GOSlim_bin, aspect, ProteinName FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1045].[UniprotProtNamesReviewed_yes20130610]sp 
on p.Column3=sp.SPID 
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id
where aspect like 'P'



________________________________________


SELECT DISTINCT Column1, GOSlim_bin FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1045].[UniprotProtNamesReviewed_yes20130610]sp 
on p.Column3=sp.SPID 
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id
where aspect like 'P'



________________________________________


SELECT DISTINCT Column1, GOSlim_bin FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1045].[UniprotProtNamesReviewed_yes20130610]sp 
on p.Column3=sp.SPID 
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT DISTINCT Column1, GOSlim_bin FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT * FROM [1123].[Piura_v1_CpG.sorted]cpg
  left join
[1123].[Piura_v1_GOslim.sorted]go
  on
  cpg.Column1=go.Column1


________________________________________


SELECT * FROM [1123].[Piura_v1_CpG.sorted]cpg
  left join
[1123].[Piura_v1_GOslim.sorted]go
  on
  cpg.Column1=go.Column1


________________________________________


SELECT Column1, term, GOSlim_bin, aspect, ProteinName FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1045].[UniprotProtNamesReviewed_yes20130610]sp 
on p.Column3=sp.SPID 
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id
where aspect like 'P'
  


________________________________________


SELECT Column1, term, GOSlim_bin, aspect, ProteinName FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1045].[UniprotProtNamesReviewed_yes20130610]sp 
on p.Column3=sp.SPID 
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id




________________________________________


SELECT Column1, term, GOSlim_bin, aspect, ProteinName FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1045].[UniprotProtNamesReviewed_yes20130610]sp 
on p.Column3=sp.SPID 
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT Column1, term, GOSlim_bin, aspect, ProteinName FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1045].[UniprotProtNamesReviewed_yes20130610]sp 
on p.Column3=sp.SPID 
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id
where aspect like 'P'
and ProteinName like '%heat%'


________________________________________


SELECT Column1, term, GOSlim_bin, aspect, ProteinName FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1045].[UniprotProtNamesReviewed_yes20130610]sp 
on p.Column3=sp.SPID 
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id
where aspect like 'P'
and GOSlim_bin like 'stress response'


________________________________________


SELECT Column1, term, GOSlim_bin, aspect, ProteinName FROM [1123].[Piura_v1_uniprot_sprot_sql.tab]p
left join [1045].[UniprotProtNamesReviewed_yes20130610]sp 
on p.Column3=sp.SPID 
left join [1123].[SPID and GO Numbers]go 
on p.Column3=go.SPID 
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id
where aspect like 'P'




________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
left join
[1123].[Cgigas-DEGlist-sql]de
on
sp.CGI_ID=de.baseMean  


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
left join
[1123].[Cgigas-DEGlist-sql]de
on
sp.CGI_ID=de.baseMean  


________________________________________


SELECT SPID, basemean FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
left join
[1123].[Cgigas-DEGlist-sql]de
on
sp.CGI_ID=de.baseMean  


________________________________________



SELECT SPID, basemean FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
left join
[1123].[Cgigas-DEGlist-sql]de
on
sp.CGI_ID=de.baseMean  


________________________________________



SELECT SPID, basemean as DiffEx_ID FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
left join
[1123].[Cgigas-DEGlist-sql]de
on
sp.CGI_ID=de.baseMean  


________________________________________



SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
left join
[1123].[Cgigas-DEGlist-sql]de
on
sp.CGI_ID=de.baseMean  


________________________________________



SELECT SPID, 
  basemean as DiffEx_ID 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
left join
[1123].[Cgigas-DEGlist-sql]de
on
sp.CGI_ID=de.baseMean  


________________________________________



SELECT SPID, 
  basemean as DiffEx_ID 
  FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
left join
[1123].[Cgigas-DEGlist-sql]de
on
sp.CGI_ID=de.baseMean  
where baseMean like 'CGI%'


________________________________________


SELECT * FROM [1123].[Cgigas-DEGlist-sql]deg
left join
[1123].[qDOD_Cgigas_GOslim_DISTINCT]sl
on
deg.baseMean=sl.CGI_ID  


________________________________________


SELECT 
CGI_ID,
GOslim_bin  
  FROM [1123].[Cgigas-DEGlist-sql]deg
left join
[1123].[qDOD_Cgigas_GOslim_DISTINCT]sl
on
deg.baseMean=sl.CGI_ID  


________________________________________


SELECT 
CGI_ID,
GOslim_bin,
aspect  
  FROM [1123].[Cgigas-DEGlist-sql]deg
left join
[1123].[qDOD_Cgigas_GOslim_DISTINCT]sl
on
deg.baseMean=sl.CGI_ID  


________________________________________


SELECT 
CGI_ID,
GOslim_bin,
aspect  
  FROM [1123].[Cgigas-DEGlist-sql]deg
left join
[1123].[qDOD_Cgigas_GOslim_DISTINCT]sl
on
deg.baseMean=sl.CGI_ID
where
aspect like 'P'  

  


________________________________________


SELECT CGI_ID
  FROM [1123].[Cgigas-RNAseq-HS-goslim]

  


________________________________________


SELECT * FROM [1123].[qDOD_Cgigas_GOslim_DISTINCT]


________________________________________



SELECT CGI_ID 
  
  FROM [1123].[qDOD_Cgigas_GOslim_DISTINCT]


________________________________________


SELECT * FROM [1123].[Cgigas-DEGlist-sql]de
  left join
[1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]go
  on 
de.basemean=go.CGI_ID  


________________________________________


SELECT * FROM [1123].[Cgigas-DEGlist-sql]de
  left join
[1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]go
  on 
de.baseMean=go.CGI_ID  


________________________________________


SELECT  
CGI_ID,
log2FoldChange,  
SPID,
Description,
GOID,
GOSlim_bin  
  FROM [1123].[Cgigas-DEGlist-sql]de
  left join
[1123].[qDOD_Cgigas_GO_GOslim_DISTINCT]go
  on 
de.baseMean=go.CGI_ID  
  where 
  aspect = 'P'


________________________________________


SELECT * FROM [1123].[Cgigas-DEGlist-GOdesc]de
  left join
  [1123].[Cgigas-HS-count.txt]cnt
  on
  de.CGI_ID=cnt.[Feature ID]


________________________________________


SELECT * FROM [1123].[Cgigas-DEGlist-GOdesc]de
  left join
  [1123].[Cgigas-HS-count.txt]cnt
  on
  de.CGI_ID=cnt.[Feature ID]
  where
  GOSlim_bin like '%stress%'


________________________________________


SELECT * FROM [1123].[Cgigas-DEGlist-GOdesc]de
  left join
  [1123].[Cgigas-HS-count.txt]cnt
  on
  de.CGI_ID=cnt.[Feature ID]
  where
  GOSlim_bin like '%stress%'


________________________________________


SELECT * FROM [1123].[Cgigas-DEGlist-GOdesc]de
  left join
  [1123].[Cgigas-HS-count.txt]cnt
  on
  de.CGI_ID=cnt.[Feature ID]
  where
  GOSlim_bin like 'death'


________________________________________


SELECT * FROM [1123].[Cgigas-DEGlist-GOdesc]de
  left join
  [1123].[Cgigas-HS-count.txt]cnt
  on
  de.CGI_ID=cnt.[Feature ID]
  where
  GOSlim_bin like 'death'


________________________________________


SELECT * FROM [1123].[Cgigas-DEGlist-GOdesc]de
  left join
  [1123].[Cgigas-HS-count.txt]cnt
  on
  de.CGI_ID=cnt.[Feature ID]
  where
  GOSlim_bin like 'death'
  and
  Description like '%apop%'


________________________________________


SELECT 
* 
  FROM [1123].[Cgigas-DEGlist-sql]deg
left join
[1123].[qDOD_Cgigas_GOslim_DISTINCT]sl
on
deg.baseMean=sl.CGI_ID
where
aspect like 'P'  


________________________________________


SELECT *
  FROM 

[1123].[Cgigas-DEGlist-sql]de
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
on
sp.CGI_ID=de.baseMean  


________________________________________


SELECT *
  FROM 
[1123].[Cgigas-DEGlist-sql]de
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
on
sp.CGI_ID=de.baseMean  


________________________________________


SELECT *
  FROM [1123].[Cgigas-DEGlist-sql]de
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
on
sp.CGI_ID=de.baseMean  


________________________________________


SELECT *
  FROM [1123].[Cgigas-DEGlist-sql]de
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
on
de.baseMean=sp.CGI_ID


________________________________________


SELECT *
  FROM [1123].[Cgigas-DEGlist-sql]de
  left join
[1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
on
de.baseMean=sp.CGI_ID


________________________________________


SELECT * FROM [1123].[_cuffdiffgenes.sorted_by_expression.sig.txt]sig
  left join
   [1123].[_rebuilt.gtf.geneIDend]id
  on
  sig.gene_ID=id.Column10
  


________________________________________


SELECT Column1, Column2, Column3, Column4, Column5, Column6, Column7, Column8, Column9 
  FROM [1123].[_cuffdiffgenes.sorted_by_expression.sig.txt]sig
  left join
   [1123].[_rebuilt.gtf.geneIDend]id
  on
  sig.gene_ID=id.Column10
  


________________________________________


SELECT * FROM [1123].[Zhang_etal_SuppTable14]
  where
  GeneID='CGI_10003983'


________________________________________


SELECT * FROM [1123].[Zhang_etal_SuppTable14]
  where
  GeneID='CGI_10003983'


________________________________________


SELECT * FROM [1123].[Zhang_etal_SuppTable14]
  where
  GeneID='CGI_10003983'


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID='CGI_100004806'


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
  where
  CGI_ID='CGI_10004806'


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
where
SPID like 'Q%'
  


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
where
CGI_ID like 'C%'
  


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
where
CGI_ID like 'CGI_100004%'
  


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
where
CGI_ID like 'CGI_100004086%'
  


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
where
CGI_ID like 'CGI_10000408%'
  


________________________________________


SELECT * FROM [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]
where
CGI_ID like 'CGI_10004086'
  


________________________________________


SELECT * FROM [1123].[Cgigas Larvae RNA-Seq OsHV]


________________________________________


SELECT * FROM [1123].[Cgigas Larvae RNA-Seq OsHV]


________________________________________


SELECT * FROM [1123].[Cgigas Larvae RNA-Seq OsHV]
  where
  ID like 'CGI_10003983'



________________________________________


SELECT * FROM [1123].[OlyO transcriptome v3 swiss-prot Blast]oly
  left join
  [1123].[uniprot-reviewed_wGO_010714]up
  on 
  oly.Column1=up.Entry


________________________________________


SELECT * FROM [1123].[OlyO transcriptome v3 swiss-prot Blast]oly
left join
[1123].[uniprot-reviewed_wGO_010714]up
on 
oly.Column1=up.Entry


________________________________________


SELECT * FROM [1123].[OlyO transcriptome v3 swiss-prot Blast]oly
left join
[1123].[uniprot-reviewed_wGO_010714]up
on 
oly.Column1=up.Entry




________________________________________


SELECT * FROM [1123].[OlyO transcriptome v3 swiss-prot Blast]oly
left join
[1123].[uniprot-reviewed_wGO_010714]up
  on
oly.Column1=up.Entry




________________________________________


SELECT * FROM [1123].[OlyO transcriptome v3 swiss-prot Blast]oly
left join
[1123].[uniprot-reviewed_wGO_010714]up
on 
oly.Column3=up.Entry




________________________________________


SELECT * FROM [1123].[OlyO transcriptome v3 swiss-prot Blast]oly
left join
[1123].[uniprot-reviewed_wGO_010714]up
on 
oly.Column3=up.Entry



________________________________________


SELECT * FROM [1123].[Dheilly_S1_v9_join]d
  left join
  [1123].[Cg_Sigenae6_transcriptome]s
  on
  d.Column1=s.Column1


________________________________________


SELECT * FROM [1123].[Dheilly_S1_v9_join]d
  full join
  [1123].[Cg_Sigenae6_transcriptome]s
  on
  d.Column1=s.Column1


________________________________________


SELECT * FROM [1123].[Dheilly_S1_v9_join]d
  right join
  [1123].[Cg_Sigenae6_transcriptome]s
  on
  d.Column1=s.Column1


________________________________________


SELECT * FROM [1123].[Dheilly_S1_v9_join]d
left join
  [1123].[Cg_Sigenae6_transcriptome]s
  on
  d.Column1=s.Column1


________________________________________


SELECT * FROM [1123].[Dheilly_S1_v9_join]d
left join
  [1123].[Cg_Sigenae6_transcriptome]s
  on
  d.Column1=s.Column1


________________________________________


SELECT * FROM [1123].[Phel_blastx_Pm_e50]
  Where Column2 like 'PMI_000464-RA'


________________________________________


SELECT Distinct Column1 as ContigID, GOSlim_bin
  FROM [1123].[Past_blastx_uniprot.sql.tab]anno
  left join [1123].[SPID and GO Numbers]go
  on anno.Column3=go.SPID
  left join [1123].[GO_to_GOslim]slim
  on go.GOID=slim.GO_id where aspect like 'P'


________________________________________


SELECT COUNT (*)
FROM
(SELECT Distinct Column1 as ContigID, GOSlim_bin
  FROM [1123].[Past_blastx_uniprot.sql.tab]anno
  left join [1123].[SPID and GO Numbers]go
  on anno.Column3=go.SPID
  left join [1123].[GO_to_GOslim]slim
  on go.GOID=slim.GO_id where aspect like 'P') alias  -- note: needs alias



________________________________________


SELECT COUNT (*)
FROM
(SELECT Distinct Column1 as ContigID, GOSlim_bin
  FROM [1123].[Past_blastx_uniprot.sql.tab]anno
  left join [1123].[SPID and GO Numbers]go
  on anno.Column3=go.SPID
  left join [1123].[GO_to_GOslim]slim
  on go.GOID=slim.GO_id where aspect like 'P') alias  -- note: needs alias



________________________________________


SELECT * FROM [1123].[YEmixDMR-gene]ye
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
 
  ye.Column14=sp.CGI_ID


________________________________________


SELECT * FROM [1123].[YEmixDMR-gene]ye
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
 
  ye.Column14=sp.CGI_ID


________________________________________


SELECT * FROM [1123].[Pgen_blastx_uniprot_sql.tab]


________________________________________


SELECT * 
FROM [1123].[Pgen_blastx_uniprot_sql.tab]

  


________________________________________


SELECT * 
FROM [1123].[Pgen_blastx_uniprot_sql.tab]ann
left join
[1123].[uniprot-reviewed_wGO_010714]uni
on   
ann.Column3 = uni.Entry  


________________________________________


SELECT * 
FROM [1123].[Pgen_blastx_uniprot_sql.tab]ann
left join
[1123].[uniprot-reviewed_wGO_010714]uni
on   
ann.Column3 = uni.Entry  


________________________________________


SELECT * 
FROM [1123].[Pgen_blastx_uniprot_sql.tab]ann
left join
[1123].[uniprot-reviewed_wGO_010714]uni
on   
ann.Column3 = uni.Entry


________________________________________


SELECT * 
FROM [1123].[OlyO transcriptome v3 swiss-prot Blast]blast
Left join
[1123].[uniprot-reviewed_wGO_010714]unp
on  
blast.Column3 = unp.Entry  


________________________________________


SELECT * FROM 
[859].[Geo_Female-blastx-uniprot]uni
Left Join
[1022].[GeoF_blastn_GeoM_3.out]fm
on
uni.Column1 = fm.Column1  


________________________________________


SELECT * FROM 
[859].[Geo_Female-blastx-uniprot]uni
Left Join
[1022].[GeoF_blastn_GeoM_3.out]fm
on
uni.Column1 = fm.Column1  


________________________________________


SELECT * FROM 
[859].[Geo_Female-blastx-uniprot]uni
Left Join
[1022].[GeoF_match_GeoM]fm
on
uni.Column1 = fm.GeoF_ID


________________________________________


SELECT * FROM 
[859].[Geo_Female-blastx-uniprot]uni
Left Join
[1022].[GeoF_match_GeoM]fm
on
uni.Column1 = fm.GeoF_ID
Where GeoF_ID is null


________________________________________


SELECT 
Column1 as ContigID, term, GOSlim_bin, aspect, ProteinName 
FROM [859].[Geo_Female-blastx-uniprot]md
left join 
[1045].[UniprotProtNamesReviewed_yes20130610]sp
on md.Column3=sp.SPID
left join
[1123].[SPID and GO Numbers]go
on md.Column3=go.SPID
left join
[1123].[GO_to_GOslim]slim on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT 
Column1 as ContigID, term, GOSlim_bin, aspect, ProteinName 
FROM [859].[Geo_Female-blastx-uniprot]md
left join 
[1045].[UniprotProtNamesReviewed_yes20130610]sp
on md.Column3=sp.SPID
left join
[1123].[SPID and GO Numbers]go
on md.Column3=go.SPID
left join
[1123].[GO_to_GOslim]slim on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT 
*
FROM [859].[Geo_Female-blastx-uniprot]md
left join 
[1045].[UniprotProtNamesReviewed_yes20130610]sp
on md.Column3=sp.SPID
left join
[1123].[SPID and GO Numbers]go
on md.Column3=go.SPID
left join
[1123].[GO_to_GOslim]slim on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT 
Column1 as ContigID, term, GOID, GOSlim_bin, aspect, ProteinName 
FROM [859].[Geo_Female-blastx-uniprot]md
left join 
[1045].[UniprotProtNamesReviewed_yes20130610]sp
on md.Column3=sp.SPID
left join
[1123].[SPID and GO Numbers]go
on md.Column3=go.SPID
left join
[1123].[GO_to_GOslim]slim on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT * FROM [1123].[Geo_Female-full-Annotation]fu
Left join
[1022].[GeoF_match_GeoM]m
on
fu.ContigID = m.GeoF_ID


________________________________________


SELECT * FROM [1123].[Geo_Female-full-Annotation]fu
Left join
[1022].[GeoF_match_GeoM]m
on
fu.ContigID = m.GeoF_ID
where GeoF_ID is null


________________________________________


SELECT * FROM [1123].[Geo_Female-full-Annotation]fu
Left join
[1022].[GeoF_match_GeoM]m
on
fu.ContigID = m.GeoF_ID




________________________________________


SELECT * FROM [1123].[Geo-Female-full-with-Match-join]


________________________________________


SELECT * FROM [1123].[Geo-Female-full-with-Match-join]
  where GeoF_ID is null
  


________________________________________


SELECT * FROM [1022].[GeoFemale-full-anno-with-SPID]fusp
  Left join
[1022].[GeoF_match_GeoM]m
on
fusp.ContigID = m.GeoF_ID


________________________________________


SELECT * FROM [1123].[Piura_v1_CpG.sorted]cpg
  left join
[1123].[Piura_v1_GOslim.sorted]go
  on
  cpg.Column1=go.Column1


________________________________________


SELECT * FROM [1123].[exon_intersect_DML_lin_wb]ei
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  ei.Column14 = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[exon_intersect_DML_lin_wb]ei
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  ei.Column14 = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[intron_intersect_DML_lin_wb]ii
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  ii.Column14 = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[exon_intersect_DML_dev_wb]ei
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  ei.Column14 = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[exon_intersect_DML_dev_wb]ei
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  ei.Column14 = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[intron_intersect_DML_dev_wb]ii
  left join
  [1123].[qDOD Cgigas Gene Descriptions (Swiss-prot)]sp
  on
  ii.Column14 = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[exon_intersect_DML_lin_wb]ei
  left join
  [1123].[qDOD-Ensembl-annotation]sp
  on
  ei.Column14 = sp.CGI_ID


________________________________________


SELECT * FROM [1123].[DML-genes]dml
  left join 
  [1123].[qDOD-Ensembl-annotation]sp
  on
  dml.Column14 = sp.CGI_ID
 


________________________________________


SELECT * FROM [1123].[DML-genes]dml
  left join 
  [1123].[qDOD-Ensembl-annotation]sp
  on
  dml.Column14 = sp.CGI_ID
 


________________________________________


SELECT * FROM [1123].[DML-genes]dml
  left join 
  [1123].[qDOD-Ensembl-annotation]sp
  on
  dml.Column14 = sp.CGI_ID
 where Column14 = 'CGI_10012036'


________________________________________


SELECT * FROM [1123].[DML-genes]dml
  left join 
  [1123].[qDOD-Ensembl-annotation]sp
  on
  dml.Column14 = sp.CGI_ID
 where Column14 = 'CGI_10013832'


________________________________________


SELECT * 
FROM [1123].[Geoduck-tranv2-blastx_sprot]blast
left join 
[1045].[UniprotProtNamesReviewed_yes20130610]sp
on blast.Column3=sp.SPID
left join
[1123].[SPID and GO Numbers]go
on blast.Column3=go.SPID
left join
[1123].[GO_to_GOslim]slim on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT * 
FROM [1123].[Geoduck-tranv2-blastx_sprot]blast
left join 
[1045].[UniprotProtNamesReviewed_yes20130610]sp
on blast.Column3=sp.SPID
left join
[1123].[SPID and GO Numbers]go
on blast.Column3=go.SPID
left join
[1123].[GO_to_GOslim]slim on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT * 
FROM [1123].[Geoduck-tranv2-blastx_sprot]blast
left join
[1123].[SPID and GO Numbers]go
on blast.Column3=go.SPID
left join
[1123].[GO_to_GOslim]slim on go.GOID=slim.GO_id
where aspect like 'P'


________________________________________


SELECT * FROM [1123].[Geoduck-tranv2-blastx_sprot]blast 
left join
 [1123].[SPID and GO Numbers]go 
on blast.Column3=go.SPID 


________________________________________


SELECT * FROM [1123].[Geoduck-v2_GO]go
  left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id where aspect like 'P'


________________________________________


SELECT * FROM [1123].[Snapshot-Geoduck-v2_GO-only]go
  left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id where aspect like 'P'


________________________________________


SELECT * FROM [1123].[Snapshot-Geoduck-v2_GO-only]go
left join [1123].[GO_to_GOslim]slim 
on go.GOID=slim.GO_id where aspect like 'P'


________________________________________


SELECT * FROM [1123].[Snapshot-geoduck-goslim]


________________________________________


SELECT * FROM [1123].[Snapshot-geoduck-goslim]


________________________________________


SELECT * FROM [1123].[Snapshot-geoduck-goslim]


________________________________________


SELECT * FROM [412].[bact detection peptides and proteins]
  Where protein like '%RUEPO%'
  


________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1


________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1
  left join 
  [1123].[Dheilly_SexSpecific_File_S1]ss
  on 
  ss.[Genbank Acc] = s6.Column4


________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1
  left join 
  [1123].[Dheilly_SexSpecific_File_S1]ss
  on 
  ss.[Genbank Acc] = s6.Column4
  where
  ID_Ref <> ' '


________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1
  left join 
  [1123].[Dheilly_SexSpecific_File_S1]ss
  on 
  ss.[Genbank Acc] = s6.Column4


________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1
  left join 
  [1123].[Dheilly_SexSpecific_File_S1]ss
  on 
  ss.[Genbank Acc] = s6.Column4
where ID_Ref <> ' '


________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1
  left join 
  [1123].[Dheilly_SexSpecific_File_S1]ss
  on 
  ss.[Genbank Acc] = s6.Column4
where ID_Ref <> ' '


________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1
  left join 
  [1123].[Dheilly_SexSpecific_File_S1]ss
  on 
  ss.[Genbank Acc] = s6.Column4
where ID_Ref <> ' '


________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1
  left join 
  [1123].[Dheilly_DiffGametogenesis_File_S2]df
  on 
  df.Genebank = s6.Column4




________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1
  left join 
  [1123].[Dheilly_DiffGametogenesis_File_S2]df
  on 
  df.Genebank = s6.Column4
  Where ID_Ref <> ' '




________________________________________


SELECT * 
  FROM [1123].[Dheilly_blastn_Geoduck-v2]bl
  left join
  [1123].[Sig6_blastn_Sig9]s6
  on
  bl.Column1 = s6.Column1
  left join 
  [1123].[Dheilly_DiffGametogenesis_File_S2]df
  on 
  df.Genebank = s6.Column4
  Where ID_Ref <> ' '



________________________________________


SELECT * FROM [1123].[Geoduck-tranv3-blastx_sprot]bl
  left join
  [1123].[uniprot-reviewed_wGO_010714]uni
  on
  bl.Column3 = uni.Entry


________________________________________


SELECT 
 Column1 as ContigID,
 Column13 as evalue, 
 Entry,
 'Gene ontology IDs',
'Gene ontology (GO)',  
  'Protein names'
  FROM [1123].[Geoduck-tranv3-blastx_sprot]bl
  left join
  [1123].[uniprot-reviewed_wGO_010714]uni
  on
  bl.Column3 = uni.Entry


________________________________________


SELECT 
 Column1 as ContigID,
 Column13 as evalue, 
 Entry,
 "Gene ontology IDs",
'Gene ontology (GO)',  
  'Protein names'
  FROM [1123].[Geoduck-tranv3-blastx_sprot]bl
  left join
  [1123].[uniprot-reviewed_wGO_010714]uni
  on
  bl.Column3 = uni.Entry


________________________________________


SELECT 
 Column1 as ContigID,
 Column13 as evalue, 
 Entry,
 "Gene ontology IDs",
"Gene ontology (GO)",  
  "Protein names"
  FROM [1123].[Geoduck-tranv3-blastx_sprot]bl
  left join
  [1123].[uniprot-reviewed_wGO_010714]uni
  on
  bl.Column3 = uni.Entry


________________________________________


SELECT 
 Column1 as ContigID,
 Column13 as evalue, 
 Entry as UniProt_Acc,
 "Gene ontology IDs",
"Gene ontology (GO)",  
  "Protein names"
  FROM [1123].[Geoduck-tranv3-blastx_sprot]bl
  left join
  [1123].[uniprot-reviewed_wGO_010714]uni
  on
  bl.Column3 = uni.Entry


________________________________________


SELECT 
 Column1 as ContigID,
 Column13 as evalue, 
 Entry as UniProt_Acc,
 "Gene ontology IDs",
"Gene ontology (GO)",  
  "Protein names"
  FROM [1123].[Geoduck-tranv3-blastx_sprot]bl
  left join
  [1123].[uniprot-reviewed_wGO_010714]uni
  on
  bl.Column3 = uni.Entry


________________________________________


SELECT count(*) 
  FROM [1314howe].[UW Salaries 2009]
  WHERE monthly_salary < 11235



________________________________________


SELECT count(*) 
  FROM [1314howe].[UW Salaries 2009]
 WHERE monthly_salary > 11235
  AND (title LIKE '%SOFTWARE%' OR title LIKE '%COMPUTER%')



________________________________________


SELECT *
  FROM [1314howe].[UW Salaries 2009]
 WHERE monthly_salary > 11235
  AND (title LIKE '%SOFTWARE%' OR title LIKE '%COMPUTER%')



________________________________________


SELECT *
  FROM [1314howe].[UW Salaries 2009]
 WHERE 
 -- monthly_salary > 11235 AND 
  (title LIKE '%SOFTWARE%' OR title LIKE '%COMPUTER%')



________________________________________


SELECT * FROM [1314howe].[sunrise sunset times 2009 - 2011]


________________________________________


SELECT count(*) FROM [1314howe].[sunrise sunset times 2009 - 2011]


________________________________________


SELECT *
  FROM [1314howe].[UW Salaries 2009]
 WHERE monthly_salary > 11235
  AND (title LIKE '%SOFTWARE%' OR title LIKE '%COMPUTER%')



________________________________________


SELECT *
  FROM [1314howe].[UW Salaries 2009]
 WHERE last like 'MICHAUD'



________________________________________


SELECT *
  FROM [1314howe].[UW Salaries 2009]
 WHERE last like 'LEWIS'



________________________________________


SELECT * FROM [1352].[mbari_ALL_PHYLUM_COUNT_by_gene_site_tax_id]


________________________________________


SELECT * FROM [1352].[mbari_COG_PHYLUM_best pp for each gene, read]


________________________________________


SELECT * FROM [1231].[NatureMapping_historic1.csv]


________________________________________


SELECT OBSERVER_ID  FROM [1231].[NatureMapping_historic1.csv]


________________________________________


SELECT OBSERVER_ID 
  FROM [1231].[NatureMapping_historic1.csv]
  
UNION

SELECT Obs_id
  FROM [1231].[ArboretumData.csv]

  UNION

SELECT OBSERVER_ID
  FROM [1231].[online_export_080410_edit.csv]

  UNION

SELECT NULL as observer_id
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT 'historic' as source, OBSERVER_ID 
  FROM [1231].[NatureMapping_historic1.csv]
  
UNION

SELECT 'arboretum' as source, Obs_id
  FROM [1231].[ArboretumData.csv]

  UNION

SELECT 'online_export' as source, OBSERVER_ID
  FROM [1231].[online_export_080410_edit.csv]

  UNION

SELECT 'ebird' as source, NULL as observer_id
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT *
  FROM [1231].[NatureMapping_historic1.csv]



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , lat as latitude
     , long as longitude
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]



________________________________________




SELECT 'arboretum' as datasource
  
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name

  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , Date as date

  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
  , convert(datetime, [date]) as date
 
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year

  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
  
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude
  
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude
  
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude

    , source

     
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude

    , source
     , qty as quantity

     
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude

    , source
     , qty as quantity
     , null as estimate
     , habitat as habitat1

     
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________




SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude

    , source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family
     
  FROM [1231].[ArboretumData.csv]

--  UNION

--SELECT 'online_export' as source
--     , OBSERVER_ID
--     , Species_id as species_code

--  FROM [1231].[online_export_080410_edit.csv]



________________________________________


SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , QUESTION
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , LATITUDE
     , LONGITUDE
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]



________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name


  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name


  FROM [1231].[online_export_080410_edit.csv]



________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
    -- , q as questionable
     , st as state


  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
  --   , QUESTION
     , STATE


  FROM [1231].[online_export_080410_edit.csv]



________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state


  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE


  FROM [1231].[online_export_080410_edit.csv]



________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
  , cast(Co as varchar(max)) as county
  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY

  FROM [1231].[online_export_080410_edit.csv]



________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day

  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day


  FROM [1231].[online_export_080410_edit.csv]



________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude
  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , LATITUDE
     , LONGITUDE
  FROM [1231].[online_export_080410_edit.csv]



________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude
     , cast(source as varchar(max)) as source
  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , LATITUDE
     , LONGITUDE
     , SOURCE
  FROM [1231].[online_export_080410_edit.csv]



________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , LATITUDE
     , LONGITUDE
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]



________________________________________


select distinct question from [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT Years + Months + Days
  FROM [1231].[xls_ebird_WA_history.txt]


________________________________________


SELECT * FROM [1231].[xls_ebird_WA_history.txt]


________________________________________


SELECT years FROM [1231].[xls_ebird_WA_history.txt]


________________________________________


SELECT convert(varchar(4), years) FROM [1231].[xls_ebird_WA_history.txt]


________________________________________


SELECT convert(varchar(4), years) 
     + convert(varchar(4), months)
     + convert(varchar(4), days)
  FROM [1231].[xls_ebird_WA_history.txt]


________________________________________


SELECT convert(varchar(4), years) +'\'
     + convert(varchar(4), months) + '\'
     + convert(varchar(4), days)
  FROM [1231].[xls_ebird_WA_history.txt]


________________________________________


SELECT ''
     + convert(varchar(4), months)
     + '\'
     + convert(varchar(4), days)
     + '\'
     + convert(varchar(4), years) 
  FROM [1231].[xls_ebird_WA_history.txt]


________________________________________


SELECT ''
     + convert(varchar(4), months)
     + '/'
     + convert(varchar(4), days)
     + '/'
     + convert(varchar(4), years) 
  FROM [1231].[xls_ebird_WA_history.txt]


________________________________________


SELECT convert(datetime,
  convert(varchar(4), months)
     + '/'
     + convert(varchar(4), days)
     + '/'
     + convert(varchar(4), years)
  )
  FROM [1231].[xls_ebird_WA_history.txt]


________________________________________


SELECT 'online_export' as source
     , NULL as OBSERVER_ID

  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT 'online_export' as source
     , NULL as OBSERVER_ID
     , species_code as species_code
     , common_NAME as common_name
     , null as scientific_name
--  , case when (QUESTION = ‘Not valid and reviewed’  OR QUESTION = ‘Not valid but not reviewed’) THEN 0 ELSE 1 END as questionable
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT 'online_export' as source
     , NULL as OBSERVER_ID
     , species_code as species_code
     , common_NAME as common_name
     , null as scientific_name
  FROM [1231].[xls_ebird_WA_history.txt]
  WHERE QUESTION = 'Not valid and reviewed'



________________________________________


SELECT 'online_export' as source
     , NULL as OBSERVER_ID
     , species_code as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
  FROM [1231].[xls_ebird_WA_history.txt]
 



________________________________________


SELECT 'online_export' as source
     , NULL as OBSERVER_ID
     , species_code as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , LATITUDE
     , LONGITUDE
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]
 



________________________________________



SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , lat as latitude
     , long as longitude
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]




________________________________________


SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , latitude as latitude
     , longitude as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]




________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date

  FROM [1231].[NatureMapping_historic1.csv]
  
 UNION   

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date

  FROM [1231].[ArboretumData.csv]




________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day


  FROM [1231].[NatureMapping_historic1.csv]
  
 UNION   

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day


  FROM [1231].[ArboretumData.csv]




________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
  , convert(float, lat) as latitude
     , long as longitude


  FROM [1231].[NatureMapping_historic1.csv]
  



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
  , convert(float, lat) as latitude
  , convert(float,long) as longitude


  FROM [1231].[NatureMapping_historic1.csv]
  



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , case when lat = '' then NULL ELSE lat end as latitude
   --  , convert(float,long) as longitude


  FROM [1231].[NatureMapping_historic1.csv]
  



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , case when lat = '' then NULL ELSE lat end as latitude
   --  , convert(float,long) as longitude


  FROM [1231].[NatureMapping_historic1.csv]
  where lat = ''



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , case when lat = '' then NULL ELSE lat end as latitude
   --  , convert(float,long) as longitude


  FROM [1231].[NatureMapping_historic1.csv]
  where lat != ''



________________________________________


SELECT
  isnumeric(lat)


  FROM [1231].[NatureMapping_historic1.csv]




________________________________________


SELECT lat



  FROM [1231].[NatureMapping_historic1.csv]
where   isnumeric(lat) = 1



________________________________________


SELECT lat



  FROM [1231].[NatureMapping_historic1.csv]
where   isnumeric(lat) = 0 and lat != ''



________________________________________



SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , lat as latitude
     , long as longitude
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]
  
 UNION   

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]




________________________________________



  
SELECT 'online_export' as datasource
     , OBSERVER_ID

  FROM [1231].[online_export_080410_edit.csv]
  
  UNION
  
SELECT 'online_export' as datasource
     , NULL as OBSERVER_ID

  FROM [1231].[xls_ebird_WA_history.txt]





________________________________________



  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
  

  FROM [1231].[online_export_080410_edit.csv]
  



________________________________________



  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
  

  FROM [1231].[online_export_080410_edit.csv]
  
  UNION
  
SELECT 'online_export' as datasource
     , NULL as OBSERVER_ID
  , convert(varchar(max), species_code) as species_code
 
  FROM [1231].[xls_ebird_WA_history.txt]





________________________________________


  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
   
  FROM [1231].[online_export_080410_edit.csv]
  
  UNION
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE

  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
   
  FROM [1231].[online_export_080410_edit.csv]
  
  UNION
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE

  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , LATITUDE
     , LONGITUDE
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]
  
  UNION
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , LATITUDE
     , LONGITUDE
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]


________________________________________



SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , lat as latitude
     , long as longitude
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]
  
 UNION   

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]

  


________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , LATITUDE
     , LONGITUDE
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]


________________________________________



SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , LATITUDE
     , LONGITUDE
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]





________________________________________



SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county

  FROM [1231].[NatureMapping_historic1.csv]
  
  UNION
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY

  FROM [1231].[xls_ebird_WA_history.txt]





________________________________________



SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]
  
  UNION
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]





________________________________________



SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , convert(varchar(max), lat) as LATITUDE
     , convert(varchar(max), long) as LONGITUDE
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]
  
 UNION   

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]

  UNION
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]
  
  UNION
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]




________________________________________


SELECT month, year, common_name, county, questionable, quantity 
  FROM [1231].[NatureMapping]


________________________________________


SELECT month, year, common_name, county, questionable, quantity 
  FROM [1231].[NatureMapping]
 WHERE common_name is not null



________________________________________


SELECT month, year, common_name, county, count(*) 
  FROM [1231].[NatureMapping]
 WHERE common_name is not null
  GROUP BY month, year, common_name, county



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , convert(varchar(max), lat) as LATITUDE
     , convert(varchar(max), long) as LONGITUDE
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]

 UNION

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family
  FROM [1231].[ArboretumData.csv]

  UNION

SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]

  UNION

SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION =
'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]




________________________________________


SELECT * FROM [1314howe].[sql azure bulk load throughput]


________________________________________


SELECT * FROM [1314howe].[sql azure bulk load throughput]


________________________________________


SELECT * FROM 1385s



________________________________________


SELECT * FROM 1385s order by date_created desc



________________________________________


SELECT count(*) FROM 1385s 



________________________________________


SELECT count(*) FROM 1385_queries



________________________________________


SELECT * FROM 1385_queries



________________________________________


SELECT * FROM 1385_queries where is_public = 1



________________________________________


SELECT count(*) FROM 1385_queries where is_public = 1



________________________________________


SELECT count(*) FROM 1385_queries 
  --where is_public = 1



________________________________________


SELECT count(*) FROM sys.tables
  --where is_public = 1



________________________________________


SELECT count(*) FROM 1385_queries
  --where is_public = 1



________________________________________


SELECT * FROM 1385_queries
  --where is_public = 1



________________________________________


SELECT count(*) FROM 1385_queries where sql_code NOT LIKE '%table%'
  --where is_public = 1



________________________________________


SELECT count(*) FROM 1385_queries where sql_code LIKE '%table%'
  --where is_public = 1



________________________________________


SELECT * FROM 1385_queries where sql_code LIKE '%table%'
  --where is_public = 1



________________________________________


SELECT * FROM 1385_queries where sql_code LIKE '%FROM table%'
  --where is_public = 1



________________________________________


SELECT * FROM 1385_queries where sql_code LIKE '%table%'
  --where is_public = 1



________________________________________


SELECT * FROM 1385_queries where sql_code LIKE '%FROM [table%'
  --where is_public = 1



________________________________________


SELECT * FROM 1385_queries where sql_code LIKE '%FROM%table%'
  --where is_public = 1



________________________________________


SELECT * FROM 1385_queries where sql_code LIKE '%FROM [table%'
  --where is_public = 1



________________________________________


SELECT * FROM 1385_queries where sql_code LIKE '%FROM \[table%'
  --where is_public = 1



________________________________________


SELECT * FROM 1385_queries where sql_code LIKE '%FROM%table_%'
  --where is_public = 1



________________________________________


SELECT count(*) FROM 1385_queries where sql_code LIKE '%FROM%table_%'
  --where is_public = 1



________________________________________


SELECT count(*) FROM 1385_queries where sql_code NOT LIKE '%FROM%table_%'
  --where is_public = 1



________________________________________


SELECT * FROM sys.tables



________________________________________


SELECT * FROM sys.tables where name like '%log%'



________________________________________


SELECT * 
  FROM [1307].[vizdeck_ALL_18may2011_1221.csv] x
 WHERE EXISTS (
   SELECT * 
     FROM [1307].[vizdeck_ALL_18may2011_1221.csv] y
    WHERE x.query_id = y.query_id
      AND y.score != 0
 )



________________________________________


SELECT * 
  FROM [1307].[vizdeck_ALL_18may2011_1221.csv] x
 WHERE score !=0
  
--  AND EXISTS (
--   SELECT * 
--     FROM [1307].[vizdeck_ALL_18may2011_1221.csv] y
--    WHERE x.query_id = y.query_id
--      AND y.score != 0
-- )



________________________________________



select * from 1385_queries;


________________________________________



select * from 1385_queries where is_public = 1;


________________________________________



select count(*) from 1385_queries where is_public = 1;


________________________________________



select count(*) from 1385_queries --where is_public = 0;


________________________________________



--select count(*) from 1385_queries --where is_public = 0;
select * from sys.tables;


________________________________________



--select count(*) from 1385_queries --where is_public = 0;
select count(*) from sys.tables where name like 'table_%';


________________________________________



--select count(*) from 1385_queries --where is_public = 0;
select count(*) from sys.tables where name like '%table_%';


________________________________________



select * from 1385_queries --where name like '%table_%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select count(*) from 1385_queries where sql_code like '%table_%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select * from 1385_queries where sql_code like '%table_%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select count(*) from 1385_queries where sql_code like '%table_%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select count(*) from 1385_queries where sql_code not like '%table_%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select count(*) from 1385_queries where sql_code like '%table_%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select count(*) from 1385_queries where sql_code like '%table_%' and sql_code not like '%AND%' and sql_code not like '%JOIN%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select count(*) from 1385_queries where sql_code like '%table_%' 
 -- and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select * from 1385_queries where sql_code not like '%table_%' 
  and sql_code like '%AND%' 
 -- and sql_code not like '%JOIN%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select * from 1385_queries where sql_code like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select count(*) from 1385_queries where sql_code like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%' --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select count(*) from 1385_queries where not (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';


________________________________________



select count(*) from 1385_queries where not (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
  select * from sys.tables;


________________________________________



--select count(*) from 1385_queries where not (sql_code  like '%table_%' 
--  and sql_code not like '%AND%' 
--  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
  select * from sys.tables;


________________________________________



--select count(*) from 1385_queries where not (sql_code  like '%table_%' 
--  and sql_code not like '%AND%' 
--  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
  select * from 1385_queries;


________________________________________



--select count(*) from 1385_queries where not (sql_code  like '%table_%' 
--  and sql_code not like '%AND%' 
--  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
  select * from 1385_queries where owner = '88';


________________________________________



--select count(*) from 1385_queries where not (sql_code  like '%table_%' 
--  and sql_code not like '%AND%' 
--  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries 
   --where owner = '88';
--select * from [88].[Hand Data.csv]



________________________________________



--select count(*) from 1385_queries where not (sql_code  like '%table_%' 
--  and sql_code not like '%AND%' 
--  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]



________________________________________



--select count(*) from 1385_queries where not (sql_code  like '%table_%' 
--  and sql_code not like '%AND%' 
--  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

select * from [1154].[plusseparated.txt]



________________________________________



--select count(*) from 1385_queries where not (sql_code  like '%table_%' 
--  and sql_code not like '%AND%' 
--  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
-- select * from 1385_queries order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

select * from [1154].[plusseparated.txt]



________________________________________



--select count(*) from 1385_queries where not (sql_code  like '%table_%' 
--  and sql_code not like '%AND%' 
--  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



--select count(*) from 1385_queries where not (sql_code  like '%table_%' 
--  and sql_code not like '%AND%' 
--  and sql_code not like '%JOIN%') --where is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select count(*) from 1385_queries where 1=1
  --and not (sql_code  like '%table_%' 
  --and sql_code not like '%AND%' 
  --and sql_code not like '%JOIN%') 
  and is_public = 1;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select count(*) from 1385_queries where 1=1
  --and not (sql_code  like '%table_%' 
  --and sql_code not like '%AND%' 
  --and sql_code not like '%JOIN%') 
  and is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select count(*) from 1385_queries where 1=1
  --and not (sql_code  like '%table_%' 
  --and sql_code not like '%AND%' 
  --and sql_code not like '%JOIN%') 
  --and is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select count(*) from 1385_queries where 1=1
  and not (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') 
  and is_public = 0;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select count(*) from 1385_queries where 1=1
  and not (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') 
  and is_public = 1;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select count(*) from 1385_queries where 1=1
  and (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') 
  and is_public = 1;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select 1385, count(*) from 1385_queries where 1=1
  and (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') 
  and is_public = 1;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select * from 1385_queries where 1=1
  and (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') 
  and is_public = 1;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select owner, count(*) from 1385_queries where 1=1
  and (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') 
  and is_public = 1
  group by owner
  order by count(*) desc;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select owner, count(*) from 1385_queries where 1=1
  and (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') 
 -- and is_public = 1
  group by owner
  order by count(*) desc;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________



select owner, count(*) from 1385_queries where 1=1
  and not (sql_code  like '%table_%' 
  and sql_code not like '%AND%' 
  and sql_code not like '%JOIN%') 
 -- and is_public = 1
  group by owner
  order by count(*) desc;
--select count(*) from sys.tables where name like '%table_%';
  
 select * from 1385_queries where short_desc like '%orca%' --order by date_created desc;
   --where owner = '88';
--select * from [88].[Hand Data.csv]

--select * from [1154].[plusseparated.txt]



________________________________________


SELECT o.*
     , CASE WHEN sunrise IS NULL THEN 'night' ELSE 'day' END as day_or_night
  FROM [1117].[orcasound-detections.csv] o
  LEFT OUTER JOIN [1314howe].[sunrise sunset times 2009 - 2011] day
 ON date between day.sunrise and day.sunset



________________________________________


SELECT * FROM [1231].[ArboretumData.csv] 



________________________________________


SELECT common_name
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT county
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


select * from 1385_queries;



________________________________________


select owner, count(*) from 1385_queries group by owner;



________________________________________


select owner, count(*) from 1385_queries group by owner order by count(*);



________________________________________


select owner, count(*) from 1385_queries group by owner order by count(*) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select * from 1385_queries



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select * from 1385_queries order by date_created desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select owner, max(date_created) from 1385_queries group by owner order by max(date_created) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select owner, max(date_created) from 1385_queries where owner like '%washington%' 
  group by owner order by max(date_created) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select owner, max(date_created) 
  from 1385_queries q, [uw_employees_dept.csv] e
  where owner like '%washington%' 
    and q.owner like '%'+ e.1385name + '%'
  group by owner order by max(date_created) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select owner, e.last, e.first, e.department, max(date_created) 
  from 1385_queries q, [uw_employees_dept.csv] e
  where owner like '%washington%' 
    and q.owner like '%'+ e.1385name + '%'
  group by owner, e.last, e.first, e.department
  order by max(date_created) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select owner, e.last, e.first, e.department, e.1385name, max(date_created) 
  from 1385_queries q, [uw_employees_dept.csv] e
  where owner like '%washington%' 
    and q.owner like e.1385name + '%'
  group by owner, e.last, e.first, e.department, e.1385name
  order by max(date_created) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select owner, e.last, e.first, e.department, e.1385name, max(date_created) 
  from 1385_queries q, [uw_employees_dept.csv] e
  where owner like '%washington%' 
    and q.owner like e.1385name + '%'
    and e.1385name is not null
  group by owner, e.last, e.first, e.department, e.1385name
  order by max(date_created) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select owner, e.last, e.first, e.department, e.1385name, max(date_created) 
  from 1385_queries q, [uw_employees_dept.csv] e
  where owner like '%washington%' 
    and q.owner like e.1385name + '%'
  and len(e.1385name) > 0
  group by owner, e.last, e.first, e.department, e.1385name
  order by max(date_created) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select --owner, e.last, e.first, e.1385name,
  e.department, count(*), max(date_created) 
  from 1385_queries q, [uw_employees_dept.csv] e
  where owner like '%washington%' 
    and q.owner like e.1385name + '%'
  and len(e.1385name) > 0
  group by --owner, e.last, e.first, e.1385name
  e.department
  order by max(date_created) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select --owner, e.last, e.first, e.1385name,
  e.department, count(*), max(date_created) 
  from 1385_queries q, [uw_employees_dept.csv] e
  where owner like '%washington%' 
    and q.owner like e.1385name + '%'
  and len(e.1385name) > 0
  group by --owner, e.last, e.first, e.1385name
  e.department
  order by count(*) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

select --owner, e.last, e.first, e.1385name,
  e.department--, count(*), max(date_created) 
  from 1385_queries q, [uw_employees_dept.csv] e
  where owner like '%washington%' 
    and q.owner like e.1385name + '%'
  and len(e.1385name) > 0
  group by --owner, e.last, e.first, e.1385name
  e.department
  order by count(*) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select owner, count(*), max(date_created)
  from 1385_queries q
    where owner not like '%washington%'
  group by owner
 order by count(*) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select owner, count(*), max(date_created)
  from 1385_queries q
    --where owner not like '%washington%'
  group by owner
 order by count(*) desc;



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select sum(cnt) from (

select owner, count(*) as cnt, max(date_created) dt
  from 1385_queries q
    --where owner not like '%washington%'
  group by owner
-- order by count(*) desc
) s



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

--select sum(cnt) from (

--select owner, count(*) as cnt, max(date_created) dt
--  from 1385_queries q
    --where owner not like '%washington%'
--  group by owner
-- order by count(*) desc
--) s
  
  
select top 100 * from 1385_queries
  



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select sum(cnt) from (

select owner, count(*) as cnt, max(date_created) dt
  from 1385_queries q
   where 1=1
     -- and owner not like '%washington%'
     and is_public = 1
  group by owner
-- order by count(*) desc
) s
  
  
--select top 100 * from 1385_queries
  



________________________________________


select * from sys.tables



________________________________________


select * from sys.tables where name like '%1385%'



________________________________________


select * from sys.tables where name like '%table%'



________________________________________


select count(*) from sys.tables where name like '%table_%'



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select sum(cnt) from (

select owner, count(*) as cnt, max(date_created) dt
  from 1385_queries q
   where 1=1
      and owner not like '%washington%'
     and is_public = 1
  group by owner
-- order by count(*) desc
) s
  
  
--select top 100 * from 1385_queries
  



________________________________________


select count(*) from sys.tables where name like '%dbo%'



________________________________________


select * from sys.tables where name like '%dbo%'



________________________________________


--select * from sys.tables where name like '%dbo%'
  
  select * from sys.schemas



________________________________________


select * from sys.tables where schema_id = 1--like '%dbo%'
  
--  select * from sys.schemas



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select sum(cnt) from (

select owner, count(*) as cnt, max(date_created) dt
  from 1385_queries q
   where 1=1
      and owner not like '%washington%'
     and is_public = 1
  group by owner
-- order by count(*) desc
) s
  
  
--select top 100 * from 1385_queries
  



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select sum(cnt) from (

select owner, count(*) as cnt, max(date_created) dt
  from 1385_queries q
   where 1=1
      and owner like '%washington%'
     --and is_public = 1
  group by owner
-- order by count(*) desc
) s
  
  
--select top 100 * from 1385_queries
  



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select sum(cnt) from (

select owner, count(*) as cnt, max(date_created) dt
  from 1385_queries q
   where 1=1
      and owner not like '%washington%'
     --and is_public = 1
  group by owner
-- order by count(*) desc
) s
  
  
--select top 100 * from 1385_queries
  



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select sum(cnt) from (

select owner, count(*) as cnt, max(date_created) dt
  from 1385_queries q
   where 1=1
      and owner like '%washington%'
     --and is_public = 1
  group by owner
-- order by count(*) desc
) s
  
  
--select top 100 * from 1385_queries
  



________________________________________


--select owner, count(*) from 1385_queries group by owner order by count(*) desc;

--select --owner, e.last, e.first, e.1385name,
--  e.department--, count(*), max(date_created) 
--  from 1385_queries q, [uw_employees_dept.csv] e
--  where owner like '%washington%' 
--    and q.owner like e.1385name + '%'
--  and len(e.1385name) > 0
--  group by --owner, e.last, e.first, e.1385name
--  e.department
--  order by count(*) desc;

select sum(cnt) from (

select owner, count(*) as cnt, max(date_created) dt
  from 1385_queries q
   where 1=1
      and owner like '%washington%'
     and is_public = 1
  group by owner
-- order by count(*) desc
) s
  
  
--select top 100 * from 1385_queries
  



________________________________________


select datepart(day, date_created), count(*) 
  from 1385_queries
group by datepart(day, date_created)
  
--  select * from sys.schemas



________________________________________


select cast(date_created as date), count(*) 
  from 1385_queries
group by cast(date_created as date)
  
--  select * from sys.schemas



________________________________________


select dt, count(*)  from (
  select cast(date_created as date) dt
  from 1385_queries
  ) x
  group by dt
  order by count(*)


________________________________________


select dt, count(*)  from (
  select cast(datepart(month, date_created) as varchar) + '/' + cast(datepart(year, date_created) as varchar) dt
  from 1385_queries
  ) x
  group by dt
  order by count(*)


________________________________________


select dt, count(*)  from (
  select month, year, cast(month as varchar) + '/' + cast(year as varchar) dt
  from (
select datepart(month, date_created) as month,  datepart(year, date_created) as year
  from 1385_queries
  ) x
) y
  group by dt
  order by count(*)


________________________________________


select dt, year, month, count(*)  from (
  select month, year, cast(month as varchar) + '/' + cast(year as varchar) dt
  from (
select datepart(month, date_created) as month,  datepart(year, date_created) as year
  from 1385_queries
  ) x
) y
  group by dt, year, month
  order by year, month



________________________________________


select dt, count(*)  from (
  select month, year, cast(month as varchar) + '/' + cast(year as varchar) dt
  from (
select datepart(month, date_created) as month,  datepart(year, date_created) as year
  from 1385_queries
  ) x
) y
  group by dt, year, month
  order by year, month



________________________________________


select dt, count(*) as cnt from (
  select month, year, cast(month as varchar) + '/' + cast(year as varchar) dt
  from (
select datepart(month, date_created) as month,  datepart(year, date_created) as year
  from 1385_queries
  ) x
) y
  group by dt, year, month
  order by year, month



________________________________________


select dt as date, count(*) as number_of_queries from (
  select month, year, cast(month as varchar) + '/' + cast(year as varchar) dt
  from (
select datepart(month, date_created) as month,  datepart(year, date_created) as year
  from 1385_queries
  ) x
) y
  group by dt, year, month
  order by year, month



________________________________________


select dt as date, month, year, count(*) as number_of_queries from (
  select month, year, cast(month as varchar) + '/' + cast(year as varchar) dt
  from (
select datepart(month, date_created) as month,  datepart(year, date_created) as year
  from 1385_queries
  ) x
) y
  group by dt, year, month
  order by year, month



________________________________________


select top 100 * from dbo.1385_query_log



________________________________________


SELECT * FROM [1314howe].[uw_employees_dept.csv]
  WHERE email = '1267'



________________________________________


SELECT * FROM [1314howe].[uw_employees_dept.csv]
  WHERE email like 'whitead%'



________________________________________


SELECT * FROM [1314howe].[uw_employees_dept.csv]
  WHERE email like 'whitead%'



________________________________________


SELECT * FROM [1314howe].[uw_employees_dept.csv]
  WHERE email like 'whitead%'



________________________________________


select * from sys.tables



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]


________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]


________________________________________


select name from 1314howe.[dnasamples.csv] where status_id = (select id from 1314howe.[statuses.csv] where name = 'failed alignment')


________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]

  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s65.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s64.xlsx.txt]

  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s65.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s64.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]

  
  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s65.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s64.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s61.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s60.xlsx.txt]

  
  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s65.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s64.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s61.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s60.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s59.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s58.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s57.xlsx.txt]

  
  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s65.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s64.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s61.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s60.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s59.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s58.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s57.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s56.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s55.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s54.xlsx.txt]

  
  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s65.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s64.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s61.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s60.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s59.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s58.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s57.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s56.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s55.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s54.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s53.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s52.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s51.xlsx.txt]

  
  
  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s65.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s64.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s61.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s60.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s59.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s58.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s57.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s56.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s55.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s54.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s53.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s52.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s51.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s50.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s49.xlsx.txt]

  
  
  
  
  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s65.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s64.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s61.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s60.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s59.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s58.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s57.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s56.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s55.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s54.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s53.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s52.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s51.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s50.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s49.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s48.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s47.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s46.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s45.xlsx.txt]

  
  
  
  
  
  



________________________________________


SELECT * FROM [1314howe].[For Share Point Report SSGCID s73.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s69.xlsx.txt]
  UNION ALL 
SELECT * FROM [1314howe].[For Share Point Report SSGCID s68.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s67.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s66.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s65.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s64.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s63.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s62.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s61.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s60.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s59.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s58.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s57.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s56.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s55.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s54.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s53.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s52.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s51.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s50.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s49.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s48.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s47.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s46.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s45.xlsx.txt]
  UNION ALL
SELECT * FROM [1314howe].[For Share Point Report SSGCID s44.xlsx.txt]
  
  
  



________________________________________


select *
  from 1314howe.[dnasamples.csv] s, 1314howe.HT_screening_results r
 where status_id = (select id from 1314howe.[statuses.csv] where name = 'failed alignment')
   and r.Clone_name like s.name + '%'



________________________________________


select *
  from 1314howe.[dnasamples.csv] s--, 1314howe.HT_screening_results r
 where status_id = (select id from 1314howe.[statuses.csv] where name = 'failed alignment')
   --and r.Clone_name like s.name + '%'



________________________________________


select * from 1314howe.ht_screening_results
  where [Clone_name] like 'AnphA.00354%'



________________________________________


select * from 1314howe.ht_screening_results
  where [Clone_name] like '%AnphA%'



________________________________________


select * from 1314howe.ht_screening_results
  where [Clone_name] like '%AnphA.00421%'



________________________________________


select * from 1314howe.ht_screening_results, 1314howe.[dnasamples.csv] d
  where [Clone_name] like d.name + '%'





________________________________________


select top 10 * from 1314howe.ht_screening_results, 1314howe.[dnasamples.csv] d
  where substring([Clone_name], 1, 5) = substring(d.name, 1, 5)





________________________________________


select top 10 * from 1314howe.ht_screening_results, 1314howe.[dnasamples.csv] d
  where substring([Clone_name], 1, 11) = substring(d.name, 1, 11)





________________________________________


SELECT substring([Clone_name], 1, 5) as construct
  , substring([Clone_name], 6, 5) as glycerol_id 
  , *
  FROM [1314howe].[HT_screening_results]


________________________________________


SELECT substring([Clone_name], 1, 5) as construct
  , substring([Clone_name], 7, 5) as glycerol_id 
  , *
  FROM [1314howe].[HT_screening_results]


________________________________________


SELECT substring(d.name, 1, 5) as construct
     , substring(d.name, 7, 5) as glycerol_id
     , *
  FROM [1314howe].[dnasamples.csv] d



________________________________________


select top 10 * from 1314howe.ht_screening_results_parsed_clone h, 1314howe.[dnasamples_parsed_name] d
  where h.construct = d.construct
    and h.glycerol_id = d.glycerol_id




________________________________________


select * 
  from 1314howe.ht_screening_results_parsed_clone h
     , 1314howe.[dnasamples_parsed_name] d
  where h.construct = d.construct
    and h.glycerol_id = d.glycerol_id
    and status_id = (select id from 1314howe.[statuses.csv] where name = 'failed alignment')




________________________________________


select *
  from 1314howe.[dnasamples_parsed_name] d
  where status_id = (select id from 1314howe.[statuses.csv] where name = 'failed alignment')


________________________________________


select * 
  from 1314howe.ht_screening_results_parsed_clone h
     , 1314howe.[dnasamples_parsed_name] d
  where d.name like h.Clone_name + '%'
    and status_id = (select id from 1314howe.[statuses.csv] where name = 'failed alignment')




________________________________________


SELECT *
  FROM [1314howe].[Target_Status.csv]
  WHERE isnumeric(MaxCode) = 0



________________________________________


SELECT MaxCode, Kingdom, Target 
  FROM [1314howe].[Target_Status.csv]


________________________________________


SELECT d.kind, d.name, p.*
  FROM [1314howe].[profile.csv] p
     , [1314howe].[descriptor.csv] d
 WHERE p.[desc] = d.id



________________________________________


SELECT clock, issues, memrefs, phantoms, streams FROM [1314howe].[counter.csv]
  UNION ALL
SELECT clock, issues, memrefs, phantoms, streams FROM [1314howe].[profile.csv]
  UNION ALL
SELECT clock, issues, memrefs, phantoms, streams FROM [1314howe].[barrier.csv]



________________________________________


SELECT 'counter' as source, clock, issues, memrefs, phantoms, streams FROM [1314howe].[counter.csv]
  UNION ALL
SELECT 'profile' as source, clock, issues, memrefs, phantoms, streams FROM [1314howe].[profile.csv]
  UNION ALL
SELECT 'barrier' as source, clock, issues, memrefs, phantoms, streams FROM [1314howe].[barrier.csv]



________________________________________


SELECT 'counter' as source, clock, issues, memrefs, phantoms, streams FROM [1314howe].[counter.csv]
  UNION ALL
SELECT 'profile' as source, clock, issues, memrefs, phantoms, streams FROM [1314howe].[profile.csv]
  UNION ALL
SELECT 'barrier' as source, clock, issues, memrefs, phantoms, streams FROM [1314howe].[barrier.csv]
  order by clock



________________________________________


SELECT * 
  FROM [1314howe].[counter_profile_barrier] m1
     , [1314howe].[counter_profile_barrier] m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM [1314howe].[counter_profile_barrier] m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )



________________________________________


SELECT * 
  FROM [1314howe].[counter_profile_barrier] m1
     , [1314howe].[counter_profile_barrier] m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM [1314howe].[counter_profile_barrier] m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


SELECT m1.clock, m2.clock
  FROM [1314howe].[counter_profile_barrier] m1
     , [1314howe].[counter_profile_barrier] m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM [1314howe].[counter_profile_barrier] m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


SELECT m1.*, m2.*
  FROM [1314howe].[counter_profile_barrier] m1
     , [1314howe].[counter_profile_barrier] m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM [1314howe].[counter_profile_barrier] m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


SELECT m1.source as source1, m2.source as source2
     , m2.clock as clock, m2.clock - m1.clock as ticks
     , m2.issues - m1.issues as issues
     , m2.memrefs - m1.memrefs as memrefs
     , m2.phantoms - m1.phantoms as phantoms
     , m2.streams - m1.streams as streams
  FROM [1314howe].[counter_profile_barrier] m1
     , [1314howe].[counter_profile_barrier] m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM [1314howe].[counter_profile_barrier] m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


SELECT m1.source as source1, m2.source as source2
     , m2.clock as clock, m2.clock - m1.clock as ticks
     , m2.issues - m1.issues as issues
     , m2.memrefs - m1.memrefs as memrefs
     , m2.phantoms - m1.phantoms as phantoms
     , m2.streams - m1.streams as streams
  FROM [1314howe].[counter_profile_barrier] m1
     , [1314howe].[counter_profile_barrier] m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM [1314howe].[counter_profile_barrier] m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  and m1.source = 'barrier'
  ORDER BY m1.clock asc



________________________________________


WITH measurement(source, clock, issues, memrefs, phantoms, streams) AS
  (
    SELECT * 
      FROM [1314howe].[counter_profile_barrier] 
     WHERE source = 'barrier'
  )

SELECT m1.source as source1, m2.source as source2
     , m2.clock as clock, m2.clock - m1.clock as ticks
     , m2.issues - m1.issues as issues
     , m2.memrefs - m1.memrefs as memrefs
     , m2.phantoms - m1.phantoms as phantoms
     , m2.streams - m1.streams as streams
  FROM measurement m1
     , measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


WITH measurement(source, clock, issues, memrefs, phantoms, streams) AS
  (
    SELECT * 
      FROM [1314howe].[counter_profile_barrier] 
     WHERE source = 'barrier'
  )

SELECT m1.source as source1, m2.source as source2
     , m2.clock / 1000000 as clock, m2.clock - m1.clock as ticks
     , m2.issues - m1.issues as issues
     , m2.memrefs - m1.memrefs as memrefs
     , m2.phantoms - m1.phantoms as phantoms
     , m2.streams - m1.streams as streams
  FROM measurement m1
     , measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


WITH measurement(source, clock, issues, memrefs, phantoms, streams) AS
  (
    SELECT * 
      FROM [1314howe].[counter_profile_barrier] 
     WHERE source = 'barrier'
  )

SELECT m1.source as source1, m2.source as source2
  , round(m2.clock / 1000000,2) as clock, m2.clock - m1.clock as ticks
     , m2.issues - m1.issues as issues
     , m2.memrefs - m1.memrefs as memrefs
     , m2.phantoms - m1.phantoms as phantoms
     , m2.streams - m1.streams as streams
  FROM measurement m1
     , measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


WITH measurement(source, clock, issues, memrefs, phantoms, streams) AS
  (
    SELECT * 
      FROM [1314howe].[counter_profile_barrier] 
     WHERE source = 'barrier'
  )

SELECT m1.source as source1, m2.source as source2
  , round(m2.clock / 1000000,0) as clock, m2.clock - m1.clock as ticks
     , m2.issues - m1.issues as issues
     , m2.memrefs - m1.memrefs as memrefs
     , m2.phantoms - m1.phantoms as phantoms
     , m2.streams - m1.streams as streams
  FROM measurement m1
     , measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


WITH measurement(source, clock, issues, memrefs, phantoms, streams) AS
  (
    SELECT * 
      FROM [1314howe].[counter_profile_barrier] 
     WHERE source = 'barrier'
  )

SELECT m1.source as source1, m2.source as source2
     , round(m2.clock / 10000000,0) as clock_M, m2.clock - m1.clock as ticks
     , m2.issues - m1.issues as issues
     , m2.memrefs - m1.memrefs as memrefs
     , m2.phantoms - m1.phantoms as phantoms
     , m2.streams - m1.streams as streams
  FROM measurement m1
     , measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


WITH measurement(source, clock, issues, memrefs, phantoms, streams) AS
  (
    SELECT * 
      FROM [1314howe].[counter_profile_barrier] 
     WHERE source = 'barrier' -- change this to counter, profile, or barrier
  )

SELECT m1.source as source1, m2.source as source2
     , m2.clock / 10000000 as clock_M
     , (m2.clock - m1.clock)/10000000 as ticks_M
     , (m2.issues - m1.issues)/10000000  as issues_M
     , (m2.memrefs - m1.memrefs)/10000000  as memrefs_M
     , (m2.phantoms - m1.phantoms)/10000000  as phantoms_M
     , (m2.streams - m1.streams)/10000000  as streams_M
  FROM measurement m1
     , measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


WITH measurement(source, clock, issues, memrefs, phantoms, streams) AS
  (
    SELECT * 
      FROM [1314howe].[counter_profile_barrier] 
     WHERE source = 'barrier' -- change this to counter, profile, or barrier
  )

SELECT m1.source as source1, m2.source as source2
     , m1.clock / 10000000 as clock_M
     , (m2.clock - m1.clock)/10000000 as ticks_M
     , (m2.issues - m1.issues)/10000000  as issues_M
     , (m2.memrefs - m1.memrefs)/10000000  as memrefs_M
     , (m2.phantoms - m1.phantoms)/10000000  as phantoms_M
     , (m2.streams - m1.streams)/10000000  as streams_M
  FROM measurement m1
     , measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ORDER BY m1.clock asc



________________________________________


WITH measurement(source, clock, issues, memrefs, phantoms, streams) AS
  (
    SELECT * 
      FROM [1314howe].[counter_profile_barrier] 
     WHERE source = 'barrier' -- change this to counter, profile, or barrier
  )

SELECT clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM measurement m1
     , measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


    SELECT *
      FROM [1314howe].[counter_profile_barrier]
     WHERE source = 'barrier'



________________________________________


SELECT clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT NTILE(100) OVER(ORDER BY clock asc) as progress
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT clock / 10000000 as clock_M
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  WHERE clock < 503684528123771
  ORDER BY clock asc



________________________________________


SELECT * 
  FROM [1314howe].[counter_profile_barrier]
 WHERE source = 'counter'



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     --, log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT * 
  FROM [1314howe].[counter_profile_barrier]
 WHERE source = 'counter'
   AND clock > 0



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  WHERE clock < 503684528123771
  ORDER BY clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


--SELECT clock
--     , clock / 10000000 as clock_millions 
--     , log(clock) as log_clock
--     , issues/ticks as issues_per_tick
--     , memrefs/ticks as memrefs_per_tick
--     , phantoms/ticks as phantoms_per_tick
--     , streams/ticks as streams_per_tick
--  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
     , (m2.clock - m1.clock) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
--  ) x
--  ORDER BY clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues, ticks
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues, ticks
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , m2.issues as m2issues, m1.issues as m1issues
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues, ticks, m2issues, m1issues
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , m2.issues as m2issues, m1.issues as m1issues
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


--SELECT clock
--     , clock / 10000000 as clock_millions 
--     , log(clock) as log_clock
--     , issues/ticks as issues_per_tick
--     , memrefs/ticks as memrefs_per_tick
--     , phantoms/ticks as phantoms_per_tick
--     , streams/ticks as streams_per_tick
--  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
--  ) x
--  ORDER BY clock asc



________________________________________


--SELECT clock
--     , clock / 10000000 as clock_millions 
--     , log(clock) as log_clock
--     , issues/ticks as issues_per_tick
--     , memrefs/ticks as memrefs_per_tick
--     , phantoms/ticks as phantoms_per_tick
--     , streams/ticks as streams_per_tick
--  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
--  ) x
  ORDER BY clock asc



________________________________________


--SELECT clock
--     , clock / 10000000 as clock_millions 
--     , log(clock) as log_clock
--     , issues/ticks as issues_per_tick
--     , memrefs/ticks as memrefs_per_tick
--     , phantoms/ticks as phantoms_per_tick
--     , streams/ticks as streams_per_tick
--  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
    , m1.*, m2.*
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
--  ) x
  ORDER BY m1.clock asc



________________________________________


SELECT * 
  FROM [1314howe].[counter_profile_barrier]
 WHERE source = 'counter'
   AND clock > 0
  order by clock asc



________________________________________


SELECT * 
  FROM [1314howe].[counter_profile_barrier]
 WHERE source = 'counter'
   AND clock > 0
 -- order by clock asc



________________________________________


SELECT * 
  FROM [1314howe].[counter_profile_barrier]
 WHERE source = 'counter'
   AND clock > 0
 order by clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
    --, m1.*, m2.*
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m2.clock > m3.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
    --, m1.*, m2.*
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m3.clock < m2.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT * 
  FROM [1314howe].[counter_profile_barrier]
 WHERE source = 'barrier'
   AND clock > 0



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
    --, m1.*, m2.*
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m3.clock < m2.clock
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT * 
  FROM [1314howe].[counter_profile_barrier]
 WHERE clock > 0



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
    --, m1.*, m2.*
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND m2.source = m1.source
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m3.clock < m2.clock
        AND m2.source = m1.source
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT clock
     , clock / 10000000 as clock_millions 
     , log(clock) as log_clock
     , source1 as source
     , issues/ticks as issues_per_tick
     , memrefs/ticks as memrefs_per_tick
     , phantoms/ticks as phantoms_per_tick
     , streams/ticks as streams_per_tick
  FROM (
SELECT m1.source as source1, m2.source as source2
     , m1.clock as clock
    , cast((m2.clock - m1.clock) as float) as ticks
     , (m2.issues - m1.issues)  as issues
     , (m2.memrefs - m1.memrefs)  as memrefs
     , (m2.phantoms - m1.phantoms)  as phantoms
     , (m2.streams - m1.streams)  as streams
    --, m1.*, m2.*
  FROM 1314howe.measurement m1
     , 1314howe.measurement m2
 WHERE m2.clock > m1.clock
   AND m2.source = m1.source
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m3.clock < m2.clock
        AND m2.source = m1.source
   )
  ) x
  ORDER BY clock asc



________________________________________


SELECT * 
  FROM [1314howe].[counter_per_tick] m1
     , [1314howe].[counter_per_tick] m2
 WHERE m2.clock > m1.clock
   aND m2.source != m1.source
   AND NOT EXISTS (
     SELECT clock
       FROM 1314howe.measurement m3
      WHERE m1.clock < m3.clock
        AND m3.clock < m2.clock
   )



________________________________________


SELECT *
  --CASE WHEN [Total Calories] = 'None' THEN NULL 
  --ELSE [Total Calories] END as [Total Calories]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]
  --WHERE [Total Calories] != 'None'



________________________________________


SELECT *,
  CAST(CASE WHEN [Seafood Fat] = 'None' THEN NULL 
  ELSE [Seafood Fat] END as float) as [Seafood Fat]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]




________________________________________


SELECT [Date], [Total Calories], [Total Fat],
  CAST(CASE WHEN [Seafood Fat] = 'None' THEN NULL 
  ELSE [Seafood Fat] END as float) as [Seafood Fat]
  , CAST(CASE WHEN [Nut Fat] = 'None' THEN NULL 
  ELSE [Nut Fat] END as float) as [Nut Fat]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]




________________________________________


SELECT [Date], [Total Calories], [Total Fat],
  CAST(CASE WHEN [Seafood Fat] = 'None' THEN NULL 
  ELSE [Seafood Fat] END as float) as [Seafood Fat]
  , CAST(CASE WHEN [Nut Fat] = 'None' THEN NULL 
  ELSE [Nut Fat] END as float) as [Nut Fat]
  , CAST(CASE WHEN [Vegetable Fat] = 'None' THEN NULL 
  ELSE [Vegetable Fat] END as float) as [Vegetable Fat]
  , CAST(CASE WHEN [Chocolate Fat] = 'None' THEN NULL 
  ELSE [Chocolate Fat] END as float) as [Chocolate Fat]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]




________________________________________


SELECT *
     , [Total Fat]-([Seafood Fat]+[Nut Fat]+[Vegetable Fat]) as AD_fat 
  FROM [1314howe].[categorized_fat.xlsx.txt]


________________________________________


SELECT [Date], [Total Calories], [Total Fat]
-- , CAST(CASE WHEN [Seafood Fat] = 'None' THEN 0.0 
--  ELSE [Seafood Fat] END as float) as [Seafood Fat]
--  , CAST(CASE WHEN [Nut Fat] = 'None' THEN 0.0
--  ELSE [Nut Fat] END as float) as [Nut Fat]
--  , CAST(CASE WHEN [Vegetable Fat] = 'None' THEN 0.0 
--  ELSE [Vegetable Fat] END as float) as [Vegetable Fat]
--  , CAST(CASE WHEN [Chocolate Fat] = 'None' THEN 0.0 
--  ELSE [Chocolate Fat] END as float) as [Chocolate Fat]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]
WHERE [Nut Fat] = 'None'  



________________________________________


SELECT [Date], [Total Calories], [Total Fat], [Nut Fat]
-- , CAST(CASE WHEN [Seafood Fat] = 'None' THEN 0.0 
--  ELSE [Seafood Fat] END as float) as [Seafood Fat]
--  , CAST(CASE WHEN [Nut Fat] = 'None' THEN 0.0
--  ELSE [Nut Fat] END as float) as [Nut Fat]
--  , CAST(CASE WHEN [Vegetable Fat] = 'None' THEN 0.0 
--  ELSE [Vegetable Fat] END as float) as [Vegetable Fat]
--  , CAST(CASE WHEN [Chocolate Fat] = 'None' THEN 0.0 
--  ELSE [Chocolate Fat] END as float) as [Chocolate Fat]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]
WHERE [Nut Fat] = 'None'  



________________________________________


SELECT [Date], [Total Calories], [Total Fat], [Nut Fat]
-- , CAST(CASE WHEN [Seafood Fat] = 'None' THEN 0.0 
--  ELSE [Seafood Fat] END as float) as [Seafood Fat]
  , CASE WHEN [Nut Fat] = 'None' THEN 0.0
  ELSE [Nut Fat] END as [Nut Fat]
--  , CAST(CASE WHEN [Vegetable Fat] = 'None' THEN 0.0 
--  ELSE [Vegetable Fat] END as float) as [Vegetable Fat]
--  , CAST(CASE WHEN [Chocolate Fat] = 'None' THEN 0.0 
--  ELSE [Chocolate Fat] END as float) as [Chocolate Fat]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]
WHERE [Nut Fat] = 'None'  



________________________________________


SELECT [Date], [Total Calories], [Total Fat]
-- , CASE WHEN [Seafood Fat] = 'None' THEN 0.0 
--  ELSE [Seafood Fat] END as [Seafood Fat]
  , CASE WHEN [Nut Fat] = 'None' THEN 0.0
  ELSE CAST([Nut Fat] as float) END as [Nut Fat]
-- ,  CASE WHEN [Vegetable Fat] = 'None' THEN 0.0 
--  ELSE [Vegetable Fat] END as [Vegetable Fat]
--  , CASE WHEN [Chocolate Fat] = 'None' THEN 0.0 
--  ELSE [Chocolate Fat] END as [Chocolate Fat]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]
--WHERE [Nut Fat] = 'None'  



________________________________________


SELECT [Date], [Total Calories], [Total Fat]
 , CASE WHEN [Seafood Fat] = 'None' THEN 0.0 
  ELSE CAST([Seafood Fat] as float) END as [Seafood Fat]
  , CASE WHEN [Nut Fat] = 'None' THEN 0.0
  ELSE CAST([Nut Fat] as float) END as [Nut Fat]
 ,  CASE WHEN [Vegetable Fat] = 'None' THEN 0.0 
  ELSE CAST([Vegetable Fat] as float) END as [Vegetable Fat]
  , CASE WHEN [Chocolate Fat] = 'None' THEN 0.0 
  ELSE CAST([Chocolate Fat] as float) END as [Chocolate Fat]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]



________________________________________


SELECT *
     , [Total Fat]-([Seafood Fat]+[Nut Fat]+[Vegetable Fat]) as AD_fat 
  FROM [1314howe].[categorized_fat.xlsx.txt]


________________________________________


SELECT *
     , [Total Fat]-([Seafood Fat]+[Nut Fat]+[Vegetable Fat]) as AD_fat 
     , [Total Fat]-([Seafood Fat]+[Nut Fat]+[Vegetable Fat] + [Chocolate Fat]) as ADC_fat 
  FROM [1314howe].[categorized_fat.xlsx.txt]


________________________________________


SELECT *
     , [Total Fat]-([Seafood Fat]+[Nut Fat]+[Vegetable Fat]) as AD_fat 
     , [Total Fat]-([Seafood Fat]+[Nut Fat]+[Vegetable Fat] + [Chocolate Fat]) as ADC_fat
     , [Seafood Fat]*9 as seafood_calories
     , [Nut Fat]*9 as nut_calories
     , [Vegetable Fat]*9 as vegetable_calories
     , [Chocolate Fat]*9 as chocolate_calories
  FROM [1314howe].[categorized_fat.xlsx.txt]


________________________________________


SELECT [Total Calories]
     , seafood_calories/[Total Calories] as seafood_percent
     , nut_calories / [Total Calories] as nut_calories
     , vegetable_calories / [Total Calories] as vegetable_calories
     , chocolate_calories / [Total Calories] as chocolate_percent
  
  FROM [1314howe].[categorized_fat_with_calories]


________________________________________


SELECT [Date], [Total Calories]
     , seafood_calories/[Total Calories] as seafood_percent
     , nut_calories / [Total Calories] as nut_calories
     , vegetable_calories / [Total Calories] as vegetable_calories
     , chocolate_calories / [Total Calories] as chocolate_percent
  
  FROM [1314howe].[categorized_fat_with_calories]


________________________________________


SELECT [Total Fat]*9/[Total Calories]
  FROM [1314howe].[categorized_fat_with_calories]


________________________________________


SELECT Date, [Total Fat]*9/[Total Calories]
  FROM [1314howe].[categorized_fat_with_calories]


________________________________________


SELECT avg([Total Fat]*9/[Total Calories])
  FROM [1314howe].[categorized_fat_with_calories]


________________________________________



  
select  (0.18*(180+344)-344*0.14222)/180.0



________________________________________


select top 180 dateadd(month, 6, [Date])   
  FROM [1314howe].[categorized_fat_with_calories]



________________________________________


select top 180 dateadd(month, 6, [Date])  
  FROM [1314howe].[categorized_fat_with_calories]
  order by [DAte] desc



________________________________________


select [date], 0.25 as fat_calorie_percent
  from (
select top 180 dateadd(month, 6, [Date]) as [date] 
  FROM [1314howe].[categorized_fat_with_calories]
  order by [Date] desc
  ) x


________________________________________


select [date], 2500*0.25/9 as fat_grams
  from (
select top 180 dateadd(month, 6, [Date]) as [date] 
  FROM [1314howe].[categorized_fat_with_calories]
  order by [Date] desc
  ) x


________________________________________


select [date], 2500*0.25/9 as [Total Fat]
  from (
select top 180 dateadd(month, 6, [Date]) as [date] 
  FROM [1314howe].[categorized_fat_with_calories]
  order by [Date] desc
    ) x
  UNION ALL
  select [Date], [Total Fat]
  from [1314howe].[categorized_fat_with_calories]



________________________________________


select [date], 2500*0.25/9 as [Total Fat]
  from (
select top 180 dateadd(month, 6, [Date]) as [date] 
  FROM [1314howe].[categorized_fat_with_calories]
  order by [Date] desc
    ) x
  UNION ALL
  select [Date], [Total Fat]
  from [1314howe].[categorized_fat_with_calories]
  order by [Date] asc



________________________________________


SELECT row_number() OVER (ORDER BY [Date] ASC)
  FROM [1314howe].[total_fat_6_month_projection]


________________________________________


SELECT [Date]
  , (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average
  FROM [1314howe].[total_fat_6_month_projection] now


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average
  FROM [1314howe].[total_fat_6_month_projection] now


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT max([Date]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average
  FROM [1314howe].[total_fat_6_month_projection] now


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average
  FROM [1314howe].[total_fat_6_month_projection] now


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '8/16/2011'



________________________________________


SELECT * FROM [1314howe].[categorized_fat_with_calories]


________________________________________


SELECT top 10 * 
  FROM [1314howe].[categorized_fat_with_calories]
 ORDER BY [total fat] desc



________________________________________


SELECT * 
  FROM [1314howe].[categorized_fat_with_calories]
 ORDER BY [total fat] desc



________________________________________


SELECT * 
  FROM [1314howe].[categorized_fat_with_calories]
 ORDER BY [total fat]*9/[TOTAL CALORIES] desc



________________________________________


SELECT * 
  FROM [1314howe].[categorized_fat_with_calories] c
WHERE NOT EXISTS (
  SELECT * 
    FROM [1314howe].[categorized_fat_with_calories] d
  WHERE d.[Total Fat] > c.[Total Fat]
) 


________________________________________


SELECT top 3 *
  FROM [1314howe].[categorized_fat_with_calories] c
ORDER BY [Total Fat] Desc



________________________________________


SELECT * FROM (
SELECT row_number() over (order by [Total Fat] DESC) as row
     , *
  FROM [1314howe].[categorized_fat_with_calories] c
 ) x
 WHERE x.row = 2


________________________________________


SELECT * FROM (
SELECT row_number() over (order by [Total Fat] DESC) as row
     , *
  FROM [1314howe].[categorized_fat_with_calories] c
 ) x
 WHERE x.row = 10


________________________________________


SELECT * FROM (
SELECT row_number() over (order by [Total Fat] DESC) as row
     , *
  FROM [1314howe].[categorized_fat_with_calories] c
 ) x
 WHERE x.row = 10


________________________________________


SELECT * FROM (
SELECT row_number() over (order by [Total Fat] DESC) as row
     , *
  FROM [1314howe].[categorized_fat_with_calories] c
 ) x
 WHERE x.row = 3


________________________________________


select * from sys.tables


________________________________________


select * from sys.tables


________________________________________


SELECT First_Name, Last_Name, email_address, sum(TransAmount) as balance 
  FROM [1314howe].[TransactionReport881060.csv]
GROUP BY First_Name, Last_Name, email_address
  HAVING sum(TransAmount) > 0



________________________________________


SELECT First_Name, Last_Name, email_address, sum(TransAmount) as balance 
  FROM [1314howe].[TransactionReport881060.csv]
GROUP BY First_Name, Last_Name, email_address




________________________________________


SELECT * FROM [1052].[Discovery Island 2000-11.txt] x
  LEFT JOIN [1052].[Cattle Point 1.2m 2000-11.txt] y
  ON x.date = y.date 
  WHERE x.intensity = y.current_intensity


________________________________________


SELECT date, time, time_of_day_knots, intensity, row_number() over (partition by date, intensity order by time)
  FROM [1052].[Discovery Island 2000-11.txt] x

  
  --  LEFT JOIN [1052].[Cattle Point 1.2m 2000-11.txt] y
--  ON x.date = y.date 
--  WHERE x.intensity = y.current_intensity 
 


________________________________________


SELECT date, time, time_of_day_knots, intensity
     -- This next line assigns a row number
     , rank() over (partition by date, intensity order by time)
  FROM [1052].[Discovery Island 2000-11.txt] x
  


  
  --  LEFT JOIN [1052].[Cattle Point 1.2m 2000-11.txt] y
--  ON x.date = y.date 
--  WHERE x.intensity = y.current_intensity 
 


________________________________________


--SELECT * FROM
--(
--SELECT date, time, time_of_day_knots, intensity
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
--     , rank() over (partition by date, intensity order by time)
--  FROM [1052].[Discovery Island 2000-11.txt]
--  )  x,

-- Now do the same thing with the other table
(
SELECT *
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
     --, rank() over (partition by date, intensity order by time)
  FROM [1052].[Cattle Point 1.2m 2000-11.txt] 
  )  
  --  LEFT JOIN [1052].[Cattle Point 1.2m 2000-11.txt] y
--  ON x.date = y.date 
--  WHERE x.intensity = y.current_intensity 
 


________________________________________


--SELECT * FROM
--(
--SELECT date, time, time_of_day_knots, intensity
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
--     , rank() over (partition by date, intensity order by time)
--  FROM [1052].[Discovery Island 2000-11.txt]
--  )  x,

-- Now do the same thing with the other table
(
SELECT date, time, time_of_day_knots, current_intensity
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
     , rank() over (partition by date, current_intensity order by time)
  FROM [1052].[Cattle Point 1.2m 2000-11.txt] 
  )  
  --  LEFT JOIN [1052].[Cattle Point 1.2m 2000-11.txt] y
--  ON x.date = y.date 
--  WHERE x.intensity = y.current_intensity 
 


________________________________________


--SELECT * FROM
--(
--SELECT date, time, time_of_day_knots, intensity
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
--     , rank() over (partition by date, intensity order by time)
--  FROM [1052].[Discovery Island 2000-11.txt]
--  )  x,

-- Now do the same thing with the other table
(
SELECT date, cast(time as time), time_of_day_knots, current_intensity
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
  , rank() over (partition by date, current_intensity order by cast(time as time))
  FROM [1052].[Cattle Point 1.2m 2000-11.txt] 
  )  
  --  LEFT JOIN [1052].[Cattle Point 1.2m 2000-11.txt] y
--  ON x.date = y.date 
--  WHERE x.intensity = y.current_intensity 
 


________________________________________


SELECT * FROM
(
SELECT date, cast(time as time) as time, time_of_day_knots, intensity
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
     , rank() over (partition by date, intensity order by cast(time as time)) as rank
  FROM [1052].[Discovery Island 2000-11.txt]
  )  x,

-- Now do the same thing with the other table
(
SELECT date
     -- We want to tell SQL that this is a time value, not just a string
     , cast(time as time) as time
     , time_of_day_knots, current_intensity
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
    , rank() over (partition by date, current_intensity order by cast(time as time)) as rank -- Note that we need to treat the time as a time. not a string
  FROM [1052].[Cattle Point 1.2m 2000-11.txt] 
  ) y
WHERE x.date = y.date 
  AND x.intensity = y.current_intensity 
-- Now only join records of the same rank
  AND x.rank = y.rank
 


________________________________________


SELECT * FROM
(
SELECT date, cast(time as time) as time, time_of_day_knots, intensity
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
     , rank() over (partition by date, intensity order by cast(time as time)) as occurrence
  FROM [1052].[Discovery Island 2000-11.txt]
  )  x,

-- Now do the same thing with the other table
(
SELECT date
     -- We want to tell SQL that this is a time value, not just a string
     , cast(time as time) as time
     , time_of_day_knots, current_intensity
     -- This next line assigns a row number to 
     -- each record in the group, ordered by time
     -- So the earliest time each day will be assigned 1, etc.
    , rank() over (partition by date, current_intensity order by cast(time as time)) as occurrence -- Note that we need to treat the time as a time. not a string
  FROM [1052].[Cattle Point 1.2m 2000-11.txt] 
  ) y
WHERE x.date = y.date 
  AND x.intensity = y.current_intensity 
  -- Now only join records of the same occurrence (first of the day, second of the day, etc.)
  AND x.occurrence = y.occurrence
 


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Lat BETWEEN 48.2961 AND 48.2817 AND Lat BETWEEN 48.2727 AND 48.2870 AND
  [Long] BETWEEN 123.0701 AND 123.0869 AND [long] BETWEEN 123.0564 AND 123.0399


________________________________________


--SELECT * FROM [1117].[OrcaMaster2010.csv]
--  WHERE Lat BETWEEN 48.2961 AND 48.2817 
--    AND Lat BETWEEN 48.2727 AND 48.2870 
--    AND [Long] BETWEEN 123.0701 AND 123.0869 
--    AND [long] BETWEEN 123.0564 AND 123.0399

SELECT min(Lat), max(Lat), min([Long]), max([Long]) 
  FROM [1117].[OrcaMaster2010.csv]


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE Lat BETWEEN 48.2961 AND 48.2817 
--    AND Lat BETWEEN 48.2727 AND 48.2870 
--    AND [Long] BETWEEN 123.0701 AND 123.0869 
--    AND [long] BETWEEN 123.0564 AND 123.0399

--SELECT min(Lat), max(Lat), min([Long]), max([Long]) 
--  FROM [1117].[OrcaMaster2010.csv]


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
--  WHERE Lat BETWEEN 48.2961 AND 48.2817 
--    AND Lat BETWEEN 48.2727 AND 48.2870 
--    AND [Long] BETWEEN 123.0701 AND 123.0869 
--    AND [long] BETWEEN 123.0564 AND 123.0399

--SELECT min(Lat), max(Lat), min([Long]), max([Long]) 
--  FROM [1117].[OrcaMaster2010.csv]


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE 1=1
--    AND Lat BETWEEN 48.2961 AND 48.2817 
    AND Lat BETWEEN 48.2727 AND 48.2870 
--    AND [Long] BETWEEN 123.0701 AND 123.0869 
--    AND [long] BETWEEN 123.0564 AND 123.0399

--SELECT min(Lat), max(Lat), min([Long]), max([Long]) 
--  FROM [1117].[OrcaMaster2010.csv]


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE 1=1
--    AND Lat BETWEEN 48.2961 AND 48.2817 
--    AND Lat BETWEEN 48.2727 AND 48.2870 
    AND [Long] BETWEEN 123.0701 AND 123.0869 
--    AND [long] BETWEEN 123.0564 AND 123.0399

--SELECT min(Lat), max(Lat), min([Long]), max([Long]) 
--  FROM [1117].[OrcaMaster2010.csv]


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE 1=1
--    AND Lat BETWEEN 48.2961 AND 48.2817 
    AND Lat BETWEEN 48.2727 AND 48.2870 
--    AND [Long] BETWEEN 123.0701 AND 123.0869 
    AND [long] BETWEEN 123.0564 AND 123.0399

--SELECT min(Lat), max(Lat), min([Long]), max([Long]) 
--  FROM [1117].[OrcaMaster2010.csv]


________________________________________


SELECT * FROM [1117].[OrcaMaster2010.csv]
  WHERE 1=1
--    AND Lat BETWEEN 48.2961 AND 48.2817 
--    AND Lat BETWEEN 48.2727 AND 48.2870 
--    AND [Long] BETWEEN 123.0701 AND 123.0869 
    AND [long] BETWEEN 123.0564 AND 123.0399

--SELECT min(Lat), max(Lat), min([Long]), max([Long]) 
--  FROM [1117].[OrcaMaster2010.csv]


________________________________________


SELECT  date + ' ' + time
  FROM [1052].[PP-orca master] x

  --  JOIN [Pile Point Currents 00-11.txt]y
--  ON x.location = y.location
--  AND x.date = y.date


________________________________________


SELECT  cast(date + ' ' + time as datetime) as timestamp, *
  FROM [1052].[PP-orca master] x

  --  JOIN [Pile Point Currents 00-11.txt]y
--  ON x.location = y.location
--  AND x.date = y.date


________________________________________


--SELECT cast(date + ' ' + time as datetime) as timestamp, * 
--  FROM [1052].[PP-orca master] x


SELECT cast(date + ' ' + time as datetime), * FROM [1052].[Pile Point Currents 00-11.txt] y
--  ON x.location = y.location
--  AND x.date = y.date


________________________________________


SELECT * FROM
(
  SELECT cast(date + ' ' + time as datetime) as timestamp, * FROM [1052].[PP-orca master]
) x
JOIN
(
  SELECT cast(date + ' ' + time as datetime) as timestamp, * FROM [1052].[Pile Point Currents 00-11.txt]
) y
  ON x.location = y.location
 AND x.timestamp= y.timestamp


________________________________________



  SELECT cast(date + ' ' + time as datetime) as timestamp, * FROM [1052].[Pile Point Currents 00-11.txt]




________________________________________



  SELECT * 
    FROM [1052].[Pile Point Currents 00-11.txt] maxebb
       , [1052].[Pile Point Currents 00-11.txt] slackebb
   WHERE maxebb.date = slackebb.date
     AND maxebb.current_intensity = 'Max Ebb'
     AND slackebb.current_intensity like '%Slack%'




________________________________________



  SELECT * 
    FROM [1052].[Pile Point Currents 00-11.txt] maxebb
       , [1052].[Pile Point Currents 00-11.txt] slackebb
   WHERE maxebb.date = slackebb.date
     AND maxebb.current_intensity = 'Max Ebb'
     AND slackebb.current_intensity = '"Slack, Ebb Begins"'




________________________________________



  SELECT * 
    FROM [1052].[Pile Point Currents 00-11.txt] maxebb
 --      , [1052].[Pile Point Currents 00-11.txt] slackebb
 --  WHERE maxebb.date = slackebb.date
 --    AND maxebb.current_intensity = 'Max Ebb'
  --   AND slackebb.current_intensity = '"Slack, Ebb Begins"'




________________________________________



  SELECT date, time, event_knots, current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
    ORDER BY cast(date + ' ' + time as datetime) 
 --      , [1052].[Pile Point Currents 00-11.txt] slackebb
 --  WHERE maxebb.date = slackebb.date
 --    AND maxebb.current_intensity = 'Max Ebb'
  --   AND slackebb.current_intensity = '"Slack, Ebb Begins"'




________________________________________



  SELECT cast(date + ' ' + time as datetime) as timestamp, location, event_knots, current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
    ORDER BY cast(date + ' ' + time as datetime) 
 --      , [1052].[Pile Point Currents 00-11.txt] slackebb
 --  WHERE maxebb.date = slackebb.date
 --    AND maxebb.current_intensity = 'Max Ebb'
  --   AND slackebb.current_intensity = '"Slack, Ebb Begins"'




________________________________________


  SELECT cast(date + ' ' + time as datetime) as timestamp, location, event_knots, current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
    ORDER BY cast(date + ' ' + time as datetime) desc




________________________________________


  SELECT cast(date + ' ' + time as datetime) as timestamp, location, event_knots, current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
    ORDER BY cast(date + ' ' + time as datetime)




________________________________________


SELECT (rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) % 4, location, event_knots, current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
    ORDER BY cast(date + ' ' + time as datetime)
  
  



________________________________________


SELECT cast(date + ' ' + time as datetime) as timestamp 
     , (rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) % 4
     , location, event_knots
     , current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
    ORDER BY cast(date + ' ' + time as datetime)
  
  



________________________________________


SELECT cast(date + ' ' + time as datetime) as timestamp 
     , ((rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) - 1) % 4
     , location, event_knots
     , current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
    ORDER BY cast(date + ' ' + time as datetime)
  
  



________________________________________


SELECT cast(date + ' ' + time as datetime) as timestamp 
     --, min(time) OVER(ORDER BY cast(date + ' ' + time as datetime))
     , (((rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) - 1) % 4) as phase
     , location, event_knots
     , current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
    ORDER BY cast(date + ' ' + time as datetime)
  
  



________________________________________


--SELECT min(time) OVER(PARTITION BY phase) as start_of_tidal_cycle, *
--  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp 
     , (((rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) - 1) % 4) as phase
     , location, event_knots
     , current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
--  ) x
--ORDER BY timestamp
  
  



________________________________________


SELECT min(timestamp) OVER(PARTITION BY phase) as start_of_tidal_cycle, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp 
     , (((rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) - 1) % 4) as phase
     , location, event_knots
     , current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
  ) x
ORDER BY timestamp
  
  



________________________________________


SELECT min(timestamp) OVER(PARTITION BY phase) as start_of_tidal_cycle, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp 
     , (((rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) - 1) % 4) as phase
     , (((rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) - 1) / 4) as tidal_cycle
     , location, event_knots
     , current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
  ) x
ORDER BY timestamp
  
  



________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp 
     , (((rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) - 1) % 4) as phase
     , (((rank() OVER(ORDER BY cast(date + ' ' + time as datetime))) - 1) / 4) as tidal_cycle
     , location, event_knots
     , current_intensity
    FROM [1052].[Pile Point Currents 00-11.txt] 
  ) x
ORDER BY timestamp
  
  



________________________________________


SELECT rank() OVER(ORDER BY timestamp) as rank 
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
ORDER BY timestamp


________________________________________


SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
ORDER BY timestamp


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , timestamp, location,event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , timestamp, location,event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , * 
     --, timestamp, location,event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , * 
     --, timestamp, location,event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) - 1 as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , timestamp, location,event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) - 1 as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , max(timestamp) OVER(PARTITION BY tidal_cycle) as end_of_tidal_cycle
     , timestamp, location,event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) - 1 as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , max(timestamp) OVER(PARTITION BY tidal_cycle) as end_of_tidal_cycle
     , timestamp, location,event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) - 1 as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


Select * from [1314howe].[Pile Point tide events labeled by tidal cycle]


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , max(timestamp) OVER(PARTITION BY tidal_cycle) as end_of_tidal_cycle
     , tidal_cycle, phase, timestamp, location, event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) - 1 as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


SELECT maxflood.timestamp as max_flood_time
     , slackebb.timestamp as slack_ebb_time
     , maxebb.timestamp as max_ebb_time
     , slackflood.timestamp as slack_flood_time  
FROM [1314howe].[Pile Point tide events labeled by tidal cycle] maxflood
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] maxebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackflood
 WHERE maxflood.current_intensity = 'Max Flood'
   AND slackebb.current_intensity = '"Slack, Ebb Begins"'
   AND maxebb.current_intensity = 'Max Ebb'
   AND slackflood.current_intensity = '"Slack, Flood Begins"'
   AND maxflood.tidal_cycle = slackebb.tidal_cycle
   AND maxflood.tidal_cycle = maxebb.tidal_cycle
   AND maxflood.tidal_cycle = slackflood.tidal_cycle



________________________________________


SELECT maxflood.timestamp as max_flood_time
     , slackebb.timestamp as slack_ebb_time
     , maxebb.timestamp as max_ebb_time
     , slackflood.timestamp as slack_flood_time  
FROM [1314howe].[Pile Point tide events labeled by tidal cycle] maxflood
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] maxebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackflood
 WHERE maxflood.current_intensity = 'Max Flood'
   AND slackebb.current_intensity = '"Slack, Ebb Begins"'
   AND maxebb.current_intensity = 'Max Ebb'
   AND slackflood.current_intensity = '"Slack, Flood Begins"'
   AND maxflood.tidal_cycle = slackebb.tidal_cycle
   AND maxflood.tidal_cycle = maxebb.tidal_cycle
   AND maxflood.tidal_cycle = slackflood.tidal_cycle
 ORDER BY maxflood.timestamp



________________________________________


SELECT *, maxflood.timestamp as max_flood_time
     , slackebb.timestamp as slack_ebb_time
     , maxebb.timestamp as max_ebb_time
     , slackflood.timestamp as slack_flood_time  
FROM [1314howe].[Pile Point tide events labeled by tidal cycle] maxflood
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] maxebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackflood
 WHERE maxflood.current_intensity = 'Max Flood'
   AND slackebb.current_intensity = '"Slack, Ebb Begins"'
   AND maxebb.current_intensity = 'Max Ebb'
   AND slackflood.current_intensity = '"Slack, Flood Begins"'
   AND maxflood.tidal_cycle = slackebb.tidal_cycle
   AND maxflood.tidal_cycle = maxebb.tidal_cycle
   AND maxflood.tidal_cycle = slackflood.tidal_cycle
 ORDER BY maxflood.timestamp



________________________________________


SELECT * FROM [1314howe].[table_untitled (2).txt]
  ORDER BY timestamp



________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , max(timestamp) OVER(PARTITION BY tidal_cycle) as end_of_tidal_cycle
     , timestamp, location,event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) - 1 as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
     , max(timestamp) OVER(PARTITION BY tidal_cycle) as end_of_tidal_cycle
     , phase, tidal_cycle, timestamp, location,event_knots, current_intensity
  FROM (
SELECT rank % 4 as phase
     , rank / 4 as tidal_cycle
     , *
  FROM (
SELECT rank() OVER(ORDER BY timestamp) - 1 as rank, *
  FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
     , location, event_knots
     , current_intensity
  FROM [1052].[Pile Point Currents 00-11.txt]
) x
) y
) z
ORDER BY timestamp


________________________________________


SELECT * FROM [1314howe].[table_untitled (2).txt]
ORDER BY tidal_cycle, phase



________________________________________


SELECT cast(timestamp as datetime) as timestamp
     , start_of_tidal_cycle
     , end_of_tidal_cycle
     , tidal_cycle
     , phase
     , location
     , event_knots
     , current_intensity
  FROM [1314howe].[table_untitled (2).txt]


________________________________________


SELECT *, maxflood.timestamp as max_flood_time
     , slackebb.timestamp as slack_ebb_time
     , maxebb.timestamp as max_ebb_time
     , slackflood.timestamp as slack_flood_time  
FROM [1314howe].[Pile Point tide events labeled by tidal cycle] maxflood
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] maxebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackflood
 WHERE maxflood.current_intensity = 'Max Flood'
   AND slackebb.current_intensity = '"Slack, Ebb Begins"'
   AND maxebb.current_intensity = 'Max Ebb'
   AND slackflood.current_intensity = '"Slack, Flood Begins"'
   AND maxflood.tidal_cycle = slackebb.tidal_cycle
   AND maxflood.tidal_cycle = maxebb.tidal_cycle
   AND maxflood.tidal_cycle = slackflood.tidal_cycle
 ORDER BY maxflood.timestamp



________________________________________


SELECT maxflood.timestamp as max_flood_time
     , slackebb.timestamp as slack_ebb_time
     , maxebb.timestamp as max_ebb_time
     , slackflood.timestamp as slack_flood_time  
FROM [1314howe].[Pile Point tide events labeled by tidal cycle] maxflood
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] maxebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackflood
 WHERE maxflood.current_intensity = 'Max Flood'
   AND slackebb.current_intensity = '"Slack, Ebb Begins"'
   AND maxebb.current_intensity = 'Max Ebb'
   AND slackflood.current_intensity = '"Slack, Flood Begins"'
   AND maxflood.tidal_cycle = slackebb.tidal_cycle
   AND maxflood.tidal_cycle = maxebb.tidal_cycle
   AND maxflood.tidal_cycle = slackflood.tidal_cycle
 ORDER BY maxflood.timestamp



________________________________________


SELECT maxflood.location
     , maxflood.timestamp as max_flood_time
     , slackebb.timestamp as slack_ebb_time
     , maxebb.timestamp as max_ebb_time
     , slackflood.timestamp as slack_flood_time  
FROM [1314howe].[Pile Point tide events labeled by tidal cycle] maxflood
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] maxebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackflood
 WHERE maxflood.current_intensity = 'Max Flood'
   AND slackebb.current_intensity = '"Slack, Ebb Begins"'
   AND maxebb.current_intensity = 'Max Ebb'
   AND slackflood.current_intensity = '"Slack, Flood Begins"'
   AND maxflood.tidal_cycle = slackebb.tidal_cycle
   AND maxflood.tidal_cycle = maxebb.tidal_cycle
   AND maxflood.tidal_cycle = slackflood.tidal_cycle
   AND maxflood.location = slackflood.location
   AND maxflood.location = maxebb.location
   AND maxflood.location = slackflood.location
     ORDER BY maxflood.timestamp



________________________________________


SELECT maxflood.location
     , maxflood.timestamp as max_flood_time, maxflood.event_knots as max_flood_knots
     , slackebb.timestamp as slack_ebb_time, slackebb.event_knots as slack_ebb_knots
     , maxebb.timestamp as max_ebb_time, maxebb.event_knots as max_ebb_knots
     , slackflood.timestamp as slack_flood_time, slackflood.event_knots as slack_flood_knots 
FROM [1314howe].[Pile Point tide events labeled by tidal cycle] maxflood
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] maxebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackflood
 WHERE maxflood.current_intensity = 'Max Flood'
   AND slackebb.current_intensity = '"Slack, Ebb Begins"'
   AND maxebb.current_intensity = 'Max Ebb'
   AND slackflood.current_intensity = '"Slack, Flood Begins"'
   AND maxflood.tidal_cycle = slackebb.tidal_cycle
   AND maxflood.tidal_cycle = maxebb.tidal_cycle
   AND maxflood.tidal_cycle = slackflood.tidal_cycle
   AND maxflood.location = slackflood.location
   AND maxflood.location = maxebb.location
   AND maxflood.location = slackflood.location
     ORDER BY maxflood.timestamp



________________________________________


SELECT cast(maxflood.timestamp as date) as date, maxflood.location
     , maxflood.timestamp as max_flood_time, maxflood.event_knots as max_flood_knots
     , slackebb.timestamp as slack_ebb_time, slackebb.event_knots as slack_ebb_knots
     , maxebb.timestamp as max_ebb_time, maxebb.event_knots as max_ebb_knots
     , slackflood.timestamp as slack_flood_time, slackflood.event_knots as slack_flood_knots 
FROM [1314howe].[Pile Point tide events labeled by tidal cycle] maxflood
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] maxebb
   , [1314howe].[Pile Point tide events labeled by tidal cycle] slackflood
 WHERE maxflood.current_intensity = 'Max Flood'
   AND slackebb.current_intensity = '"Slack, Ebb Begins"'
   AND maxebb.current_intensity = 'Max Ebb'
   AND slackflood.current_intensity = '"Slack, Flood Begins"'
   AND maxflood.tidal_cycle = slackebb.tidal_cycle
   AND maxflood.tidal_cycle = maxebb.tidal_cycle
   AND maxflood.tidal_cycle = slackflood.tidal_cycle
   AND maxflood.location = slackflood.location
   AND maxflood.location = maxebb.location
   AND maxflood.location = slackflood.location
     ORDER BY maxflood.timestamp



________________________________________


SELECT * FROM [1314howe].[table_untitled (2).txt]
  ORDER BY timestamp



________________________________________


SELECT * FROM [1052].[PP-orca master] x
--  JOIN [191].[Pile Point Tidal Cycles 2000-2011] y
--  ON 



________________________________________


SELECT * FROM
(SELECT cast(date + ' ' + time as datetime) as timestamp, * 
  FROM [1052].[PP-orca master]) x
  JOIN [1314howe].[Pile Point Tidal Cycles 2000-2011] y
    ON x.timestamp BETWEEN y.max_flood_time and y.slack_flood_time



________________________________________


SELECT cast(date + ' ' + time as datetime) as timestamp, * 
  FROM [1052].[PP-orca master]


________________________________________


SELECT min(timestamp) OVER(PARTITION BY tidal_cycle) as start_of_tidal_cycle
    , max(timestamp) OVER(PARTITION BY tidal_cycle) as end_of_tidal_cycle
    , timestamp, location,event_knots, current_intensity
 FROM (
SELECT rank % 4 as phase
    , rank / 4 as tidal_cycle
    , *
 FROM (
SELECT rank() OVER(ORDER BY timestamp) - 1 as rank, *
 FROM (
SELECT cast(date + ' ' + time as datetime) as timestamp
    , location, event_knots
    , current_intensity
 FROM [1052].[Kellett Bluff Currents 00-11]

) x
) y
) z
ORDER BY
timestamp


________________________________________


SELECT * 
  FROM [1314howe].[SDSS Starter Queries with Snippet Features]
  WHERE feature LIKE '%WHERE%'



________________________________________


SELECT a.sql_query, a.vizlet_type, a.action, d.* 
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] a
     , [1307].[vizlets_23nov11_10h34m16s_data_features.csv] d
 WHERE a.sql_query_hash = d.query_string_hash
   AND a.x_col_name = d.x_col_name
   AND a.y_col_name = d.y_col_name



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type, count(*)  
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id, count(distinct vizlet_type)
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id, count(distinct vizlet_type)
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id
HAVING count(distinct vizlet_type) > 1


________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id, count(*)
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id
HAVING count(*) > 1


________________________________________


SELECT distinct vizlet_type 
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]




________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
     , vt.vizlet_type
  FROM [1314howe].[Vizlet Types] vt
     LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] a
     ON vt.vizlet_type = a.vizlet_type
--  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
--  , session_id




________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
     , vt.vizlet_type
  FROM [1314howe].[Vizlet Types] vt
     LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] a
     ON vt.vizlet_type = a.vizlet_type
--  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
--  , session_id
ORDER BY vt.vizlet_type DESC



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id, vizlet_type, count(*) as votes
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id, vizlet_type 



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id, vizlet_type, count(*) as score
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , session_id, vizlet_type 



________________________________________


SELECT sql_query_hash, x_col_name, y_col_name
  , rank() over (partition by vizlet_type order by score desc) as rnk 
  FROM [1314howe].[Vizlet Scores] a
--  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
--  , session_id




________________________________________


SELECT sql_query_hash, x_col_name, y_col_name
  , vizlet_type, rank() over (partition by vizlet_type order by score desc) as rnk 
  FROM [1314howe].[Vizlet Scores] a
--  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
--  , session_id




________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type, count(*) as score
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type 



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type, count(*) as score
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type 
ORDER BY count(*) desc


________________________________________


SELECT sql_query_hash, x_col_name, y_col_name
  , vizlet_type, rank() over (partition by vizlet_type order by score desc) as rnk 
  FROM [1314howe].[Vizlet Scores] a
--  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
--  , session_id




________________________________________


SELECT sql_query_hash, x_col_name, y_col_name
  , vizlet_type, rank() over (partition by vizlet_type order by score desc) as rnk 
  FROM [1314howe].[Vizlet Scores] a
--  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
--  , session_id
  
  ORDER BY sql_query_hash, x_col_name, y_col_name
  , vizlet_type



________________________________________


SELECT sql_query_hash, x_col_name, y_col_name
  , vizlet_type, rank() over (partition by sql_query_hash, x_col_name, y_col_name
  , vizlet_type order by score desc) as rnk 
  FROM [1314howe].[Vizlet Scores] a
--  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
--  , session_id
  
  ORDER BY sql_query_hash, x_col_name, y_col_name
  , vizlet_type



________________________________________


SELECT * FROM (
SELECT sql_query_hash, x_col_name, y_col_name
  , vizlet_type, rank() over (partition by sql_query_hash, x_col_name, y_col_name
  , vizlet_type order by score desc) as rnk 
  FROM [1314howe].[Vizlet Scores] a
  ) x
--  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
--  , session_id
  
  ORDER BY x.rnk desc



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , count(distinct vizlet_type)
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]

  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
HAVING count(distinct vizlet_type) > 1


________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type, count(*) OVER (partition by vizlet_type)
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]

--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type, count(*) OVER (partition by vizlet_type)
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]

--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  
ORDER BY sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type



________________________________________


SELECT * FROM (
SELECT sql_query_hash, x_col_name, y_col_name
  , vizlet_type, rank() over (partition by vizlet_type order by score desc) as rnk 
  FROM [1314howe].[Vizlet Scores] a
  ) x
--  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
--  , session_id
  
  ORDER BY x.rnk desc



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , count(*) 
  FROM [1314howe].[Vizlet Scores]
GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
 ORDER BY count(*) desc



________________________________________


SELECT * FROM (
SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type, rank() over (partition by sql_query, sql_query_hash, x_col_name, y_col_name
    , vizlet_type order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
--GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  ) x
  ORDER BY x.rnk desc



________________________________________


SELECT * FROM (
SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , count(distinct vizlet_type) as rnk
  FROM [1314howe].[Vizlet Scores]
GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  ) x
ORDER BY x.rnk desc


________________________________________


SELECT * 
  FROM [1314howe].[Vizlet Scores]
  WHERE sql_query_hash = 1823800715



________________________________________


SELECT * 
  FROM [1314howe].[Vizlet Scores]
  WHERE sql_query_hash = 1823800715
ORDER by x_col_name, y_col_name


________________________________________


SELECT *, 
  rank() over (partition by sql_query, sql_query_hash, x_col_name, y_col_name
    , vizlet_type order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
  WHERE sql_query_hash = 1823800715
ORDER by x_col_name, y_col_name


________________________________________


SELECT *, 
  rank() over (partition by sql_query, sql_query_hash, x_col_name, y_col_name
     order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
  WHERE sql_query_hash = 1823800715
ORDER by x_col_name, y_col_name


________________________________________


SELECT *, 
  row_number() over (partition by sql_query, sql_query_hash, x_col_name, y_col_name
     order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
  WHERE sql_query_hash = 1823800715
ORDER by x_col_name, y_col_name


________________________________________


SELECT * FROM (
SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type, row_number() over (partition by sql_query, sql_query_hash, x_col_name, y_col_name
    , vizlet_type order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
--GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  ) x
  ORDER BY x.rnk desc



________________________________________


SELECT * FROM (
SELECT sql_query, sql_query_hash
  , x_col_name, y_col_name
  , vizlet_type
  , row_number() over (partition by 
         sql_query, sql_query_hash, x_col_name, y_col_name 
      order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
--GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  ) x
  ORDER BY x.rnk desc



________________________________________


SELECT * FROM (
SELECT sql_query, sql_query_hash
  , x_col_name, y_col_name
  , vizlet_type
  , row_number() over (partition by 
         sql_query, sql_query_hash, x_col_name, y_col_name 
      order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
--GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  ) x
  ORDER BY sql_query, sql_query_hash
  , x_col_name, y_col_name, x.rnk desc



________________________________________


SELECT * FROM (
SELECT sql_query, sql_query_hash
  , x_col_name, y_col_name
  , vizlet_type
  , row_number() over (partition by 
         sql_query, sql_query_hash, x_col_name, y_col_name 
      order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
--GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  ) x
  WHERE x.rnk > 1
  ORDER BY sql_query, sql_query_hash
  , x_col_name, y_col_name, x.rnk desc



________________________________________


SELECT * FROM (
SELECT sql_query, sql_query_hash
  , x_col_name, y_col_name
  , vizlet_type
  , row_number() over (partition by 
         sql_query, sql_query_hash, x_col_name, y_col_name 
      order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
--GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  ) x
  WHERE sql_query_hash = -122367063
  ORDER BY sql_query, sql_query_hash
  , x_col_name, y_col_name, x.rnk desc



________________________________________


SELECT * FROM (
SELECT sql_query, sql_query_hash
  , x_col_name, y_col_name
  , vizlet_type
  , row_number() over (partition by 
         sql_query, sql_query_hash, x_col_name, y_col_name 
      order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
--GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  ) x
  WHERE x.rnk = 1



________________________________________


SELECT sql_query, sql_query_hash
  , x_col_name, y_col_name FROM (
SELECT * FROM (
SELECT sql_query, sql_query_hash
  , x_col_name, y_col_name
  , vizlet_type
  , row_number() over (partition by 
         sql_query, sql_query_hash, x_col_name, y_col_name 
      order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
--GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  ) x
  WHERE x.rnk = 1
  ) y
    GROUP BY sql_query, sql_query_hash
  , x_col_name, y_col_name
    HAVING count(*) > 1



________________________________________



SELECT * FROM (
SELECT sql_query, sql_query_hash
  , x_col_name, y_col_name
  , vizlet_type
  , row_number() over (partition by 
         sql_query, sql_query_hash, x_col_name, y_col_name 
      order by score desc) as rnk
  FROM [1314howe].[Vizlet Scores]
  ) x
  WHERE x.rnk = 1



________________________________________



SELECT * 
  FROM [1314howe].[Vizlet Data Features] f
     , [1314howe].[Best Vizlet Types] v
 WHERE f.query_string_hash = v.sql_query_hash 
   AND f.x_col_name = v.x_col_name
   AND f.y_col_name = v.y_col_name


________________________________________



SELECT v.sql_query_hash, v.x_col_name, v.y_col_name, v.vizlet_type, f.* 
  FROM [1314howe].[Vizlet Data Features] f
     , [1314howe].[Best Vizlet Types] v
 WHERE f.query_string_hash = v.sql_query_hash 
   AND f.x_col_name = v.x_col_name
   AND f.y_col_name = v.y_col_name


________________________________________



SELECT v.sql_query_hash, v.x_col_name, v.y_col_name
     , v.vizlet_type
     , x_unique_count, x_unique_ratio, x_average
     , x_variance_over_mean, x_kurtosis
     , x_gap_variance
     , y_unique_count
     , y_unique_ratio
     , y_average
     , y_variance_over_mean
     , y_kurtosis
     , y_gap_variance
  FROM [1314howe].[Vizlet Data Features] f
     , [1314howe].[Best Vizlet Types] v
 WHERE f.query_string_hash = v.sql_query_hash 
   AND f.x_col_name = v.x_col_name
   AND f.y_col_name = v.y_col_name


________________________________________


SELECT * FROM [1314howe].[Vizlet Features]
  ORDER BY x_gap_variance DESC



________________________________________


SELECT * 
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
 WHERE sql_query_hash = -473156204



________________________________________


SELECT * FROM [1314howe].[Vizlet Features]
  where x_col_name = 'seaflow_pe'
  ORDER BY x_gap_variance DESC



________________________________________


SELECT v.sql_query_hash
     , v.sql_query_hash, v.x_col_name, v.y_col_name
     , v.vizlet_type
     , x_unique_count, x_unique_ratio, x_average
     , x_variance_over_mean, x_kurtosis
     , x_gap_variance
     , y_unique_count
     , y_unique_ratio
     , y_average
     , y_variance_over_mean
     , y_kurtosis
     , y_gap_variance
  FROM [1314howe].[Vizlet Data Features] f
     , [1314howe].[Best Vizlet Types] v
 WHERE f.query_string_hash = v.sql_query_hash 
   AND f.x_col_name = v.x_col_name
   AND f.y_col_name = v.y_col_name


________________________________________


SELECT v.sql_query
     , v.sql_query_hash, v.x_col_name, v.y_col_name
     , v.vizlet_type
     , x_unique_count, x_unique_ratio, x_average
     , x_variance_over_mean, x_kurtosis
     , x_gap_variance
     , y_unique_count
     , y_unique_ratio
     , y_average
     , y_variance_over_mean
     , y_kurtosis
     , y_gap_variance
  FROM [1314howe].[Vizlet Data Features] f
     , [1314howe].[Best Vizlet Types] v
 WHERE f.query_string_hash = v.sql_query_hash 
   AND f.x_col_name = v.x_col_name
   AND f.y_col_name = v.y_col_name


________________________________________


SELECT * FROM [1314howe].[Vizlet Features]
  where x_col_name = 'seaflow_pe'
  ORDER BY x_gap_variance DESC



________________________________________


SELECT * 
  FROM [1307].[vizlets_23nov11_10h34m16s_data_features.csv] d
  JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] v
    ON (d.query_string_hash = v.sql_query_hash
   AND d.x_col_name = v.x_col_name
      AND d.y_col_name = v.y_col_name)



________________________________________


SELECT count(*) 
  FROM [1307].[vizlets_23nov11_10h34m16s_data_features.csv] d
  JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] v
    ON (d.query_string_hash = v.sql_query_hash
   AND d.x_col_name = v.x_col_name
      AND d.y_col_name = v.y_col_name)



________________________________________


SELECT distinct action
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]


________________________________________


SELECT count(*) 
  FROM [1307].[vizlets_23nov11_10h34m16s_data_features.csv] d
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] v
    ON (d.query_string_hash = v.sql_query_hash
   AND d.x_col_name = v.x_col_name
      AND d.y_col_name = v.y_col_name)



________________________________________


SELECT distinct sql_query_hash, session_id
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]


________________________________________


SELECT sql_query_hash, count(distinct session_id)
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
  group by sql_query_hash
  order by count(distinct session_id)



________________________________________


SELECT sql_query_hash, count(distinct session_id)
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
  group by sql_query_hash
  order by count(distinct session_id) desc



________________________________________


 SELECT sql_query, count(distinct session_id)
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
  group by sql_query
  order by count(distinct session_id) desc




________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type 
ORDER BY count(*) desc


________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type 
ORDER BY count(*) asc


________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  --WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type 
ORDER BY count(*) asc


________________________________________


SELECT count(*) 
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]


________________________________________


SELECT count(*) 
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv]


________________________________________


SELECT *
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]


________________________________________


SELECT distinct x_col_name, y_col_name, sql_query_hash, vizlet_type
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]


________________________________________


SELECT count(*) FROM (
SELECT distinct x_col_name, y_col_name, sql_query_hash, vizlet_type
  FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
) x



________________________________________


SELECT count(*) FROM (
SELECT distinct x_col_name, y_col_name, sql_query_hash, vizlet_type
  --FROM [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv]
FROM [1314howe].[Vizlet Scores]
) x



________________________________________


SELECT count(*) FROM (
SELECT distinct x_col, y_col, query_hash, vizlet_type
FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv]
--FROM [1314howe].[Vizlet Scores]
) x



________________________________________


SELECT count(*) FROM (

SELECT * FROM (
SELECT distinct x_col, y_col, query_hash, vizlet_type as vizlet_type_a
FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv]
) a,
(
SELECT distinct x_col_name, y_col_name, sql_query_hash, vizlet_type
  FROM [1314howe].[Vizlet Scores]
) b
WHERE a.x_col = b.x_col_name 
  AND a.y_col = b.y_col_name 
  AND a.query_hash = b.sql_query_hash
  AND a.vizlet_type_a = b.vizlet_type
) x



________________________________________


SELECT count(*) FROM (

SELECT * FROM (
SELECT distinct x_col, y_col, query_hash, vizlet_type as vizlet_type_a
FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv]
) a
  JOIN
(
SELECT distinct x_col_name, y_col_name, sql_query_hash, vizlet_type
  FROM [1314howe].[Vizlet Scores]
) b
ON a.x_col = b.x_col_name 
  AND a.y_col = b.y_col_name 
  AND a.query_hash = b.sql_query_hash
  AND a.vizlet_type_a = b.vizlet_type
) x



________________________________________


SELECT count(*) FROM (

SELECT * FROM (
SELECT distinct x_col, y_col, query_hash, vizlet_type as vizlet_type_a
FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv]
) a
  LEFT OUTER
  JOIN
(
SELECT distinct x_col_name, y_col_name, sql_query_hash, vizlet_type
  FROM [1314howe].[Vizlet Scores]
) b
ON a.x_col = b.x_col_name 
  AND a.y_col = b.y_col_name 
  AND a.query_hash = b.sql_query_hash
  AND a.vizlet_type_a = b.vizlet_type
) x



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  --WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type 
ORDER BY count(*) asc


________________________________________


SELECT count(*) FROM (
  SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  --WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , fs.vizlet_type 
--ORDER BY count(*) asc
  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT sql_query, sql_query_hash, x_col_name, y_col_name, fs.vizlet_type--, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  --WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, fs.vizlet_type 
--ORDER BY count(*) asc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type--, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  --WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, fs.vizlet_type 
--ORDER BY count(*) asc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type--, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE action = 'promote'
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, fs.vizlet_type 
--ORDER BY count(*) asc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type--, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE action = 'promote'
    AND fs.sql_query IS NULL
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, fs.vizlet_type 
--ORDER BY count(*) asc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type--, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE 1=1 -- action = 'promote'
    AND fs.sql_query IS NULL
--  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, fs.vizlet_type 
--ORDER BY count(*) asc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  action = 'promote'
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
--ORDER BY count(*) asc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  action = 'promote'
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
ORDER BY count(*) asc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  action = 'promote'
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
ORDER BY count(*) desc
--  ) z


________________________________________


SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  action = 'promote'
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
--ORDER BY count(*) desc
  ) z


________________________________________


SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  1=1--action = 'promote'
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
--ORDER BY count(*) desc
  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  1=1
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
--ORDER BY count(*) desc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  1=1
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
ORDER BY count(*) desc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  1=1
    AND sql_query IS NULL
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
ORDER BY count(*) desc
--  ) z


________________________________________


--SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  1=1
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
ORDER BY count(*) desc
--  ) z


________________________________________


SELECT count(*) FROM (
  SELECT fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] vs
  LEFT OUTER JOIN [1307].[vizlets_23nov11_10h34m16s_vizlet_and_action_features.csv] fs 
  ON (vs.query_hash = fs.sql_query_hash 
     and vs.x_col = fs.x_col_name 
     and vs.y_col = fs.y_col_name
     and vs.vizlet_type = fs.vizlet_type)
  WHERE  sql_query IS NOT NULL
  GROUP BY fs.sql_query, vs.query_hash, vs.x_col, vs.y_col, vs.vizlet_type 
--ORDER BY count(*) desc
  ) z


________________________________________


SELECT * 
  FROM [dbo].[1385s]


________________________________________


SELECT * 
  FROM [dbo].[1385s] u
  LEFT OUTER JOIN [1314howe].[uw_employees_dept.csv] d
  ON (u.1385name = d.email or u.1385name = d.1385name)
  WHERE department is not null



________________________________________


SELECT count(*) FROM (
SELECT u.1385name as sqlshare_1385name, d.* 
  FROM [dbo].[1385s] u
  LEFT OUTER JOIN [1314howe].[uw_employees_dept.csv] d
  ON (u.1385name = d.email or u.1385name = d.1385name)
  WHERE department is not null
  ) x


________________________________________


--SELECT count(*) FROM (
SELECT u.1385name as sqlshare_1385name, d.* 
  FROM [dbo].[1385s] u
  LEFT OUTER JOIN [1314howe].[uw_employees_dept.csv] d
  ON (u.1385name = d.email or u.1385name = d.1385name)
  WHERE department is null
 -- ) x


________________________________________


--SELECT count(*) FROM (
SELECT u.1385name as sqlshare_1385name, d.* 
  FROM [dbo].[1385s] u
  LEFT OUTER JOIN [1314howe].[uw_employees_dept.csv] d
  ON (replace(u.1385name, '@u.washington.edu', '@washington.edu') = d.email or u.1385name = d.1385name)
  WHERE department is null
 -- ) x


________________________________________


--SELECT count(*) FROM (
SELECT u.1385name as sqlshare_1385name, d.* 
  FROM [dbo].[1385s] u
  LEFT OUTER JOIN [1314howe].[uw_employees_dept.csv] d
  ON (replace(d.email, '@u.washington.edu', '@washington.edu') = u.1385name or u.1385name = d.1385name)
  WHERE department is null
 -- ) x


________________________________________


--SELECT count(*) FROM (
SELECT replace(d.email, '@u.washington.edu', '@washington.edu') , u.1385name as sqlshare_1385name, d.* 
  FROM [dbo].[1385s] u
  LEFT OUTER JOIN [1314howe].[uw_employees_dept.csv] d
  ON (replace(d.email, '@u.washington.edu', '@washington.edu') = u.1385name or u.1385name = d.1385name)
  --WHERE department is null
 -- ) x


________________________________________


SELECT * FROM [1314howe].[uw_employees_dept.csv]
  WHERE email like 'ahindra%'


________________________________________


SELECT * FROM [1314howe].[uw_employees_dept.csv]
  WHERE email like 'abhindra%'


________________________________________


SELECT * FROM [1314howe].[uw_employees_dept.csv]
  WHERE email like 'abhindra%'


________________________________________


SELECT * FROM [1314howe].[uw_employees_dept.csv]
  WHERE email like 'abhindra%'


________________________________________


--SELECT count(*) FROM (
SELECT distinct department from (
SELECT u.1385name as sqlshare_1385name, d.* 
  FROM [dbo].[1385s] u
  LEFT OUTER JOIN [1314howe].[uw_employees_dept.csv] d
  ON (replace(d.email, '@u.washington.edu', '@washington.edu') = u.1385name or u.1385name = d.1385name)
  --WHERE department is null
  ) x


________________________________________


--SELECT count(*) FROM (
SELECT distinct department from (
SELECT u.1385name as sqlshare_1385name, d.* 
  FROM [dbo].[1385s] u
  LEFT OUTER JOIN [1314howe].[uw_employees_dept.csv] d
  ON (replace(d.email, '@u.washington.edu', '@washington.edu') = u.1385name or u.1385name = d.1385name)
  --WHERE department is null
  ) x


________________________________________


SELECT * FROM [1307].[vizlets_28nov11_16h16m43s_data_features.csv]


________________________________________


SELECT * FROM [1314howe].[Vizlet Data Features]


________________________________________


SELECT * FROM [1314howe].[Best Vizlet Types]


________________________________________


SELECT * FROM [1314howe].[Vizlet Features]


________________________________________


SELECT vizlet_type, avg(x_gap_variance) 
  FROM [1314howe].[Vizlet Features]
  GROUP BY vizlet_type



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv ]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type 
ORDER BY count(*) desc


________________________________________


SELECT * FROM
  [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] x
  LEFT OUTER JOIN (
    SELECT sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv ]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type 
  ) y ON x.query_hash = y.sql_query_hash 
     AND x.x_col = y.x_col_name 
     AND x.y_col = y.y_col_name
     AND x.vizlet_type = y.vizlet_type



________________________________________



SELECT sql_query_hash, x_col_name, y_col_name
  , vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv ]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name
  , vizlet_type 

  UNION
SELECT query_hash, x_col, y_col, vizlet_type, 0 as score
  FROM
  [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] x




________________________________________


SELECT *, count(*) FROM (
SELECT sql_query_hash, x_col_name, y_col_name
  , vizlet_type
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv ]
 WHERE action = 'promote'
  UNION
SELECT query_hash, x_col, y_col, vizlet_type
  FROM
  [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] x
  ) x
  GROUP BY sql_query_hash, x_col_name, y_col_name
  , vizlet_type 



________________________________________


SELECT sql_query_hash, x_col_name, y_col_name, vizlet_type, sum(score) FROM (
SELECT sql_query_hash, x_col_name, y_col_name, vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv ]
 WHERE action = 'promote'
  GROUP BY sql_query_hash, x_col_name, y_col_name, vizlet_type
  UNION
SELECT query_hash, x_col, y_col, vizlet_type, 0
  FROM
  [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] x
  ) x
  GROUP BY sql_query_hash, x_col_name, y_col_name, vizlet_type 



________________________________________


SELECT sql_query_hash, x_col_name, y_col_name, vizlet_type, sum(score) as score FROM (
SELECT sql_query_hash, x_col_name, y_col_name, vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv ]
 WHERE action = 'promote'
  GROUP BY sql_query_hash, x_col_name, y_col_name, vizlet_type
  UNION
SELECT query_hash, x_col, y_col, vizlet_type, 0
  FROM
  [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] x
  ) x
  GROUP BY sql_query_hash, x_col_name, y_col_name, vizlet_type 



________________________________________


SELECT sql_query_hash, x_col_name, y_col_name, vizlet_type, sum(score) as score FROM (
SELECT sql_query_hash, x_col_name, y_col_name, vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv ]
 WHERE action = 'promote'
  GROUP BY sql_query_hash, x_col_name, y_col_name, vizlet_type
  UNION
SELECT query_hash, x_col, y_col, vizlet_type, 0
  FROM
  [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] x
  ) x
  GROUP BY sql_query_hash, x_col_name, y_col_name, vizlet_type 
 ORDER BY score DESC



________________________________________


SELECT sql_query_hash, x_col_name, y_col_name, vizlet_type, sum(score) as score FROM (
SELECT sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type
  UNION
SELECT (
  select distinct sql_query 
  from [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv] d
  where e.query_hash = d.sql_query_hash) as sql_query,
  query_hash, x_col, y_col, vizlet_type, 0 as score
  
  FROM
  [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] e
  ) x
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type 
 ORDER BY score DESC



________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type, sum(score) as score FROM (
SELECT sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type
  UNION
SELECT (
  select distinct sql_query 
  from [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv] d
  where e.query_hash = d.sql_query_hash) as sql_query,
  query_hash, x_col, y_col, vizlet_type, 0 as score
  
  FROM
  [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] e
  ) x
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type 
 ORDER BY score DESC



________________________________________


SELECT * FROM [1314howe].[Vizlet Features]


________________________________________


SELECT sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type, sum(score) as score FROM (
SELECT sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type, count(*) as score
  FROM [1307].[vizlets_28nov11_16h16m43s_vizlet_and_action_features.csv]
 WHERE action = 'promote'
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type
  UNION
SELECT (
  select distinct query_string 
  from [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
  where e.query_hash = d.query_string_hash) as sql_query,
  query_hash, x_col, y_col, vizlet_type, 0 as score
  
  FROM
  [1307].[vizlets_28nov11_16h16m43s_every_displayed_vizlet.csv] e
  ) x
  GROUP BY sql_query, sql_query_hash, x_col_name, y_col_name, vizlet_type 
 ORDER BY score DESC



________________________________________


SELECT * FROM [1314howe].[Vizlet Features]


________________________________________


SELECT * 
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash



________________________________________


SELECT s.score, d.* 
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name



________________________________________


SELECT s.score, s.vizlet_type, d.* 
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name



________________________________________


SELECT * FROM [1314howe].[Vizlet Scores and Features]
  WHERE x_gap_variance > 0



________________________________________


SELECT * FROM [1307].[cinq cents objets 1312nomiques]


________________________________________


SELECT * FROM [1314howe].[Vizlet Scores and Features]
  WHERE x_variance_over_mean > 0



________________________________________


SELECT var(objid) FROM [1307].[cinq cents objets 1312nomiques]


________________________________________


SELECT sqrt(var(objid)) FROM [1307].[cinq cents objets 1312nomiques]


________________________________________


SELECT sqrt(var(objid))/avg(objid) FROM [1307].[cinq cents objets 1312nomiques]


________________________________________


SELECT s.score, s.vizlet_type, sqrt(x_variance_over_mean) as coeff_var, x_gap_variance
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
   and x_variance_over_mean > 0



________________________________________


SELECT s.score, s.vizlet_type, d.x_col_name, d.y_col_name, sqrt(x_variance_over_mean) as coeff_var, x_gap_variance
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
   and x_variance_over_mean > 0



________________________________________


SELECT s.score, s.vizlet_type, d.x_col_name, d.y_col_name, sqrt(x_variance_over_mean*x_average)/x_average as coeff_var, x_gap_variance
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
   and x_variance_over_mean > 0


________________________________________


SELECT * 
  FROM [1314howe].[table_vizstudy_analysisv7.csv]
 WHERE Software IS NOT NULL



________________________________________


SELECT * 
  FROM [1314howe].[table_vizstudy_analysisv7.csv]
 WHERE Software != ''



________________________________________


SELECT * 
  FROM [1314howe].[table_vizstudy_analysisv7.csv]
 WHERE [id#] != ''



________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time], [Q2 Time], [Q3 Time], [Q4 Time], [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]


________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time]
  --, cast([Q2 Time] as float) as [Q2 Time]
  --, cast([Q3 Time] as float) as [Q3 Time]
  , cast([Q4 Time] as float) as [Q4 Time]
  , cast([Q5 Time] as float) as [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]


________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time]
  , [Q2 Time]
  --, cast([Q2 Time] as float) as [Q2 Time]
  --, cast([Q3 Time] as float) as [Q3 Time]
  , cast([Q4 Time] as float) as [Q4 Time]
  , cast([Q5 Time] as float) as [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]
  WHERE isnumeric([Q2 Time]) = 0



________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time]
  , [Q2 Time]
  --, cast([Q2 Time] as float) as [Q2 Time]
  --, cast([Q3 Time] as float) as [Q3 Time]
  , cast([Q4 Time] as float) as [Q4 Time]
  , cast([Q5 Time] as float) as [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]
  WHERE [Q2 Time] != ''



________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time]
  , [Q2 Time]
  , cast([Q2 Time] as float) as [Q2 Time]
  --, cast([Q3 Time] as float) as [Q3 Time]
  , cast([Q4 Time] as float) as [Q4 Time]
  , cast([Q5 Time] as float) as [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]
  WHERE [Q2 Time] != ''



________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time]
  , cast([Q2 Time] as float) as [Q2 Time]
  , [Q3 Time]
  --, cast([Q3 Time] as float) as [Q3 Time]
  , cast([Q4 Time] as float) as [Q4 Time]
  , cast([Q5 Time] as float) as [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]
  WHERE [Q2 Time] != ''
  AND isnumeric([Q3 Time]) = 0 -- != ''



________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time]
  , cast([Q2 Time] as float) as [Q2 Time]
  , [Q3 Time]
  --, cast([Q3 Time] as float) as [Q3 Time]
  , cast([Q4 Time] as float) as [Q4 Time]
  , cast([Q5 Time] as float) as [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]
  WHERE [Q2 Time] != ''
  AND isnumeric([Q3 Time]) = 0 -- != ''
  AND [id#] Not like 'Q1%'



________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time]
  , cast([Q2 Time] as float) as [Q2 Time]
  , cast([Q3 Time] as float) as [Q3 Time]
  , cast([Q4 Time] as float) as [Q4 Time]
  , cast([Q5 Time] as float) as [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]
  WHERE [Q2 Time] != ''
  AND isnumeric([Q3 Time]) = 0 -- != ''
  AND [id#] Not like 'Q1%'



________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time]
  , cast([Q2 Time] as float) as [Q2 Time]
  , cast([Q3 Time] as float) as [Q3 Time]
  , cast([Q4 Time] as float) as [Q4 Time]
  , cast([Q5 Time] as float) as [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]
  WHERE [Q2 Time] != ''
  AND [Q3 Time] != ''
  AND [id#] Not like 'Q1%'



________________________________________


SELECT id# as id, Software
  , cast([Q1 Time] as float) as [Q1 Time]
  , cast([Q2 Time] as float) as [Q2 Time]
  , cast([Q3 Time] as float) as [Q3 Time]
  , cast([Q4 Time] as float) as [Q4 Time]
  , cast([Q5 Time] as float) as [Q5 Time]
  , [Q1 (Trend)], [Q2 (Average)], [Q3 (Compare)], [Q4 (Sort)], [Q5 (Fit)]
  FROM [1314howe].[vizstudy_analysisv7.csv]
  WHERE [Q2 Time] != ''
  AND [Q3 Time] != ''
  AND [id#] Not like 'Q1%'


________________________________________


SELECT s.score, s.vizlet_type
     , d.x_col_name, d.y_col_name
     , sqrt(x_variance_over_mean * x_average) / x_average as coeff_var
     , x_gap_variance
     , d.*
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
   and x_variance_over_mean > 0



________________________________________


SELECT s.score, s.vizlet_type
     , d.x_col_name, d.y_col_name
     , sqrt(x_variance_over_mean * x_average) / x_average as coeff_var
     , sqrt(y_variance_over_mean * y_average) / y_average as coeff_var
     , x_gap_variance
     , d.x_unique_ratio
     , d.x_unique_count
     , d.x_kurtosis
     , d.y_kurtosis
     
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
   and x_variance_over_mean > 0
     and y_variance_over_mean > 0



________________________________________


SELECT s.score, s.vizlet_type
     , d.x_col_name, d.y_col_name
     , case when x_average = 0 then 0 else sqrt(x_variance_over_mean * x_average) / x_average end as x_coeff_var
     , case when y_average = 0 then 0 else sqrt(y_variance_over_mean * y_average) / y_average end as y_coeff_var
     , x_gap_variance
     , d.x_unique_ratio
     , d.x_unique_count
     , d.x_kurtosis
     , d.y_kurtosis
     
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100




________________________________________


SELECT s.score, s.vizlet_type
     , d.x_col_name, d.y_col_name
     , case when x_average = 0 then 0 else sqrt(x_variance_over_mean * x_average) / x_average end as x_coeff_var
     , case when y_average = 0 then 0 else sqrt(y_variance_over_mean * y_average) / y_average end as y_coeff_var
     , x_gap_variance
     , d.x_unique_ratio
     , d.x_unique_count
     , d.x_kurtosis
     , d.y_kurtosis
     
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
  ORDER BY score desc




________________________________________


SELECT count(*) FROM (
SELECT s.score, s.vizlet_type
     , d.x_col_name, d.y_col_name
     , case when x_average = 0 then 0 else sqrt(x_variance_over_mean * x_average) / x_average end as x_coeff_var
     , case when y_average = 0 then 0 else sqrt(y_variance_over_mean * y_average) / y_average end as y_coeff_var
     , x_gap_variance
     , d.x_unique_ratio
     , d.x_unique_count
     , d.x_kurtosis
     , d.y_kurtosis
     
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
 -- ORDER BY score desc
  ) x



________________________________________



SELECT s.score, s.vizlet_type
     , d.x_col_name, d.y_col_name
     , case when x_average = 0 then 0 else sqrt(x_variance_over_mean * x_average) / x_average end as x_coeff_var
     , case when y_average = 0 then 0 else sqrt(y_variance_over_mean * y_average) / y_average end as y_coeff_var
     , x_gap_variance
     , d.x_unique_ratio
     , d.x_unique_count
     , d.x_kurtosis
     , d.y_kurtosis
     
  FROM [1314howe].[Vizlet Scores] s
     , [1307].[vizlets_28nov11_16h16m43s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
 ORDER BY score desc




________________________________________


SELECT CAST([Date] as datetime) as [Date]
 , [Total Calories], [Total Fat]
 , CASE WHEN [Seafood Fat] = 'None' THEN 0.0 
  ELSE CAST([Seafood Fat] as float) END as [Seafood Fat]
  , CASE WHEN [Nut Fat] = 'None' THEN 0.0
  ELSE CAST([Nut Fat] as float) END as [Nut Fat]
 ,  CASE WHEN [Vegetable Fat] = 'None' THEN 0.0 
  ELSE CAST([Vegetable Fat] as float) END as [Vegetable Fat]
  , CASE WHEN [Chocolate Fat] = 'None' THEN 0.0 
  ELSE CAST([Chocolate Fat] as float) END as [Chocolate Fat]
  FROM [1314howe].[table_categorized_fat.xlsx.txt52269]



________________________________________


SELECT * FROM [1314howe].[mhip_zip_with_distance.csv]
  WHERE distance is not null



________________________________________


SELECT * FROM [1314howe].[mhip_zip_with_distance.csv]
  WHERE len(distance) > 0


________________________________________


SELECT * FROM [1314howe].[mhip_zip_with_distance.csv]
  WHERE distance is not null



________________________________________


SELECT count(*) 
  FROM [1314howe].[mhip_travel_distance_home_clinic]
  WHERE distance > (SELECT avg(distance) FROM [1314howe].[mhip_travel_distance_home_clinic])
  



________________________________________


SELECT count(*) 
  FROM [1314howe].[mhip_travel_distance_home_clinic]
  WHERE distance <= (SELECT avg(distance) FROM [1314howe].[mhip_travel_distance_home_clinic])
  



________________________________________


SELECT count(*), avg(total4type_fu), avg(any4type_fu_24wk)
  FROM [1314howe].[mhip_travel_distance_home_clinic]
  WHERE distance <= (SELECT avg(distance) FROM [1314howe].[mhip_travel_distance_home_clinic])
  



________________________________________


SELECT count(*), avg(total4type_fu), avg(any4type_fu_24wk)
  FROM [1314howe].[mhip_travel_distance_home_clinic]
  WHERE distance > (SELECT avg(distance) FROM [1314howe].[mhip_travel_distance_home_clinic])
  



________________________________________


SELECT count(*)
     , avg(total4type_fu)
     , avg(any4type_fu_24wk)
     , avg(any4type_fu_2wk)
  FROM [1314howe].[mhip_travel_distance_home_clinic]
  WHERE distance > (SELECT avg(distance) FROM [1314howe].[mhip_travel_distance_home_clinic])
  



________________________________________


SELECT count(*)
     , avg(total4type_fu)
     , avg(any4type_fu_24wk)
     , avg(any4type_fu_2wk)
  FROM [1314howe].[mhip_travel_distance_home_clinic]
  WHERE distance > (SELECT avg(distance) FROM [1314howe].[mhip_travel_distance_home_clinic])
  



________________________________________


SELECT count(*)
     , avg(total4type_fu)
     , avg(any4type_fu_24wk)
     , avg(any4type_fu_2wk)
  FROM [1314howe].[mhip_travel_distance_home_clinic]
  WHERE distance < (SELECT avg(distance) FROM [1314howe].[mhip_travel_distance_home_clinic])
  



________________________________________


SELECT count(*)
     , avg(total4type_fu)
     , avg(any4type_fu_24wk)
     , avg(any4type_fu_2wk)
     , avg(any4type_fu_16wk)
  FROM [1314howe].[mhip_travel_distance_home_clinic]
  WHERE distance > 25000
 -- (SELECT avg(distance) FROM [1314howe].[mhip_travel_distance_home_clinic])
  



________________________________________


SELECT count(*)
     , avg(total4type_fu)
     , avg(any4type_fu_24wk)
     , avg(any4type_fu_2wk)
     , avg(any4type_fu_16wk)
  FROM [1314howe].[mhip_travel_distance_home_clinic]
  WHERE distance < 25000
 -- (SELECT avg(distance) FROM [1314howe].[mhip_travel_distance_home_clinic])
  



________________________________________


SELECT * 
  FROM [1314howe].[amath_analysis.csv]
 WHERE Column10 is not null
 



________________________________________


SELECT * 
  FROM [1314howe].[amath_analysis.csv]
  WHERE len(Column10) > 0



________________________________________


SELECT * 
  FROM [1314howe].[amath_analysis.csv]
  WHERE Column10 != ''


________________________________________


SELECT * 
  FROM [1314howe].[amath_analysis.csv]
  WHERE Column11 != ''


________________________________________


SELECT * 
  FROM [1314howe].[amath_analysis.csv]
  WHERE Column11 = ''


________________________________________


SELECT * 
  FROM [1314howe].[amath_analysis.csv]
  WHERE Column11 is null


________________________________________


SELECT * 
  FROM [1314howe].[amath_analysis.csv]
  WHERE Column10 is null


________________________________________


SELECT * 
  FROM [1314howe].[amath_analysis.csv]
  WHERE Column10 is not null


________________________________________


SELECT * 
  FROM [1314howe].[amath_analysis.csv]
  WHERE Column11 is not null


________________________________________


SELECT system_key 
  FROM [1314howe].[amath_analysis.csv]
  WHERE dept_abbrev = 'AMATH'
INTERSECT
SELECT system_key 
  FROM [1314howe].[amath_analysis.csv]
  WHERE dept_abbrev = 'CSE'


________________________________________


select count(*) from (
  SELECT system_key 
  FROM [1314howe].[amath_analysis.csv]
  WHERE dept_abbrev = 'AMATH'
INTERSECT
SELECT system_key 
  FROM [1314howe].[amath_analysis.csv]
  WHERE dept_abbrev = 'CSE'
  ) x



________________________________________


--select count(*) from (
SELECT count(system_key) 
  FROM [1314howe].[amath_analysis.csv]
  WHERE dept_abbrev = 'AMATH'
--INTERSECT
--SELECT system_key 
--  FROM [1314howe].[amath_analysis.csv]
--  WHERE dept_abbrev = 'CSE'
--  ) x



________________________________________


--select count(*) from (
SELECT count(system_key) 
  FROM [1314howe].[amath_analysis.csv]
  WHERE dept_abbrev = 'CSE'
--INTERSECT
--SELECT system_key 
--  FROM [1314howe].[amath_analysis.csv]
--  WHERE dept_abbrev = 'CSE'
--  ) x



________________________________________


--select count(*) from (
SELECT count(system_key) 
  FROM [1314howe].[amath_analysis.csv]
  WHERE dept_abbrev = 'CSE'
--INTERSECT
--SELECT system_key 
--  FROM [1314howe].[amath_analysis.csv]
--  WHERE dept_abbrev = 'CSE'
--  ) x



________________________________________


SELECT cast('1/' + cast(a.tran_qtr as varchar) + '/' + cast(a.tran_yr as varchar) as date)
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key


________________________________________


SELECT dept_abbrev, course_number
     , cast('1/' + cast(tran_qtr as varchar) + '/' + cast(tran_yr as varchar) as date) as start_date
     , tran_qtr, tran_yr, grade, s1_gender, class, system_key
  FROM [1314howe].[table_amath_analysis.csv]


________________________________________


SELECT count(*) 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date < c.start_date



________________________________________


SELECT count(*) 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date > c.start_date



________________________________________


SELECT count(*) 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date < c.start_date



________________________________________


SELECT count(*) 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date = c.start_date



________________________________________


SELECT count(*) 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date < c.start_date



________________________________________


SELECT count(*) 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date > c.start_date



________________________________________


SELECT count(*) 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date = c.start_date



________________________________________


SELECT count(*), avg(datediff(month, a.start_date, c.start_date)) 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date < c.start_date



________________________________________


SELECT count(*), avg(datediff(month, a.start_date, c.start_date))/3.0 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date < c.start_date



________________________________________


SELECT count(*), avg(datediff(month, a.start_date, c.start_date))/3.0 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date > c.start_date



________________________________________


SELECT count(*), avg(datediff(month, a.start_date, c.start_date))/3.0 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date = c.start_date



________________________________________


SELECT count(*), avg(datediff(month, a.start_date, c.start_date))/3.0 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date = c.start_date
    AND a.grade != '00'



________________________________________


SELECT count(*), avg(datediff(month, a.start_date, c.start_date))/3.0 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    --AND a.start_date = c.start_date
    AND a.grade != '00'



________________________________________


SELECT count(*), avg(datediff(month, a.start_date, c.start_date))/3.0 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    --AND a.start_date = c.start_date
    AND a.s1_gender = 'F'



________________________________________


SELECT count(*), avg(datediff(month, a.start_date, c.start_date))/3.0 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    --AND a.start_date = c.start_date
    AND a.s1_gender != c.s1_gender


________________________________________


SELECT count(*), avg(datediff(month, a.start_date, c.start_date))/3.0 
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    --AND a.start_date = c.start_date
    AND a.s1_gender = 'F'


________________________________________


SELECT system_key, dept_abbrev, course_number
     , cast('1/' + cast(tran_qtr as varchar) + '/' + cast(tran_yr as varchar) as date) as start_date
     , tran_qtr, tran_yr
     , cast(grade as int)
     , s1_gender, class 
  FROM [1314howe].[table_amath_analysis.csv]


________________________________________


SELECT system_key, dept_abbrev, course_number
     , cast('1/' + cast(tran_qtr as varchar) + '/' + cast(tran_yr as varchar) as date) as start_date
  , tran_qtr, tran_yr
  , cast(tran_qtr as varchar) + '/' + cast(tran_yr as varchar) as quarter
     , cast(grade as int)
     , s1_gender, class 
  FROM [1314howe].[table_amath_analysis.csv]


________________________________________


SELECT system_key, dept_abbrev, course_number
     , cast('1/' + cast(tran_qtr as varchar) + '/' + cast(tran_yr as varchar) as date) as start_date
  , tran_qtr, tran_yr
  , cast(tran_qtr as varchar) + '/' + cast(tran_yr as varchar) as quarter
     , cast(grade as int) as grade
     , s1_gender, class 
  FROM [1314howe].[table_amath_analysis.csv]


________________________________________


SELECT system_key, dept_abbrev, course_number
     , cast('1/' + cast(tran_qtr as varchar) + '/' + cast(tran_yr as varchar) as date) as start_date
     , tran_qtr, tran_yr
     , cast(tran_qtr as varchar) + '/' + cast(tran_yr as varchar) as quarter
     , CASE WHEN isnumeric(grade) != 0 THEN cast(grade as int) ELSE NULL END as grade
     , s1_gender, class 
  FROM [1314howe].[table_amath_analysis.csv]


________________________________________


SELECT count(*), avg(a.grade) as amathgrade, avg(c.grade) as csegrade
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date < c.start_date



________________________________________


SELECT count(*), avg(a.grade) as amathgrade, avg(c.grade) as csegrade
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date > c.start_date



________________________________________


SELECT count(*), avg(a.grade) as amathgrade, avg(c.grade) as csegrade
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date < c.start_date



________________________________________


SELECT count(*), avg(a.grade) as amathgrade, avg(c.grade) as csegrade
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    AND a.start_date = c.start_date



________________________________________


SELECT count(*), avg(a.grade) as amathgrade, avg(c.grade) as csegrade
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    --AND a.start_date = c.start_date



________________________________________


SELECT count(*), avg(a.grade) as amathgrade, avg(c.grade) as csegrade
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    --AND a.start_date = c.start_date
    AND a.s1_gender = 'F'



________________________________________


SELECT count(*), avg(a.grade) as amathgrade, avg(c.grade) as csegrade
  FROM [1314howe].[amath_analysis.csv] a
     , [1314howe].[amath_analysis.csv] c
  WHERE a.dept_abbrev = 'AMATH' 
    AND c.dept_abbrev = 'CSE' 
    AND a.system_key = c.system_key
    --AND a.start_date = c.start_date
    AND a.s1_gender = 'M'



________________________________________


SELECT * FROM [1314howe].[mhip_zip_eScience_022112a.csv]


________________________________________


SELECT * FROM [1052].[Kellett Bluff Orca Sightings with Tidal Cycles]


________________________________________


select * from dbo.1385_queries


________________________________________


select * from dbo.1385_queries where owner like 'koester'


________________________________________


select * from dbo.1385_queries where owner like '%koester%'


________________________________________


select count(*) from dbo.1385_queries where owner like '%koester%'


________________________________________


SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_December-08.csv]
UNION
SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_December-08.csv]



________________________________________



SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_May-09.csv]
UNION
SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_August-08.csv]




________________________________________



SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_May-09.csv]
UNION
SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_August-08.csv]




________________________________________


SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_December-08.csv]
 WHERE Station = 'None'



________________________________________


SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_December-08.csv]
 WHERE Station != 'None'



________________________________________



SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_May-09.csv]
UNION
SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_August-08.csv]





________________________________________



SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_May-09.csv]
UNION
SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_August-08.csv]





________________________________________


SELECT * 
  FROM [1314howe].[table_Hoodcanal2011corrected.xlsx_December-08.csv]



________________________________________


SELECT * FROM [1314howe].[Hoodcanal2011corrected.xlsx_December-08.csv]


________________________________________


SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_December-08.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_August-08.csv]




________________________________________



SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_May-09.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_August-08.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_December-08.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_October-08.csv]
  
  




________________________________________


SELECT * FROM (
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_May-09.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_August-08.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_December-08.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_October-08.csv]
  ) x
    WHERE Station is not null




________________________________________


SELECT * FROM (
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_May-09.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_August-08.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_December-08.csv]
UNION
SELECT * 
  FROM [1314howe].[Hoodcanal2011corrected.xlsx_October-08.csv]
  ) x
    WHERE Station != ''




________________________________________


SELECT * FROM [1314howe].[Hoodcanal2011corrected]


________________________________________


SELECT arcamoA FROM [1314howe].[Hoodcanal2011corrected]


________________________________________


SELECT Sal, arcamoA FROM [1314howe].[Hoodcanal2011corrected]


________________________________________


SELECT  (COUNT(*)*SUM(x*y)-SUM(x)*SUM(y))/(
   SQRT(COUNT(*)*SUM(SQUARE(x))-SQUARE(SUM(x)))*
   SQRT(COUNT(*)*SUM(SQUARE(y))-SQUARE(SUM(y)))) 
   correlation 
FROM (
  SELECT [Sal] as x, [arcamoA] as y
  FROM [1314howe].[Hoodcanal2011corrected]
) x



________________________________________


SELECT  (COUNT(*)*SUM(x*y)-SUM(x)*SUM(y))/(
   SQRT(COUNT(*)*SUM(SQUARE(x))-SQUARE(SUM(x)))*
   SQRT(COUNT(*)*SUM(SQUARE(y))-SQUARE(SUM(y)))) 
   correlation 
FROM (
  SELECT [Temp (C)] as x, [arcamoA] as y
  FROM [1314howe].[Hoodcanal2011corrected]
) x



________________________________________


SELECT  (COUNT(*)*SUM(x*y)-SUM(x)*SUM(y))/(
   SQRT(COUNT(*)*SUM(SQUARE(x))-SQUARE(SUM(x)))*
   SQRT(COUNT(*)*SUM(SQUARE(y))-SQUARE(SUM(y)))) 
   correlation 
FROM (
  SELECT [Chl (mg/m3)] as x, [arcamoA] as y
  FROM [1314howe].[Hoodcanal2011corrected]
) x



________________________________________


SELECT  (COUNT(*)*SUM(x*y)-SUM(x)*SUM(y))/(
   SQRT(COUNT(*)*SUM(SQUARE(x))-SQUARE(SUM(x)))*
   SQRT(COUNT(*)*SUM(SQUARE(y))-SQUARE(SUM(y)))) 
   correlation 
FROM (
  SELECT [O2 (mg/L)] as x, [arcamoA] as y
  FROM [1314howe].[Hoodcanal2011corrected]
) x



________________________________________


SELECT  (COUNT(*)*SUM(x*y)-SUM(x)*SUM(y))/(
   SQRT(COUNT(*)*SUM(SQUARE(x))-SQUARE(SUM(x)))*
   SQRT(COUNT(*)*SUM(SQUARE(y))-SQUARE(SUM(y)))) 
   correlation 
FROM (
  SELECT [NO3- (M)] as x, [arcamoA] as y
  FROM [1314howe].[Hoodcanal2011corrected]
) x



________________________________________


SELECT  (COUNT(*)*SUM(x*y)-SUM(x)*SUM(y))/(
   SQRT(COUNT(*)*SUM(SQUARE(x))-SQUARE(SUM(x)))*
   SQRT(COUNT(*)*SUM(SQUARE(y))-SQUARE(SUM(y)))) 
   correlation 
FROM (
  SELECT [NH4 (M)] as x, [arcamoA] as y
  FROM [1314howe].[Hoodcanal2011corrected]
) x



________________________________________


SELECT  (COUNT(*)*SUM(x*y)-SUM(x)*SUM(y))/(
   SQRT(COUNT(*)*SUM(SQUARE(x))-SQUARE(SUM(x)))*
   SQRT(COUNT(*)*SUM(SQUARE(y))-SQUARE(SUM(y)))) 
   correlation 
FROM (
  SELECT [Sal] as x, [arcamoA] as y
  FROM [1314howe].[Hoodcanal2011corrected]
) x



________________________________________


SELECT [NO2 (M)],
[NO2 * 10],
[Temp (C)],
[Sal],
[O2 (mg/L)],
[Chl (mg/m3)],
[NO3- (M)],
[NH4 (M)],
[NH4+ *10],
[Sigma-t (Kg/m3)],
[Transm (%)],
[PAR],
[Abs],
[DC],
[SE],
[sd],
[arcamoA]
  FROM [1314howe].[Hoodcanal2011corrected]


________________________________________


SELECT 
Station, [Date (euro)],
  [NO2 (M)],
[NO2 * 10],
[Temp (C)],
[Sal],
[O2 (mg/L)],
[Chl (mg/m3)],
[NO3- (M)],
[NH4 (M)],
[NH4+ *10],
[Sigma-t (Kg/m3)],
[Transm (%)],
[PAR],
[Abs],
[DC],
[SE],
[sd],
[arcamoA]
  FROM [1314howe].[Hoodcanal2011corrected]


________________________________________


SELECT 
Station, [Date (euro)],
  [NO2 (M)],
[NO2 * 10],
[Temp (C)],
[Sal],
[O2 (mg/L)],
[Chl (mg/m3)],
[NO3- (M)],
[NH4 (M)],
[NH4+ *10],
[Sigma-t (Kg/m3)],
[Transm (%)],
[PAR],
[Abs],
[DC],
[SE],
[sd],
[arcamoA]
  FROM [1314howe].[Hoodcanal2011corrected]


________________________________________


SELECT 
Station, [Date (euro)],
[NO2 (M)],
[NO2 * 10],
[Temp (C)],
[Sal],
[O2 (mg/L)],
[Chl (mg/m3)],
[NO3- (M)],
[NH4 (M)],
[NH4+ *10],
[Sigma-t (Kg/m3)],
[Transm (%)],
[PAR],
[Abs],
[DC],
[SE],
[sd],
[arcamoA]
  FROM [1314howe].[Hoodcanal2011corrected]


________________________________________



SELECT definition
FROM sys.sql_modules
WHERE object_id = OBJECT_ID('<schema_name.object_name>');


________________________________________



SELECT definition
FROM sys.sql_modules
WHERE object_id = OBJECT_ID('<[1314howe@washington.edu].[upload_failing.csv]>');


________________________________________



SELECT definition
FROM sys.sql_modules
WHERE object_id = OBJECT_ID('<[1314howe].[upload_failing.csv]>');


________________________________________



SELECT definition
FROM sys.sql_modules
WHERE object_id = OBJECT_ID('<[1314howe@u.washington.edu].[upload_failing.csv]>');


________________________________________



SELECT definition
FROM sys.sql_modules




________________________________________


select USER_NAME(p.grantee_principal_id) AS principal_name,
        dp.type_desc AS principal_type_desc,
        p.class_desc,
        OBJECT_NAME(p.major_id) AS object_name,
        p.permission_name,
        p.state_desc AS permission_state_desc
from    sys.database_permissions p
inner   JOIN sys.database_principals dp
on     p.grantee_principal_id = dp.principal_id


________________________________________


select USER_NAME(p.grantee_principal_id) AS principal_name,
        dp.type_desc AS principal_type_desc,
        p.class_desc,
        OBJECT_NAME(p.major_id) AS object_name,
        p.permission_name,
        p.state_desc AS permission_state_desc, p.*
from    sys.database_permissions p
inner   JOIN sys.database_principals dp
on     p.grantee_principal_id = dp.principal_id


________________________________________


select USER_NAME(p.grantee_principal_id) AS principal_name,
        dp.type_desc AS principal_type_desc,
        p.class_desc,
        OBJECT_NAME(p.major_id) AS object_name, o.type,
        p.permission_name,
        p.state_desc AS permission_state_desc, p.*
from    sys.database_permissions p
inner   JOIN sys.database_principals dp
on     p.grantee_principal_id = dp.principal_id
inner   JOIN sys.objects o
  on p.major_id = o.object_id
 WHERE o.type = 'V'




________________________________________


select USER_NAME(p.grantee_principal_id) AS principal_name,
        dp.type_desc AS principal_type_desc,
        p.class_desc,
        OBJECT_NAME(p.major_id) AS object_name, o.type,
        p.permission_name,
        p.state_desc AS permission_state_desc, p.*
from    sys.database_permissions p
inner   JOIN sys.database_principals dp
on     p.grantee_principal_id = dp.principal_id
inner   JOIN sys.objects o
  on p.major_id = o.object_id
 WHERE o.type = 'V'
  and dp.type_desc = 'SQL_USER'




________________________________________


select USER_NAME(p.grantee_principal_id) AS principal_name,
        dp.type_desc AS principal_type_desc,
        p.class_desc,
        OBJECT_NAME(p.major_id) AS object_name, 
        p.permission_name,
        p.state_desc AS permission_state_desc, p.*
from    sys.database_permissions p
inner   JOIN sys.database_principals dp
on     p.grantee_principal_id = dp.principal_id
WHERE dp.type_desc = 'SQL_USER'
  and permission_name = 'SELECT'
  and state_desc = 'GRANT'
  and OBJECT_NAME(p.major_id) = 'viewname'



________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%ENGINEER%'



________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%SOFTWARE ENGINEER%'



________________________________________


SELECT avg(salary)
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%SOFTWARE ENGINEER%'



________________________________________


SELECT avg(salary)
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%SOFTWARE%'



________________________________________


SELECT avg(salary)
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%ENGINEER%'



________________________________________


SELECT avg(salary)
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%PROGRAMMER%'



________________________________________


SELECT title, avg(salary)
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%PROGRAMMER%'
  group by title



________________________________________


SELECT title, avg(salary)
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%WEB%'
  group by title



________________________________________


SELECT title, avg(salary)
  FROM [1314howe].[UW employees, salary and department]
  WHERE last like '%MICHAUD%'
  group by title



________________________________________


SELECT first, avg(salary)
  FROM [1314howe].[UW employees, salary and department]
  WHERE last like '%LEWIS%'
group by first



________________________________________


SELECT first, avg(salary)
  FROM [1314howe].[UW employees, salary and department]
  WHERE last like '%KOESTER%'
group by first



________________________________________


SELECT *
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%MICHAUD%'




________________________________________


SELECT *
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%MICH%'




________________________________________


SELECT *
  FROM [1314howe].[UW employees, salary and department]
  WHERE last like '%MICHAUD%'




________________________________________


SELECT *
  FROM [1314howe].[UW employees, salary and department]
  WHERE department like '%Learning%'




________________________________________


SELECT *
  FROM [1314howe].[UW employees, salary and department]
  WHERE department like '%Scholarly%'




________________________________________


SELECT *
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%OFTWARE%'




________________________________________


SELECT *
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'




________________________________________


SELECT avg(sal)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'




________________________________________


SELECT *
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'




________________________________________


SELECT *
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  order by sal desc




________________________________________


SELECT *
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%SOFTWARE%'
  order by salary desc




________________________________________


SELECT *
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  order by sal desc




________________________________________


SELECT min(sal), max(sal)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  --order by sal desc




________________________________________


SELECT sal / 100, min(sal), max(sal)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  group by sal / 100
  --order by sal desc




________________________________________


SELECT round(sal / 1000, 2), min(sal), max(sal)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  group by round(sal / 1000, 2)
  --order by sal desc




________________________________________


SELECT round(sal / 1000, 0), min(sal), max(sal)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT round(sal / 1000, 0), min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT round(sal / 1000, 0), min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal > 5900
  group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT 
  --round(sal / 1000, 0), 
  min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal > 5900
  --group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT 
  --round(sal / 1000, 0), 
  min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal < 5900
  --group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT 
  --round(sal / 1000, 0), 
  min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal < 6200
  --group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT 
  --round(sal / 1000, 0), 
  min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal < 6500
  --group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT 
  --round(sal / 1000, 0), 
  min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal < 7000
  --group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT 
  --round(sal / 1000, 0), 
  min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal > 7000
  --group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT 
  --round(sal / 1000, 0), 
  min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal > 8000
  --group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT 
  --round(sal / 1000, 0), 
  min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal < 8000
  --group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT 
  --round(sal / 1000, 0), 
  min(sal), max(sal), count(*)
  FROM [1314howe].[uwsalaries.csv]
  WHERE title like '%SOFTWARE%'
  and sal > 8000
  --group by round(sal / 1000, 0)
  --order by sal desc




________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%SOFTWARE%'



________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
  WHERE title like '%SOFTWARE%'
  order by salary desc



________________________________________


select * from dbo.1385_queries



________________________________________


SELECT * FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


SELECT * FROM [1314howe].[python bootcamp respondents]


________________________________________


SELECT min(binid), max(binid) FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


SELECT min(binid), max(binid) FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


SELECT min(binid), max(binid) FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


SELECT min(binid), max(binid) FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


SELECT min(binid), max(binid) FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


SELECT min(binid), max(binid) FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


SELECT min(binid), max(binid) FROM [1002].[Tokyo_ALL_merged_data_time_binned]


________________________________________


select count(*) from dbo.1385_queries



________________________________________


select * from sys.objects



________________________________________


select name from sys.objects where name like '%log%'



________________________________________


select count(*) from dbo.1385_query_log



________________________________________


select count(*) from dbo.1385s



________________________________________


select top 5 * from dbo.1385_query_log
  --datepart('month', date) count(*) 
  



________________________________________


select month, year, count(*) from   
(
  select datepart(month, date_queried) as month
  , datepart(year, date_queried) as year
  from dbo.1385_query_log 
  ) x
  group by month, year
  



________________________________________


select month, year, count(*) from   
(
  select datepart(month, date_queried) as month
  , datepart(year, date_queried) as year
  from dbo.1385_query_log 
  ) x
  group by month, year
  order by year, month
  



________________________________________


select month, year, count(*) from   
(
  select datepart(month, date_queried) as month
  , datepart(year, date_queried) as year
  from dbo.1385_query_log 
  ) x
  group by month, year
  order by year desc, month desc
  



________________________________________


SELECT top 5 * 
  FROM [1002].[Tokyo_ALL_merged_data_time_binned]
  


________________________________________


SELECT top 5 * 
  FROM [1002].[Tokyo_ALL_merged_data_time_binned]
  


________________________________________


SELECT min(binid) 
  FROM [1002].[Tokyo_4_merged_data_time_binned]


________________________________________


SELECT min(binid), max(binid)
  FROM [1002].[Tokyo_4_merged_data_time_binned]


________________________________________


SELECT min(binid), max(binid)
  FROM [1002].[Tokyo_3_merged_data_time_binned]


________________________________________


SELECT min(binid), max(binid)
  FROM [1002].[Tokyo_ALL_merged_data_time_binned]
  


________________________________________


SELECT min(binid), max(binid)
  FROM [1002].[Tokyo_ALL_merged_data_time_binned]
  


________________________________________


SELECT 'Tokyo_0' as source, *
FROM [1002].[Tokyo_0_merged_data_time_binned]     
UNION    
SELECT 'Tokyo_1' as source   , *   
FROM [1002].[Tokyo_1_merged_data_time_binned]
UNION ALL
SELECT 'Tokyo_2' as source   , *   
FROM [1002].[Tokyo_2_merged_data_time_binned]
UNION ALL
SELECT 'Tokyo_3' as source   , *   
FROM [1002].[Tokyo_3_merged_data_time_binned]
UNION ALL   
SELECT 'Tokyo_4' as source   , *   
FROM [1002].[Tokyo_4_merged_data_time_binned]


________________________________________


SELECT * FROM [897].[NDBC_46088_A1_AirTemp_30d.csv] x
  JOIN [280].[WaterTemp.txt] y
  ON x.Temp = y.Water_Temp


________________________________________


SELECT * FROM dbo.1385s


________________________________________


SELECT * FROM dbo.1385s order by date_created desc



________________________________________


SELECT * FROM dbo.1385s where date_created > cast('10/8/2012' as date) order by date_created desc



________________________________________


SELECT * FROM [1314howe].[activities.csv]


________________________________________


SELECT * FROM [1314howe].[all views in sqlshare]


________________________________________


SELECT * FROM [1314howe].[table_reuters_terms.csv41E74]


________________________________________


SELECT * FROM [1314howe].[table_reuters_terms.csv]


________________________________________


SELECT * FROM [1314howe].[small_reuters_tail.csv]


________________________________________


SELECT * FROM [1314howe].[small_reuters.csv]


________________________________________


SELECT * FROM [1314howe].[upload_failing.csv]


________________________________________


select term_id, doc_id, frequency,
/* TF */ 
  (cast(frequency as float) / (select top 1 cast(frequency as float) as docFreq from [1314howe].[reuters_terms.csv] A where A.doc_id = Z.doc_id order by frequency desc) *    
/* IDF */
  (log(
    (select cast(count (distinct doc_id) as float) from [1314howe].[reuters_terms.csv])/
    (1 + (select cast(count (distinct doc_id) as float) from [1314howe].[reuters_terms.csv] C where Z.term_id = C.term_id ))
  )
  )) as tfidf
    from [1314howe].[reuters_terms.csv] Z  
    order by doc_id, tfidf


________________________________________


--select '<a href=\"https://sqlsharedependencies.cloudapp.net/?table=' +  + '\">

select * from 1385_queries



________________________________________



--select '<a href=\"https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>' as link from ( 

select short_desc, replace(short_desc, ' ', '_') as name from 1385_queries
--)



________________________________________



select '<a href=\"https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>' as link from ( 

select short_desc, replace(short_desc, ' ', '_') as name from 1385_queries
) as x



________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

select replace(short_desc, ' ', '_') as name, short_desc from 1385_queries

) as x



________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

select replace(short_desc, ' ', '_') as name, short_desc from 1385_queries where is_public = 'true'

) as x



________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

select replace(short_desc, ' ', '_') as name, short_desc from 1385_queries

) as x


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

select short_desc as name, short_desc from 1385_queries

) as x


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

  select replace(short_desc, ' ', '%20') as name, short_desc from 1385_queries

) as x


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

  select replace(short_desc, ' ', '%20') as name, short_desc from 1385_queries
  where sql_code not like '%cast%'
) as x
  
 


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

  select replace(short_desc, ' ', '%20') as name, short_desc from 1385_queries
  where sql_code not like '%CAST%'
) as x
  
 


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

  select replace(short_desc, ' ', '%20') as name, short_desc from 1385_queries
  where sql_code not like '%varchar%'
) as x
  
 


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

  select replace(short_desc, ' ', '%20') as name, short_desc from 1385_queries
  where sql_code not like '%varchar%'
    and short_desc like '%measurements%'
) as x
  
 


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

  select replace(short_desc, ' ', '%20') as name, short_desc from 1385_queries
  where 1=1
    --and sql_code not like '%varchar%'
    and short_desc like '%measurements%'
) as x
  
 


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '\">' + short_desc + '</a>'

from (

  select replace(short_desc, ' ', '%20') as name, short_desc from 1385_queries
  where 1=1
    --and sql_code not like '%varchar%'
    and short_desc like '%measurement%'
) as x
  
 


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '">' + short_desc + '</a>'

from (

  select replace(short_desc, ' ', '%20') as name, short_desc from 1385_queries
  where 1=1
    --and sql_code not like '%varchar%'
    and short_desc like '%measurement%'
) as x
  
 


________________________________________


select '<a href="https://sqlsharedependencies.cloudapp.net/?table=' + name + '">' + short_desc + '</a>'

from (

  select replace(short_desc, ' ', '%20') as name, short_desc from 1385_queries
  where 1=1
    and sql_code not like '%varchar%'
    --and short_desc like '%measurement%'
) as x
  
 


________________________________________


SELECT * FROM [1314howe].[table_tiny.csv8DA8B]


________________________________________


SELECT * FROM sys.tables 



________________________________________


declare @D int
  set @D =(select count(distinct doc_id) from reuters)
  
select r.term_id, r.doc_id, r.frequency/m.maxf * log(@D / i.occurrences) as tfidf
from reuters r
  join ( -- the inverse index
    select term_id, count(*) as occurrences
    from reuters
    group by term_id
  ) i on i.term_id = r.term_id
  join ( -- the maximum frequency
    select doc_id, max(frequency) as maxf
    from reuters
    group by doc_id
  ) m on m.doc_id = r.doc_id
  order by tfidf desc




________________________________________


select r.term_id, r.doc_id, r.frequency/m.maxf * log((select count(distinct doc_id) from reuters) / i.occurrences) as tfidf
from reuters r
  join ( -- the inverse index
    select term_id, count(*) as occurrences
    from reuters
    group by term_id
  ) i on i.term_id = r.term_id
  join ( -- the maximum frequency
    select doc_id, max(frequency) as maxf
    from reuters
    group by doc_id
  ) m on m.doc_id = r.doc_id
  order by tfidf desc




________________________________________


select * from 1314howe


________________________________________


select * from 1314howe


________________________________________


select * from 13581314


________________________________________


select * from 1314howe


________________________________________


select * from 1358w


________________________________________


select * from 1358w


________________________________________


select * from 1358


________________________________________


select * from 1358


________________________________________


SELECT * FROM [1314howe].[table_activities2.csv]


________________________________________


select * from xyzw


________________________________________


select x, y, count(speciesId)
from (select round((observation.latitude-29.5)/0.1, 2) as x
   , round((observation.longitude+137.789)/0.1, 2) as y
   , observation.species as speciesId
      from  [690].[All3col] observation) t
group by x, y;


________________________________________


--select x, y, count(speciesId)
--from (
  select latitude, longitude, 
     round((observation.latitude-29.5)/0.1, 2) as x
   , round((observation.longitude+137.789)/0.1, 2) as y
   , observation.species as speciesId
      from  [690].[All3col] observation
--) t
--group by x, y;


________________________________________


--select x, y, count(speciesId)
--from (
  select top 5 latitude, longitude, 
     round((observation.latitude-29.5)/0.1, 1) as x
   , round((observation.longitude+137.789)/0.1, 1) as y
   , observation.species as speciesId
      from  [690].[All3col] observation
--) t
--group by x, y;


________________________________________


--select x, y, count(speciesId)
--from (
  select top 5 latitude, longitude, 
     round((observation.latitude-29.5)/0.1, 0) as x
   , round((observation.longitude+137.789)/0.1, 1) as y
   , observation.species as speciesId
      from  [690].[All3col] observation
--) t
--group by x, y;


________________________________________


--select x, y, count(speciesId)
--from (
  select top 5 latitude, longitude,
     round((observation.latitude-29.5)/0.1, 0) as x
   , round((observation.longitude+137.789)/0.1, 0) as y
   , observation.species as speciesId
      from  [690].[All3col] observation
--) t
--group by x, y;


________________________________________


SELECT * FROM [690].[All3col]



________________________________________


SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM [690].[All3col]



________________________________________


-- SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM [690].[All3col]

--SELECT (bounds.maxLat)-latBin*binSize-binSize/2) AS latitude
--      ,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies 
-- FROM binnedSpeciesCount,bounds,parameters
-- ORDER BY latBin,longBin
  
  
 SELECT species
      , FLOOR((59.983-latitude)/0.1) AS latBin
      , FLOOR((longitude- 137.789)/0.1) AS longBin 
   FROM [690].[All3col]




________________________________________


-- SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM [690].[All3col]

--SELECT (bounds.maxLat)-latBin*binSize-binSize/2) AS latitude
--      ,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies 
-- FROM binnedSpeciesCount,bounds,parameters
-- ORDER BY latBin,longBin
  
  
 SELECT species
      , FLOOR((59.983-latitude)/0.1) AS latBin
      , FLOOR((longitude- 137.789)/0.1) AS longBin
      , latitude, longitude
   FROM [690].[All3col]




________________________________________


-- SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM [690].[All3col]

--SELECT 59.983-latBin*0.1 AS latitude
--      ,-137.789+longBin*binSize+binSize/2) AS longitude,numSpecies 
--FROM (
--   SELECT species
--      , 59.983 - FLOOR((59.983-latitude)/0.1) AS latBin
--      , FLOOR((longitude- -137.789)/0.1) AS longBin
--      , latitude, longitude
--   FROM [690].[All3col]
--)
-- ORDER BY latBin,longBin

SELECT round(latitude, 2), latitude from [690].[All3col]
 




________________________________________


-- SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM [690].[All3col]

--SELECT 59.983-latBin*0.1 AS latitude
--      ,-137.789+longBin*binSize+binSize/2) AS longitude,numSpecies 
--FROM (
--   SELECT species
--      , 59.983 - FLOOR((59.983-latitude)/0.1) AS latBin
--      , FLOOR((longitude- -137.789)/0.1) AS longBin
--      , latitude, longitude
--   FROM [690].[All3col]
--)
-- ORDER BY latBin,longBin

SELECT round(latitude, 1), latitude from [690].[All3col]
 




________________________________________


-- SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM [690].[All3col]

--SELECT 59.983-latBin*0.1 AS latitude
--      ,-137.789+longBin*binSize+binSize/2) AS longitude,numSpecies 
--FROM (
--   SELECT species
--      , 59.983 - FLOOR((59.983-latitude)/0.1) AS latBin
--      , FLOOR((longitude- -137.789)/0.1) AS longBin
--      , latitude, longitude
--   FROM [690].[All3col]
--)
-- ORDER BY latBin,longBin

SELECT latbin, lonbin, COUNT(species) 
  FROM (
SELECT round(latitude, 1) as latbin
     , round(longitude, 1) as lonbin
     , species
    FROM [690].[All3col]
  ) binned
GROUP BY latbin, lonbin
ORDER BY lonbin  




________________________________________


-- SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM [690].[All3col]

--SELECT 59.983-latBin*0.1 AS latitude
--      ,-137.789+longBin*binSize+binSize/2) AS longitude,numSpecies 
--FROM (
--   SELECT species
--      , 59.983 - FLOOR((59.983-latitude)/0.1) AS latBin
--      , FLOOR((longitude- -137.789)/0.1) AS longBin
--      , latitude, longitude
--   FROM [690].[All3col]
--)
-- ORDER BY latBin,longBin

SELECT latbin, lonbin, COUNT(species) 
  FROM (
SELECT round(latitude, 1) as latbin
     , round(longitude, 1) as lonbin
     , species
    FROM [690].[All3col]
  ) binned
GROUP BY latbin, lonbin
ORDER BY lonbin, latbin  




________________________________________


-- SELECT MAX(latitude) AS maxLat,MIN(longitude) AS minLong FROM [690].[All3col]

--SELECT 59.983-latBin*0.1 AS latitude
--      ,-137.789+longBin*binSize+binSize/2) AS longitude,numSpecies 
--FROM (
--   SELECT species
--      , 59.983 - FLOOR((59.983-latitude)/0.1) AS latBin
--      , FLOOR((longitude- -137.789)/0.1) AS longBin
--      , latitude, longitude
--   FROM [690].[All3col]
--)
-- ORDER BY latBin,longBin

SELECT latbin, lonbin, COUNT(species) 
  FROM (
SELECT round(latitude, 1) as latbin
     , round(longitude, 1) as lonbin
     , species
    FROM [690].[All3col]
  ) binned
GROUP BY latbin, lonbin
ORDER BY latbin desc, lonbin asc




________________________________________



SELECT latbin, lonbin, COUNT(species) 
  FROM (
SELECT round(latitude, 1, 1) as latbin
     , round(longitude, 1, 1) as lonbin
     , species
    FROM [690].[All3col]
  ) binned
GROUP BY latbin, lonbin
ORDER BY latbin desc, lonbin asc




________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col])
  SELECT * FROM data


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MIN(latitude) AS minLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),

     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*binSize+binSize/2) AS latitude,(bounds.minLong+longBin*binSize+binSize/2) AS longitude,numSpecies from binnedSpeciesCount,bounds,parameters ORDER BY latBin,longBin


________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize)
  SELECT * FROM data, parameters



________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MIN(latitude) AS minLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),

     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT * FROM binnedSpecies



________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MIN(latitude) AS minLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),

     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*binSize+binSize/2) AS latitude
  ,(bounds.minLong+longBin*binSize+binSize/2) AS longitude
  ,numSpecies 
  from binnedSpeciesCount,bounds,parameters 
--  ORDER BY latBin,longBin



________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col]),
     parameters AS
         (SELECT 0.1 AS binSize),
     bounds AS
         (SELECT MIN(latitude) AS minLat,MIN(longitude) AS minLong FROM data),
     binnedSpecies AS
         (SELECT data.species,FLOOR((data.latitude-bounds.minLat)/binSize) AS latBin, FLOOR((data.longitude-bounds.minLong)/binSize) AS longBin FROM data, bounds, parameters),

     binnedSpeciesCount AS
         (SELECT latBin,longBin,COUNT(species) AS numSpecies FROM binnedSpecies GROUP BY latBin,longBin)
SELECT (bounds.minLat+latBin*binSize+binSize/2) AS latitude
  ,(bounds.minLong+longBin*binSize+binSize/2) AS longitude
  ,numSpecies 
  from binnedSpeciesCount,bounds,parameters 
  ORDER BY latBin,longBin



________________________________________


WITH data AS
         (SELECT * FROM [690].[All3col])
 SELECT * FROM data ORDER BY latitude



________________________________________


SELECT floor(latitude/0.1)*0.1 as latbin, latitude
     , round(longitude, 1, 1) as lonbin
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.2)*0.2 as latbin, latitude
     , round(longitude, 1, 1) as lonbin
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin, latitude
     , round(longitude, 1, 1) as lonbin
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin, latitude
     , floor(longitude/0.7)*0.7 as lonbin, longitude
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.12/0.7)*0.7
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(23.12/0.7)*0.7
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.2/0.7)*0.7
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.2/0.7)*0.7, 0.2/0.7
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.2/0.7)*0.7, 0.12/0.7
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.2/0.7)*0.7, 0.14/0.7
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.2/0.7)*0.7, 0.49/0.7
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.2/0.7)*0.7, 0.49/7
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.2/0.7)*0.7, 0.49/0.07
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.2/0.7)*0.7, 0.49/0.7
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(0.2/0.7)*0.7, 0.49/0.07
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(1.4/0.7)*0.7, 0.49/0.07
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/0.7)*0.7 as latbin
     , floor(longitude/0.7)*0.7 as lonbin
  , floor(1.1/0.7)*0.7, 0.49/0.07
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/5)*5 as latbin
     , floor(longitude/5)*5 as lonbin
  , floor(1.1/0.7)*0.7, 0.49/0.07
     , species
    FROM [690].[All3col]


________________________________________


SELECT floor(latitude/2)*2 as latbin
     , floor(longitude/2)*2 as lonbin
  , floor(1.1/0.7)*0.7, 0.49/0.07
     , species
    FROM [690].[All3col]


________________________________________


SELECT * FROM sys.tables ORDER BY rand()



________________________________________


SELECT * FROM sys.tables ORDER BY rand()



________________________________________


SELECT * FROM sys.tables ORDER BY rand(23)



________________________________________


SELECT * FROM sys.tables ORDER BY rand(26)



________________________________________


SELECT * FROM sys.tables ORDER BY rand(object_id)



________________________________________


SELECT * FROM sys.tables ORDER BY rand(object_id + 1)



________________________________________


SELECT * FROM sys.tables ORDER BY rand(object_id + 3)



________________________________________


SELECT * FROM sys.tables ORDER BY rand(schema_id + 3)



________________________________________


select * from dbo.1385s



________________________________________


select * from dbo.1385s where 1385name like '%bert%'



________________________________________


select * from dbo.1385s where 1385name like '%sr320%'



________________________________________


--select * from dbo.1385s where 1385name like '%sr320%'

select * from dbo.1385s where 1385name like '%gav%'



________________________________________


--select * from dbo.1385s where 1385name like '%sr320%'

-- select * from dbo.1385s where 1385name like '%gav%'

select * from dbo.1385_queries 



________________________________________


--select * from dbo.1385s where 1385name like '%sr320%'

-- select * from dbo.1385s where 1385name like '%gav%'

select * from dbo.1385_queries where owner = '823'



________________________________________


SELECT time, pop, lat, long
     , flow, bulk_red, event_rate
     , salinity, temperature, evt, opp, n
     ,  fluorescence, conc, flag
  FROM [1314howe].[stats.tab]


________________________________________


SELECT time, pop, lat, long
     , flow, bulk_red, event_rate
     , salinity, temperature, evt, opp, n
     ,  fluorescence, conc, flag
  FROM [1314howe].[stats.tab]
  WHERE time BETWEEN '2011-10-26' AND '2011-10-27'



________________________________________


SELECT time, pop, lat, long
     , flow, bulk_red, event_rate
     , salinity, temperature, evt, opp, n
     ,  fluorescence, conc, flag
  FROM [1314howe].[stats.tab]
  WHERE time BETWEEN '2011-10-27' AND '2011-10-28'



________________________________________


SELECT time, pop, lat, long
     , flow, bulk_red, event_rate
     , salinity, temperature, evt, opp, n
     ,  fluorescence, conc, flag
  FROM [1314howe].[stats.tab]
  WHERE time BETWEEN '2011-10-28' AND '2011-10-29'



________________________________________


SELECT time, pop, lat, long
     , flow, bulk_red, event_rate
     , salinity, temperature, evt, opp, n
     ,  fluorescence, conc, flag
  FROM [1314howe].[stats.tab]
  WHERE time BETWEEN '2011-10-30' AND '2011-10-31'



________________________________________


SELECT time, pop, lat, long
     , flow, bulk_red, event_rate
     , salinity, temperature, evt, opp, n
     ,  fluorescence, conc, flag
  FROM [1314howe].[stats.tab]
  WHERE time BETWEEN '2011-11-4' AND '2011-11-5'



________________________________________


SELECT time, pop, lat, long
     , flow, bulk_red, event_rate
     , salinity, temperature, evt, opp, n
     ,  fluorescence, conc, flag
  FROM [1314howe].[stats.tab]
  WHERE time BETWEEN '2011-11-1' AND '2011-11-2'



________________________________________


SELECT time, pop, lat, long
     , flow, bulk_red, event_rate
     , salinity, temperature, evt, opp, n
     ,  fluorescence, conc, flag
  FROM [1314howe].[stats.tab]
  WHERE time BETWEEN '2011-10-31' AND '2011-11-1'



________________________________________


SELECT * FROM [1314howe].[table_activities2.csv]


________________________________________


SELECT activity FROM [1314howe].[query13582]


________________________________________


SELECT * 
  FROM [354].[bivalvia_methylated_20CG_20as_20bed.txt.gff]
 WHERE Seqname = 'scaffold100'



________________________________________


SELECT * 
  FROM [354].[bivalvia_methylated_20CG_20as_20bed.txt.gff]
 WHERE Seqname != 'scaffold100'



________________________________________


SELECT * 
  FROM [354].[bivalvia_methylated_20CG_20as_20bed.txt.gff]
 WHERE Seqname != 'scaffold1009'



________________________________________


SELECT * 
  FROM [354].[bivalvia_methylated_20CG_20as_20bed.txt.gff]
 WHERE Seqname != 'scaffold1009'



________________________________________


SELECT * 
  FROM [354].[bivalvia_methylated_20CG_20as_20bed.txt.gff]
 WHERE Seqname = 'scaffold1009'



________________________________________


select * from 1385_queries



________________________________________


select * from 1385_queries where short_desc like '%anon%'



________________________________________


select * from sys.views



________________________________________


select * from sys.views where name like '%anon%'



________________________________________


select * from sys.tables where name like '%anon%'



________________________________________


SELECT max(binid), min(binid)
  FROM [1002].[Tokyo_2_merged_data_time_binned]




________________________________________


    SELECT top 10 *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]



________________________________________


    SELECT top 10 *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]
      WHERE
   timestamp BETWEEN '6/27/2011' AND '6/30/2011' 



________________________________________


    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]
      WHERE
   timestamp BETWEEN '6/27/2011' AND '6/30/2011' 



________________________________________


   SELECT top 4000 *, cast(timestamp as float) as ts, 5 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]
      WHERE timestamp BETWEEN  '6/27/2011' AND '6/30/2011'



________________________________________


  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT top 4000 *, cast(timestamp as float) as ts, 5 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]
      WHERE timestamp BETWEEN  '6/27/2011' AND '6/30/2011'
  ) x



________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(cast(T1 as float)),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(cast(S as float)),3) as S
  , round(avg(cast(SV as float)),3) as SV
  , round(avg(cast(T2 as float)),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT top 4000 *, cast(timestamp as float) as ts, 5 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]
      WHERE timestamp BETWEEN  '6/27/2011' AND '6/30/2011'
  ) x
) bins
GROUP BY binid
  order by binid asc


________________________________________


select * from sys.views where name like '%log%'



________________________________________


select * from sys.tables where name like '%log%'



________________________________________


select top 10 * from 1385_query_log



________________________________________


select top 10 * from 1385_query_log order by date_queried desc



________________________________________


select top 100 * from 1385_query_log order by date_queried desc



________________________________________


select top 100 * from 1385_query_log where owner not like '%1314howe%' and owner not like '%1354c%' order by date_queried desc



________________________________________


select top 100 * from 1385_query_log where owner not like '%1314howe%' and owner not like '%1354c%' and owner not like '%halperi%'
 and owner not like '%akey%'
  order by date_queried desc



________________________________________


select hashbytes('sha1', owner), * from 1385_query_log where owner not like '%1314howe%' and owner not like '%1354c%' and owner not like '%halperi%'
 and owner not like '%akey%'
  order by date_queried desc



________________________________________


select convert(int,hashbytes('sha1', owner)), * from 1385_query_log where owner not like '%1314howe%' and owner not like '%1354c%' and owner not like '%halperi%'
 and owner not like '%akey%'
  order by date_queried desc



________________________________________


select convert(int,hashbytes('sha1', owner)), query, date_queried, proc_time 
  from 1385_query_log 



________________________________________


SELECT * FROM anonymized_query_log


________________________________________


SELECT * FROM [dbo].[anonymized_1385_log]


________________________________________


select * from anonymized_1385_log


________________________________________


SELECT vizlet_type, avg(score), avg(x_kurtosis), avg(y_kurtosis) 
  FROM [1314howe].[Vizlet Scores and Features]
 WHERE score > 0
  GROUP BY vizlet_type



________________________________________


SELECT vizlet_type, avg(score)
 , avg(x_kurtosis), avg(y_kurtosis)
 , avg(x_coeff_var), avg(y_coeff_var) 
 , avg(x_gap_variance)  
 , avg(x_unique_ratio)   
  FROM [1314howe].[Vizlet Scores and Features]
 WHERE score > 0
  GROUP BY vizlet_type



________________________________________


SELECT vizlet_type, avg(score)
 , avg(x_kurtosis), avg(y_kurtosis)
 , avg(x_coeff_var), avg(y_coeff_var) 
 , avg(x_gap_variance)  
 , avg(x_unique_ratio)   
  FROM [1314howe].[Vizlet Scores and Features]
 WHERE score > 0 aND y_coeff_var <1000000
  GROUP BY vizlet_type



________________________________________


SELECT vizlet_type, avg(score)
 , avg(x_kurtosis), avg(y_kurtosis)
 , avg(x_coeff_var), avg(y_coeff_var) 
 , avg(x_gap_variance)  
 , avg(x_unique_ratio)   
  FROM [1314howe].[Vizlet Scores and Features]
 WHERE score > 0 aND y_coeff_var > -1000000
  GROUP BY vizlet_type



________________________________________


SELECT vizlet_type, avg(score)
 , avg(x_kurtosis) as x_kurtosis, avg(y_kurtosis) as y_kurtosis
 , avg(x_coeff_var) as x_var, avg(y_coeff_var) as y_var
 , avg(x_gap_variance) as x_gap_var
 , avg(x_unique_ratio) x_   
  FROM [1314howe].[Vizlet Scores and Features]
 WHERE score > 0 aND y_coeff_var > -1000000
  GROUP BY vizlet_type



________________________________________


SELECT vizlet_type, avg(score)
 , avg(x_kurtosis) as x_kurtosis, avg(y_kurtosis) as y_kurtosis
 , avg(x_coeff_var) as x_var, avg(y_coeff_var) as y_var
 , avg(x_gap_variance) as x_gap_var
 , avg(x_unique_ratio) x_unique_ratio   
  FROM [1314howe].[Vizlet Scores and Features]
 WHERE score > 0 aND y_coeff_var > -1000000
  GROUP BY vizlet_type



________________________________________


SELECT * FROM [1314howe].[Vizlet Scores and Features]
  WHERE score > 0



________________________________________


SELECT s.score, s.vizlet_type
     , d.x_col_name, d.y_col_name
     , case when x_average = 0 then 0 else sqrt(x_variance_over_mean * x_average) / x_average end as x_coeff_var
     , case when y_average = 0 then 0 else sqrt(y_variance_over_mean * y_average) / y_average end as y_coeff_var
     , x_gap_variance
     , d.x_unique_ratio
     , d.x_unique_count
     , d.x_kurtosis
     , d.y_kurtosis
     
  FROM [1314howe].[Vizlet Scores] s
     , [1314howe].[vizlets_21nov11_10h12m18s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
 ORDER BY score desc




________________________________________


SELECT vizlet_Type, count(*) FROM (
SELECT s.score, s.vizlet_type
     , d.x_col_name, d.y_col_name
     , case when x_average = 0 then 0 else sqrt(x_variance_over_mean * x_average) / x_average end as x_coeff_var
     , case when y_average = 0 then 0 else sqrt(y_variance_over_mean * y_average) / y_average end as y_coeff_var
     , x_gap_variance
     , d.x_unique_ratio
     , d.x_unique_count
     , d.x_kurtosis
     , d.y_kurtosis
     
  FROM [1314howe].[Vizlet Scores] s
     , [1314howe].[vizlets_21nov11_10h12m18s_data_features.csv] d
 WHERE d.query_string_hash = s.sql_query_hash
   AND s.x_col_name = d.x_col_name
   AND s.y_col_name = d.y_col_name
   AND x_gap_variance < 100
  )x
  GROUP BY vizlet_type  
-- ORDER BY score desc




________________________________________


SELECT * FROM [354].[tmpColumnNameTest]


________________________________________


SELECT latitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT * FROM [354].[tmpColumnNameTest]


________________________________________


SELECT latitude1 FROM [354].[tmpColumnNameTest]


________________________________________


SELECT numSpecies FROM [354].[tmpColumnNameTest]


________________________________________


SELECT longitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT * FROM [354].[tmpColumnNameTest]


________________________________________


SELECT latitude1 FROM [354].[tmpColumnNameTest]


________________________________________


SELECT * FROM [377].[wilson home energy ]


________________________________________


SELECT * 
  FROM [377].[wilson home energy ]
  WHERE Device = 'Computer (4)'



________________________________________


SELECT * 
  FROM [377].[wilson home energy ]
  WHERE Device != 'Computer (4)'



________________________________________


SELECT Name, [Job Title] as job_title, [2010 Gross Earnings] as salary 
  FROM [1314howe].[uw_salaries_2011.txt]



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE job_title like '%RSEARCH%SCI%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE job_title like '%RESEARCH%SCI%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE job_title like '%RESEARCH%SCI%'
  ORDER BY salary DESC



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE job_title like '%RESEARCH%SCI%'
  AND salary < 90000
  ORDER BY salary DESC



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE job_title like '%RESEARCH%SCI%'
  AND salary < 60000
  ORDER BY salary DESC



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE job_title like '%RESEARCH%SCI%4%'
  --AND salary < 60000
  ORDER BY salary DESC



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE job_title like '%RESEARCH%SCI%3%'
  --AND salary < 60000
  ORDER BY salary DESC



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  --AND job_title like '%RESEARCH%SCI%3%'
  AND job_title like '%ENGINEER%'
  --AND salary < 60000
  ORDER BY salary DESC



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  --AND job_title like '%RESEARCH%SCI%3%'
  AND job_title like '%SOFTWARE%'
  --AND salary < 60000
  ORDER BY salary DESC



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%SCI%PRINC%'
  --AND job_title like '%SOFTWARE%'
  --AND salary < 60000
  ORDER BY salary DESC



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%EER %PRINC%'
  --AND job_title like '%SOFTWARE%'
  --AND salary < 60000
  ORDER BY salary DESC



________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009]
  WHERE title like '%PRINCIPAL%'



________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009]
  WHERE title like '%PRINCIPAL%'
ORDER BY monthly_salary*12 desc


________________________________________


SELECT monthly_salary*12, * 
  FROM [1314howe].[UW Salaries 2009]
  WHERE title like '%PRINCIPAL%'
ORDER BY monthly_salary*12 desc


________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
 WHERE title like '%PRINCIPAL%'
  ORDER BY salary*12 desc


________________________________________


SELECT *, salary*12 
  FROM [1314howe].[UW employees, salary and department]
 WHERE title like '%PRINCIPAL%'
  ORDER BY salary*12 desc


________________________________________


SELECT *, salary*12 
  FROM [1314howe].[UW employees, salary and department]
 WHERE title like '%SOFTWARE%'
  ORDER BY salary*12 desc


________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  --AND job_title like '%RESEARCH%EER %PRINC%'
  AND job_title like '%SOFTWARE%'
  --AND salary < 60000
  ORDER BY salary DESC



________________________________________


SELECT *, salary*12 
  FROM [1314howe].[UW employees, salary and department]
 WHERE title like '%SPEC%'
  ORDER BY salary*12 desc


________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%EER %PRINC%'
  --AND job_title like '%SOFTWARE%'
  --AND salary < 60000
  ORDER BY salary DESC



________________________________________


SELECT avg(salary) 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%EER %PRINC%'
  --AND job_title like '%SOFTWARE%'
  --AND salary < 60000
  --ORDER BY salary DESC



________________________________________


SELECT avg(salary) 
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%EER %PRINC%'
  --AND job_title like '%SOFTWARE%'
  AND salary > 60000
  --ORDER BY salary DESC



________________________________________


SELECT salary
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%EER %PRINC%'
  --AND job_title like '%SOFTWARE%'
  --AND salary > 60000
  ORDER BY salary DESC



________________________________________


SELECT *
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%EER %PRINC%'
  --AND job_title like '%SOFTWARE%'
  --AND salary > 60000
  ORDER BY salary DESC



________________________________________


SELECT *
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%EER%'
  --AND job_title like '%SOFTWARE%'
  --AND salary > 60000
  ORDER BY salary DESC



________________________________________


SELECT *
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%EER%SENIOR%'
  --AND job_title like '%SOFTWARE%'
  --AND salary > 60000
  ORDER BY salary DESC



________________________________________


SELECT *
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  AND job_title like '%RESEARCH%EER %PRINC%'
  --AND job_title like '%SOFTWARE%'
  --AND salary > 60000
  ORDER BY salary DESC



________________________________________


SELECT *
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  --AND job_title like '%RESEARCH%EER %PRINC%'
  AND job_title like '%SOFTWARE%'
  --AND salary > 60000
  ORDER BY salary DESC



________________________________________


SELECT *
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  --AND job_title like '%RESEARCH%EER %PRINC%'
  --AND job_title like '%SOFTWARE%'
  --AND salary > 60000
  AND NAme like '%TIMSS%'
  ORDER BY salary DESC



________________________________________


SELECT *
  FROM [1314howe].[UW 2010 Salaries]
 WHERE 1=1
  --AND job_title like '%RESEARCH%EER %PRINC%'
  AND (job_title like '%SOFTWARE%' 
    OR job_title like '%COMPUTER SPECIALIST%')
  --AND salary > 60000
  --AND NAme like '%TIMSS%'
  ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
    OR job_title like '%COMPUTER SPECIALIST%')
    AND salary > 100000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
    OR job_title like '%COMPUTER SPECIALIST%')
    --AND salary > 100000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
    OR job_title like '%COMPUTER SPECIALIST%')
    AND salary > 80000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
    OR job_title like '%COMPUTER SPECIALIST%' 
    OR job_title like '%RESEARCH%ENG%')
    AND salary > 80000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
    OR job_title like '%COMPUTER SPECIALIST%' 
    OR job_title like '%RESEARCH%ENG%')
    --AND salary > 80000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
    OR job_title like '%COMPUTER SPECIALIST%' 
    OR job_title like '%RESEARCH%ENG%')
    AND salary > 80000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE --(job_title like '%SOFTWARE%' 
    --OR job_title like '%COMPUTER SPECIALIST%' 
     job_title like '%RESEARCH%ENG%'
    AND salary > 100000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE --(job_title like '%SOFTWARE%' 
    --OR job_title like '%COMPUTER SPECIALIST%' 
     job_title like '%FACULTY%'
    AND salary > 100000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE --(job_title like '%SOFTWARE%' 
    --OR job_title like '%COMPUTER SPECIALIST%' 
     job_title like '%PROFESSOR%'
    AND salary > 100000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE --(job_title like '%SOFTWARE%' 
    --OR job_title like '%COMPUTER SPECIALIST%' 
     job_title like '%PROFESSOR%'
    --AND salary > 100000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
   OR job_title like '%COMPUTER SPECIALIST%')
    -- job_title like '%PROFESSOR%'
    --AND salary > 100000
  --ORDER BY salary DESC



________________________________________


SELECT * --count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
   OR job_title like '%COMPUTER SPECIALIST%')
    -- job_title like '%PROFESSOR%'
    --AND salary > 100000
  ORDER BY salary DESC



________________________________________


SELECT * --count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
   OR job_title like '%COMPUTER SPECIALIST%')
    -- job_title like '%PROFESSOR%'
    AND salary > 86000
  ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
   OR job_title like '%COMPUTER SPECIALIST%')
    -- job_title like '%PROFESSOR%'
    AND salary > 86000
  --ORDER BY salary DESC



________________________________________


SELECT count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
   OR job_title like '%COMPUTER SPECIALIST%')
    -- job_title like '%PROFESSOR%'
    --AND salary > 86000
  --ORDER BY salary DESC



________________________________________


SELECT * -- count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
   OR job_title like '%COMPUTER SPECIALIST%')
    -- job_title like '%PROFESSOR%'
    --AND salary > 86000
  --ORDER BY salary DESC



________________________________________


SELECT * -- count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
   OR job_title like '%COMPUTER SPECIALIST%')
    -- job_title like '%PROFESSOR%'
    --AND salary > 86000
  ORDER BY salary DESC



________________________________________


SELECT * -- count(*)
  FROM [1314howe].[UW 2010 Salaries]
 WHERE (job_title like '%SOFTWARE%' 
   OR job_title like '%COMPUTER SPECIALIST%')
    -- job_title like '%PROFESSOR%'
    AND salary > 111299.84
  ORDER BY salary DESC



________________________________________


SELECT * 
  FROM [1314howe].[uw_employees_dept.csv] d 
  LEFT OUTER JOIN
  [1314howe].[UW 2010 Salaries] s
  ON PATINDEX(lower(d.last), lower(s.Name)) > 0 
  AND PATINDEX(lower(d.first), lower(s.Name)) > 0 



________________________________________


SELECT * 
  FROM [1314howe].[uw_employees_dept.csv] d 
  --LEFT OUTER 
  JOIN
  [1314howe].[UW 2010 Salaries] s
  ON PATINDEX(lower(d.last), lower(s.Name)) > 0 
  AND PATINDEX(lower(d.first), lower(s.Name)) > 0 



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like 'R%EER %'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like 'R%EER %SR'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like 'R%EER %S%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like 'R%EER %SENIOR%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like 'R%EER%SENIOR%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like 'R%EER%SENIOR%'
ORDER BY salary DESC


________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like 'R%EER%4%'
ORDER BY salary DESC


________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like '%SOFTWARE%'
ORDER BY salary DESC


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like 'PRI%RES%SCI%'



________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like 'RES%SCI%PRI%'



________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like 'RES%SCI%PRI%'
order by salary desc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like 'RES%SCI%PRI%'
order by salary desc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like 'RES%SCI%EER PRI%'
order by salary desc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like 'RES%SCI%EER%PRI%'
order by salary desc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like '%ASS%PROF%'
order by salary desc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like '%ASSIS%PROF%'
order by salary desc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like '%ASSISTANT %PROF%'
order by salary desc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like '%ASSISTANT %PROF%'
order by salary asc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like '%ASSISTANT %PROF%'
order by salary asc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like '%ASSISTANT %PROF%'
order by salary desc


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  where job_title like '%RESEARCH%SCI%'
order by salary desc


________________________________________


SELECT COUNT(*) 
  FROM twitter4M leftT 
  JOIN twitter4M rightT 
  ON leftT.follower=rightT.followee


________________________________________


--SELECT COUNT(distinct) FROM (
  SELECT leftT.follower, rightT.followee
  FROM twitter4M leftT 
  JOIN twitter4M rightT   
  ON leftT.follower=rightT.followee
--) y


________________________________________


SELECT COUNT(*) FROM (
  SELECT leftT.follower, rightT.followee
  FROM twitter4M leftT 
  JOIN twitter4M rightT   
  ON leftT.follower=rightT.followee
) y


________________________________________


SELECT COUNT(*) FROM (
  SELECT distinct leftT.follower, rightT.followee
  FROM twitter4M leftT 
  JOIN twitter4M rightT   
  ON leftT.follower=rightT.followee
) y


________________________________________


SELECT COUNT(*)
FROM twitter4M leftT
JOIN twitter4M rightT
ON leftT.follower=rightT.followee


________________________________________


SELECT COUNT(*)
FROM twitter4M leftT
JOIN twitter4M rightT
ON leftT.follower=rightT.followee


________________________________________


SELECT COUNT(*)
 FROM twitter4M leftT
 JOIN twitter4M rightT
 ON leftT.follower=rightT.followee


________________________________________


SELECT COUNT(*)
 FROM twitter4M leftT
 JOIN twitter4M rightT
 ON leftT.follower=rightT.followee


________________________________________


SELECT COUNT(*)
 FROM twitter4M leftT
 JOIN twitter4M rightT
 ON leftT.follower=rightT.followee


________________________________________


SELECT last, first, middle, count(*) 
  FROM [1314howe].[uw_employees_dept.csv]
  group by last, first, middle



________________________________________


SELECT l.department, l.email, r.department
  FROM [1314howe].[uw_employees_dept.csv] l,
       [1314howe].[uw_employees_dept.csv] r




________________________________________


SELECT l.department, l.email, r.department
  FROM [1314howe].[uw_employees_dept.csv] l,
       [1314howe].[uw_employees_dept.csv] r
  WHERE l.email = r.email
    AND l.department != r.department
    AND l.email IN (
 SELECT email
  FROM [1314howe].[uw_employees_dept.csv]
  group by email
  having count(*) = 2
)




________________________________________


SELECT l.department, l.email, r.department
  FROM [1314howe].[uw_employees_dept.csv] l,
       [1314howe].[uw_employees_dept.csv] r
  WHERE l.email = r.email
    AND l.department < r.department
    AND l.email IN (
 SELECT email
  FROM [1314howe].[uw_employees_dept.csv]
  group by email
  having count(*) = 2
)




________________________________________


SELECT l.department, l.email, r.department
  FROM [1314howe].[uw_employees_dept.csv] l,
       [1314howe].[uw_employees_dept.csv] r
  WHERE l.email = r.email
    AND l.department < r.department
    AND l.email IN (
 SELECT email
  FROM [1314howe].[uw_employees_dept.csv]
  group by email
  having count(*) > 1
)




________________________________________


SELECT l.department, l.email, r.department
  FROM [1314howe].[uw_employees_dept.csv] l,
       [1314howe].[uw_employees_dept.csv] r
  WHERE l.email = r.email
    AND l.department < r.department
    AND l.email IS NOT NULL
    AND l.email IN (
 SELECT email
  FROM [1314howe].[uw_employees_dept.csv]
  group by email
  having count(*) > 1
)




________________________________________


SELECT l.department, l.email, r.department
  FROM [1314howe].[uw_employees_dept.csv] l,
       [1314howe].[uw_employees_dept.csv] r
  WHERE l.email = r.email
    AND l.department < r.department
    AND l.email != ''
    AND l.email IN (
 SELECT email
  FROM [1314howe].[uw_employees_dept.csv]
  group by email
  having count(*) > 1
)




________________________________________


SELECT distinct l.department, l.email, r.department
  FROM [1314howe].[uw_employees_dept.csv] l,
       [1314howe].[uw_employees_dept.csv] r
  WHERE l.email = r.email
    AND l.department < r.department
    AND l.email != ''
    AND l.email IN (
 SELECT email
  FROM [1314howe].[uw_employees_dept.csv]
  group by email
  having count(*) > 1
)




________________________________________


SELECT src.Organization, dst.Organization 
  FROM [1314howe].[collaborators.txt] src
     , [1314howe].[collaborators.txt] dst
 WHERE src.Collaborator = dst.Collaborator
   AND src.Organization < dst.Organization


________________________________________


SELECT src.Organization, src.Collaborator
     , src.Role, dst.Role, dst.Organization 
  FROM [1314howe].[collaborators.txt] src
     , [1314howe].[collaborators.txt] dst
 WHERE src.Collaborator = dst.Collaborator
   AND src.Organization < dst.Organization


________________________________________


SELECT src.Organization, src.Collaborator
     , src.Role, dst.Role, dst.Organization 
  FROM [1314howe].[collaborators.txt] src
     , [1314howe].[collaborators.txt] dst
 WHERE src.Collaborator = dst.Collaborator
  AND src.Organization < dst.Organization
  ORDER BY src.Organization desc



________________________________________


SELECT src.Organization, src.Collaborator
     , src.Role, dst.Organization 
  FROM [1314howe].[collaborators.txt] src
     , [1314howe].[collaborators.txt] dst
 WHERE src.Collaborator = dst.Collaborator
  AND src.Organization != dst.Organization
  ORDER BY src.Organization desc



________________________________________


SELECT src.Organization, src.Collaborator
     , src.Role, dst.Organization 
  FROM [1314howe].[collaborators.txt] src
     , [1314howe].[collaborators.txt] dst
 WHERE src.Collaborator = dst.Collaborator
  AND src.Organization != dst.Organization
  ORDER BY src.Collaborator desc



________________________________________


SELECT src.Organization, src.Collaborator, src.Role
--     , src.Role, dst.Organization 
  FROM [1314howe].[collaborators.txt] src
--     , [1314howe].[collaborators.txt] dst
 WHERE 1=1
  --src.Collaborator = dst.Collaborator
--  AND src.Organization != dst.Organization
  AND src.Role = 'Faculty'
  ORDER BY src.Organization desc



________________________________________


select a.fullname, count(*) as totalPUBS
from [1143].author a, [1143].authored b, [1143].inproceedings p
where a.fullname = b.fullname and b.pubID = p.id and p.booktitle = 'PODS'
 and not exists
   (select * from [1143].authored b2, [1143].inproceedings p2
   where a.fullname=b2.fullname and b2.pubID = p2.id
     and p2.booktitle in ('SIGMOD Conference', 'VLDB'))
group by a.fullname
order by count(*) desc;


________________________________________


select *
from [1143].author a


________________________________________


select a.fullname, b.fullname
  from [1143].author a
     , [1143].author b
  where soundex(a.fullname) = soundex(b.fullname)


________________________________________


select count(*) from dbo.1385_queries


________________________________________


select count(*) from dbo.1385_tables


________________________________________


select * from dbo.1385_tables


________________________________________


select * from dbo.1385_queries


________________________________________


--select owner, min(sqllen), max(sqllen) 
--  from (
select owner,
  len(sql_code) as sqllen
    from dbo.1385_queries
--  ) x
--  group by owner



________________________________________


--select owner, min(sqllen), max(sqllen) 
--  from (
select owner, *,
  len(sql_code) as sqllen
    from dbo.1385_queries
--  ) x
--  group by owner



________________________________________


select owner, ts, min(sqllen), max(sqllen) 
  from (
select owner, date_created as ts,
  len(sql_code) as sqllen
    from dbo.1385_queries
  ) x
  group by owner, ts



________________________________________


select owner, 
  --ts, 
  min(sqllen), max(sqllen) 
  from (
select owner, date_created as ts,
  len(sql_code) as sqllen
    from dbo.1385_queries
  ) x
  group by owner--, ts



________________________________________


SELECT * 
  FROM [1314howe].[uw_employees_dept.csv] d
     , dbo.1385s q
 WHERE d.email = q.1385name


________________________________________


SELECT * 
  FROM [1314howe].[uw_employees_dept.csv] d
     , dbo.1385s q
 WHERE   d.1385name + '%' like q.1385name


________________________________________


SELECT * 
  FROM [1314howe].[uw_employees_dept.csv] d
     , dbo.1385s q
 WHERE  q.1385name like d.1385name + '%'


________________________________________


SELECT * 
  FROM [1314howe].[uw_employees_dept.csv] d
     , dbo.1385s q
  WHERE  q.1385name like d.1385name + '%'
   AND d.1385name is not null



________________________________________


SELECT * 
  FROM [1314howe].[uw_employees_dept.csv] d
     , dbo.1385s q
  WHERE  q.1385name like d.1385name + '%'
   AND d.1385name != ''



________________________________________


SELECT * 
  FROM [1314howe].[uw_employees_dept.csv] d
     , dbo.1385s q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''



________________________________________


SELECT  distinct last, first, middle, email 
  FROM [1314howe].[uw_employees_dept.csv] d
     , dbo.1385s q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''



________________________________________


SELECT count(*) 
  FROM (
SELECT distinct last, first, middle, email 
  FROM [1314howe].[uw_employees_dept.csv] d
     , dbo.1385s q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''
  ) x


________________________________________


--SELECT count(*) 
--  FROM (
SELECT distinct department
  --last, first, middle, email 
  FROM [1314howe].[uw_employees_dept.csv] d
     , dbo.1385s q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''
--  ) x


________________________________________


--SELECT count(*) 
--  FROM (
SELECT distinct department
  --last, first, middle, email 
  FROM [1314howe].[uw_employees_dept.csv] d
  , (select distinct owner as 1385name 
    from dbo.1385_queries) q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''
--  ) x


________________________________________


--SELECT count(*) 
--  FROM (
SELECT distinct department
  --last, first, middle, email 
  FROM [1314howe].[uw_employees_dept.csv] d
  , (select owner as 1385name 
    from dbo.1385_query_log
    group by owner
    having count(*) > 10
  ) q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''
--  ) x


________________________________________


--SELECT count(*) 
--  FROM (
SELECT distinct department
  --last, first, middle, email 
  FROM [1314howe].[uw_employees_dept.csv] d
  , (select owner as 1385name 
    from dbo.1385_query_log
    group by owner
    having count(*) > 2
  ) q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''
--  ) x


________________________________________


--SELECT count(*) 
--  FROM (
SELECT distinct department
  --last, first, middle, email 
  FROM [1314howe].[uw_employees_dept.csv] d
  , (select owner as 1385name 
    from dbo.1385_query_log
    group by owner
    having count(*) > 0
  ) q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''
--  ) x


________________________________________


SELECT distinct department
  FROM [1314howe].[uw_employees_dept.csv] d
  , (select owner as 1385name 
    from dbo.1385_query_log
    group by owner
    having count(*) > 0
  ) q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''




________________________________________


SELECT distinct department
  FROM [1314howe].[uw_employees_dept.csv] d
  , (select owner as 1385name 
    from dbo.1385_query_log
    group by owner
    having count(*) > 0
  ) q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''




________________________________________


WITH collab as (SELECT * 
  FROM [1314howe].[escience site visit collaborators]) 
SELECT * 
  FROM collab a, collab b 
 WHERE a.Organization = b.Organization



________________________________________


WITH collab as (SELECT * 
  FROM [1314howe].[escience site visit collaborators]) 
SELECT * 
  FROM collab a, collab b 
 WHERE a.Organization = b.Organization
   AND a.Collaborator != b.Collaborator



________________________________________


WITH collab as (SELECT * 
  FROM [1314howe].[escience site visit collaborators]) 
SELECT *
  FROM collab a, collab b 
 WHERE a.Collaborator = b.Collaborator
   AND a.Organization != b.Organization



________________________________________


SELECT rand() FROM [1314howe].[organization pairs]


________________________________________


SELECT rand(hashbytes('sha', Collaborator)) FROM [1314howe].[organization pairs]


________________________________________


SELECT newid(), rand(hashbytes('sha', Collaborator)) FROM [1314howe].[organization pairs]


________________________________________


SELECT newid(), 
  rand(hashbytes('sha', Collaborator)+
    datepart(ms, GETDATE())) 
  FROM [1314howe].[organization pairs]


________________________________________


SELECT newid(), 
  rand(hashbytes('sha', Collaborator)+
    (datepart(ms, GETDATE()) +1)) 
  FROM [1314howe].[organization pairs]


________________________________________


SELECT (select top 1 Collaborator 
  from [1314howe].[organization pairs]
  order by newid()
)
  FROM [1314howe].[organization pairs]


________________________________________


--SELECT (
  select top 1 Collaborator 
  from [1314howe].[organization pairs]
  order by newid()
--)
--  FROM [1314howe].[organization pairs]


________________________________________


SELECT (
  select top 1 Collaborator 
  from [1314howe].[organization pairs]
  order by newid()
)
  FROM [1314howe].[organization pairs]


________________________________________


SELECT (
  select top 1 Collaborator 
  from [1314howe].[organization pairs]
  order by rand()
)
  FROM [1314howe].[organization pairs]




________________________________________


SELECT (
  select top 1 Collaborator 
  from [1314howe].[organization pairs]
  order by rand(random)
)
  FROM 
  (
    SELECT rand() as random, *
      FROM [1314howe].[organization pairs] 
  ) x


________________________________________


--SELECT (
  select top 1 Collaborator 
  from [1314howe].[organization pairs]
    order by newid()
  
--)
--  FROM 
--  (
--    SELECT rand() as random, *
--      FROM [1314howe].[organization pairs] 
--  ) x


________________________________________


--SELECT (
  select top 1 Collaborator 
  from [1314howe].[organization pairs]
    order by newid()
  
--)
--  FROM 
--  (
--    SELECT rand() as random, *
--      FROM [1314howe].[organization pairs] 
--  ) x


________________________________________


SELECT (
  select top 1 Collaborator 
  from [1314howe].[organization pairs]
    order by newid(), x.Collaborator
  
)
  FROM [1314howe].[organization pairs] x 



________________________________________


SELECT (
  select top 1 Collaborator 
  from [1314howe].[organization pairs]
  where x.Collaborator != Collaborator
    order by newid()
  
)
  FROM [1314howe].[organization pairs] x 



________________________________________


SELECT rand() as random


________________________________________


SELECT rand() as random


________________________________________


select random.number
from [1314howe].[organization pairs], random





________________________________________


select dbo.RandomNumber()
from [1314howe].[organization pairs]




________________________________________


SELECT (
  select top 1 Collaborator
   from [1314howe].[organization pairs]
  order by dbo.RandomNumber()
) 
  FROM [1314howe].[organization pairs]
  
  
  



________________________________________


SELECT (
  select top 1 Collaborator
   from [1314howe].[organization pairs]
  order by dbo.RandomNumber(newid())
) 
  FROM [1314howe].[organization pairs] x
  
  
  



________________________________________


SELECT (
  select top 1 Collaborator
   from [1314howe].[organization pairs]
  order by dbo.RandomNumber(x.Collaborator)
) 
  FROM [1314howe].[organization pairs] x
  
  
  



________________________________________


SELECT (
  select top 1 Collaborator
   from [1314howe].[organization pairs]
  order by dbo.RandomNumber(r)
) 
  FROM 
  (
  SELECT *, dbo.RandomNumber(Collaborator) as r
  FROM [1314howe].[organization pairs]
  ) x
  
  
  



________________________________________


SELECT (
  select top 1 id
   from [1314howe].[gels.csv]
  order by dbo.RandomNumber(r)
) 
  FROM 
  (
  SELECT *, dbo.RandomNumber(id) as r
  FROM [1314howe].[gels.csv]
  ) x
  
  
  



________________________________________


SELECT TOP 1 * FROM [354].[Dan's binning] a,   [354].[Dan's binning] b 


________________________________________


SELECT * FROM [354].[tmpColumnNameTest]


________________________________________


SELECT TOP 1 * FROM [354].[Dan's binning] a,
  [354].[Dan's binning] b


________________________________________



SELECT 1


________________________________________


SELECT * FROM [1314howe].[reuters]


________________________________________


SELECT count(*) FROM [1314howe].[reuters]


________________________________________


SELECT doc_id, count(*) FROM [1314howe].[reuters]
  group by doc_id



________________________________________


SELECT doc_id, count(*) FROM [1314howe].[reuters]
  group by doc_id
  order by count(*) desc


________________________________________


SELECT doc_id, count(*) FROM [1314howe].[reuters]
  where term_id = 'parliament'
  group by doc_id
  order by count(*) desc


________________________________________


--SELECT doc_id, count(*) FROM [1314howe].[reuters]
--  where term_id = 'parliament'
--  group by doc_id
--  order by count(*) desc

SELECT * FROM [1314howe].[reuters]


________________________________________


--SELECT doc_id, count(*) FROM [1314howe].[reuters]
--  where term_id = 'parliament'
--  group by doc_id
--  order by count(*) desc

SELECT count(distinct doc_id) 
  FROM 1314howe.reuters WHERE term_id = 'parliament'


________________________________________


--SELECT doc_id, count(*) FROM [1314howe].[reuters]
--  where term_id = 'parliament'
--  group by doc_id
--  order by count(*) desc

SELECT count(doc_id) 
  FROM 1314howe.reuters WHERE term_id = 'parliament'


________________________________________


--SELECT doc_id, count(*) FROM [1314howe].[reuters]
--  where term_id = 'parliament'
--  group by doc_id
--  order by count(*) desc

SELECT * FROM (
SELECT doc_id, count(term_id) as term_count 
FROM 1314howe.reuters 
GROUP BY doc_id
) x
WHERE term_count > 300


________________________________________


 select term_id
    from reuters


________________________________________


select term_id, sum(frequency)
  from reuters
  group by term_id
  order by sum(frequency) desc



________________________________________


select term_id, sum(frequency)
  from reuters
  group by term_id
  having sum(frequency) between 400 and 500
  order by sum(frequency) desc



________________________________________


select * from reuters where
  term_id in (
select term_id
  from reuters
  group by term_id
  having sum(frequency) between 400 and 500

  )


________________________________________


select * from reuters where
  term_id in (
select term_id
  from reuters
  group by term_id
  having sum(frequency) between 400 and 500
  )
  
  select doc_id, sum(frequency)
  from reuters
  group by doc_id
  having sum(frequency) between 400 and 500



________________________________________


select * from reuters where
  term_id in (
select term_id
  from reuters
  group by term_id
  having sum(frequency) between 400 and 500
  )
  
  select doc_id, sum(frequency)
  from reuters
  group by doc_id
  having sum(frequency) between 400 and 500



________________________________________


--select * from reuters where
--  term_id in (
--select term_id
--  from reuters
--  group by term_id
--  having sum(frequency) between 400 and 500
 -- )
  
  select doc_id, sum(frequency)
  from reuters
  group by doc_id
  having sum(frequency) between 400 and 500



________________________________________


--select * from reuters where
--  term_id in (
--select term_id
--  from reuters
--  group by term_id
--  having sum(frequency) between 400 and 500
 -- )
  
  select doc_id, sum(frequency)
  from reuters
  group by doc_id
    order by sum(frequency) desc
    --  having sum(frequency) between 400 and 500



________________________________________


--select * from reuters where
--  term_id in (
--select term_id
--  from reuters
--  group by term_id
--  having sum(frequency) between 400 and 500
 -- )
  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 100



________________________________________


--select * from reuters where
--  term_id in (
--select term_id
--  from reuters
--  group by term_id
--  having sum(frequency) between 400 and 500
 -- )
  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 300



________________________________________


select * from reuters where
  term_id in (
select term_id
  from reuters
  group by term_id
  having sum(frequency) between 400 and 500
 )
and doc_id in (  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 300
    )


________________________________________


select * from reuters where
  term_id not in (
select term_id
  from reuters
  group by term_id
  having sum(frequency) between 400 and 500
 )
and doc_id in (  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 300
    )


________________________________________


--select * from reuters where
--  term_id not in (
select term_id
  from reuters
  where len(term_id) < 4
--  group by term_id
--  having sum(frequency) between 400 and 500
-- )
--and doc_id in (  
--  select doc_id
--  from reuters
--  group by doc_id
--     having sum(frequency) between 200 and 300
--    )


________________________________________


--select * from reuters where
--  term_id not in (
select doc_id, term_id
  from reuters
  where len(term_id) < 4
--  group by term_id
--  having sum(frequency) between 400 and 500
-- )
--and doc_id in (  
--  select doc_id
--  from reuters
--  group by doc_id
--     having sum(frequency) between 200 and 300
--    )


________________________________________


--select * from reuters where
--  term_id not in (
select distinct doc_id
  from reuters
  where len(term_id) < 4
--  group by term_id
--  having sum(frequency) between 400 and 500
-- )
--and doc_id in (  
--  select doc_id
--  from reuters
--  group by doc_id
--     having sum(frequency) between 200 and 300
--    )


________________________________________


--select * from reuters where
--  term_id not in (
select count(distinct doc_id)
  from reuters
  where len(term_id) < 4
--  group by term_id
--  having sum(frequency) between 400 and 500
-- )
--and doc_id in (  
--  select doc_id
--  from reuters
--  group by doc_id
--     having sum(frequency) between 200 and 300
--    )


________________________________________


--select * from reuters where
--  term_id not in (
select count(distinct doc_id)
  from reuters
  where len(term_id) > 4
--  group by term_id
--  having sum(frequency) between 400 and 500
-- )
--and doc_id in (  
--  select doc_id
--  from reuters
--  group by doc_id
--     having sum(frequency) between 200 and 300
--    )


________________________________________


select * from reuters where
  term_id not in (
select count(distinct doc_id)
  from reuters
  where len(term_id) > 10
  group by term_id
  having sum(frequency) between 400 and 500
 )
and doc_id in (  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 300
    )


________________________________________


select * from reuters where
  term_id in (
select count(distinct doc_id)
  from reuters
  where len(term_id) > 10
  group by term_id
  having sum(frequency) between 400 and 500
 )
and doc_id in (  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 300
    )


________________________________________


select * from reuters where
  term_id in (
select count(distinct doc_id)
  from reuters
  where len(term_id) > 10
  group by term_id
  having sum(frequency) between 400 and 500
 )
and doc_id in (  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 300
    )


________________________________________


select * from reuters where
  term_id in (
select term_id
  from reuters
  group by term_id
  having sum(frequency) between 400 and 500
 )
and doc_id in (  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 300
    )


________________________________________


select * from reuters where
  term_id not in (
select term_id
  from reuters
  group by term_id
  having sum(frequency) between 400 and 500
 )
and doc_id in (  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 300
    )


________________________________________


select * from reuters where
  term_id not in (
select term_id
  from reuters
  group by term_id
  having sum(frequency) between 400 and 500
 )
and doc_id in (  
  select doc_id
  from reuters
  group by doc_id
     having sum(frequency) between 200 and 300
)
  union
select '10642_txt_trade', 'government', 3
  union
select '10779_txt_trade', 'agreement', 1
    union
select '11763_txt_acq', 'offer', 4
  



________________________________________


SELECT * FROM [1314howe].[complementary subset of reuters]
  where doc_id = '10779_txt_trade'



________________________________________


SELECT * FROM [1314howe].[complementary subset of reuters]
  where doc_id = '10779_txt_trade'



________________________________________


select * from 1385_queries


________________________________________


select * from 1385_queries order by date_created desc


________________________________________


select * from [profile.csv]


________________________________________


select * from 1385_queries where owner like '%sr320%'


________________________________________


select * from 1385_queries where owner like '%fridayharbor%'


________________________________________


select * from 1385_queries where owner like '%fridayharbor%' and sql_code like '%<%'


________________________________________


select * from 1385_queries where sql_code like '%>%'


________________________________________


select * from 1385_queries where sql_code like '%>%' order by date_created desc


________________________________________


select * from 1385_queries where short_desc = 'PmTE_ALL-DE_group1_Min1SigDE'


________________________________________


select * from 1385_queries where short_desc = 'PmTE_ALL-DE_group1'


________________________________________


SELECT * FROM 1385_queries where short_desc = 'PmTE_ALL-DE_group1_Min1SigDE'


________________________________________


--SELECT * FROM 1385_queries where short_desc = 'PmTE_ALL-DE_group1_Min1SigDE'
SELECT * FROM 1385_queries where short_desc = 'PmTE_ALL-DE_group1'



________________________________________


SELECT * FROM 1385_queries where short_desc = 'PmTE_ALL-DE_group1_Min1SigDE'

--SELECT * FROM 1385_queries where short_desc = 'PmTE_ALL-DE_group1'  
--  SELECT * FROM [826].[PmTE_ALL-DE.txt] DE join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup on supergroup.Consensus = DE.name



________________________________________


SELECT * FROM 1385_queries where sql_code like '%PmTE_ALL-DE_group1_Min1SigDE%'
--SELECT * FROM 1385_queries where short_desc = 'PmTE_ALL-DE_group1_Min1SigDE'
--SELECT * FROM [826].[PmTE_ALL-DE_group1] where PValue_Fe < 0.05 or PValue_P < 0.05 or PValue_Si < 0.05 or PValue_Urea < 0.05
  
--SELECT * FROM 1385_queries where short_desc = 'PmTE_ALL-DE_group1'  
--  SELECT * FROM [826].[PmTE_ALL-DE.txt] DE join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup on supergroup.Consensus = DE.name



________________________________________


select * from 1385_queries where owner like '%dmitry%'


________________________________________


select * from 1385_queries where owner like '%mitry%'


________________________________________


select * from 1385_queries where owner like '%medved%'


________________________________________


SELECT * FROM [354].[twitter_rv.6200000]


________________________________________


SELECT * FROM [1314howe].[table_OH_data_example.csv] 
  where schoolid != 'schoolid'



________________________________________


SELECT count(*) FROM [1314howe].[table_OH_data_example.csv] 
  where schoolid != 'schoolid'



________________________________________


SELECT count(*) FROM [1314howe].[table_OH_data_example.csv] 
--  where schoolid != 'schoolid'



________________________________________


SELECT count(*) FROM [1314howe].[table_OH_data_example.csv] 
  where schoolid != 'Building IRN'



________________________________________


SELECT * FROM [1314howe].[table_OH_data_example.csv] 
  where schoolid != 'Building IRN'



________________________________________


SELECT f1.doc_id, f2.doc_id, 
     sum(f1.frequency * f2.frequency) 
  / (  sqrt(sum(f1.frequency^2)) 
     * sqrt(sum(f2.frequency^2))
    ) as similarity
FROM [reuters_terms.csv] f1
   , [reuters_terms.csv] f2
WHERE f1.doc_id = f2.doc_id AND f1.term_id = f2.term_id
GROUP BY f1.doc_id, f2.doc_id


________________________________________


SELECT * FROM [1123].[TJGR_genomic_gene.txt]
  WHERE gID = 'CGI_10006842'



________________________________________


select 
CASE WHEN gID = 'CGI' THEN gID + substring(sequence_gg, 1, 8)
     ELSE gID
END as gID, sequence_gg
from [1123].[TJGR_genomic_gene.txt]


________________________________________


select 
CASE WHEN gID = 'CGI' THEN gID + '_' + substring(sequence_gg, 1, 8)
     ELSE gID
END as gID, 
  CASE WHEN gID = 'CGI' THEN substring(sequence_gg, 9, len(sequence_gg))
  ELSE sequence_gg
END
from [1123].[TJGR_genomic_gene.txt]


________________________________________


SELECT count(*) 
  FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID like '%_%'



________________________________________


SELECT count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID like '%_%'



________________________________________


SELECT count(*) 
 -- FROM [1123].[TJGR_genomic_gene.txt]
  FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID like '%_%'



________________________________________


SELECT count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID = 'CGI'
  


________________________________________


SELECT count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID LIKE 'CGI_%'
  


________________________________________


SELECT count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID LIKE '%_%'
  


________________________________________


SELECT count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID LIKE '%_%' AND gID = 'CGI'
  


________________________________________


SELECT top 5 *
  --count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID LIKE '%_%' AND gID = 'CGI'
  


________________________________________


SELECT top 5 *
  --count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID LIKE '%\_%' AND gID = 'CGI'
  


________________________________________


SELECT top 5 *
  --count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID LIKE '%\_%' --AND gID = 'CGI'
  


________________________________________


SELECT top 5 *
  --count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID LIKE '%[_]%' --AND gID = 'CGI'
  


________________________________________


SELECT count(*) 
  FROM [1123].[TJGR_genomic_gene.txt]
 -- FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID LIKE '%[_]%'
  


________________________________________


SELECT count(*) 
  -- FROM [1123].[TJGR_genomic_gene.txt]
  FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 WHERE gID LIKE '%[_]%'
  


________________________________________


SELECT count(*) 
  -- FROM [1123].[TJGR_genomic_gene.txt]
  FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
 --WHERE gID LIKE '%[_]%'
  


________________________________________


select 
CASE WHEN gID = 'CGI' THEN gID + '_' + substring(sequence_gg, 1, 8)
     ELSE gID
END as gID, 
CASE WHEN gID = 'CGI' THEN substring(sequence_gg, 9, len(sequence_gg))
     ELSE sequence_gg 
END as sequence_gg
from [1123].[TJGR_genomic_gene.txt]


________________________________________


SELECT * 
  FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
  WHERE gID LIKE '%006842'



________________________________________


SELECT count(*) 
  FROM [1314howe].[corrected_TJGR_genomic_gene.txt]



________________________________________


SELECT count(*) 
  --FROM [1314howe].[corrected_TJGR_genomic_gene.txt]
  FROM [1123].[TJGR_genomic_gene.txt]



________________________________________


SELECT f1.doc_id, f2.doc_id, 
     sum(f1.frequency * f2.frequency) 
  / ( sqrt(sum(f1.frequency^2)) 
    * sqrt(sum(f2.frequency^2)) ) as similarity 
  FROM [reuters_terms.csv] f1 , [reuters_terms.csv] f2 
 WHERE f1.doc_id = f2.doc_id 
   AND f1.term_id = f2.term_id 
GROUP BY f1.doc_id, f2.doc_id


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  WHERE Name like '%BALAZINSKA%'


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like '%PRINCI%'


________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like '%PRINCI%'
  ORDER BY salary desc



________________________________________


SELECT * FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like '%PRINCI%'
  AND job_title not like '%APL%'
  ORDER BY salary desc



________________________________________


SELECT avg(salary) FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like '%PRINCI%'
  AND job_title not like '%APL%'
  --ORDER BY salary desc



________________________________________


SELECT stdev(salary) FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like '%PRINCI%'
  AND job_title not like '%APL%'
  --ORDER BY salary desc



________________________________________


SELECT max(salary), min(salary) FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like '%PRINCI%'
  AND job_title not like '%APL%'
  --ORDER BY salary desc



________________________________________


SELECT max(salary), min(salary) FROM [1314howe].[UW 2010 Salaries]
  WHERE job_title like '%PRINCI%'
  AND job_title not like '%APL%'
  AND salary > 50000
  --ORDER BY salary desc



________________________________________


SELECT max(salary), min(salary) 
  
  FROM (
    SELECT Name, [Job Title] as job_title, [2010 Gross Earnings] as salary 
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%PRINCI%'
  AND job_title not like '%APL%'
  AND salary > 50000
  --ORDER BY salary desc


________________________________________


--SELECT max(salary), min(salary) 
  
--  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary, *
  FROM [1314howe].[uw_salaries_2011.txt]
--  ) x
--  WHERE job_title like '%PRINCI%'
--  AND job_title not like '%APL%'
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary)   
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%PRINCI%'
  AND job_title not like '%APL%'
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary)   
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%PRINCI%'
  AND job_title not like '%APL%'
  AND salary > 30000  
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary)   
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%PRINCI%'
  AND job_title not like '%APL%'
  AND salary > 30000  
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary)   
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%PRINCI%'
  --AND job_title not like '%APL%'
  AND salary > 30000  
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%PRINCI%'
  --AND job_title not like '%APL%'
  --AND salary > 30000  
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%PRINCI%'
  --AND job_title not like '%APL%'
  AND salary > 30000  
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%PRINCI%'
  --AND job_title not like '%APL%'
  AND salary > 80000  
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%PRINCI%'
  --AND job_title not like '%APL%'
  AND salary > 100000  
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%PRINCI%'
  --AND job_title not like '%APL%'
  --AND salary > 100000  
  --ORDER BY salary desc


________________________________________


SELECT max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%SR%'
  --AND job_title not like '%APL%'
  --AND salary > 100000  
  --ORDER BY salary desc


________________________________________


SELECT * 
  --max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%SR%'
  --AND job_title not like '%APL%'
  --AND salary > 100000  
  --ORDER BY salary desc


________________________________________


SELECT * 
  --max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%SR'
  --AND job_title not like '%APL%'
  --AND salary > 100000  
  --ORDER BY salary desc


________________________________________


SELECT * 
  --max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%SENIOR%'
  --AND job_title not like '%APL%'
  --AND salary > 100000  
  --ORDER BY salary desc


________________________________________


SELECT * 
  --max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%SENIOR%'
  --AND job_title not like '%APL%'
  --AND salary > 100000  
  ORDER BY salary desc


________________________________________


SELECT  
  max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%SENIOR%'
  --AND job_title not like '%APL%'
  AND salary > 112800  
  --ORDER BY salary desc


________________________________________


SELECT  
  max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%SENIOR%'
  --AND job_title not like '%APL%'
  AND salary < 112800  
  --ORDER BY salary desc


________________________________________


SELECT  
  max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%SENIOR%'
  --AND job_title not like '%APL%'
  --AND salary < 112800  
  --ORDER BY salary desc


________________________________________


SELECT  
  max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%PRINCI%'
  --AND job_title not like '%APL%'
  --AND salary < 112800  
  --ORDER BY salary desc


________________________________________


SELECT 
 * 
  --max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE job_title like '%RESEAR%PRINCI%'
  
  --AND job_title not like '%APL%'
  --AND salary < 112800  
  ORDER BY salary desc


________________________________________


SELECT 
 * 
  --max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE 
    --job_title like '%RESEAR%PRINCI%'
  name like '%balazinska%'
  --AND job_title not like '%APL%'
  --AND salary < 112800  
  ORDER BY salary desc


________________________________________


SELECT 
 * 
  --max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE 
    --job_title like '%RESEAR%PRINCI%'
  job_title like 'ASSISTANT PROFESSOR'
  --name like '%balazinska%'
  --AND job_title not like '%APL%'
  --AND salary < 112800  
  ORDER BY salary desc


________________________________________


SELECT 
 --* 
  max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE 
    --job_title like '%RESEAR%PRINCI%'
  job_title like 'ASSISTANT PROFESSOR'
  --name like '%balazinska%'
  --AND job_title not like '%APL%'
  AND salary < 120800  
  --ORDER BY salary desc


________________________________________


SELECT 
 --* 
  max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE 
    --job_title like '%RESEAR%PRINCI%'
  job_title like 'ASSISTANT PROFESSOR'
  --name like '%balazinska%'
  --AND job_title not like '%APL%'
  AND salary > 120800  
  --ORDER BY salary desc


________________________________________


SELECT 
 --* 
  max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE 
    --job_title like '%RESEAR%PRINCI%'
  job_title like 'ASSISTANT PROFESSOR'
  --name like '%balazinska%'
  --AND job_title not like '%APL%'
  AND salary > 131960  
  --ORDER BY salary desc


________________________________________


SELECT 
 --* 
  max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE 
    --job_title like '%RESEAR%PRINCI%'
  job_title like 'ASSISTANT PROFESSOR'
  --name like '%balazinska%'
  --AND job_title not like '%APL%'
  AND salary < 131960  
  --ORDER BY salary desc


________________________________________


SELECT 
 --* 
  max(salary), min(salary), avg(salary), count(*)
  FROM (
    SELECT Name, [Job Title] as job_title, 
    [2010 Gross Earnings] as salary
  FROM [1314howe].[uw_salaries_2011.txt]
  ) x
  WHERE 
    --job_title like '%RESEAR%PRINCI%'
  job_title like 'ASSISTANT PROFESSOR'
  --name like '%balazinska%'
  --AND job_title not like '%APL%'
  AND salary > 131960  
  --ORDER BY salary desc


________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE Name like '%GROSSMAN%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE Name like '%ERNST%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE Name like 'ERNST%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE Name like 'TOMPA%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE Name like 'POP%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE Name like 'PATEL%'



________________________________________


SELECT * 
  FROM [1314howe].[UW 2010 Salaries]
  WHERE Name like 'ZETT%'



________________________________________


SELECT DateTime, lat, long
      , pop, flow, salinity
      , temperature, fluorescence
      , evt, opp
      , conc, n, resamp, bulk_red
  FROM [1059].[STATS_VIEW]


________________________________________


SELECT top 1000 DateTime, lat, long
      , pop, flow, salinity
      , temperature, fluorescence
      , evt, opp
      , conc, n, resamp, bulk_red
  FROM [1059].[STATS_VIEW]
  order by DateTime Desc



________________________________________


SELECT * FROM [1314howe].[Seaflow Science Dashboard]


________________________________________


SELECT * FROM [1314howe].[Seaflow Science Dashboard]


________________________________________


  SELECT roi.id, count(rd.start)
  FROM [1314howe].[roi.csv] roi
     , [1314howe].[read.csv] rd
  WHERE roi.start <= rd.start AND roi.[end] >= rd.[end]
  GROUP BY roi.id


________________________________________


  SELECT roi.id, count(rd.start)
  FROM [1314howe].[roi.csv] roi
     , [1314howe].[read.csv] rd
  WHERE roi.start <= rd.start AND roi.[end] >= rd.[end]
  GROUP BY roi.id


________________________________________


SELECT d.*
  FROM [1314howe].[uw_employees_dept.csv] d
  , (select owner as 1385name 
    from dbo.1385_query_log
    group by owner
    having count(*) > 0
  ) q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''


________________________________________


SELECT distinct last, first, email, department
  FROM [1314howe].[uw_employees_dept.csv] d
  , (select owner as 1385name 
    from dbo.1385_query_log
    group by owner
    having count(*) > 0
  ) q
  WHERE  q.1385name like d.1385name + '@%'
   AND d.1385name != ''


________________________________________


SELECT * 
  FROM (
SELECT *, ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) % 1000 as sample
  FROM [1059].[SDS_VIEW]
) x
  WHERE sample = 0


________________________________________


SELECT count(*), min(UnixTimestamp), max(UnixTimestamp)
  FROM (
    SELECT *, ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) % floor((SELECT count(*) from [1059].[SDS_VIEW]) / 1000)  as sample
  FROM [1059].[SDS_VIEW]
) x
  WHERE sample = 0


________________________________________


SELECT count(*)
  FROM (
    SELECT *, ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) % floor((SELECT count(*) from [1059].[SDS_VIEW]) / 1000)  as sample
  FROM [1059].[SDS_VIEW]
) x
  WHERE sample = 0


________________________________________


SELECT count(*)
  FROM (
    SELECT *, ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) % floor((SELECT count(*) from [1059].[SDS_VIEW]) / 500)  as sample
  FROM [1059].[SDS_VIEW]
) x
  WHERE sample = 0


________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
  where title = 'MANAGER OF PROGRAM OPERATIONS'
  order by salary desc



________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
  where title = 'MANAGER OF PROGRAM OPERATIONS'
  and last = 'ERBECK'
  order by salary desc



________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
  where 1=1
  --And title = 'MANAGER OF PROGRAM OPERATIONS'
  and last = 'ERBECK'
  order by salary desc



________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
  where 1=1
  --And title = 'MANAGER OF PROGRAM OPERATIONS'
  and first = 'TRACY'
  order by salary desc



________________________________________


SELECT * 
  FROM [1314howe].[UW employees, salary and department]
  where 1=1
  --And title = 'MANAGER OF PROGRAM OPERATIONS'
  and first = 'TRACY'
  order by salary desc



________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009]
  where first = 'TRACY'
  



________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009]
  where first = 'TRACY'
  order by last



________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009]
  where last = 'ERBECK'
  order by last



________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009]
  where last like '%ERBECK%'
  order by last



________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009]
  where last like '%CUNNINGTON%'
  order by last



________________________________________


SELECT Physician_Specialty
     , sum(Total_Amount_of_Payment_USDollars)
  FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
GROUP BY Physician_Specialty
  ORDER BY sum(Total_Amount_of_Payment_USDollars)


________________________________________


SELECT Physician_Specialty
     , sum(Total_Amount_of_Payment_USDollars)
  FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
GROUP BY Physician_Specialty
  ORDER BY sum(Total_Amount_of_Payment_USDollars) desc


________________________________________


SELECT Physician_Profile_ID, 
  Physician_First_Name, 
Physician_Middle_Name,
Physician_Last_Name,
  sum(Total_Amount_of_Payment_USDollars)
  FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
  GROUP BY Physician_Profile_ID, 
  Physician_First_Name, 
Physician_Middle_Name,
Physician_Last_Name
  ORDER BY  sum(Total_Amount_of_Payment_USDollars) desc


________________________________________


SELECT * FROM [1314howe].[top_earning_physician_specialties]


________________________________________


SELECT sum(Total_Amount_of_Payment_USDollars)
  FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]


________________________________________


SELECT datepart(year, Date_of_Payment)
     , sum(Total_Amount_of_Payment_USDollars)
  FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
  GROUP BY datepart(year, Date_of_Payment)


________________________________________


SELECT count(*)
  FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
  GROUP BY datepart(year, Date_of_Payment)


________________________________________


SELECT count(*)
  FROM [1079].[OPPR_ALL_DTL_GNRL_093020141.csv]
  GROUP BY datepart(year, Date_of_Payment)


________________________________________


SELECT count(*) 
  FROM [1314howe].[grades.csv]
 WHERE [Twitter Sentiment Analysis in Python] > 0


________________________________________


SELECT count(*) 
  FROM [1314howe].[grades.csv]
 --WHERE [Twitter Sentiment Analysis in Python] > 0
 WHERE [Database Assignment: Simple In-Database Text Analytics] > 0


________________________________________


SELECT count(*) 
  FROM [1314howe].[grades.csv]
 WHERE [Twitter Sentiment Analysis in Python] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0 
   AND [Algorithms in MapReduce] > 0 
   AND [R Assignment: Classification of Ocean Microbes] > 0


________________________________________


SELECT count(*) 
  FROM [1314howe].[grades.csv]
 WHERE [Twitter Sentiment Analysis in Python] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0 
   AND [Algorithms in MapReduce] > 0 
   AND [R Assignment: Classification of Ocean Microbes] > 0
   AND course_distinction_grade < 60


________________________________________


SELECT *
  FROM [1314howe].[grades.csv]
 WHERE [Twitter Sentiment Analysis in Python] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0 
   AND [Algorithms in MapReduce] > 0 
   AND [R Assignment: Classification of Ocean Microbes] > 0
   AND course_distinction_grade < 60


________________________________________


SELECT *
  FROM [1314howe].[grades.csv]
 WHERE [Twitter Sentiment Analysis in Python] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0 
   AND [Algorithms in MapReduce] > 0 
   AND [R Assignment: Classification of Ocean Microbes] > 0
   AND course_distinction_grade < 60


________________________________________


SELECT max([Twitter Sentiment Analysis in Python]), 
  max([Database Assignment: Simple In-Database Text Analytics]),
  max([Algorithms in MapReduce]),
  max([R Assignment: Classification of Ocean Microbes])
  FROM [1314howe].[grades.csv]




________________________________________


SELECT *
  FROM [1314howe].[grades.csv]
 WHERE [Twitter Sentiment Analysis in Python] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0
   AND [Database Assignment: Simple In-Database Text Analytics] > 0 
   AND [Algorithms in MapReduce] > 0 
   AND [R Assignment: Classification of Ocean Microbes] > 0
   AND course_distinction_grade < 60



________________________________________


select cast('1.56E+01' as float)


________________________________________


select * from 1385s


________________________________________


select count(*) from 1385s


________________________________________


select * from 1385s;


________________________________________


select * from 1385s where 1385name like 'angela%'


________________________________________


select * from 1385s where 1385name like '%angela%'


________________________________________


select * from 1385s;


________________________________________


select * from 1385_queries;


________________________________________


select * 
  from 1385s, 1385_queries
where owner = 1385


________________________________________


select owner, count(*)  
  from 1385_queries q
group by owner


________________________________________


select owner, count(*)  
  from 1385_queries q
group by owner


________________________________________


select owner, count(*)  
  from 1385_queries q
group by owner
  order by count(*) desc;


________________________________________


select * from 1385_query_log;


________________________________________


select owner, count(*) 
  from 1385_query_log
group by owner


________________________________________


select owner, count(*) 
  from 1385_query_log
group by owner
  order by count(*) desc


________________________________________


select count(*) from (
select owner, count(*) as cnt
  from 1385_query_log
group by owner
  ) x
--  order by count(*) desc


________________________________________


SELECT *
  FROM [1314howe].[uw_salaries_2011.txt]


________________________________________


SELECT *
  FROM [1314howe].[uw_salaries_2011.txt]


________________________________________


SELECT * FROM [1314howe].[uwsalaries.csv] 
  where [percent] < 26


________________________________________


SELECT * FROM [1314howe].[uwsalaries.csv] 
  where [percent] < 26 and [percent] > 0


________________________________________


SELECT * FROM [1314howe].[uwsalaries.csv] 
  where [percent] < 50 and [percent] > 0


________________________________________


SELECT * FROM [1314howe].[uwsalaries.csv] 
  where [percent] < 100 and [percent] > 0


________________________________________


select * from 1385_queries where sql_code like '%HIV%'


________________________________________


SELECT * FROM [1314howe].[uw_employees_dept.csv] WHERE last like 'Hodgins%'


________________________________________


SELECT [Offense Type], count(*) 
  FROM [1238].[SeattleCrimeIncidents]
GROUP BY [Offense Type]


________________________________________


SELECT [Offense Type], count(*) as incident_count
  FROM [1238].[SeattleCrimeIncidents]
GROUP BY [Offense Type]
  Order by incident_count


________________________________________


SELECT [Offense Type], count(*) as incident_count
  FROM [1238].[SeattleCrimeIncidents]
GROUP BY [Offense Type]
  Order by incident_count desc


________________________________________


SELECT year, [Offense Type]
     , count(*) as incident_count
FROM (
  
SELECT *
     , [Offense Type] as offense
     , [Occurred Date or Date Range Start] as occurred_date
  FROM [1238].[SeattleCrimeIncidents]

) as i  
GROUP BY [Offense Type], year 
ORDER BY year, incident_count desc


________________________________________


SELECT year, [Offense Type]
     , count(*) as incident_count
FROM (
  
SELECT *
     , [Offense Type] as offense
     , [Occurred Date or Date Range Start] as occurred_date
  FROM [1238].[SeattleCrimeIncidents]

) as i  
GROUP BY [Offense Type], year 
  ORDER BY cast(year as integer), incident_count desc


________________________________________


SELECT year, [Offense Type]
     , count(*) as incident_count
FROM (
  
SELECT *
     , [Offense Type] as offense
     , [Occurred Date or Date Range Start] as occurred_date
  FROM [1238].[SeattleCrimeIncidents]

) as i  
GROUP BY [Offense Type], year 
  ORDER BY incident_count desc


________________________________________


SELECT year, [Offense Type]
     , count(*) as incident_count
FROM [1238].[SeattleCrimeIncidents]
GROUP BY [Offense Type], year 
ORDER BY incident_count desc


________________________________________


SELECT year
     , count(*) as incident_count
FROM [1238].[SeattleCrimeIncidents]
GROUP BY  year 
ORDER BY incident_count desc


________________________________________


SELECT year, month
     , count(*) as incident_count
FROM [1238].[SeattleCrimeIncidents]
GROUP BY  year, month 
ORDER BY incident_count desc


________________________________________


SELECT year, month, [Offense Type]
     , count(*) as incident_count
FROM [1238].[SeattleCrimeIncidents]
GROUP BY  year, month, [Offense Type] 
ORDER BY incident_count desc


________________________________________


SELECT year, month, [Offense Type]
--     , count(*) as incident_count
FROM [1238].[SeattleCrimeIncidents]
WHERE [Offense Type] Like '%CAR%'  
--GROUP BY  year, month, [Offense Type] 
--ORDER BY incident_count desc


________________________________________


SELECT year, month, [Offense Type]
--     , count(*) as incident_count
FROM [1238].[SeattleCrimeIncidents]
WHERE [Offense Type] = 'THEFT-CARPROWL' 
   OR [Offense Type] LIKE '%AUTO%'
   
--GROUP BY  year, month, [Offense Type] 
--ORDER BY incident_count desc


________________________________________


SELECT year, month, [Offense Type]
--     , count(*) as incident_count
FROM [1238].[SeattleCrimeIncidents]
WHERE [Offense Type] = 'THEFT-CARPROWL' 
   OR [Offense Type] = 'VEH-THEFT-AUTO'
   
--GROUP BY  year, month, [Offense Type] 
--ORDER BY incident_count desc


________________________________________


--SELECT * 
--  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
--     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
-- WHERE o.[CDW Incident ID] = i.[RMS CDW ID]

SELECT count(*) FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o



________________________________________


--SELECT * 
--  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
--     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
-- WHERE o.[CDW Incident ID] = i.[RMS CDW ID]

SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i


________________________________________


SELECT * 
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE o.[CDW Incident ID] = i.[RMS CDW ID]

--SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i


________________________________________


SELECT count(*) 
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE o.[CDW Incident ID] = i.[RMS CDW ID]

--SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i


________________________________________


SELECT count(*) 
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE o.[CDW Incident ID] = i.[RMS CDW ID]

--SELECT count(*) FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] i
--SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i  


________________________________________


--SELECT count(*) 
--  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
--     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
-- WHERE o.[CDW Incident ID] = i.[RMS CDW ID]

--SELECT count(*) FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] i
SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i  


________________________________________


--SELECT count(*) 
--  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
--     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
-- WHERE o.[CDW Incident ID] = i.[RMS CDW ID]

SELECT count(*) FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] i
--SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i  


________________________________________


--SELECT count(*) 
--  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
--     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
-- WHERE o.[CDW Incident ID] = i.[RMS CDW ID]

--SELECT count(*) FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] i
SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i  


________________________________________


SELECT count(*) 
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE o.[CDW Incident ID] = i.[RMS CDW ID]

--SELECT count(*) FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] i
--SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i  


________________________________________


SELECT i.[RMS CDW ID], count(*)
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
 GROUP BY i.[RMS CDW ID]

--SELECT count(*) FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] i
--SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i  


________________________________________


SELECT i.[RMS CDW ID], count(*) 
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
 GROUP BY i.[RMS CDW ID]
  HAVING count(*) > 1

--SELECT count(*) FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] i
--SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i  


________________________________________


SELECT i.[RMS CDW ID], count(*) 
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
 GROUP BY i.[RMS CDW ID]
  HAVING count(*) > 1
  ORDER BY count(*) DESC

--SELECT count(*) FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] i
--SELECT count(*) FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i  


________________________________________



SELECT o.*
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
     , [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
 AND [RMS CDW ID] = 647908


________________________________________


SELECT year, month, [Offense Type], count(*) as incident_count
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Incident.csv]
 GROUP BY [Offense Type], year, month
  ORDER BY incident_count desc


________________________________________


  
SELECT i.*
  FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE NOT EXISTS (
 SELECT * 
   FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
  WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
)
  


________________________________________


  
SELECT count(*)
  FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE NOT EXISTS (
 SELECT * 
   FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
  WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
)
  


________________________________________


  
SELECT [Offense Type], year, count(*)
  FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE NOT EXISTS (
 SELECT * 
   FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
  WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
) 
GROUP BY [Offense Type], year 


________________________________________


  
SELECT [Offense Type], year, count(*)
  FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE NOT EXISTS (
 SELECT * 
   FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
  WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
) 
GROUP BY [Offense Type], year 


________________________________________


  
SELECT [Offense Type], year, count(*)
  FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE NOT EXISTS (
 SELECT * 
   FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
  WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
) 
GROUP BY [Offense Type], year 
  ORDER BY count(*) DESC


________________________________________


  
SELECT year, count(*)
  FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv] i
 WHERE NOT EXISTS (
 SELECT * 
   FROM [1314howe].[Seattle_Police_Department_Police_Report_Offense.csv] o
  WHERE o.[CDW Incident ID] = i.[RMS CDW ID]
) 
GROUP BY  year 
  ORDER BY count(*) DESC


________________________________________


SELECT count(*) 
  FROM (
SELECT DISTINCT *
  FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv]  i
) x



________________________________________


SELECT count(*) 
  FROM (
SELECT DISTINCT [RMS CDW ID]
  FROM [1314howe].[table_Seattle_Police_Department_Police_Report_Incident.csv]  i
) x



________________________________________


SELECT count(*) 
  FROM [412].[bact detection SpC-L]


________________________________________


SELECT count(*) 
  FROM [412].[bact detection SpC-L]


________________________________________


SELECT count(*) 
  FROM [412].[bact detection SpC-L]


________________________________________


SELECT * 
  FROM [1314howe].[Seattle_Police_Department_Police_Report_Incident.csv]
ORDER BY [Offense Code]


________________________________________


SELECT budget
     , category_label as category
     , Description
     , cast(inv_date as date)
     , BAR_Amt
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]


________________________________________


SELECT budget
     , category_label as category
     , Description
     , cast(inv_date as date) as inv_date
     , BAR_Amt
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]


________________________________________


SELECT budget
     , category_label as category
     , Description
     , cast(inv_date as date) as inv_date
     , BAR_Amt
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
  where INV_Date is null


________________________________________


SELECT budget
     , category_label as category
     , Description
     , cast(inv_date as date) as inv_date
     , BAR_Amt
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
  where len(INV_Date) = 0


________________________________________


SELECT budget
     , category_label as category
     , Description
     , cast(inv_date as date) as inv_date
     , BAR_Amt
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
  where len(INV_Date) <2


________________________________________


SELECT budget
     , category_label as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
  where BAR_Amt is null


________________________________________


SELECT budget
     , category_label as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
  where BAR_Amt is null


________________________________________


SELECT budget
     , category_label as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]




________________________________________


SELECT category, sum(amount) 
  FROM [1314howe].[eScience_spend_11_2015]
  group by category


________________________________________


SELECT *
  FROM [1314howe].[ALL_Operations_Details.csv]
  where isdate(inv_date) = 0



________________________________________


SELECT *
  FROM [1314howe].[ALL_Operations_Details.csv]
  WHERE isdate(inv_date) = 0



________________________________________


SELECT *
  FROM [1314howe].[ALL_Operations_Details.csv]
  WHERE isdate(inv_date) = 0



________________________________________


SELECT len(inv_date), *
  FROM [1314howe].[ALL_Operations_Details.csv]
  WHERE isdate(inv_date) = 0 



________________________________________


SELECT len(inv_date), isnull(inv_date, 5)
  FROM [1314howe].[ALL_Operations_Details.csv]
  WHERE isdate(inv_date) = 0 



________________________________________


SELECT budget
     , category_label as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]




________________________________________


select year, category, sum(amount) from (
SELECT datepart(year, inv_date) as year
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by year, category
  


________________________________________


select year, category, sum(amount) from (
SELECT datepart(year, inv_date) as year
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by year, category
  order by year desc


________________________________________


select * from [1314howe].[eScience_spend_11_2015]
  where category = 'Sub-budgets'



________________________________________


select budget, year, category, sum(amount) from (
SELECT budget
     , datepart(year, inv_date) as year
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, year, category
  order by year desc
  


________________________________________


SELECT budget
     , sum(amount)
  FROM [1314howe].[eScience_spend_11_2015]
  group by budget
  


________________________________________


SELECT budget, category
     , sum(amount)
  FROM [1314howe].[eScience_spend_11_2015]
  group by budget, category
  


________________________________________


SELECT budget, category
     , sum(amount)
  FROM [1314howe].[eScience_spend_11_2015]
  group by budget, category
  order by budget
  


________________________________________


select budget, year, category, sum(amount) from (
SELECT budget
     , datepart(year, inv_date) as year
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, year, category
  order by year desc


________________________________________


select budget, year, category, sum(amount) from (
SELECT budget
     , datepart(year, inv_date) as year
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, year, category
  order by year desc


________________________________________


select budget, inv_month, category, sum(amount) from (
SELECT budget
     , DATEADD(month,DATEDIFF(month,0,inv_date),0) as inv_month
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, inv_month, category
  order by inv_month desc


________________________________________


select budget, month, category, sum(amount) as amount from (
SELECT budget
     , DATEADD(month,DATEDIFF(month,0,inv_date),0) as month
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, month, category
  order by month desc


________________________________________


SELECT budget, category
     , sum(amount)
  FROM [1314howe].[escience_spending_totals_by_month_2015]
  group by budget, category
  order by budget
  


________________________________________


SELECT budget, category
     , sum(amount) as amount
  FROM [1314howe].[escience_spending_totals_by_month_2015]
  group by budget, category
  order by budget
  


________________________________________


select budget, year, category, sum(amount) as amount from (
SELECT budget
     , DATEADD(year,DATEDIFF(year,0,inv_date),0) as year
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, year, category
  order by year desc


________________________________________


select budget, year, category, sum(amount) as amount from (
SELECT budget
     , DATEADD(year,DATEDIFF(year,0,inv_date),0) as year
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, year, category
  order by year desc, budget


________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , category_label as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]




________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , category_label as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
  where budget = 'Moore'


________________________________________


select budget, month, category, sum(amount) as amount from (
SELECT budget
     , DATEADD(month,DATEDIFF(month,0,inv_date),0) as month
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, month, category
  order by month desc


________________________________________


SELECT budget, category
     , sum(amount) as amount
  FROM [1314howe].[escience_spending_totals_by_month_2015]
  group by budget, category
  order by budget 
  


________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%Faculty:%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%tudent%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
             when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%tudent%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ostdoc%' and category_label = 'Benefits' 
            then 'Postdoc'
            else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%tudent%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ostdoc%' and category_label = 'Benefits' 
            then 'Postdoc'
            else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%ostdoc%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ostdoc%' and category_label = 'Benefits' 
            then 'Postdoc'
            else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where category_label Like '%Salaries%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ostdoc%' and category_label = 'Benefits' 
            then 'Postdoc'
            else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%ost-docs%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%Res%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%Res%' and category_label like '%Res%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%Res%' and category_label like '%sci%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where Description Like '%Res%' and category_label like '%Sci%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where  category_label like '%Salaries%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Staff%' and category_label = 'Benefits' 
            then 'Admin Staff'
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where  category_label like '%Salaries%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Benefits' 
            then 'Admin Staff'  
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
          where  category_label like '%Salaries%'



________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Benefits' 
            then 'Admin Staff'  
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]



________________________________________


select category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Benefits' 
            then 'Admin Staff'  
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
              
            ) x
  group by category



________________________________________


select *, category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Benefits' 
            then 'Admin Staff'  
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
              
            ) x
where category = 'Salaries'


________________________________________


select *, category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Bill%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Bill%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Benefits' 
            then 'Admin Staff'    
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
              
            ) x
where category = 'Salaries'


________________________________________


select *, category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Bill%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Bill%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Benefits' 
            then 'Admin Staff'   
            when Description Like '%Hyak%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hyak%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Benefits' 
            then 'Admin Staff'     
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
              
            ) x
where category = 'Salaries'


________________________________________


SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Bill%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Bill%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Benefits' 
            then 'Admin Staff'   
            when Description Like '%Hyak%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hyak%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Benefits' 
            then 'Admin Staff'     
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]




________________________________________


select category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Bill%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Bill%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Benefits' 
            then 'Admin Staff'   
            when Description Like '%Hyak%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hyak%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Benefits' 
            then 'Admin Staff'     
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]

              ) x 
  group by category


________________________________________


select 
  *, category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Bill%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Bill%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Benefits' 
            then 'Admin Staff'   
            when Description Like '%Hyak%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hyak%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Benefits' 
            then 'Admin Staff'     
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]

              ) x 
where category = 'Benefits'


________________________________________


select 
  *, category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Bill%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Bill%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Benefits' 
            then 'Admin Staff'   
            when Description Like '%Hyak%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hyak%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Benefits' 
            then 'Admin Staff'     
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]

              ) x 
where category = 'Benefits'


________________________________________


select 
  *, category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Bill%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Bill%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Benefits' 
            then 'Admin Staff'   
            when Description Like '%Hyak%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hyak%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Benefits' 
            then 'Admin Staff'     
            when category_label = 'Consulting' or category_label = ''
            then 'Other'  
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]

              ) x 
where category = 'Benefits'


________________________________________


select 
 category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Bill%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Bill%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Benefits' 
            then 'Admin Staff'   
            when Description Like '%Hyak%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hyak%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Benefits' 
            then 'Admin Staff'     
            when category_label = 'Consulting' or category_label = ''
            then 'Other'  
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
  ) x 
    group by category



________________________________________


select 
 category from (
SELECT case when budget = 'Moore' then 'Moore/Sloan'
            when budget = 'Sloan' then 'Moore/Sloan'
            else budget
            end as budget
     , case when Description Like '%Faculty:%' and category_label = 'Salaries' 
            then 'Faculty'
            when Description Like '%Faculty:%' and category_label = 'Benefits' 
            then 'Faculty'
            when Description Like '%tudents%' and category_label = 'Salaries' 
            then 'Students'
            when Description Like '%tudents%' and category_label = 'Benefits' 
            then 'Students'
            when Description Like '%ost-doc%' and category_label = 'Benefits' 
            then 'Postdoc'
            when Description Like '%ost-doc%' and category_label = 'Salaries' 
            then 'Postdoc'
            when Description Like '%Pro Staff%' and category_label = 'Salaries' 
            then 'Research Staff'
            when Description Like '%Pro Staff%' and category_label = 'Benefits' 
            then 'Research Staff'
            when Description Like '%Admin Pro%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Admin Pro%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Salaries' 
            then 'Admin Staff'
            when Description Like '%Classified Staff%' and category_label = 'Benefits' 
            then 'Admin Staff'
            when Description Like '%Bill%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Bill%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%visiting%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Chance%' and category_label = 'Benefits' 
            then 'Admin Staff'   
            when Description Like '%Hyak%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hyak%' and category_label = 'Benefits' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Salaries' 
            then 'Admin Staff'  
            when Description Like '%Hourly%' and category_label = 'Benefits' 
            then 'Admin Staff'     
  when category_label = 'Consulting' or category_label = 'Equipment' or category_label = 'Supplies' or category_label = 'Contractual Services' or category_label='Recharge'
            then 'Other'  
  else category_label
        end as category
     , Description
     , case 
       when len(INV_Date) <2 then NULL
       when PO_Invoice = 'CR3566' then '9/1/2015'
       else cast(inv_date as date) 
       end as inv_date
     , cast(case 
       when BAR_Amt is null then Encumbered 
       else BAR_Amt
       end as float) as amount
     , cd, PO_Invoice, Encumbered
  FROM [1314howe].[ALL_Operations_Details.csv]
  ) x 
    group by category



________________________________________


SELECT budget, category
     , sum(amount) as amount
  FROM [1314howe].[escience_spending_totals_by_month_2015]
  group by budget, category
  order by budget


________________________________________


select budget, month, category, sum(amount) as amount from (
SELECT budget
     , DATEADD(month,DATEDIFF(month,0,inv_date),0) as month
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, month, category
  order by month desc


________________________________________


select budget, year, category, sum(amount) as amount from (
SELECT budget
     , DATEADD(year,DATEDIFF(year,0,inv_date),0) as year
     , category
     , amount
  FROM [1314howe].[eScience_spend_11_2015]
  ) x
  group by budget, year, category
  order by year desc, budget 


________________________________________


SELECT isdate(Fiscal_year_start) 
  FROM [1314howe].[projections_year_category.csv]


________________________________________


SELECT *
  FROM [1314howe].[projections_year_category.csv]
  where isdate(Fiscal_year_start)  = 0


________________________________________


;WITH e1(n) AS
(
    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL 
    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL 
    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1
), -- 10
e2(n) AS (SELECT 1 FROM e1 CROSS JOIN e1 AS b), -- 10*10
e3(n) AS (SELECT 1 FROM e1 CROSS JOIN e2) -- 10*100
  SELECT n = ROW_NUMBER() OVER (ORDER BY n) FROM e3 ORDER BY n;


________________________________________


WITH e1(n) AS
(
    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL 
    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL 
    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1
), -- 10
e2(n) AS (SELECT 1 FROM e1 CROSS JOIN e1 AS b), -- 10*10
e3(n) AS (SELECT 1 FROM e1 CROSS JOIN e2) -- 10*100
  SELECT n = ROW_NUMBER() OVER (ORDER BY n) FROM e3 ORDER BY n;


________________________________________


select * from ten


________________________________________


select * from ten a cross join ten b


________________________________________


    SELECT 1 as n UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL 
    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL 
    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1



________________________________________


SELECT row_number() over (order by a.n)
  FROM [1314howe].[ten] a cross join [1314howe].[ten] b


________________________________________


SELECT row_number() over (order by a.n)
  FROM [1314howe].[ten] a 
  cross join [1314howe].[ten] b
  cross join [1314howe].[ten] c


________________________________________


select count(*) as cnt from (
SELECT row_number() over (order by a.n) as n
  FROM [1314howe].[ten] a 
  cross join [1314howe].[ten] b
  cross join [1314howe].[ten] c
  ) x


________________________________________


SELECT row_number() over (order by a.n) as n
  FROM [1314howe].[ten] a 
  cross join [1314howe].[ten] b
  cross join [1314howe].[ten] c




________________________________________


SELECT dateadd(year, i.n, '1/1/2014')
  FROM [1314howe].[thousand] i


________________________________________


SELECT dateadd(year, i.n, '1/1/2014')
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5


________________________________________


SELECT dateadd(year, i.n, '1/1/2014'), dateadd(year, i.n, '12/31/2014')
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5


________________________________________


SELECT dateadd(year, i.n-1, '1/1/2014'), dateadd(year, i.n-1, '12/31/2014')
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5


________________________________________


SELECT dateadd(year, i.n-1, '1/1/2014'), dateadd(year, i.n-1, '1/1/2015')
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5


________________________________________


SELECT *
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s <= period.s and period.s <= projection.e)
or
(projection.s <= period.e and period.e <= projection.e)
or
(projection.s <= period.s and period.e <= projection.e)
or
(period.s <= projection.s and projection.e <= period.e)


________________________________________


SELECT *,
case when projection.s <= period.s and period.e < projection.e 
     then amount*datediff(day, period.e, period.s)/datediff(day, projection.e, projection.s)
     when projection.s <= period.s and period.s < projection.e 
      and projection.e <= period.e
     then amount*datediff(day, projection.e, period.s)/datediff(day, projection.e, projection.s)
     when projection.s <= period.e and period.e < projection.e 
      and period.s <= projection.s
     then amount*datediff(day, period.e, projection.s)/datediff(day, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then amount   
end as amount
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s <= period.s and period.s <= projection.e)
or
(projection.s <= period.e and period.e <= projection.e)
or
(projection.s <= period.s and period.e <= projection.e)
or
(period.s <= projection.s and projection.e <= period.e)


________________________________________


SELECT *,
case when projection.s <= period.s and period.e < projection.e 
  then amount*cast(datediff(day, period.e, period.s) as float)/datediff(day, projection.e, projection.s)
     when projection.s <= period.s and period.s < projection.e 
      and projection.e <= period.e
     then amount*datediff(day, projection.e, period.s)/datediff(day, projection.e, projection.s)
     when projection.s <= period.e and period.e < projection.e 
      and period.s <= projection.s
     then amount*datediff(day, period.e, projection.s)/datediff(day, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then amount   
end as amount
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s <= period.s and period.s < projection.e)
or
(projection.s <= period.e and period.e < projection.e)
or
(projection.s <= period.s and period.e < projection.e)
or
(period.s <= projection.s and projection.e < period.e)


________________________________________


SELECT *,
case when projection.s <= period.s and period.e < projection.e 
  then amount*cast(datediff(day, period.e, period.s) as float)/datediff(day, projection.e, projection.s)
     when projection.s <= period.s and period.s < projection.e 
      and projection.e <= period.e
     then amount*datediff(day, projection.e, period.s)/datediff(day, projection.e, projection.s)
     when projection.s <= period.e and period.e < projection.e 
      and period.s <= projection.s
     then amount*datediff(day, period.e, projection.s)/datediff(day, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then amount   
end as amount
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s <= period.s and period.s < projection.e)
or
(projection.s < period.e and period.e < projection.e)
or
(projection.s <= period.s and period.e < projection.e)
or
(period.s <= projection.s and projection.e < period.e)


________________________________________


SELECT *,
case when projection.s <= period.s and period.e < projection.e 
     then datediff(day, period.e, period.s)/datediff(day, projection.e, projection.s)
     when projection.s <= period.s and period.s < projection.e 
      and projection.e <= period.e
     then datediff(day, projection.e, period.s)/datediff(day, projection.e, projection.s)
     when projection.s <= period.e and period.e < projection.e 
      and period.s <= projection.s
     then datediff(day, period.e, projection.s)/datediff(day, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s < projection.e)
or
(projection.s < period.e and period.e < projection.e)
or
(projection.s <= period.s and period.e < projection.e)
or
(period.s <= projection.s and projection.e < period.e)


________________________________________


SELECT *,
case when projection.s <= period.s and period.e < projection.e 
    then cast(datediff(day, period.e, period.s) as float)/datediff(day, projection.e, projection.s)
     when projection.s <= period.s and period.s < projection.e 
      and projection.e <= period.e
     then cast(datediff(day, projection.e, period.s) as float)/datediff(day, projection.e, projection.s)
     when projection.s <= period.e and period.e < projection.e 
      and period.s <= projection.s
     then cast(datediff(day, period.e, projection.s) as float)/datediff(day, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s < projection.e)
or
(projection.s < period.e and period.e < projection.e)
or
(projection.s <= period.s and period.e < projection.e)
or
(period.s <= projection.s and projection.e < period.e)


________________________________________


SELECT *,
case when projection.s <= period.s and period.e < projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and period.s < projection.e 
      and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e < projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s < projection.e)
or
(projection.s < period.e and period.e < projection.e)
or
(projection.s <= period.s and period.e < projection.e)
or
(period.s <= projection.s and projection.e < period.e)


________________________________________


SELECT *, datediff(minute, period.e, period.s),
case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s <= period.s and period.s <= projection.e)
or
(projection.s <= period.e and period.e <= projection.e)
or
(projection.s <= period.s and period.e <= projection.e)
or
(period.s <= projection.s and projection.e <= period.e)


________________________________________


SELECT *, cast(datediff(minute, period.e, period.s) as float)
        , datediff(minute, period.e, period.s),
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s <= period.s and period.s <= projection.e)
or
(projection.s <= period.e and period.e <= projection.e)
or
(projection.s <= period.s and period.e <= projection.e)
or
(period.s <= projection.s and projection.e <= period.e)


________________________________________


SELECT *, cast(datediff(minute, period.e, period.s) as float)
        , datediff(minute, period.e, period.s),
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT *, cast(datediff(minute, period.e, period.s) as float)
        , datediff(minute, period.e, period.s)
        , cast(datediff(minute, projection.e, period.s) as float)
        , cast(datediff(minute, period.e, projection.s) as float)
        ,
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT *, cast(datediff(minute, period.e, period.s) as float)
        , datediff(minute, period.e, period.s)
        , cast(datediff(minute, projection.e, period.s) as float)
        , cast(datediff(minute, period.e, projection.s) as float)
        , datediff(minute, projection.e, projection.s)
        , 
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT *, 
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT period.s as fiscal_year_start, period.e as fiscal_year_end, budget, category,
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________



SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]


________________________________________


SELECT period.s as fiscal_year_start, period.e as fiscal_year_end, budget, category,
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT period.s as fiscal_year_start, period.e as fiscal_year_end, budget, category,
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
  , projection.s
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT period.s as fiscal_year_start, period.e as fiscal_year_end, budget, category,
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end as proportion
  , projection.s, projection.e
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT period.s as fiscal_year_start, period.e as fiscal_year_end, budget, category,
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end*amount as amount
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT period.s as fiscal_year_start, period.e as fiscal_year_end, budget, category,
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end*amount as amount, amount as original_amount
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT period.s as fiscal_year_start, period.e as fiscal_year_end, budget, category,
  case when projection.s <= period.s and period.e <= projection.e 
    then cast(datediff(minute, period.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.s and projection.e <= period.e
     then cast(datediff(minute, projection.e, period.s) as float)/datediff(minute, projection.e, projection.s)
     when projection.s <= period.e and period.e <= projection.e 
      and period.s <= projection.s
     then cast(datediff(minute, period.e, projection.s) as float)/datediff(minute, projection.e, projection.s)   
     when period.s <= projection.s and projection.e <= period.e
     then 1.0
end*amount as amount
FROM (
SELECT dateadd(year, i.n-1, '1/1/2014') as s, dateadd(year, i.n-1, '1/1/2015') as e
  FROM [1314howe].[thousand] i
 WHERE i.n <= 5
 ) period, (
SELECT budget, Fiscal_year_start as s, Fiscal_year_end as e, category, amount
  FROM [1314howe].[projections_year_category.csv]
) projection
WHERE 
(projection.s < period.s and period.s <= projection.e)
or
(projection.s < period.e and period.e <= projection.e)
or
(projection.s < period.s and period.e <= projection.e)
or
(period.s < projection.s and projection.e <= period.e)


________________________________________


SELECT sum(amount) 
  FROM [1314howe].[eScience_spend_11_2015]
 WHERE category = 'Postdoc'


________________________________________


SELECT sum(BAR_amt) 
  FROM [1314howe].[ALL_Operations_Details.csv]
 WHERE category_label = 'Salaries' or category_label = 'Benefits'
   AND Description like '%ost-doc%'


________________________________________


SELECT * --sum(BAR_amt) 
  FROM [1314howe].[ALL_Operations_Details.csv]
 WHERE category_label = 'Salaries' 
  -- or category_label = 'Benefits'
  AND Description like '%ost-doc%'


________________________________________


SELECT * --sum(BAR_amt) 
  FROM [1314howe].[ALL_Operations_Details.csv]
 WHERE category_label = 'Salaries' 
  -- or category_label = 'Benefits'
  AND Description like 'Total Post-docs'


________________________________________


SELECT sum(BAR_amt) 
  FROM [1314howe].[ALL_Operations_Details.csv]
 WHERE category_label = 'Salaries' 
  -- or category_label = 'Benefits'
  AND Description like 'Total Post-docs'


________________________________________


SELECT sum(BAR_amt) 
  FROM [1314howe].[ALL_Operations_Details.csv]
 WHERE (category_label = 'Salaries' 
   or category_label = 'Benefits')
  AND Description like 'Total Post-docs'


________________________________________


SELECT sum(BAR_amt) 
  FROM [1314howe].[ALL_Operations_Details.csv]
 WHERE (category_label = 'Salaries' 
   or category_label = 'Benefits')
  AND Description like '%ost-docs%'


________________________________________


SELECT sum(BAR_amt) 
  FROM [1314howe].[ALL_Operations_Details.csv]
 WHERE --(category_label = 'Salaries' 
  -- or 
  (category_label = 'Benefits')
  AND 
  Description like '%ost-docs%'


________________________________________


SELECT sum(BAR_amt) 
  FROM [1314howe].[ALL_Operations_Details.csv]
 WHERE category_label = 'Salaries' 
  -- or 
  --(category_label = 'Benefits')
  AND 
  Description like '%ost-docs%'


________________________________________


SELECT * FROM [826].[thaps.txt] thapschr,
 [826].[table_possel_bonf809_ids.txt] bonf809
  WHERE thapschr.name = bonf809.Column1



________________________________________


SELECT * FROM [826].[take 1] take1
  where take1.version = 'extended'


________________________________________


SELECT * FROM [826].[take 1] take1
  where take1.version = 'extended' order by take1.name1 ASC


________________________________________


SELECT * FROM [826].[take 1] take1
  where take1.version = 'extended' 
  order by 1,4


________________________________________


SELECT * FROM [826].[take 1] take1
  where take1.version = 'extended' 
  order by 11,4


________________________________________


SELECT * FROM [826].[thaps.txt] thapschr,
 [826].[table_possel_qval1784_ids.txt] bonf1784
  WHERE thapschr.name = bonf1784.Column1



________________________________________


SELECT * FROM [826].[PositivsBonf1784Chr] bonf1784
  where bonf1784.version = 'extended' 
  order by 11,4


________________________________________


SELECT * FROM [826].[thaps.txt] thapschr,
 [826].[table_possel_qval1784_ids.txt] pos1784
  WHERE thapschr.name = pos1784.Column1


________________________________________


SELECT * FROM [826].[Pos1784] pos1784
  where pos1784.version = 'extended' 
  order by 11,4


________________________________________


SELECT * FROM [826].[take 1] take1
  where take1.version = 'extended' 
  order by 11,4


________________________________________


SELECT * FROM [826].[1012SigDE] SigDE1012,
  [826].[table_thaps.txt] Location
  where SigDE1012.ProteinIds = Location.protein_id


________________________________________


SELECT * FROM [826].[1012SigDE] SigDE1012,
  [826].[table_thaps.txt] Location 
  where SigDE1012.ProteinIds = Location.protein_id


________________________________________


SELECT distinct ProteinIds FROM [826].[SigDE1012ChrPos]


________________________________________


SELECT distinct 1-12, 19, 21-24, 30 FROM [826].[SigDE1012ChrPos]


________________________________________


SELECT distinct ProteinIds, logConc, logFC FROM [826].[SigDE1012ChrPos]


________________________________________


SELECT distinct ProteinIds, logConc
  FROM [826].[SigDE1012ChrPos]


________________________________________


SELECT distinct ProteinIds, logConc, logFC
  FROM [826].[SigDE1012ChrPos]


________________________________________


SELECT distinct ProteinIds, logConc, logFC, fdr
  FROM [826].[SigDE1012ChrPos]


________________________________________


SELECT distinct ProteinIds, logConc, logFC, fdr, start_pos
  FROM [826].[SigDE1012ChrPos]


________________________________________


SELECT distinct ProteinIds, logConc, logFC, fdr, start_pos, end_pos, name1
  FROM [826].[SigDE1012ChrPos]


________________________________________


SELECT * FROM [826].[TwoChrPosSNPOpp.txt]
  twochr, 
  [826].[table_thaps_bestblast_kegg_annotations.txt]
  keggannot
  where keggannot.query_seq = twochr.protein_ids
  


________________________________________


SELECT * FROM [826].[table_TEs in PapaGOplusFe.txt] plusFe,
 [826].[table_TEs in PapaGO control.txt] control 
  where plusFe.Column7 = control.Column7



________________________________________


SELECT DISTINCT Column7 FROM [826].[TEs in PapaGOplusFe and PapaGOcontrol.txt]


________________________________________


SELECT * FROM [1352].[GO_Slims]
  where def LIKE '%xidative%'



________________________________________


SELECT * FROM [1352].[GO_Slims]
  where def LIKE '%stress%'



________________________________________


SELECT * FROM [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy,
 [826].[table_Phatr2.FilteredModels2_aa.interproscan4.8.tab] phatr
 where fracy.InterproEntry = phatr.InterproEntry 


________________________________________


SELECT * FROM [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy,
 [826].[table_Phatr2.FilteredModels2_aa.interproscan4.8.tab] phatr
 where fracy.InterproEntry != phatr.InterproEntry 


________________________________________


SELECT * FROM 
  [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy,
  [826].[table_Phatr2.FilteredModels2_aa.interproscan4.8.tab] phatr
  where fracy.InterproEntry != phatr.InterproEntry
 


________________________________________


SELECT * FROM 
  [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy,
  [826].[table_Phatr2.FilteredModels2_aa.interproscan4.8.tab] phatr
  where fracy.InterproEntry != phatr.InterproEntry
  
 


________________________________________


SELECT * FROM 
  [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy,
  [826].[table_Phatr2.FilteredModels2_aa.interproscan4.8.tab] phatr
  where fracy.InterproEntry != phatr.InterproEntry
  
 


________________________________________


SELECT * FROM 
  [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy,
  [826].[Phatr2.FilteredModels2_aa.interproscan4.8.tab] phatr
  where fracy.InterproEntry != phatr.InterproEntry
  
 


________________________________________


SELECT InterproEntry FROM 
  [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt]
  minus
  select InterproEntry from [826].[Phatr2.FilteredModels2_aa.interproscan4.8.tab]
 
  
 


________________________________________


SELECT fracy.InterproEntry, phatr.InterproEntry FROM [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy,
  [826].[table_Phatr2.FilteredModels2_aa.interproscan4.8.tab] phatr
  where fracy.InterproEntry != phatr.InterproEntry
    


________________________________________


SELECT distinct fracy.InterproEntry FROM [826].[table_Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy


________________________________________


SELECT distinct phatr.InterproEntry FROM [826].[table_Phatr2.FilteredModels2_aa.interproscan4.8.tab] phatr


________________________________________


SELECT distinct thaps.InterproEntry FROM [826].[table_Thaps3_geneModels_FilteredModels2_aa.INTERPRO-20110228.tab] thaps
  order by InterproEntry


________________________________________


SELECT distinct fracy.InterproEntry FROM [826].[table_Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy
  order by InterproEntry



________________________________________


SELECT distinct phatr.InterproEntry FROM [826].[table_Phatr2.FilteredModels2_aa.interproscan4.8.tab] phatr
  order by InterproEntry


________________________________________


SELECT fracy.InterproEntry, count(*) FROM [826].[table_Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy
  group by InterproEntry



________________________________________


SELECT fracy.InterproEntry, count(*) FROM [826].[table_Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy
  group by InterproEntry
  order by InterproEntry



________________________________________


SELECT fracy.InterproEntry, count(*) FROM [826].[table_Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy
  group by InterproEntry

  



________________________________________


SELECT * FROM [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy
  where fracy.InterproEntry not in (select InterproEntry from [826].[table_Phatr2.FilteredModels2_aa.interproscan4.8.tab])


________________________________________


SELECT * FROM [826].[InterproIdsFracyNOTPhatr] fcNOTpt
  where fcNOTpt.InterproEntry not in (select InterproEntry from [826].[table_Thaps3_geneModels_FilteredModels2_aa.INTERPRO-20110228.tab])


________________________________________


SELECT distinct InterproEntry FROM [826].[InterproIdsFracyNOTPtorTP]


________________________________________


SELECT distinct InterproEntry, InterPro_desc FROM [826].[InterproIdsFracyNOTPtorTP]


________________________________________


SELECT distinct * FROM [826].[AllOxInterProIds.tab.txt]


________________________________________


SELECT distinct * FROM [826].[AllOxInterProIds.tab.txt]
  order by InterproId_Ox


________________________________________


SELECT * FROM [826].[AllUniqueOxInterproIds] oxinter
  where exists (select InterproEntry from [826].[UniqueInterproIdsFracyNOTPtorTp] interfracy
    where interfracy.InterproEntry = oxinter.InterproId_Ox)



________________________________________


SELECT * FROM [826].[DistinctInterproIdsFracy]
  order by column2


________________________________________


SELECT * FROM [826].[DistinctInterproIdsFracy]
  order by column2 DESC


________________________________________


 SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc
  FROM [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy

  
  



________________________________________


SELECT * FROM [826].[FracyInterProScan]
  where InterproEntry != NULL


________________________________________


SELECT * FROM [826].[FracyInterProScan]
  where InterproEntry IS not NULL


________________________________________


SELECT * FROM [826].[FracyInterProScan]
  where InterproEntry != 'NULL'


________________________________________


SELECT UniqueProteinId, InterproEntry, count(*) 
  FROM [826].[FracyInterProScan_noNULL]
  GROUP BY UniqueProteinId, InterproEntry



________________________________________


SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc, count(*) 
  FROM [826].[FracyInterProScan_noNULL]
  GROUP BY GeneModel, UniqueProteinId, InterproEntry, InterPro_desc



________________________________________


SELECT InterproEntry, count(*) InterproIdHits 
  FROM [826].[UniqueInterProIds_ForAllFracyProteins]
  group by InterproEntry


________________________________________


SELECT InterproEntry, count(*) InterproIdHits 
  FROM [826].[UniqueInterProIds_ForAllFracyProteins]
  group by InterproEntry
  order by InterproEntry DESC



________________________________________


SELECT InterproEntry, count(*) InterproIdHits 
  FROM [826].[UniqueInterProIds_ForAllFracyProteins]
  group by InterproEntry
  order by InterproIdHits DESC



________________________________________


SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc
FROM [826].[Thaps3_geneModels_FilteredModels2_aa.INTERPRO-20110228.tab]


________________________________________


SELECT * FROM [826].[ThapsInterPro_shortform]
  where InterproEntry != 'NULL'


________________________________________


SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc, count(*)
  FROM [826].[ThapsInterpro_NoNull]
  GROUP BY GeneModel, UniqueProteinId, InterproEntry, InterPro_desc


________________________________________


SELECT InterproEntry, count(*) InterproIdHits
  FROM [826].[UniqueInterproIds_Thaps]
  group by InterproEntry
  order by InterproIdHits DESC


________________________________________


SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc
  FROM [826].[Phatr2.FilteredModels2_aa.interproscan4.8.tab]
 


________________________________________


SELECT * FROM [826].[Phatr_InterproIds_short_form]
  where InterproEntry != 'NULL'


________________________________________


SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc, count(*)
  FROM [826].[PhatrInterpro_NoNull]
  GROUP BY GeneModel, UniqueProteinId, InterproEntry, InterPro_desc


________________________________________


SELECT InterproEntry, count(*) InterproIdHits
  FROM [826].[UniqueInterproIds_Phatr]
  group by InterproEntry
  order by InterproIdHits DESC


________________________________________


SELECT * FROM [826].[AllUniqueOxInterproIds] oxinter
  where exists (select InterproEntry from [826].[FracyInterproIdHitCount] interfracy
    where interfracy.InterproEntry = oxinter.InterproId_Ox)


________________________________________


SELECT * FROM [826].[FracyInterproIdHitCount] interfracy
  where exists (select InterproEntry from [826].[AllUniqueOxInterproIds] oxinter
    where interfracy.InterproEntry = oxinter.InterproId_Ox)


________________________________________


SELECT * FROM [826].[FracyInterproIdHitCount] interfracy
  where exists (select InterproEntry from [826].[AllUniqueOxInterproIds] oxinter
    where interfracy.InterproEntry = oxinter.InterproId_Ox)
  order by InterproIdHits DESC



________________________________________


SELECT * FROM [826].[FracyInterproIdHitCount] interfracy
  where exists (select InterproId_Ox from [826].[AllUniqueOxInterproIds] oxinter
    where interfracy.InterproEntry = oxinter.InterproId_Ox)
  order by InterproIdHits DESC



________________________________________


SELECT * FROM [826].[PhatrInterproIdsHitCounts] interphatr
  where exists (select InterproId_Ox from [826].[AllUniqueOxInterproIds] oxinter
    where interphatr.InterproEntry = oxinter.InterproId_Ox)
  order by InterproIdHits DESC


________________________________________


SELECT * FROM [826].[ThapsInterproIdHitCount] interthaps
  where exists (select InterproId_Ox from [826].[AllUniqueOxInterproIds] oxinter
    where interthaps.InterproEntry = oxinter.InterproId_Ox)
  order by InterproIdHits DESC



________________________________________


SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[ThapsInterproHitCount_Ox] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry


________________________________________


SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[ThapsInterproHitCount_Ox] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC


________________________________________


SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[PhatrInterproIdsHitCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC


________________________________________


SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[FracyInterproIdHitCount] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC


________________________________________


SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[FracyInterproIdHitCount] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC


________________________________________


SELECT * FROM [826].[ParalogTest.txt] para
  JOIN [826].[table_thaps.txt]
      ON Column2 = name
 



________________________________________


SELECT distinct name, protein_id, start_pos, end_pos, label_2
  FROM [826].[Paralog_chr] 
  


________________________________________


 SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc, evalue
  FROM [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy

  
  



________________________________________


 SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc, evalue
  FROM [826].[Fracy1_GeneModels_FilteredModels2_aa.interproscan4.8.tab.txt] fracy

  
  



________________________________________


SELECT * FROM [826].[FracyInterProScan] 
  where InterproEntry != 'NULL'



________________________________________


SELECT * FROM [826].[FracyInterProScan_noNulls] 
  where evalue != 'NA'



________________________________________


SELECT UniqueProteinId, MIN(evalue) best_evalue
  FROM [826].[FracyInterProScan_noNull_noNA]
  group by UniqueProteinId
 



________________________________________


SELECT * FROM [826].[Best_evalues_Fracy] best 
  where exists (select GeneModel, InterproEntry, InterPro_desc from [826].[FracyInterProScan_noNulls] fracy
    where best.UniqueProteinId = fracy.UniqueProteinId)




________________________________________


SELECT * FROM [826].[Best_evalues_Fracy] best 
  where exists (select GeneModel, InterproEntry, InterPro_desc from [826].[FracyInterProScan_noNulls] fracy
    where fracy.UniqueProteinId = best.UniqueProteinId)



________________________________________


SELECT * FROM [826].[Best_evalues_Fracy] best 
  where exists (select GeneModel, InterproEntry, InterPro_desc from [826].[FracyInterProScan_noNull_noNA] fracy
    where fracy.UniqueProteinId = best.UniqueProteinId)


________________________________________


select * from [826].[FracyInterProScan_noNull_noNA]
where exists (SELECT UniqueProteinId, MIN(evalue) best_evalue
  FROM [826].[FracyInterProScan_noNull_noNA]
  group by UniqueProteinId)
 



________________________________________


SELECT * FROM [826].[Best_evalues_Fracy] best
   where exists (select GeneModel, UniqueProteinId, InterproEntry, InterPro_desc from [826].[FracyInterProScan_noNull_noNA] fracy
    where best.UniqueProteinId = fracy.UniqueProteinId)




________________________________________


SELECT UniqueProteinId, MIN(evalue) best_evalue
  FROM [826].[FracyInterProScan_noNull_noNA] fracy
  group by UniqueProteinId
  select GeneModel from fracy
 



________________________________________


Select * from [826].[FracyInterProScan_noNull_noNA]
  where exists (SELECT UniqueProteinId, MIN(evalue) best_evalue
  FROM [826].[FracyInterProScan_noNull_noNA]
    group by UniqueProteinId)

 



________________________________________


SELECT * FROM [826].[FracyInterProScan_noNull_noNA] fracy
  where exists (select InterproId_Ox from [826].[AllUniqueOxInterproIds] oxinter
    where fracy.InterproEntry = oxinter.InterproId_Ox)
  order by GeneModel




________________________________________


SELECT * FROM [826].[Ox_Fracy_noNULL_noNA] ox
  where exists (select UniqueProteinId from [826].[Best_evalues_Fracy] best
    where ox.UniqueProteinId = best.UniqueProteinId)
  order by GeneModel


________________________________________


SELECT * FROM [826].[Ox_Fracy_noNULL_noNA] ox
  where exists (select UniqueProteinId from [826].[Best_evalues_Fracy] best
    where ox.UniqueProteinId = best.UniqueProteinId)




________________________________________


SELECT * FROM [826].[Ox_Fracy_noNULL_noNA]
  order by evalue 



________________________________________


SELECT * FROM [826].[Ox_Fracy_noNULL_noNA]
  order by GeneModel, evalue 



________________________________________


SELECT * FROM [826].[Ox_Fracy_noNULL_noNA]
  order by GeneModel, evalue DESC



________________________________________


SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[BestevaluepermodelOxevaluegreat05.txt]
  group by InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[RealFracyBestEvalueOxHitCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc, evalue
FROM [826].[Thaps3_geneModels_FilteredModels2_aa.INTERPRO-20110228.tab]


________________________________________


SELECT * FROM [826].[ThapsInterPro_shortform]
  where InterproEntry != 'NULL'



________________________________________


SELECT * FROM [826].[ThapsInterPro_shortform]
   where InterproEntry != 'NULL'



________________________________________


SELECT * FROM [826].[ThapsInterPro_shortform]
   where InterproEntry != 'NULL'



________________________________________


SELECT * FROM [826].[ThapsInterpro_noNulls]
   where evalue != 'NA'



________________________________________


SELECT UniqueProteinId, MIN(evalue) best_evalue
  FROM [826].[ThapsInter_noNull_noNA]
  group by UniqueProteinId



________________________________________


SELECT * FROM [826].[ThapsInter_noNull_noNA] thaps
  where exists (select InterproId_Ox from [826].[AllUniqueOxInterproIds] oxinter
    where thaps.InterproEntry = oxinter.InterproId_Ox)
  order by GeneModel




________________________________________


SELECT InterproEntry, count(*) InterproIdHits FROM [826].[BestevaluepermodelOxevaluegreat05Tp.txt]
  group by InterproEntry
  order by InterproIdHits DESC


________________________________________


SELECT InterproEntry, count(*) InterproIdHits
  FROM [826].[BestevaluepermodelOxevaluegreat05Tp.txt]
  group by InterproEntry
  order by InterproIdHits DESC




________________________________________


 SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[RealThapsBestEvalueOxHitCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


SELECT GeneModel, UniqueProteinId, InterproEntry, InterPro_desc, evalue
  FROM [826].[Phatr2.FilteredModels2_aa.interproscan4.8.tab]
 


________________________________________


SELECT * FROM [826].[Phatr_InterproIds_short_form]
  where InterproEntry != 'NULL'


________________________________________


SELECT * FROM [826].[PhatrInterpro_noNulls]
     where evalue != 'NA'



________________________________________


SELECT * FROM [826].[PhatrInterPro_noNull_noNA] phatr
   where exists (select InterproId_Ox from [826].[AllUniqueOxInterproIds] oxinter
    where phatr.InterproEntry = oxinter.InterproId_Ox)
  order by GeneModel


________________________________________


SELECT InterproEntry, count(*) InterproIdHits FROM [826].[BestevaluepermodelOxevaluegreat05Pt.txt]
   group by InterproEntry
  order by InterproIdHits DESC


________________________________________


 SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[RealPhatrBestevalueInterProOxHits]
 JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
    FROM [826].[RealPhatrBestevalueInterProOxHits]
   JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC


________________________________________


SELECT * FROM [826].[HGT_TpPt.vs.Pseudo-nitzschia_multiseries.main_genome.scaffolds_na.tab] Pnm
SELECT * FROM  [826].[HGT_TpPt.vs.Fragilariopsis_cylindrus.main_genome.scaffolds_na.tab] Fracy
  inner join query_id
  on Pnm.query_id = Fracy.query_id


________________________________________


SELECT * FROM [826].[HGT_TpPt.vs.Pseudo-nitzschia_multiseries.main_genome.scaffolds_na.tab] Pnm
SELECT * FROM  [826].[HGT_TpPt.vs.Fragilariopsis_cylindrus.main_genome.scaffolds_na.tab] Fracy
  inner join Pmquery_id
  on Pnm.Pmquery_id = Fracy.Fcquery_id


________________________________________


SELECT * FROM [826].[HGT_TpPt.vs.Pseudo-nitzschia_multiseries.main_genome.scaffolds_na.tab] Pnm
inner join  [826].[HGT_TpPt.vs.Fragilariopsis_cylindrus.main_genome.scaffolds_na.tab] Fracy
  on Pnm.Pmquery_id = Fracy.Fcquery_id


________________________________________


SELECT distinct Pmquery_id FROM [826].[HGT_Pm_hits_minus10cutoff.txt]


________________________________________


SELECT distinct Pmquery_id, Pmquery_length, Pmhit_id 
  FROM [826].[HGT_Pm_hits_minus10cutoff.txt]


________________________________________


SELECT distinct Fcquery_id, Fcquery_length, Fchit_id 
  FROM [826].[HGT_Fc_hits_minus10cutoff.txt]
  



________________________________________


SELECT * FROM [826].[UniqueHGT_hits_to_Fc_minus10] Fracy, 
  [826].[UniqueHGT_hits_to_Pm_minus10] Pnm
where Fracy.Fcquery_id = Pnm.Pmquery_id


________________________________________


SELECT * FROM [826].[Fe-Cont.tab.txt] Fe,
  [826].[table_PN_multiseries_ESTs_clust.vs.KEGGnr.tab.txt] annotate
  where Fe.Transcript_id = annotate.query_id


________________________________________


SELECT * FROM [826].[P-Cont.tab.txt] P,
  [826].[table_PN_multiseries_ESTs_clust.vs.KEGGnr.tab.txt] annotate
  where P.Transcript_id = annotate.query_id


________________________________________


SELECT * FROM [826].[Urea-Cont.tab.txt] urea,
  [826].[table_PN_multiseries_ESTs_clust.vs.KEGGnr.tab.txt] annotate
  where urea.Transcript_id = annotate.query_id


________________________________________


SELECT * FROM [826].[Si-Cont.tab.txt] Si,
  [826].[table_PN_multiseries_ESTs_clust.vs.KEGGnr.tab.txt] annotate
  where Si.Transcript_id = annotate.query_id


________________________________________


SELECT * FROM [826].[Si-ControlDEgenesPmCLN47] Si,
  [826].[table_PN_multiseries_ESTs_clust.vs.AllMEs.tab.txt] ME
  where Si.Transcript_id = ME.query_id


________________________________________


SELECT * FROM [826].[Si-ControlDEgenesPmCLN47] Si,
  [826].[table_PN_multiseries_ESTs_clust.vs.AllMEs.tab.txt] ME
  where Si.Transcript_id = ME.query_id


________________________________________


SELECT * FROM [826].[Si-ControlDEgenesPmCLN47] Si,
  [826].[table_PN_multiseries_ESTs_clust.vs.AllMEs.tab.txt] ME
  where Si.Transcript_id = ME.query_id


________________________________________


SELECT * FROM [826].[Si-ControlDEgenesPmCLN47] Si,
  [826].[table_PN_multiseries_ESTs_clust.vs.AllMEs.tab.txt] ME
  where Si.Transcript_id = ME.query_id


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.FracyJGImdp.tab.txt] EST,
  [826].[table_Fracy1_ecpathwayinfo_FilteredModels1.tab] annotate
  where EST.hit_id = annotate.proteinId
  


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Fracy1FM2.tab.txt] EST,
  [826].[table_Fracy1_ecpathwayinfo_FilteredModels2.tab] annotate
  where EST.hit_id = annotate.proteinId


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly05pvaluecutoff.txt] urea
  inner join [826].[table_PmSistarveSigDEonly05pvaluecutoff.txt] Si
  on urea.Urea_TranscriptID = Si.Si_TranscriptID
  where Si.Si_logFC > 1
  and urea.Urea_logFC > 1;


________________________________________


SELECT * FROM [826].[PmUrea_Si_incommon_DEup] UreaSi
  inner join [826].[PmPstarveSigDEonly05pvaluecutoff.txt] P
  on UreaSi.Si_TranscriptID = P.P_TranscriptID
  where P.P_logFC > 1;


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_allSigDEup] USP
  inner join [826].[table_PmFelimSigDEonly05pvaluecutoff.txt] Fe
  on USP.Si_TranscriptID = Fe.Fe_TranscriptID
  where Fe.Fe_logFC > 1;


________________________________________


SELECT * FROM [826].[PmESTs_annotated_by_FracyFilteredModels2_pathway_annotations] annotate
  inner join [826].[Pm_ALL_SigDE_up] DE
  on annotate.query_id = DE.Urea_TranscriptID


________________________________________


SELECT * FROM [826].[Pm_ALL_SigDE_up] DE
  left join [826].[PmESTs_annotated_by_FracyFilteredModels2_pathway_annotations] annotate
  on DE.Urea_TranscriptID = annotate.query_id


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_allSigDEup] DE
  left join [826].[PmESTs_annotated_by_FracyFilteredModels2_pathway_annotations] annotate
  on DE.Urea_TranscriptID = annotate.query_id


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_allSigDEup] DE
   left join [826].[PmESTs_annotated_by_FracyFilteredModels2_pathway_annotations] annotate
  on DE.Urea_TranscriptID = annotate.query_id


________________________________________


SELECT * FROM [826].[Pm_ALL_SigDE_up_Annotated_w_Fracy] DE
  left join [826].[table_PN_multiseries_ESTs_clust.vs.KEGGnr.tab.txt] nr
  on DE.Urea_TranscriptID = nr.query_id;



________________________________________


SELECT * FROM [826].[Pm_ALL_SigDE_up_Annotated_w_Fracy] DE
  left join [826].[table_PN_multiseries_ESTs_clust.vs.KEGGnr.tab.txt] nr
  on DE.Urea_TranscriptID = nr.query_id;



________________________________________


SELECT * FROM [826].[in_Pn_ESTs_not_in_other_diatoms_OR_deli_WC] DA
  left join [826].[table_recipBBaus_mulseri_WC.csv] ID
  on DA.Column1 = ID.Paus_TranscriptId


________________________________________


SELECT Pmulti_TranscriptId FROM [826].[Pm_ESTs_in_recipBB_search_DA_only_libraries] DA
  left join [826].[Pm_ALL_SigDE_up_Annotated_w_Fracy_KEGGnr] DE
  on DA.Pmulti_TranscriptId = DE.Urea_TranscriptID;


________________________________________


SELECT * FROM  [826].[Pm_ALL_SigDE_up_Annotated_w_Fracy_KEGGnr] DE
  right join [826].[Pm_ESTs_in_recipBB_search_DA_only_libraries] DA
  on DA.Pmulti_TranscriptId = DE.Urea_TranscriptID;


________________________________________


SELECT * FROM [826].[Pm_ALL_SigDE_up_Annotated_w_Fracy_KEGGnr_WC.tab.txt] DE
  right join [826].[Pm_ESTs_in_recipBB_search_DA_only_libraries] DA
  on DE.TranscriptID = DA.Pmulti_TranscriptId
  
  


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_allSigDEup] DE
  right join [826].[Pm_ESTs_in_recipBB_search_DA_only_libraries] DA
  on DE.Urea_TranscriptID = DA.Pmulti_TranscriptId


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly05pvaluecutoff.txt] urea
  inner join [826].[table_PmSistarveSigDEonly05pvaluecutoff.txt] Si
  on urea.Urea_TranscriptID = Si.Si_TranscriptID
  where Si.Si_logFC < 1
  and urea.Urea_logFC < 1;


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly05pvaluecutoff.txt] urea
  inner join [826].[table_PmSistarveSigDEonly05pvaluecutoff.txt] Si
  on urea.Urea_TranscriptID = Si.Si_TranscriptID
  where Si.Si_logFC < -1
  and urea.Urea_logFC < -1;


________________________________________


SELECT * FROM [826].[PmUrea_Si_incommon_DEdown] UreaSi
  inner join [826].[PmPstarveSigDEonly05pvaluecutoff.txt] P
  on UreaSi.Si_TranscriptID = P.P_TranscriptID
  where P.P_logFC < -1;


________________________________________


SELECT * FROM [826].[PmUrea_Si_incommon_DEdown] UreaSi
  inner join [826].[PmPstarveSigDEonly05pvaluecutoff.txt] P
  on UreaSi.Si_TranscriptID = P.P_TranscriptID
  where P.P_logFC < -1;


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_allSigDEdown] USP
  inner join [826].[table_PmFelimSigDEonly05pvaluecutoff.txt] Fe
  on USP.Si_TranscriptID = Fe.Fe_TranscriptID
  where Fe.Fe_logFC < -1;


________________________________________


SELECT * FROM [826].[Pm_ALL_SigDE_down] DE
  left join [826].[PmESTs_annotated_by_FracyFilteredModels2_pathway_annotations] annotate
  on DE.Urea_TranscriptID = annotate.query_id



________________________________________


SELECT * FROM [826].[Pm_ALL_SigDE_down] DE
    right join [826].[Pm_ESTs_in_recipBB_search_DA_only_libraries] DA
  on DE.Urea_TranscriptID = DA.Pmulti_TranscriptId


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_SigDEup_annotated_w_Fracy] DE
  left join [826].[PmESTs_annotated_by_FracyFilteredModels2_pathway_annotations] annotate
  on DE.Urea_TranscriptID = annotate.query_id


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_SigDEup_annotated_w_Fracy] DE
  left join [826].[PN_multiseries_ESTs_clust.vs.KEGGnr.tab.txt] annotate
  on DE.Urea_TranscriptID = annotate.query_id


________________________________________


SELECT * FROM [826].[PmultiPausHits.txt] aus
  left join [826].[Pm_UreaSiP_SigDEup_annotated_w_FracyKEGGnr] DE
  on aus.Pmultiseries_query_id = DE.Urea_TranscriptID


________________________________________


SELECT GeneModel, MIN(evalue) best_evalue
  FROM [826].[ThapsInter_noNull_noNA]
  group by GeneModel


________________________________________


SELECT GeneModel, MIN(evalue) best_evalue
  FROM [826].[ThapsInter_noNull_noNA]
  group by GeneModel


________________________________________


SELECT GeneModel, InterproEntry, InterPro_desc, evalue, MIN(evalue) best_evalue
  FROM [826].[ThapsInter_noNull_noNA]
  group by GeneModel, InterproEntry, InterPro_desc, evalue


________________________________________


SELECT GeneModel, InterproEntry, InterPro_desc, MIN(evalue) best_evalue
  FROM [826].[ThapsInter_noNull_noNA]
  group by GeneModel, InterproEntry, InterPro_desc


________________________________________


SELECT GeneModel, MIN(evalue) best_evalue
  FROM [826].[ThapsInter_noNull_noNA]
  group by GeneModel


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Thaps_v3_models_ext_SHORTFORM.tab.txt] hits
  left join [826].[table_Thaps3_chromosomes_ecpathwayinfo_FilteredModels2.tab.txt] annotate
  on hits.hit_id = annotate.proteinId;
   


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Ehux1best_SHORTFORM.tab.txt] hits
  left join [826].[table_Emihu1_KEGG_SHORTFORM.tab.txt] annotate
  on hits.Ehux_protein_id = annotate.proteinId;


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Ehux1best_SHORTFORM.tab.txt] hits
  left join [826].[table_Emihu1_KEGG_SHORTFORM.tab.txt] annotate
  on hits.Ehux_protein_id = annotate.proteinId;


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Phatr_v2_FilteredModels2_SHORTFORM.tab.txt] hits
  left join [826].[table_Phatr2_chromosomes_ecpathwayinfo_FilteredModels2_SHORTFORM.tab.txt] annotate
  on hits.hit_id = annotate.proteinId;


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Phatr_v2_FilteredModels2_SHORTFORM.tab.txt] hits
  left join [826].[table_Phatr2_chromosomes_ecpathwayinfo_FilteredModels2_SHORTFORM.tab.txt] annotate
  on hits.hit_id = annotate.proteinId;


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Phatr_v2_FilteredModels2_SHORTFORM.tab.txt] hits
  left join [826].[table_Phatr2_chromosomes_ecpathwayinfo_FilteredModels2_SHORTFORM.tab.txt] annotate
  on hits.hit_id = annotate.proteinId;


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Fracy1FM2_SHORTFORM.tab.txt] hits
  left join [826].[table_Fracy1_ecpathwayinfo_FilteredModels2_SHORTFORM.tab.txt] annotate
  on hits.hit_id = annotate.proteinId;


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.EsiliProt_SHORTFORM.txt] hits
  left join [826].[table_Ectsi_gene_info_LATEST_SHORTFORM.txt] annotate
  on hits.hit_id = annotate.GeneID;


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Fracy1FM2_SHORTFORM.tab.txt]


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Fracy1FM2_SHORTFORM.tab.txt]


________________________________________


SELECT UniqueProteinId, InterproEntry, MIN(evalue) best_evalue
  FROM [826].[FracyInterProScan_noNull_noNA]
  group by UniqueProteinId, InterproEntry


________________________________________


SELECT UniqueProteinId, InterproEntry,InterPro_desc, MIN(evalue) best_evalue
  FROM [826].[FracyInterProScan_noNull_noNA]
  group by UniqueProteinId, InterproEntry, InterPro_desc


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Cyanidioschyzon_merolae_SHORTFORM.tab.txt] hits
  left join [826].[table_Cyanidio_annot_list_SHORTFORM.txt] annotate
  on hits.hit_id = annotate.entry;


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_allSigDEup_SHORTFORM.txt] de
  left join [826].[PnESTs_annotate_Cyame_annotations] annotate
  on de.TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_annotate_Cyame] de
  left join [826].[PnESTs_annotate_Ectsi_gene_info] annotate
  on de.TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[Pm_UreaSiP_annotate_Cyame_Ectsi] de
   left join [826].[PnESTs_annotate_Fracy_ecpathwayinfo] annotate
  on de.TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PmUreaSiP_annotate_Cyame_Ectsi_Fracy] de
 left join [826].[table_PnESTs_annotate_Thaps_ecpathwayinfo_shortformpostmerge.txt] annotate
  on de.TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PmUreaSiP_annotate_Cyame_Ectsi_Fracy_Thaps_clean.txt] de
  left join [826].[PnESTs_annotate_Phatr_ecpathwayinfo] annotate
  on de.TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PmUreaSiP_annotate_Cyame_Ectsi_Fracy_Thaps_Phatr] de
  left join [826].[PnESTs_annotate_Ehux_ecpathwayinfo] annotate
  on de.TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PN_multiseries_ESTs_clust.vs.Auran1FM3_SHORTFORM.tab.txt] hits
  left join [826].[Auran1_KEGG_SHORTFORM.tab.txt] annotate
  on hits.hit_id = annotate.proteinId;



________________________________________


SELECT * FROM [826].[PmUreaSiP_annotate_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux] de
  left join [826].[PnESTs_annotate_Auran_KEGG] annotate
  on de.TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly05pvaluecutoff.txt] de
  left join [826].[PnESTs_annotate_Cyame_annotations] annotate
  on de.Urea_TranscriptID = annotate.query_id


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly05pvaluecutoff.txt] de
  left join [826].[PnESTs_annotate_Cyame_annotations] annotate
  on de.Urea_TranscriptID = annotate.query_id


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly_Cyame] de
  left join [826].[PnESTs_annotate_Ectsi_gene_info] annotate
  on de.Urea_TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly_Cyame_Ectsi] de
  left join [826].[PnESTs_annotate_Fracy_ecpathwayinfo] annotate
  on de.Urea_TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly_Cyame_Ectsi_Fracy] de
  left join [826].[table_PnESTs_annotate_Thaps_ecpathwayinfo_shortformpostmerge.txt] annotate
  on de.Urea_TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps] de
   left join [826].[PnESTs_annotate_Phatr_ecpathwayinfo] annotate
  on de.Urea_TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr] de
  left join [826].[PnESTs_annotate_Ehux_ecpathwayinfo] annotate
  on de.Urea_TranscriptID = annotate.query_id;


________________________________________


SELECT * FROM [826].[PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux] de
  left join [826].[table_PN_multiseries_ESTs_clust.vs.AllMEs.tab.txt] annotate
  on de.Urea_TranscriptID = annotate.query_id;


________________________________________


SELECT distinct Urea_TranscriptID
  FROM [826].[PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux_AllMEs_CLEAN.txt]


________________________________________


SELECT distinct Urea_TranscriptID
  FROM [826].[PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux_AllMEs_CLEAN.txt]


________________________________________


SELECT * FROM [826].[Unique_Urea_DE_ids] ids
  left join [826].[table_PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux_AllMEs_CLEAN.txt] annotate
  on ids.Urea_TranscriptID = annotate.Urea_TranscriptID


________________________________________


SELECT * FROM [826].[Unique_Urea_DE_ids] ids
  inner join [826].[table_PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux_AllMEs_CLEAN.txt] annotate
  on ids.Urea_TranscriptID = annotate.Urea_TranscriptID


________________________________________


SELECT * FROM [826].[Unique_Urea_DE_ids] ids
  inner join [826].[table_PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux_AllMEs_CLEAN.txt] annotate
  on ids.Urea_TranscriptID = annotate.Urea_TranscriptID


________________________________________


SELECT * FROM [826].[Unique_Urea_DE_ids] ids,
  [826].[table_PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux_AllMEs_CLEAN.txt] annotate
where ids.Urea_TranscriptID = annotate.Urea_TranscriptID
 
  


________________________________________


SELECT * FROM [826].[Unique_Urea_DE_ids] ids,
  [826].[table_PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux_AllMEs_CLEAN.txt] annotate
where ids.Urea_TranscriptID = annotate.Urea_TranscriptID
 
  


________________________________________


SELECT * FROM [826].[Unique_Urea_DE_ids] ids,
  [826].[table_PmUreaSigDEonly_Cyame_Ectsi_Fracy_Thaps_Phatr_Ehux_AllMEs_CLEAN.txt] annotate
where ids.Urea_TranscriptID = annotate.Urea_TranscriptID
 
  


________________________________________


SELECT * FROM [826].[Psemu1_GeneCatalog_proteins_20111011_IPR.tab.txt] IPR
  left join [826].[table_Psemu1_pid_tid_lookup.tab.txt] id
  on IPR.proteinId = id.proteinId;


________________________________________


SELECT * FROM [826].[Psemu1_GeneCatalog_proteins_20111011_KEGG.tab.txt] KEGG
  left join [826].[table_Psemu1_pid_tid_lookup.tab.txt] id
  on KEGG.proteinId = id.proteinId;


________________________________________


SELECT * FROM [826].[Psemu1_GeneCatalog_proteins_20111011_GO.tab.txt] GO
  left join [826].[table_Psemu1_pid_tid_lookup.tab.txt] id
  on GO.proteinId = id.proteinId;


________________________________________


SELECT GO.*, KEGG.*  FROM [826].[Psemu1_GO_TranscriptIds_added.tab.txt] GO
  right outer join [826].[table_Psemu1_KEGG_TranscriptIds_added.tab.txt] KEGG
  on GO.transcriptId = KEGG.transcriptId;


________________________________________


SELECT GO.*, KEGG.*  FROM [826].[Psemu1_GO_TranscriptIds_added.tab.txt] GO
  left outer join [826].[table_Psemu1_KEGG_TranscriptIds_added.tab.txt] KEGG
  on GO.transcriptId = KEGG.transcriptId;


________________________________________


SELECT * FROM [826].[Urea_Control_8x_models.tab.txt] urea
  left join [826].[table_Psemu1_KEGG_TranscriptIds_added.tab.txt] kegg
  on urea.transcriptId = kegg.transcriptId;


________________________________________


SELECT distinct transcriptId, Urea_logConc, Urea_logFC,
  Urea_pvalue, proteinId, ecNum, definition, catalyticActivity,
  cofactors
  FROM [826].[Urea_8x_transcript_KEGG]


________________________________________


SELECT * FROM [826].[table_Si_Control_8x_models.tab.txt] Si
  left join [826].[table_Psemu1_KEGG_TranscriptIds_added.tab.txt] kegg
  on Si.transcriptId = kegg.transcriptId;


________________________________________


SELECT distinct transcriptId, Si_logConc, Si_logFC,
  Si_pvalue, proteinId, ecNum, definition, catalyticActivity,
  cofactors
FROM [826].[Si_8x_transcriptId_KEGG]


________________________________________


SELECT * FROM [826].[P_Control_8x_models.tab.txt] P
  left join [826].[table_Psemu1_KEGG_TranscriptIds_added.tab.txt] kegg
  on P.transcriptId = kegg.transcriptId;


________________________________________


SELECT distinct transcriptId, P_logConc, P_logFC,
  P_pvalue, proteinId, ecNum, definition, catalyticActivity,
  cofactors
FROM [826].[P_Control_8x_KEGG]


________________________________________


SELECT * FROM [826].[Fe_Control_8x_models.tab.txt] Fe
  left join [826].[table_Psemu1_KEGG_TranscriptIds_added.tab.txt] kegg
  on Fe.transcriptId = kegg.transcriptId;


________________________________________


SELECT distinct transcriptId, Fe_logConc, Fe_logFC,
  Fe_pvalue, proteinId, ecNum, definition, catalyticActivity,
  cofactors
 FROM [826].[Fe_8x_KEGG]


________________________________________


SELECT * FROM [826].[P_8x_transcriptId_proteinId_KEGG_unique_only] P
  inner join  [826].[Si_8x_transcriptId_proteinId_KEGG_unique] Si
  on P.transcriptId = Si.transcriptId
  where P_logFC > 0
  and Si_logFC > 0


________________________________________


SELECT * FROM [826].[table_P_Control_8x_models.tab.txt] P
  inner join  [826].[Si_Control_8x_models.tab.txt] Si
  on P.transcriptId = Si.transcriptId
  where P_logFC > 0
  and Si_logFC > 0


________________________________________


SELECT * FROM [826].[Si_P_DEup_shared] SiP
  inner join  [826].[table_Urea_Control_8x_models.tab.txt] Urea
  on SiP.transcriptId = Urea.transcriptId
  where Urea_logFC > 0



________________________________________


SELECT * FROM [826].[UreaSiP_DEup_shared] USP
  inner join  [826].[table_Fe_Control_8x_models.tab.txt] Fe
  on USP.transcriptId = Fe.transcriptId
  where Fe_logFC > 0


________________________________________


SELECT distinct proteinId, gotermId, goName, gotermType, goAcc
  FROM [826].[Psemu1_GeneCatalog_proteins_20111011_GO.tab.txt]


________________________________________


SELECT distinct proteinId, ecNum, definition, catalyticActivity, cofactors 
  FROM [826].[Psemu1_GeneCatalog_proteins_20111011_KEGG.tab.txt]


________________________________________


SELECT distinct transcriptId, proteinId, ecNum, definition, catalyticActivity, cofactors 
 FROM [826].[Psemu1_KEGG_TranscriptIds_added.tab.txt]


________________________________________


SELECT * FROM [826].[UreaSiPFe_ALL_DEup] DE
  left join [826].[OnePingOnly_KEGG_8x_transcripts_Psemu1] KEGG
  on DE.transcriptId = KEGG.transcriptId


________________________________________


SELECT * FROM [826].[Urea_Control_8x_models.tab.txt] urea
  left join [826].[table_Psemu1_GeneCatalog_proteins_20111011_KOG.tab.txt] KO
  on urea.transcriptId = KO.transcriptId;


________________________________________


SELECT distinct kogClass
  FROM [826].[Urea_8x_transcript_KOG]


________________________________________


SELECT distinct kogClass
  FROM [826].[table_Psemu1_GeneCatalog_proteins_20111011_KOG.tab.txt]


________________________________________


SELECT distinct transcriptId, Urea_logConc, Urea_logFC, Urea_pvalue, kogid, kogdefline, kogClass
  FROM [826].[Urea_8x_transcript_KOG]


________________________________________


SELECT * FROM [826].[Urea_8x_transcript_KOG] urea
  left join [826].[table_KOG_classes_colors.tab.txt] color
  on urea.kogClass = color.kogClass



________________________________________


SELECT * FROM [826].[Urea_8x_transcript_KOG] urea
  left join [826].[table_KOG_classes_colors.tab.txt] color
  on urea.kogClass = color.kogClass


________________________________________


SELECT distinct transcriptId, kogdefline
  FROM [826].[Urea_8x_KOG_color]


________________________________________


SELECT * FROM [826].[Urea_8x_KOG_OPO] OPO
  left join  [826].[Urea_8x_KOG_color] color
  on OPO.transcriptId = color.transcriptId


________________________________________


SELECT * FROM [826].[Urea_8x_KOG_OPO] OPO
  inner join  [826].[Urea_8x_KOG_color] color
  on OPO.transcriptId = color.transcriptId


________________________________________


SELECT distinct transcriptId, kogdefline, kogClass
  FROM [826].[Urea_8x_KOG_color]


________________________________________


SELECT distinct definition
  FROM [826].[Psemu1_KEGG_TranscriptIds_added.tab.txt]


________________________________________


SELECT distinct pathway
  FROM [826].[Psemu1_KEGG_TranscriptIds_added.tab.txt]


________________________________________


SELECT distinct pathway_class
  FROM [826].[Psemu1_KEGG_TranscriptIds_added.tab.txt]


________________________________________


SELECT distinct transcriptId, Fe_logConc, Fe_logFC,
  Fe_pvalue, proteinId, ecNum, definition, catalyticActivity,
  cofactors, pathway_class
 FROM [826].[Fe_8x_KEGG]


________________________________________


SELECT * FROM [826].[Fe_8x_transcriptId_proteinId_KEGG_unique_pathway_class_only.tab.txt] Fe
  left join [826].[table_KEGG_pathway_class_colors.tab.txt] color
  on Fe.pathway_class = color.pathway_class


________________________________________


SELECT * FROM [826].[Urea_8x_transcript_KEGG] kegg
  join [826].[Urea_8x_transcript_KOG] kog
  on kegg.transcriptId = kog.transcriptId;



________________________________________


SELECT * FROM [826].[Urea_8x_transcript_all_KEGG_KOG] KK
  join [826].[table_Psemu1_GO_TranscriptIds_added.tab.txt] GO
  on KK.transcriptId = GO.transcriptId;



________________________________________


SELECT * FROM [826].[Urea_Control_8x_models.tab.txt] urea
join [826].[Psemu1_IPR_transcriptIds_added.txt] ipr
  on urea.transcriptId = ipr.transcriptId;


________________________________________


SELECT * FROM [826].[Fe_Control_8x_models.tab.txt] Fe
  where Fe.Fe_logFC > 0



________________________________________


SELECT * FROM [826].[Fe_Control_8x_models.tab.txt] Fe
  where Fe.Fe_logFC > 0
  and Fe.Fe_pvalue < 0.0001



________________________________________


SELECT * FROM [826].[Fe_Control_8x_models.tab.txt] Fe
  where Fe.Fe_logFC < 0
  and Fe.Fe_pvalue < 0.0001



________________________________________


SELECT * FROM [826].[Fe_Control_8x_models.tab.txt] Fe
  where Fe.Fe_logFC < 0



________________________________________


SELECT * FROM [826].[Urea_Control_8x_models.tab.txt] Urea
  where Urea.Urea_logFC > 0



________________________________________


SELECT * FROM [826].[Urea_Control_8x_models.tab.txt] Urea
  where Urea.Urea_logFC > 0
  and Urea.Urea_pvalue < 0.0001



________________________________________


SELECT * FROM [826].[Urea_Control_8x_models.tab.txt] Urea
  where Urea.Urea_logFC < 0
  and Urea.Urea_pvalue < 0.0001



________________________________________


SELECT * FROM [826].[Urea_Control_8x_models.tab.txt] Urea
  where Urea.Urea_logFC < 0
 



________________________________________


SELECT * FROM [826].[Si_Control_8x_models.tab.txt] Si
  where Si.Si_logFC > 0


________________________________________


SELECT * FROM [826].[Si_Control_8x_models.tab.txt] Si
  where Si.Si_logFC > 0
  and Si.Si_pvalue < 0.0001



________________________________________


SELECT * FROM [826].[Si_Control_8x_models.tab.txt] Si
  where Si.Si_logFC < 0
  and Si.Si_pvalue < 0.0001



________________________________________


SELECT * FROM [826].[Si_Control_8x_models.tab.txt] Si
  where Si.Si_logFC < 0
  



________________________________________


SELECT * FROM [826].[P_Control_8x_models.tab.txt] P
  where P.P_logFC > 0


________________________________________


SELECT * FROM [826].[P_Control_8x_models.tab.txt] P
  where P.P_logFC > 0
  and P.P_pvalue < 0.0001



________________________________________


SELECT * FROM [826].[P_Control_8x_models.tab.txt] P
  where P.P_logFC < 0
  and P.P_pvalue < 0.0001



________________________________________


SELECT * FROM [826].[P_Control_8x_models.tab.txt] P
  where P.P_logFC < 0




________________________________________


SELECT * FROM [826].[UreaSiPFe_ALL_DEup]
  where P_pvalue < 0.001



________________________________________


SELECT * FROM [826].[UreaSiPFe_ALL_DEup]
  where P_pvalue < 0.0001
  and Si_pvalue < 0.0001
  and Fe_pvalue < 0.0001
  and Urea_pvalue < 0.0001


________________________________________


SELECT * FROM [826].[table_P_Control_8x_models.tab.txt] P
  inner join  [826].[Si_Control_8x_models.tab.txt] Si
  on P.transcriptId = Si.transcriptId
  where P_logFC < 0
  and Si_logFC < 0


________________________________________


SELECT * FROM [826].[table_P_Control_8x_models.tab.txt] P
  inner join  [826].[Si_Control_8x_models.tab.txt] Si
  on P.transcriptId = Si.transcriptId
  where P_logFC < 0
  and Si_logFC < 0


________________________________________


SELECT * FROM [826].[Si_P_DEdown_shared] SiP
  inner join  [826].[table_Urea_Control_8x_models.tab.txt] Urea
  on SiP.transcriptId = Urea.transcriptId
  where Urea_logFC < 0



________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_shared] USP
  inner join  [826].[table_Fe_Control_8x_models.tab.txt] Fe
  on USP.transcriptId = Fe.transcriptId
  where Fe_logFC < 0


________________________________________


SELECT * FROM [826].[UreaSiPFe_ALL_DEdown]
  where P_pvalue < 0.0001
  and Si_pvalue < 0.0001
  and Fe_pvalue < 0.0001
  and Urea_pvalue < 0.0001



________________________________________


SELECT * FROM [826].[UreaSiP_DEup_shared]
  where P_pvalue < 0.0001
  and Si_pvalue < 0.0001
  and Urea_pvalue < 0.0001;



________________________________________


SELECT * FROM [826].[UreaSiP_DEup_shared_SIG] de
  left join [826].[table_Psemu1_KEGG_TranscriptIds_added.tab.txt] kegg
  on de.transcriptId = kegg.transcriptId;


________________________________________


SELECT * FROM [826].[UreaSiP_DEup_SIG_KEGG] kegg
   join [826].[table_Psemu1_GeneCatalog_proteins_20111011_KOG.tab.txt] kog
  on kegg.transcriptId = kog.transcriptId;



________________________________________


SELECT * FROM [826].[UreaSiP_DEup_SIG_KEGG_KOG] KK
  join [826].[table_Psemu1_GO_TranscriptIds_added.tab.txt] GO
  on KK.transcriptId = GO.transcriptId;



________________________________________


SELECT * FROM [826].[UreaSiP_DEup_shared_SIG] de
  join [826].[table_Psemu1_IPR_transcriptIds_added.txt] ipr
  on de.transcriptId = ipr.transcriptId;


________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_shared]
  where P_pvalue < 0.0001
  and Si_pvalue < 0.0001
  and Urea_pvalue < 0.0001;



________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_SIG] de
  left join [826].[table_Psemu1_KEGG_TranscriptIds_added.tab.txt] kegg
  on de.transcriptId = kegg.transcriptId;


________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_SIG_KEGG] kegg
   join [826].[table_Psemu1_GeneCatalog_proteins_20111011_KOG.tab.txt] kog
  on kegg.transcriptId = kog.transcriptId;



________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_SIG_KEGG_KOG] KK
  join [826].[table_Psemu1_GO_TranscriptIds_added.tab.txt] GO
  on KK.transcriptId = GO.transcriptId;



________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_SIG_KEGG]  kegg
   join [826].[table_Psemu1_GeneCatalog_proteins_20111011_KOG.tab.txt] kog
  on kegg.transcriptId = kog.transcriptId;



________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_SIG_KEGG_KOG]  KK
  join [826].[table_Psemu1_GO_TranscriptIds_added.tab.txt] GO
  on KK.transcriptId = GO.transcriptId;



________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_SIG] de
  join [826].[table_Psemu1_IPR_transcriptIds_added.txt] ipr
  on de.transcriptId = ipr.transcriptId;


________________________________________


SELECT * FROM [826].[UreaSiP_DEup_shared]
  where P_pvalue < 0.000001
  and Si_pvalue < 0.000001
  and Urea_pvalue < 0.000001
  and P_logFC > 1
  and Si_logFC > 1
  and Urea_logFC > 1;



________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_shared]
   where P_pvalue < 0.000001
  and Si_pvalue < 0.000001
  and Urea_pvalue < 0.000001
  and P_logFC > 1
  and Si_logFC > 1
  and Urea_logFC > 1;


________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_shared]
   where P_pvalue < 0.000001
  and Si_pvalue < 0.000001
  and Urea_pvalue < 0.000001
  and P_logFC > 1
  and Si_logFC > 1
  and Urea_logFC > 1;


________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_shared]
   where P_pvalue < 0.000001
  and Si_pvalue < 0.000001
  and Urea_pvalue < 0.000001
  and P_logFC < 1
  and Si_logFC < 1
  and Urea_logFC < 1;


________________________________________


SELECT * FROM [826].[UreaSiP_DEdown_shared]
   where P_pvalue < 0.000001
  and Si_pvalue < 0.000001
  and Urea_pvalue < 0.000001
  and P_logFC < -1
  and Si_logFC < -1
  and Urea_logFC < -1;


________________________________________


SELECT * FROM [826].[UreaSiP_DEup_shared_MORESIG_and_FC] de
 left join [826].[table_Psemu1_IPR_transcriptIds_added.txt] ipr
  on de.transcriptId = ipr.transcriptId;


________________________________________


SELECT * FROM [826].[UreaSiP_DEup_shared_MORESIG_and_FC] de
 left join [826].[table_Psemu1_KEGG_TranscriptIds_added.tab.txt] kegg
  on de.transcriptId = kegg.transcriptId;


________________________________________


SELECT * FROM [826].[Fe_Control_8x_models.tab.txt] Fe
  left join [826].[table_Psemu1_IPR_transcriptIds_added.txt] ipr
  on Fe.transcriptId = ipr.transcriptId


________________________________________


SELECT * FROM [826].[Fe_Control_8x_models.tab.txt] Fe  
  left join [826].[table_Psemu1_GO_TranscriptIds_added.tab.txt] GO
  on Fe.transcriptId = GO.transcriptId;


________________________________________


SELECT * FROM [826].[Fe_Control_8x_models.tab.txt] Fe  
  left join [826].[Psemu1_GeneCatalog_proteins_20111011_KOG.tab.txt] KOG
  on Fe.transcriptId = KOG.transcriptId;



________________________________________


SELECT * FROM [826].[deFe_BH.csv]
  where logFC > 0
  and pvalue < 0.0001;



________________________________________


SELECT * FROM [826].[deFe_BH.csv]
  where logFC > 0
  and BH < 0.0001;



________________________________________


SELECT * FROM [826].[deFe_BH.csv]
  where logFC < 0
  and BH < 0.0001;



________________________________________


SELECT * FROM [826].[deP_BH.csv]
  where logFC > 0 
  and pvalue < 0.0001



________________________________________


SELECT * FROM [826].[deP_BH.csv]
  where logFC > 0 
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[deP_BH.csv]
  where logFC > 0 
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[deP_BH.csv]
  where logFC < 0 
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[deSi_BH.csv]
  where logFC > 0
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[deSi_BH.csv]
  where logFC > 0
  and BH < 0.0001;


________________________________________


SELECT * FROM [826].[deSi_BH.csv]
  where logFC < 0
  and BH < 0.0001;


________________________________________


SELECT * FROM [826].[deUrea_BH.csv]
  where logFC > 0
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[deUrea_BH.csv]
  where logFC > 0
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[deUrea_BH.csv]
  where logFC < 0
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[deUrea_BH.csv]
  where logFC > 1
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[deUrea_BH.csv]
  where logFC > 2
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC > 0
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC < 0
  and BH < 0.0001



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC < 0
  and BH < 0.05



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC < 0
  and BH < 0.1



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC > 0
  and BH < 0.1



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC < 0
  and BH < 0.1



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC < 0
  and BH < 0.1



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC > 0
  and BH < 0.1



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC < 0
  and BH < 0.1



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC < 0
  and BH < 0.05



________________________________________


SELECT * FROM [826].[de.tab.ipr.csv]
  where logFC > 0
  and BH < 0.05



________________________________________


SELECT * FROM [826].[GeneModelPositions.txt]
  where proximity < 100


________________________________________


SELECT * FROM [826].[GeneModelPositions.txt]
  where proximity < 100
  and proximity > 0



________________________________________


SELECT * FROM [826].[GeneModelPositions.txt]
  where proximity < 200
  and proximity > 0



________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0



________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0
  



________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0
  and proximity > -1000



________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0
  and proximity > -2000



________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0
  and proximity > -1000



________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0
  and proximity > -1000


________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity > 0
  and proximity < 500


________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0
  and proximity > -1000


________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0
  and proximity > -1000


________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0
  


________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0
  and proximity > -2000
  


________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity < 0

  


________________________________________


SELECT * FROM [826].[Psemu1_gene_models_positions.txt]
  where proximity > 0
  and proximity < 500


________________________________________


SELECT * FROM [826].[Overlapping_Psemu1_gene_models_no_scaffold_jumps.txt] overlap
  left join [826].[table_Psemu1_RNASeq_IPR_KEGG_KOG_merged.tab.txt] annotate
  on overlap.transcript_id = annotate.transcriptId


________________________________________


SELECT * FROM [826].[Overlap_annotated.txt] overlap
  left join [826].[table_Psemu1_RNASeq_IPR_KEGG_KOG_merged.tab.txt] annotate
  on overlap.neighbor_transcript_id = annotate.transcriptId


________________________________________


SELECT * FROM [826].[Proximal_Psemu1_gene_models.txt] overlap
  left join [826].[table_Psemu1_RNASeq_IPR_KEGG_KOG_merged.tab.txt] annotate
  on overlap.transcript_id = annotate.transcriptId


________________________________________


SELECT * FROM [826].[Proximal_Psemu1_gene_models_annotated.txt] overlap
  left join [826].[table_Psemu1_RNASeq_IPR_KEGG_KOG_merged.tab.txt] annotate
  on overlap.neighbor_transcript_id = annotate.transcriptId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnlyUreaUpOnlyCluster_list.txt] urea
  left join [826].[table_Psemu1_RNASeq_IPR_KEGG_KOG_merged.tab.txt] ann
  on urea.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnlyUreaUpOnlyCluster_list.txt] urea
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on urea.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnlyDACluster2_list.txt] DA
   left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on DA.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnly.txt]
  where Fe_logFC > 1 and Fe_logFC < -1
  and P_logFC > 1 and P_logFC < -1
  and Si_logFC > 1 and Si_logFC < -1
  and Urea_logFC > 1 and Urea_logFC < -1



________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnly.txt]
  where Fe_logFC > 1 or Fe_logFC < -1
  and P_logFC > 1 or P_logFC < -1
  and Si_logFC > 1 or Si_logFC < -1
  and Urea_logFC > 1 or Urea_logFC < -1



________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnly.txt]
  where Fe_logFC > 1 or Fe_logFC < -1




________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnly.txt]
  where Fe_logFC > 1 or Fe_logFC < -1






________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnly_FelogFC_1ormore]
  where P_logFC < -1 or P_logFC > 1


________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnly_FePlogFC_1ormore]
  where Si_logFC < -1 or Si_logFC > 1



________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnly_FePSilogFC_1ormore]
  where Urea_logFC < -1 or Urea_logFC > 1


________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnly_FePSiUrealogFC_1ormore_list_DACluster1.txt] DA
   left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on DA.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDEOnly.txt]
  where P_logFC < -1 or P_logFC > 1


________________________________________


SELECT * FROM [826].[ClusterAnalysisSigDE_Pfoldchange_greaterthanlog1]
  where Si_logFC < -1 or Si_logFC > 1


________________________________________


SELECT * FROM [826].[ClusterAnalysisSigDE_PSifoldchange_greaterthanlog1]
  where Urea_logFC < -1 or Urea_logFC > 1


________________________________________


SELECT * FROM [826].[DACluster3.txt] da
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on da.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisSigDE_PSiUreafoldchange_greaterthanlog1_list_DACluster1.txt] da
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on da.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInput.txt]
  where Fe_BH < 0.05
  and P_BH < 0.05
  and Si_BH < 0.05
  and Urea_BH < 0.05



________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDE]
  where Si_logConc > -20
  and P_logConc > -20
  and Urea_logConc > -20



________________________________________


SELECT * FROM [826].[ClusterAnalysisInput.txt]
  where P_BH < 0.001
  and Si_BH < 0.001
  and Urea_BH < 0.001



________________________________________


SELECT * FROM [826].[ClusterAnalysisInputSigDE]
  where P_logConc > -20
  and Si_logConc > -20
  and Urea_logConc > -20


________________________________________


SELECT * FROM [826].[ClusterAnalysisInput_UreaSiP_SigDElogConcgreater-20]
  where P_logFC < -1
  or P_logFC > 1


________________________________________


SELECT * FROM [826].[ClusterAnalysisInput_UreaSiP_SigDElogConcgreater-20_Pfold1]
  where Si_logFC < -1
  or Si_logFC > 1


________________________________________


SELECT * FROM [826].[ClusterAnalysisInput_UreaSiP_SigDElogConcgreater-20_PSiFold]
  where Urea_logFC < -1
  or Urea_logFC > 1


________________________________________


SELECT * FROM [826].[Overlapping_Psemu1_gene_models_no_scaffold_jumps.txt] overlap
     left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] annotate
  on overlap.transcript_id = annotate.transcriptId


________________________________________


SELECT * FROM [826].[Overlap_annotated_CORRECT_KOG] overlap
     left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] annotate
  on overlap.neighbor_transcript_id = annotate.transcriptId


________________________________________


SELECT * FROM [826].[Psemu1_GeneCatalog_proteins_20111011_IPR.tab.txt]
  where iprId != 'NULL'


________________________________________


SELECT * FROM [826].[Psemu1_GeneCatalog_proteins_20111011_IPR.tab.txt]
  where score != 'NA'


________________________________________


 SELECT * FROM [826].[AllUniqueOxInterproIds] oxinter
  where exists (select iprId from [826].[Psemu1_IPR_noNAscore.tab.txt] PsemuIPR
    where PsemuIPR.iprID = oxinter.InterproId_Ox)


________________________________________


SELECT * FROM [826].[ClusterAnalysisInput_UreaSiP_SigDElogConcgreater-20_PsiUreaFold_Onlygreaterthan2RelFCtoFe.txt] de
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on de.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInput_UreaSiP_SigDElogConcgreater-20_PsiUreaFold_Onlygreaterthan2RelFCtoFe.txt] de
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on de.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInput_UreaSiP_SigDElogConcgreater-20_PsiUreaFold_Onlygreaterthan2RelFCtoFe.txt] de
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on de.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInput_UreaSiP_SigDElogConcgreater-20_PsiUreaFold_Onlygreaterthan2RelFCtoFe.txt] de
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on de.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[ClusterAnalysisInput_UreaSiP_SigDElogConcgreater-20_PsiUreaFold_Onlygreaterthan2RelFCtoFe.txt] de
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on de.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[Psemu1_GeneCatalog_proteins_20111011.aa.interproscan.onlyIPR.tab.txt]
  where InterproEntry != 'NULL'



________________________________________


SELECT * FROM [826].[Psemu1InterProScan_noNULL]
    where evalue != 'NA'


________________________________________


SELECT UniqueProteinId, MIN(evalue) best_evalue
  FROM [826].[Psemu1InterProScan_noNULL_noNA]
  group by UniqueProteinId




________________________________________


SELECT * FROM [826].[Psemu1InterProScan_noNULL_noNA] psemu
   where exists (select InterproId_Ox from [826].[AllUniqueOxInterproIds] oxinter
    where psemu.InterproEntry = oxinter.InterproId_Ox)
  order by proteinId


________________________________________


SELECT * FROM [826].[Psemu1InterProScan_noNULL_noNA] psemu
   where exists (select InterproId_Ox from [826].[AllUniqueOxInterproIds] oxinter
    where psemu.InterproEntry = oxinter.InterproId_Ox)
  order by proteinId


________________________________________


 SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Ox_Psemu_noNULL_noNA_evalueLess05_dupsremoved.txt]
  group by InterproEntry
  order by InterproIdHits DESC


________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[PsemuBestEvalueInterProHitCount] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC


________________________________________


   SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Ox_Psemu_noNULL_noNA]
  group by InterproEntry
  order by InterproIdHits DESC


________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Psemu_AllCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Psemu_AllCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[FracyInterProScan_noNull_noNA]
  group by InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[FracyInterProScan_noNull_noNA]
  group by InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Ox_Fracy_noNULL_noNA]
  group by InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Fracy_AllCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Fracy_AllCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Fracy_AllCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Phatr_interOxonly_noNull_noNA]
  group by InterproEntry
  order by InterproIdHits DESC



________________________________________


    SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Phatr_AllCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC


________________________________________


    SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Phatr_AllCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC


________________________________________


  SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Thaps_OxInter_noNull_noNA]
  group by InterproEntry
  order by InterproIdHits DESC



________________________________________


      SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Thaps_AllCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


      SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Thaps_AllCounts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT distinct proteinId, InterproEntry
  FROM [826].[Ox_Psemu_noNULL_noNA] 


________________________________________


  SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Ox_Psemu_Unique_InterPros_for_each_protein_only]
  group by InterproEntry
  order by InterproIdHits DESC



________________________________________


    SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Psemu_uniqueIPRperprotein_counts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC


________________________________________


  SELECT distinct proteinId, InterproEntry
  FROM [826].[Ox_Psemu_noNULL_noNA] 


________________________________________


  SELECT distinct UniqueProteinId, InterproEntry
  FROM [826].[Ox_Fracy_noNULL_noNA] 


________________________________________


  SELECT distinct UniqueProteinId, InterproEntry
  FROM [826].[Ox_Fracy_noNULL_noNA] 



________________________________________


   SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Ox_Fracy_uniqueIPRsperprotein]
  group by InterproEntry
  order by InterproIdHits DESC


________________________________________


   SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Fracy_IPRperprotein_counts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


   SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Fracy_IPRperprotein_counts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


  SELECT distinct UniqueProteinId, InterproEntry
  FROM [826].[Thaps_OxInter_noNull_noNA] 



________________________________________


  SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Ox_Thaps_IPRperprotein]
  group by InterproEntry
  order by InterproIdHits DESC


________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Thaps_IPRper_counts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC




________________________________________


   SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Ox_Fracy_uniqueIPRsperprotein]
  group by InterproEntry
  order by InterproIdHits DESC


________________________________________


    SELECT distinct UniqueProteinId, InterproEntry
  FROM [826].[Phatr_interOxonly_noNull_noNA] 



________________________________________


  SELECT InterproEntry, count(*) InterproIdHits  FROM [826].[Ox_Phatr_IPRperprotein]
  group by InterproEntry
  order by InterproIdHits DESC


________________________________________


  SELECT InterproEntry, InterproIdHits, Interpro_desc_Ox
   FROM [826].[Ox_Phatr_IPRper_counts] JOIN [826].[AllOxInterProIds.tab.txt]
      ON InterproId_Ox = InterproEntry
  order by InterproIdHits DESC



________________________________________


SELECT * FROM [826].[jgi_alignment_hits_top44.txt] hits
  left join [826].[Psemu1_GeneCatalog_pid2gene.tab] pid
  on hits.Protein = pid.name


________________________________________


SELECT * FROM [826].[Top44_pid] hits
  left join [826].[PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on hits.pid = ann.proteinId


________________________________________


SELECT * FROM [826].[PC9SA11_sense_expression.txt] de
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on de.Transcript_ids = ann.transcriptId



________________________________________


SELECT * FROM [826].[NewCountsDispersionFixed.txt]
  where Fe_BH < 0.05
  or P_BH < 0.05
  or Si_BH < 0.05
  or Urea_BH < 0.05


________________________________________


SELECT * FROM [826].[PmFeCont_TE.sense.txt] Fe
  join [826].[table_PmUreaCont_TE.sense.txt] Ur
  on Fe.Column1 = Ur.Column1


________________________________________


SELECT * FROM [826].[PmFeCont_TE.sense.txt] Fe
  join [826].[table_PmSiCont_TE.sense.txt] Si
  on Fe.TEid = Si.TEid


________________________________________


SELECT * FROM [826].[PmFeSiCont_TE.sense.txt] FS
  join [826].[table_PmUreaCont_TE.sense.txt] Urea
  on FS.TEid = Urea.TEid


________________________________________


SELECT * FROM [826].[PmFeSiUreaCont_TE.sense.txt] FSU
  join [826].[table_PmPCont_TE.sense.txt] P
  on FSU.TEid = P.TEid


________________________________________


SELECT * FROM [826].[Psemu1_classif_consensus] annotate
  join [826].[PmALL_TE.sense.txt] TE
  on annotate.Column1 = TE.TEid 


________________________________________


SELECT * FROM [826].[tp1335_hemizygous_genes.txt] tp1335
  join [826].[table_tp1015_hemizygous_genes.txt] tp1015
   on tp1335.proteinId = tp1015.proteinId


________________________________________


SELECT * FROM [826].[Hemi_1335_1015] tp13351015
  join [826].[table_tp1014_hemizygous_genes.txt] tp1014
  on tp13351015.proteinId = tp1014.proteinId


________________________________________


SELECT * FROM [826].[Hemi_1335_1015_1014] a
  join [826].[table_tp1013_hemizygous_genes.txt] tp1013
  on a.proteinId = tp1013.proteinId


________________________________________


SELECT * FROM [826].[Hemi_1335_1015_1014_1013] b
  join [826].[table_tp1012_hemizygous_genes.txt] tp1012
  on b.proteinId = tp1012.proteinId


________________________________________


SELECT c.proteinId FROM [826].[Hemi_1335_1015_1014_1013_1012] c
  join [826].[table_tp1007_hemizygous_genes.txt] tp1007
  on c.proteinId = tp1007.proteinId


________________________________________


SELECT * FROM [826].[Hemi_1335_1015_1014_1013_1012] c
  join [826].[table_tp1007_hemizygous_genes.txt] tp1007
  on c.proteinId = tp1007.proteinId


________________________________________


SELECT * FROM [826].[Hemi_1335_1015_1014_1013_1012_1007] d
  join [826].[table_thapsIT_hemizygous_genes.txt] IT
  on d.proteinId = IT.proteinId


________________________________________


SELECT * FROM [826].[Hemi_ALL_with_annotations] hemi
  join [826].[table_HGT_inThapsPhaeo.txt] HGT
  on hemi.proteinId = HGT.proteinId


________________________________________


SELECT proteinId FROM [826].[Hemi_ALL_with_annotations]


________________________________________


SELECT * FROM [826].[Hemi_ALL] hemi
  join [826].[table_Thaps3_annotations.txt] annotate
  on hemi.proteinId = annotate.proteinId


________________________________________


SELECT * FROM [826].[Hemi_1335_1015_1014_1013_1012_1007] d
  join [826].[table_thapsIT_hemizygous_genes.txt] IT
  on d.proteinId = IT.proteinId


________________________________________


SELECT proteinId FROM [826].[Hemi_ALL_temp]


________________________________________


SELECT * FROM [826].[Hemi_ALL_no_annotate] ids
  join [826].[table_Thaps3_annotations.txt] ann
  on ids.proteinId = ann.proteinId


________________________________________


SELECT * FROM [826].[Thaps_protein_id_chr_position_gene models_lookup_table.txt] loc
  join [826].[table_ThapsHemiALL.txt] hemi
  on loc.protein_id = hemi.proteinId
  


________________________________________


SELECT * FROM [826].[thapsIT_hemizygous_genes.txt] IT
  join [826].[table_tp1015_hemizygous_genes.txt] tp1015
   on IT.proteinId = tp1015.proteinId


________________________________________


SELECT * FROM [826].[Hemi_IT_1015] a
  join [826].[table_tp1014_hemizygous_genes.txt] tp1014
   on a.proteinId = tp1014.proteinId


________________________________________


SELECT * FROM [826].[Hemi_IT_1015_1014] b
  join [826].[table_tp1013_hemizygous_genes.txt] tp1013
   on b.proteinId = tp1013.proteinId



________________________________________


SELECT * FROM [826].[Hemi_IT_1015_1014_1013] c
  join [826].[table_tp1012_hemizygous_genes.txt] tp1012
   on c.proteinId = tp1012.proteinId


________________________________________


SELECT * FROM [826].[Hemi_IT_1015_1014_1013_1012] d
  join [826].[table_tp1007_hemizygous_genes.txt] tp1007
   on d.proteinId = tp1007.proteinId


________________________________________


SELECT proteinId FROM [826].[Hemi_IT_1015_1014_1013_1012_1007]


________________________________________


SELECT * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT,
   [826].[Hemi_ALL_EXCEPT_1335_proteinIdsOnly] artifact
  where IT.proteinId != artifact.proteinId
  


________________________________________


 SELECT * FROM [826].[Thaps_protein_id_chr_position_gene models_lookup_table.txt] loc
  join [826].[Hemi_IT_not_putative_misassemble_artifact_set] hemi
  on loc.protein_id = hemi.proteinId


________________________________________


SELECT distinct protein_id, strand, start_pos, end_pos, assembly_id, name1 FROM [826].[Hemi_IT_not_artifact_plus_positions] hemi


________________________________________


SELECT * FROM [826].[Hemi_IT_not_artifact_plus_positions_one_ping_only] ids
  join [826].[table_Thaps3_annotations.txt] ann
  on ids.protein_id = ann.proteinId


________________________________________


SELECT * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT
join [826].[Hemi_ALL_temp] artifact
  on IT.proteinId != artifact.proteinId
  


________________________________________


SELECT * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT
join [826].[Hemi_ALL_temp] artifact
  on IT.proteinId = artifact.proteinId
  


________________________________________


SELECT * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT
join [826].[Hemi_ALL_temp] artifact
  on IT.proteinId = artifact.proteinId
  


________________________________________


SELECT * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT
join [826].[Hemi_ALL_temp] artifact
  on IT.proteinId = artifact.proteinId
  


________________________________________


SELECT * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT
join [826].[Hemi_ALL_temp] artifact
  on IT.proteinId = artifact.proteinId
  


________________________________________


SELECT * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT
join [826].[Hemi_ALL_temp] artifact
  on IT.proteinId = artifact.proteinId
  


________________________________________


select * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT,
 [826].[Hemi_ALL_temp] artifact 
delete from IT where IT.proteinId = artifact.proteinId
  


________________________________________


select * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT,
 [826].[Hemi_ALL_temp] artifact 
delete from IT where IT.proteinId = artifact.proteinId
  


________________________________________


select * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT,
 [826].[Hemi_ALL_temp] artifact 
delete from IT where IT.proteinId = artifact.proteinId


________________________________________


select * FROM [826].[table_thapsIT_hemizygous_genes.txt] IT,
 [826].[Hemi_ALL_temp] artifact 
delete from IT where IT.proteinId = artifact.proteinId


________________________________________


SELECT proteinId FROM [826].[Hemi_IT_1015_1014_1013]
  


________________________________________


SELECT * FROM [826].[Hemi_IT_1015_1014_1013] c
  join [826].[table_tp1012_hemizygous_genes.txt] tp1012
  on c.proteinId = tp1012.proteinId


________________________________________


SELECT * FROM [826].[Hemi_IT_1015_1014_1013_1012] d
  join [826].[table_tp1007_hemizygous_genes.txt] tp1007
  on d.proteinId = tp1007.proteinId
  order by d.proteinId



________________________________________


SELECT IT.proteinId, artifact.proteinId 
  FROM [826].[thapsIT_hemizygous_genes.txt]  IT,
  [826].[Hemi_IT_1015_1014_1013_1012_1007] artifact
  where IT.proteinId != artifact.proteinId



________________________________________


SELECT IT.proteinId 
  FROM [826].[thapsIT_hemizygous_genes.txt]  IT,
  [826].[Hemi_IT_1015_1014_1013_1012_1007] artifact
  where IT.proteinId != artifact.proteinId



________________________________________


SELECT distinct IT.proteinId 
  FROM [826].[thapsIT_hemizygous_genes.txt]  IT,
  [826].[Hemi_IT_1015_1014_1013_1012_1007] artifact
  where IT.proteinId != artifact.proteinId



________________________________________


  SELECT distinct tp1015.proteinId 
  FROM [826].[tp1015_hemizygous_genes.txt]  tp1015,
  [826].[Hemi_IT_1015_1014_1013_1012_1007] artifact
  where tp1015.proteinId != artifact.proteinId



________________________________________


  SELECT distinct tp1015.proteinId 
  FROM [826].[tp1015_hemizygous_genes.txt]  tp1015,
  [826].[Hemi_IT_1015_1014_1013_1012_1007] artifact
  where tp1015.proteinId != artifact.proteinId
    order by tp1015.proteinId



________________________________________


select * from [826].[tp1015_hemizygous_genes.txt] tp1015    
DELETE FROM tp1015
WHERE NOT EXISTS
  ( select *
     from [826].[Hemi_IT_1015_1014_1013_1012_1007] artifact
     where tp1015.proteinId = artifact.proteinId);



________________________________________


select * from [826].[tp1015_hemizygous_genes.txt] tp1015   
DELETE FROM tp1015
WHERE NOT EXISTS
  (select *
     from [826].[Hemi_IT_1015_1014_1013_1012_1007] artifact
    where tp1015.proteinId = artifact.proteinId) ;



________________________________________


 SELECT * from [826].[tp1015_hemizygous_genes.txt] tp1015
    DELETE FROM tp1015
WHERE NOT EXISTS
  (select *
     from   [826].[Hemi_IT_1015_1014_1013_1012_1007] artifact
    where tp1015.proteinId = artifact.proteinId) ;


________________________________________


 SELECT * from [826].[tp1015_hemizygous_genes.txt] tp1015
    DELETE FROM tp1015
WHERE NOT EXISTS
  (select *
     from   [826].[Hemi_IT_1015_1014_1013_1012_1007] artifact
    where tp1015.proteinId = artifact.proteinId) ;


________________________________________


 SELECT * from [826].[tp1015_hemizygous_genes.txt] tp1015,
   [826].[Hemi_ALL_EXCEPT_1335_proteinIdsOnly] artifact
    where tp1015.proteinId = artifact.proteinId ;


________________________________________


 SELECT * from [826].[tp1015_hemizygous_genes.txt] tp1015
   join [826].[Hemi_ALL_EXCEPT_1335_proteinIdsOnly] artifact
    on tp1015.proteinId = artifact.proteinId ;


________________________________________


 SELECT * from [826].[tp1015_hemizygous_genes.txt] tp1015
   left join [826].[Hemi_ALL_EXCEPT_1335_proteinIdsOnly] artifact
    on tp1015.proteinId = artifact.proteinId ;


________________________________________


SELECT * FROM [826].[thapsIT_hemizygous_genes.txt] IT
   left join [826].[Hemi_ALL_EXCEPT_1335_proteinIdsOnly] artifact
    on IT.proteinId = artifact.proteinId ;


________________________________________


SELECT * FROM [826].[Thaps_protein_id_chr_position_gene models_lookup_table.txt] loc
  join [826].[Hemi_IT_minus_possible_artifacts.txt] hemi
  on loc.protein_id = hemi.proteinId




________________________________________


SELECT * FROM [826].[Thaps_protein_id_chr_position_gene models_lookup_table.txt] loc
  join [826].[Hemi_IT_minus_possible_artifacts.txt] hemi
  on loc.protein_id = hemi.proteinId ;




________________________________________


SELECT distinct proteinId FROM [826].[Thaps_protein_id_chr_position_gene models_lookup_table.txt] loc
  join [826].[Hemi_IT_minus_possible_artifacts.txt] hemi
  on loc.protein_id = hemi.proteinId ;




________________________________________


SELECT * FROM [826].[Thaps_protein_id_chr_position_gene models_lookup_table.txt] loc
  join [826].[Hemi_1015_minus_possible_artifacts.txt] hemi
  on loc.protein_id = hemi.proteinId ;




________________________________________


SELECT * FROM [826].[PmFeTE.antisense.seastar.txt]


________________________________________


SELECT sequence_id FROM [826].[PmFeTE.antisense.seastar.txt]
  UNION select sequence_id from [826].[table_PmFeTE.sense.seastar.txt]


________________________________________


SELECT * FROM [826].[PmFeTE.antisense.seastar.txt] anti
  join [826].[table_PmFeTE.sense.seastar.txt] sense 
  on anti.sequence_id = sense.sequence_id


________________________________________


SELECT * FROM [826].[PmFeTE.antisense.seastar.txt] anti
  join [826].[table_PmFeTE.sense.seastar.txt] sense 
  on anti.sequence_id = sense.sequence_id


________________________________________


SELECT * FROM [826].[PmFeTE.antisense.seastar.txt] anti
  join [826].[PmFeTE.sense.seastar.txt] sense 
  on anti.sequence_id = sense.sequence_id


________________________________________


SELECT * FROM [826].[PmFeTE.sense.seastar.txt] sense
  join [826].[PmFeTE.antisense.seastar.txt] anti
  on sense.sequence_id = anti.sequence_id
  
  


________________________________________


SELECT * FROM [826].[Psemu1_classif_consensus] annotate
  join [826].[PmTE_UreaCont.txt] TE
  on annotate.Column1 = TE.name 





________________________________________


SELECT * FROM [826].[Psemu1_classif_consensus] annotate
  join [826].[PmTE_SiCont.txt] TE
  on annotate.Column1 = TE.name 





________________________________________


SELECT * FROM [826].[Psemu1_classif_consensus] annotate
  join [826].[PmTE_PCont.txt] TE
  on annotate.Column1 = TE.name 





________________________________________


SELECT * FROM [826].[Psemu1_classif_consensus] annotate
  join [826].[PmTE_FeCont.txt] TE
  on annotate.Column1 = TE.name 



________________________________________


SELECT * FROM [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup
  join [826].[PmTE_UreaCont.txt] TE
  on supergroup.Consensus = TE.name


________________________________________


SELECT * FROM [826].[Psemu1_classif_consensus] annotate
  join [826].[table_PmTE_ALL-DE.txt] TE
  on annotate.Column1 = TE.name 



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class] TE
  join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup
  on supergroup.Consensus = TE.name


________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class] TE
  join [826].[table_Psemu1FL_refTEs_hitRT_2ndround_ok.txt] supergroup
  on supergroup.Consensus = TE.name


________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class] TE
  join [826].[table_Psemu1FL_refTEs_hitRT_2ndround_ok.txt] supergroup
  on supergroup.Consensus = TE.name


________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class] TE
  join [826].[table_Psemu1FL_refTEs_hitRT_2ndround_ok.txt] supergroup
  on supergroup.Consensus = TE.name


________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class_group1]  
  where PValue_Fe < 0.05
  and PValue_Si < 0.05
  and PValue_Urea < 0.05
  and PValue_P < 0.05;



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class_group1]  
  where PValue_Fe < 0.05



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class_group1]
  where PValue_Si < 0.05



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class_group1]
  where PValue_Urea < 0.05



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class_group1]
  where PValue_Urea < 0.05



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class_group1]
  where PValue_P < 0.05



________________________________________


SELECT * FROM [826].[Psemu1_classif_consensus] annotate
join [826].[ThapsexactSifdr.txt] Si
  on annotate.Column1 = Si.name 



________________________________________


SELECT * FROM [826].[ThapsexactSifdr_class]


________________________________________


SELECT * FROM [826].[Psemu1-DiaTrois-exactSifdr]


________________________________________


SELECT * FROM [826].[ThapsexactNfdr.txt]


________________________________________


SELECT * FROM [826].[ThapsexactSifdr.txt]


________________________________________


  SELECT * FROM [826].[Psemu1_classif_consensus] annotate
  join [826].[Psemu1-DiaTrois-exactNfdr.txt] N
  on annotate.TEid = N.name 




________________________________________


 SELECT * FROM [826].[Psemu1_classif_consensus] annotate
  join [826].[Psemu1-DiaTrois-exactSifdr.txt] Si
  on annotate.TEid = Si.name 




________________________________________


SELECT * FROM [826].[Psemu1-DiaTrois-exactNfdr_class] N
  join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup
  on supergroup.Consensus = N.name


________________________________________


SELECT * FROM [826].[Psemu1-DiaTrois-exactSifdr_class] Si
  join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup
  on supergroup.Consensus = Si.name


________________________________________


SELECT * FROM [826].[Psemu1-DiaTrois-exactSifdr_class_group.txt]
  where pvalue < 0.05



________________________________________


SELECT * FROM [826].[Psemu1-DiaTrois-exactNfdr_class_group.txt]
  where pvalue < 0.05



________________________________________


SELECT * FROM [826].[Psemu1_classif_consensus] annotate
  join [826].[table_PmTE_ALL-DE.txt] TE
  on annotate.TEid = TE.name 



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_class] DE
   join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup
  on supergroup.Consensus = DE.name



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE.txt] DE
   join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup
  on supergroup.Consensus = DE.name



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_group1]
  where PValue_Fe < 0.05
  or PValue_P < 0.05
  or PValue_Si < 0.05
  or PValue_Urea < 0.05



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE.txt] DE
  join [826].[table_Psemu1-DiaTrois-exactSifdr.txt] Si
  on DE.name = Si.name


________________________________________


SELECT * FROM [826].[Psemu1-DiaTrois-exactSifdr.txt] DE
  join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup
  on supergroup.Consensus = DE.name



________________________________________


SELECT * FROM [826].[Psemu1-DiaTrois-exactSifdr_group1] DE
  join [826].[table_Psemu1-DiaTrois-exactNfdr.txt] N
  on N.name = DE.name



________________________________________


SELECT * FROM [826].[Psemu1-DiaTrois-exactNfdr-exactSifdr_group1.txt]
  where Si_pvalue < 0.05
  or N_pvalue < 0.05



________________________________________


SELECT * FROM [826].[PmContTE.seastar_forNormalizingByLoci.txt] counts
  join [826].[table_Psemu1FL_chr_allTEs_nr_noSSR_join_path_statsPerTE.txt] loci
  on counts.sequence_id = loci.TE
  ;


________________________________________


SELECT * FROM [826].[PmFeTE.seastar_ForNormalizingByLoci.txt] counts
  join [826].[table_Psemu1FL_chr_allTEs_nr_noSSR_join_path_statsPerTE.txt] loci
  on counts.sequence_id = loci.TE
  ;


________________________________________


SELECT * FROM [826].[PmPTE.seastar_ForNormalizingLoci.txt] counts
  join [826].[table_Psemu1FL_chr_allTEs_nr_noSSR_join_path_statsPerTE.txt] loci
  on counts.sequence_id = loci.TE
  ;


________________________________________


SELECT * FROM [826].[PmSiTE.seastar_ForNormalizing.txt] counts
  join [826].[table_Psemu1FL_chr_allTEs_nr_noSSR_join_path_statsPerTE.txt] loci
  on counts.sequence_id = loci.TE
  ;


________________________________________


SELECT * FROM [826].[PmUreaTE.seastar_ForNormalizing.txt] counts
  join [826].[table_Psemu1FL_chr_allTEs_nr_noSSR_join_path_statsPerTE.txt] loci
  on counts.sequence_id = loci.TE
  ;


________________________________________


SELECT * FROM [826].[PmContTE.seastar.loci_count_normalized.ClusterAnalysis.txt] Cont
  join [826].[table_PmFeTE.seastar.loci_count_normalized_Cluster.txt] Fe
  on Cont.sequence_id = Fe.sequence_id


________________________________________


SELECT * FROM [826].[PmContFe.seastar.loci_count_norm] ConF
  join [826].[table_PmPTE.seastar_loci_counts_normalized_Cluster.txt] P
  on ConF.sequence_id = P.sequence_id
;



________________________________________


SELECT * FROM [826].[PmConFeP_loci_counts_norm] CFP
  join [826].[table_PmSiTE.seastar_loci_counts_normalized_Cluster.txt] Si
  on CFP.sequence_id = Si.sequence_id;


________________________________________


SELECT * FROM [826].[PmConFePSi_loci_counts_norm] CFPS
  join [826].[table_PmUreaTE.seastar.loci_count_normalized_cluster.txt] Urea
  on CFPS.sequence_id = Urea.sequence_id


________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_group1_Min1SigDE]
  where logFC_Fe < 1
  and logFC_P > 1
  and logFC_Si > 1
  and logFC_Urea > 1



________________________________________


SELECT * FROM [826].[Psemu1FL_RT_spgp_gp_ok.txt] grp
  join [826].[table_Psemu1FL_chr_allTEs_nr_noSSR_join_path_statsPerTE.txt] counts
  on grp.Consensus = counts.TE


________________________________________


SELECT * FROM [826].[PmTE_ALL-DE_group1_Min1SigDE]
  where logFC_Fe < 0.5
  and logFC_Fe > -0.5
  and logFC_P < -1
  and logFC_Si < -1
  and logFC_Urea < -1



________________________________________


SELECT * FROM [826].[table_Orphans.txt]


________________________________________


SELECT * FROM [826].[Orphans.txt] orphan
  left join [826].[table_PmCLN47_RNASeq.mrgd.annotated.sense.counts.KOGcorrect_GOadded_WC.txt] ann
  on orphan.protein_id = ann.proteinId


________________________________________


SELECT * FROM [826].[Orphans.txt] orphan
  join [826].[table_Thaps3_annotations.txt] ann
  on orphan.protein_id = ann.proteinId


________________________________________


SELECT * FROM [826].[Psemu1-DiaTrois-exactNfdr-exactSifdr_group1.txt]
  



________________________________________


SELECT * FROM [826].[Thaps3_annotations.txt]  ann
  join [826].[table_Thaps3_protein_id_chr_positions_Chr1_only_deduped.txt]  chr1
  on ann.proteinId = chr1.protein_id



________________________________________


SELECT * FROM [826].[PmTE_ALL-DE.txt] DE join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup on supergroup.Consensus = DE.name


________________________________________


SELECT * 
  FROM [826].[PmTE_ALL-DE.txt] DE 
     , [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  WHERE supergroup.Consensus = DE.name
    AND logFC_Fe < 1 
    AND logFC_P > 1 
    AND logFC_Si > 1 
    AND logFC_Urea > 1



________________________________________


SELECT * 
  FROM [826].[PmTE_ALL-DE.txt] DE 
     , [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  WHERE supergroup.Consensus = DE.name
    AND logFC_Fe < 1 
    AND logFC_P > 1 
    AND logFC_Si > 1 
    AND logFC_Urea > 1
    AND (PValue_Fe < 0.05 
         OR PValue_P < 0.05 
         OR PValue_Si < 0.05 
         OR PValue_Urea < 0.05)



________________________________________


SELECT * 
  FROM [826].[PmTE_ALL-DE.txt] DE 
     , [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  WHERE supergroup.Consensus = DE.name
--    AND logFC_Fe < 1 
--    AND logFC_P > 1 
--    AND logFC_Si > 1 
--    AND logFC_Urea > 1
--    AND (PValue_Fe < 0.05 
--         OR PValue_P < 0.05 
--         OR PValue_Si < 0.05 
--         OR PValue_Urea < 0.05)



________________________________________


SELECT count(*) 
  FROM [826].[PmTE_ALL-DE.txt] DE 
     , [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  WHERE supergroup.Consensus = DE.name
--    AND logFC_Fe < 1 
--    AND logFC_P > 1 
--    AND logFC_Si > 1 
--    AND logFC_Urea > 1
--    AND (PValue_Fe < 0.05 
--         OR PValue_P < 0.05 
--         OR PValue_Si < 0.05 
--         OR PValue_Urea < 0.05)



________________________________________


SELECT count(*) 
  FROM [826].[PmTE_ALL-DE.txt] DE 
   --  , [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  --WHERE supergroup.Consensus = DE.name
--    AND logFC_Fe < 1 
--    AND logFC_P > 1 
--    AND logFC_Si > 1 
--    AND logFC_Urea > 1
--    AND (PValue_Fe < 0.05 
--         OR PValue_P < 0.05 
--         OR PValue_Si < 0.05 
--         OR PValue_Urea < 0.05)



________________________________________


SELECT count(*) 
  FROM --[826].[PmTE_ALL-DE.txt] DE 
   --  , 
  [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  --WHERE supergroup.Consensus = DE.name
--    AND logFC_Fe < 1 
--    AND logFC_P > 1 
--    AND logFC_Si > 1 
--    AND logFC_Urea > 1
--    AND (PValue_Fe < 0.05 
--         OR PValue_P < 0.05 
--         OR PValue_Si < 0.05 
--         OR PValue_Urea < 0.05)



________________________________________


SELECT * 
  FROM --[826].[PmTE_ALL-DE.txt] DE 
   --  , 
  [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  --WHERE supergroup.Consensus = DE.name
--    AND logFC_Fe < 1 
--    AND logFC_P > 1 
--    AND logFC_Si > 1 
--    AND logFC_Urea > 1
--    AND (PValue_Fe < 0.05 
--         OR PValue_P < 0.05 
--         OR PValue_Si < 0.05 
--         OR PValue_Urea < 0.05)



________________________________________


SELECT * 
  FROM [826].[PmTE_ALL-DE.txt] DE 
   --  , 
  --[826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  --WHERE supergroup.Consensus = DE.name
--    AND logFC_Fe < 1 
--    AND logFC_P > 1 
--    AND logFC_Si > 1 
--    AND logFC_Urea > 1
--    AND (PValue_Fe < 0.05 
--         OR PValue_P < 0.05 
--         OR PValue_Si < 0.05 
--         OR PValue_Urea < 0.05)



________________________________________


SELECT * 
  FROM [826].[PmTE_ALL-DE.txt] DE 
     , [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  WHERE supergroup.Consensus = DE.name
    AND logFC_Fe < 1 
    AND logFC_P > 1 
    AND logFC_Si > 1 
    AND logFC_Urea > 1
    AND (PValue_Fe < 0.05 
         OR PValue_P < 0.05 
         OR PValue_Si < 0.05 
         OR PValue_Urea < 0.05)



________________________________________


SELECT * FROM [PmTE_ALL-DE_group1_Min1SigDE]


________________________________________


SELECT * 
  FROM [826].[PmTE_ALL-DE.txt] DE 
     , [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  WHERE supergroup.Consensus = DE.name
    AND logFC_Fe < 0.5
    AND logFC_Fe > -0.5 
    AND logFC_P < -1 
    AND logFC_Si < -1 
    AND logFC_Urea < -1
    AND (PValue_Fe < 0.05 
         OR PValue_P < 0.05 
         OR PValue_Si < 0.05 
         OR PValue_Urea < 0.05)



________________________________________



SELECT * FROM [826].[PmTE_ALL-DE_group1_Min1SigDE] where logFC_Fe < 0.5 and logFC_Fe > -0.5 and logFC_P < -1 and logFC_Si < -1 and logFC_Urea < -1


________________________________________


SELECT * 
  FROM [826].[PmTE_ALL-DE.txt] DE 
     , [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] supergroup 
  WHERE supergroup.Consensus = DE.name
    AND logFC_Fe < 1 
    AND logFC_P > 1 
    AND logFC_Si > 1 
    AND logFC_Urea > 1
    AND (PValue_Fe < 0.05 
         OR PValue_P < 0.05 
         OR PValue_Si < 0.05 
         OR PValue_Urea < 0.05)


________________________________________



SELECT * FROM [826].[PmTE_ALL-DE_group1_Min1SigDE_UreaSiPup_Fenotsomuch]


________________________________________



SELECT * FROM [826].[PmTE_ALL-DE_group1_Min1SigDE_UreaSiPDown_Fenotsomuch]


________________________________________


SELECT * FROM [826].[Psemu1-exact_Si_fdr_all_genes.txt] Si
  where Si.fdr < 0.05



________________________________________


SELECT * FROM [826].[UreaSiP_SigDElog_logConcgreater-20lessthantoobig_onlygreater2FC_rel_Fe] DA
  left join [826].[Psemu1-exact_Si_fdr_less_than_05_all_genes] Si
  on DA.proteinId = Si.protein_id


________________________________________


SELECT * FROM [826].[PmTE_ALL-DE.txt] DE
  join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt ] LTR
  on DE.name = LTR.Consensus;


________________________________________


SELECT * FROM [826].[PmConFePSiUrea_loci_counts_norm_Cluster.txt] clust
  join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt ] LTR
  on clust.sequence_id = LTR.Consensus;


________________________________________


SELECT * FROM [826].[PmUreaTE.seastar_ForNormalizing.txt] urea
  join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] REs
  on urea.sequence_id = REs.Consensus
  ;



________________________________________


SELECT * FROM [826].[PmSiTE.seastar_ForNormalizing.txt] Si
  join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] REs
  on Si.sequence_id = REs.Consensus
  ;



________________________________________


SELECT * FROM [826].[table_PmPTE.seastar_ForNormalizingLoci.txt] P
   join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] REs
  on P.sequence_id = REs.Consensus
  ;



________________________________________


SELECT * FROM [826].[table_PmContTE.seastar_forNormalizingByLoci.txt] Cont
   join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] REs
  on Cont.sequence_id = REs.Consensus
  ;



________________________________________


SELECT * FROM [826].[table_PmFeTE.seastar_ForNormalizingByLoci.txt] Fe
   join [826].[table_Psemu1FL_RT_spgp_gp_ok.txt] REs
  on Fe.sequence_id = REs.Consensus
  ;



________________________________________


  SELECT * FROM [826].[table_PmFeTE.seastar_ForNormalizingByLoci.txt] Fe
   join [826].[Psemu1_loci_counts_merged_group1_supergroups_confidentREs_FINAL_TALLY.txt] REs
  on Fe.sequence_id = REs.Consensus
  ;


________________________________________


  SELECT * FROM [826].[table_PmUreaTE.seastar_ForNormalizing.txt] Urea
   join [826].[Psemu1_loci_counts_merged_group1_supergroups_confidentREs_FINAL_TALLY.txt] REs
  on Urea.sequence_id = REs.Consensus
  ;


________________________________________


  SELECT * FROM [826].[table_PmPTE.seastar_ForNormalizingLoci.txt] P
   join [826].[Psemu1_loci_counts_merged_group1_supergroups_confidentREs_FINAL_TALLY.txt] REs
  on P.sequence_id = REs.Consensus
  ;


________________________________________


  SELECT * FROM [826].[table_PmSiTE.seastar_ForNormalizing.txt] Si
   join [826].[Psemu1_loci_counts_merged_group1_supergroups_confidentREs_FINAL_TALLY.txt] REs
  on Si.sequence_id = REs.Consensus
  ;


________________________________________


  SELECT * FROM [826].[table_PmSiTE.seastar_ForNormalizing.txt] Si
   join [826].[Psemu1_loci_counts_merged_group1_supergroups_confidentREs_FINAL_TALLY.txt] REs
  on Si.sequence_id = REs.Consensus
  ;


________________________________________


  SELECT * FROM [826].[table_PmSiTE.seastar_ForNormalizing.txt] Si
   join [826].[Psemu1_loci_counts_merged_group1_supergroups_confidentREs_FINAL_TALLY.txt] REs
  on Si.sequence_id = REs.Consensus
  ;


________________________________________


  SELECT * FROM [826].[table_PmContTE.seastar_forNormalizingByLoci.txt] Cont
   join [826].[Psemu1_loci_counts_merged_group1_supergroups_confidentREs_FINAL_TALLY.txt] REs
  on Cont.sequence_id = REs.Consensus
  ;


________________________________________


SELECT * FROM [826].[PmContTE.seastar_counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] Cont
  full outer join [826].[PmUreaTE.seastar_counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] Urea
  on Cont.Consensus = Urea.Consensus



________________________________________


SELECT * FROM [826].[PmContUreaTE.counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] CU
  full outer join [826].[PmPTE.seastar_counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] P
  on CU.Consensus = P.Consensus



________________________________________


SELECT * FROM [826].[PmContUreaTE.counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] CU
  full outer join [826].[PmPTE.seastar_counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] P
  on CU.Consensus = P.Consensus



________________________________________


SELECT * FROM [826].[PmContUreaTE.counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] CU
  full outer join [826].[PmPTE.seastar_counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] P
  on CU.Consensus = P.Consensus



________________________________________


SELECT * FROM [826].[PmContUreaTE.counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] CU
  full outer join [826].[PmPTE.seastar_counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] P
  on CU.Consensus = P.Consensus


________________________________________


SELECT * FROM [826].[PmContUreaPTE.counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] CUP
  full outer join [826].[PmFeTE.seastar_counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] Fe
  on CUP.Consensus = Fe.Consensus


________________________________________


SELECT * FROM [826].[PmContUreaPFeTE.counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] CUPFe
  full outer join [826].[PmSiTE.seastar_counts.norm_by_loci_FINAL_TALLY_REs_cluster.txt] Si
  on CUPFe.Consensus = Si.Consensus



________________________________________


SELECT *,801 AS FileNumber
FROM [446].[Protein_Groups_N_Pacific_801bacteria_annotation.csv]




________________________________________


SELECT *,801 AS FileNumber
  FROM [446].[Protein_Groups_N_Pacific_801bacteria_annotation.csv]
UNION ALL
SELECT *,802 AS FileNumber
  FROM [446].[Protein_Groups_N_Pacific_802bacteria_annotation.csv]
UNION ALL
SELECT *,803 AS FileNumber
  FROM [446].[Protein_Groups_N_Pacific_803bacteria_annotation.csv]


________________________________________


SELECT *,801 AS FileNumber
  FROM [446].[Protein_Groups_N_Pacific_801bacteria_annotation.csv]
UNION ALL
SELECT *,802 AS FileNumber
  FROM [446].[Protein_Groups_N_Pacific_802bacteria_annotation.csv]
UNION ALL
SELECT *,803 AS FileNumber
  FROM [446].[Protein_Groups_N_Pacific_803bacteria_annotation.csv]
UNION ALL
SELECT *,804 AS FileNumber
  FROM [446].[Protein_Groups_N_Pacific_804bacteria_annotation.csv]


________________________________________


SELECT 801 AS FileNumber,*
  FROM [446].[Protein_Groups_N_Pacific_801bacteria_annotation.csv]
UNION ALL
SELECT 802 AS FileNumber,*
  FROM [446].[Protein_Groups_N_Pacific_802bacteria_annotation.csv]
UNION ALL
SELECT 803 AS FileNumber,*
  FROM [446].[Protein_Groups_N_Pacific_803bacteria_annotation.csv]
UNION ALL
SELECT 804 AS FileNumber,*
  FROM [446].[Protein_Groups_N_Pacific_804bacteria_annotation.csv]


________________________________________


SELECT FileNumber,Function_1,SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
GROUP BY FileNumber,Function_1
ORDER BY Spectra DESC



________________________________________


SELECT FileNumber,FinalTaxonomy,COUNT(*) AS Taxa
FROM [446].[LineP_CAMERA_annotation]
GROUP BY FileNumber,FinalTaxonomy
ORDER BY Taxa DESC



________________________________________


SELECT FileNumber,FinalTaxonomy,SUM(spectra_counts) AS Taxa
FROM [446].[LineP_CAMERA_annotation]
GROUP BY FileNumber,FinalTaxonomy
ORDER BY Taxa DESC



________________________________________


SELECT FileNumber,FinalTaxonomy,SUM(unique_peptide) AS Taxa
FROM [446].[LineP_CAMERA_annotation]
GROUP BY FileNumber,FinalTaxonomy
ORDER BY Taxa DESC



________________________________________


SELECT FileNumber,FinalTaxonomy,SUM(spectra_counts) AS Taxa
FROM [446].[LineP_CAMERA_annotation]
GROUP BY FileNumber,FinalTaxonomy
ORDER BY Taxa DESC



________________________________________


SELECT FileNumber,genus,SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
GROUP BY FileNumber,genus
ORDER BY Spectra DESC



________________________________________


SELECT FileNumber,genus,SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
WHERE genus <> '-'
GROUP BY FileNumber,genus
ORDER BY Spectra DESC



________________________________________


SELECT FileNumber,genus,SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
WHERE genus <> '-'
GROUP BY FileNumber,genus
ORDER BY Spectra DESC



________________________________________


SELECT Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE 'Pelagibacter'



________________________________________


SELECT Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '.*Pelagibacter.*'



________________________________________


SELECT Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'



________________________________________


SELECT Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE species LIKE '%Pelagibacter%'



________________________________________


SELECT Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE species LIKE '%Pelagibacter%'



________________________________________


SELECT Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE species LIKE '%Pelagibacter%'



________________________________________


SELECT Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE species LIKE '%Pelagibacter%'
AND spectra_counts > 2



________________________________________


SELECT Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2



________________________________________


SELECT Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2



________________________________________


SELECT FileNumber,Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2



________________________________________


SELECT FileNumber,Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2



________________________________________


SELECT FileNumber,Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2



________________________________________


SELECT FileNumber,Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2



________________________________________


SELECT FileNumber,Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'



________________________________________


SELECT FileNumber,Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2



________________________________________


SELECT event,*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'Cruise' AS Cruise, '*' AS Station, '1/1/2012' AS [mon/day/yr], '00:00:00' AS [hh:mm]
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'Cruise' AS ODVCruise
     , '*' AS ODVStation
     , '1/1/2012' AS ODVDate
     , '00:00:00' AS ODVTime
     , longitude AS ODVLon
     , latitude AS ODVLat
     , depth AS ODVDepth
     , event
     , temperature
     , salinity
     , conductivity
     , fluorescence
     , oxygen
     , [par.irradiance]
     , flag
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'Cruise' AS [Cruise]
     , '*' AS [Station]
     , '1/1/2012' AS [mon/day/yr]
     , '00:00:00' AS [hh:mm]
     , longitude AS [Lon (8E)]
     , latitude AS [Lat (8N)]
     , depth AS [Bot. Depth m]
     , event
     , temperature
     , salinity
     , conductivity
     , fluorescence
     , oxygen
     , [par.irradiance]
     , flag
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'Cruise' AS [Cruise]
     , '*' AS [Station]
     , '1/1/2012' AS [mon/day/yr]
     , '00:00:00' AS [hh:mm]
     , longitude AS [Lon (8E)]
     , latitude AS [Lat (8N)]
     , depth AS [Bot. Depth]
     , event
     , temperature
     , salinity
     , conductivity
     , fluorescence
     , oxygen
     , [par.irradiance]
     , flag
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'Cruise' AS [Cruise]
     , '*' AS [Station]
     , '1/1/2012' AS [mon/day/yr]
     , '00:00:00' AS [hh:mm]
     , longitude AS [Lon]
     , latitude AS [Lat]
     , depth AS [Bot. Depth]
     , event
     , temperature
     , salinity
     , conductivity
     , fluorescence
     , oxygen
     , [par.irradiance]
     , flag
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'Cruise' AS [Cruise]
     , '*' AS [Station]
     , '1/1/2012' AS [mon/day/yr]
     , '00:00:00' AS [hh:mm]
     , longitude AS [Lon (8E)]
     , latitude AS [Lat (8N)]
     , depth AS [Bot. Depth]
     , event
     , temperature
     , salinity
     , conductivity
     , fluorescence
     , oxygen
     , [par.irradiance]
     , flag
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'Cruise' AS [Cruise]
     , '*' AS [Station]
     , '1/1/2012' AS [mon/day/yr]
     , '00:00:00' AS [hh:mm]
     , longitude AS [Lon (E)]
     , latitude AS [Lat (N)]
     , depth AS [Bot. Depth]
     , event
     , temperature
     , salinity
     , conductivity
     , fluorescence
     , oxygen
     , [par.irradiance]
     , flag
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'Cruise' AS [Cruise]
     , '*' AS [Station]
     , '1/1/2012' AS [mon/day/yr]
     , '00:00:00' AS [hh:mm]
     , longitude AS [Lon (E)]
     , latitude AS [Lat (N)]
     , depth AS [Bot. Depth]
     , [event]
     , [temperature]
     , [salinity]
     , [conductivity]
     , [fluorescence]
     , [oxygen]
     , [par.irradiance]
     , [flag]
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'Cruise' AS [Cruise]
     , '*' AS [Station]
     , '1/1/2012' AS [mon/day/yr]
     , '00:00:00' AS [hh:mm]
     , longitude AS [Lon (E)]
     , latitude AS [Lat (N)]
     , depth AS [Bot. Depth (m)]
     , [event]
     , [temperature]
     , [salinity]
     , [conductivity]
     , [fluorescence]
     , [oxygen]
     , [par.irradiance]
     , [flag]
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , [Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude..Decimal.deg.] AS [Lon (E)]
  , [Latitude..Decimal.deg.] AS [Lat (N)]
  , [Depth..m.] AS [Bot. Depth (m)]
  , [Event]
  , [Label]
  , [fl.349]
  , [fl.357]
  , [fl.363]
  , [fl.366]
  , [fl.369]
  , [fl.375]
  , [fl.384]
  , [fl.386]
  , [fl.388]
  , [fl.390]
  , [fl.393]
  , [fl.405]
  , [fl.410]
FROM [446].[V2_Thalassiosira_ARISA_GEOMICS_RelAbund.csv]



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , [Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Depth] AS [Bot. Depth (m)]
  , [X]
  , [Label]
  , [Event]
  , [Source]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  , [SD_diffO2sat_umole.L]
  , [slope]
  , [intercept]
  , [comments]
FROM [446].[V2_O2_measurements_final.csv]



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , '*' AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [longitude] AS [Lon (E)]
  , [latitude] AS [Lat (N)]
  , [depth] AS [Bot. Depth (m)]
  , [event]
  , [time]
  , [temperature]
  , [salinity]
  , [conductivity]
  , [fluorescence]
  , [oxygen]
  , [par.irradiance]
  , [flag]
  , [time.GMT]
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]



________________________________________


SELECT [Event]
     , [Longitude..Decimal.deg.] AS [Latitude..Decimal.deg.]
     , [Latitude..Decimal.deg.] AS [Longitude..Decimal.deg.]
     , [Station]
     , [Depth..m.]
     , [Label]
     , [Source]
     , [DAPI..cells.ml.]
     , [YOUR.DATA.sd..units.]
     , [Comments]
  FROM [446].[table_V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT [Event]
     , [Latitude..Decimal.deg.] AS [Longitude..Decimal.deg.]
     , [Longitude..Decimal.deg.] AS [Latitude..Decimal.deg.]
     , [Station]
     , [Depth..m.]
     , [Label]
     , [Source]
     , [DAPI..cells.ml.]
     , [YOUR.DATA.sd..units.]
     , [Comments]
  FROM [446].[table_V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT [Event]
  , [Longitude..Decimal.deg.]
  , [Latitude..Decimal.deg.]
  , [Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , [X.Fe..nM]
  , [sd]
  , [columnX]
  , [X.L1...Fe..nM.]
  , [sd.1]
  , [log.K1...Fe.]
  , [sds]
  , [X.L2...Fe..nM.]
  , [sd.2]
  , [log.K2..Fe.]
  , [sd.3]
  , [eL1..Fe..nM.]
  , [X.Cu..nM]
  , [sd.4]
  , [columnY]
  , [X.L1...Cu..nM.]
  , [sd.5]
  , [log.K1...Cu.]
  , [sd.6]
  , [X.L2...Cu..nM.]
  , [sd.7]
  , [log.K2..Cu.]
  , [sd.8]
  , [X.log.Cu2..]
  , [eL1..Cu..nM.]
  , [Comments]
FROM [446].[V2_Copy of GeoMICS_data_RB.csv]



________________________________________


SELECT [Event]
  , [Latitude..Decimal.deg.] AS [Longitude..Decimal.deg.]
  , [Longitude..Decimal.deg.] AS [Latitude..Decimal.deg.]
  , [Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , [X.Fe..nM]
  , [sd]
  , [columnX]
  , [X.L1...Fe..nM.]
  , [sd.1]
  , [log.K1...Fe.]
  , [sds]
  , [X.L2...Fe..nM.]
  , [sd.2]
  , [log.K2..Fe.]
  , [sd.3]
  , [eL1..Fe..nM.]
  , [X.Cu..nM]
  , [sd.4]
  , [columnY]
  , [X.L1...Cu..nM.]
  , [sd.5]
  , [log.K1...Cu.]
  , [sd.6]
  , [X.L2...Cu..nM.]
  , [sd.7]
  , [log.K2..Cu.]
  , [sd.8]
  , [X.log.Cu2..]
  , [eL1..Cu..nM.]
  , [Comments]
FROM [446].[V2_Copy of GeoMICS_data_RB.csv]



________________________________________


SELECT [Event]
  , [Latitude..Decimal.deg.] AS [Longitude..Decimal.deg.]
  , [Longitude..Decimal.deg.] AS [Latitude..Decimal.deg.]
  , [Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , [X.Fe..nM]
  , [sd]
  , [columnX]
  , [X.L1...Fe..nM.]
  , [sd.1]
  , [log.K1...Fe.]
  , [sds]
  , [X.L2...Fe..nM.]
  , [sd.2]
  , [log.K2..Fe.]
  , [sd.3]
  , [eL1..Fe..nM.]
  , [X.Cu..nM]
  , [sd.4]
  , [columnY]
  , [X.L1...Cu..nM.]
  , [sd.5]
  , [log.K1...Cu.]
  , [sd.6]
  , [X.L2...Cu..nM.]
  , [sd.7]
  , [log.K2..Cu.]
  , [sd.8]
  , [X.log.Cu2..]
  , [eL1..Cu..nM.]
  , [Comments]
FROM [446].[table_V2_Copy of GeoMICS_data_RB.csv]



________________________________________


SELECT [Event]
  , [Longitude..Decimal.deg.]
  , [Latitude..Decimal.deg.]
  , [Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , [SynI.Quant.Mean..copies.ul.]
  , [SynI.Quantity.Stdev..copies.ul.]
  , [SynIV.Quant.Mean..copies.ul.]
  , [SynIV.Quantity.Stdev..copies.ul.]
  , [SynIV.Comments]
  , [SynI.SynIV]
FROM [446].[table_V2_GeoMICS_data_SYNECHOCOCCUS_clades_qPCR.csv]



________________________________________


SELECT [Event]
  , [Latitude..Decimal.deg.] AS [Longitude..Decimal.deg.]
  , [Longitude..Decimal.deg.] AS [Latitude..Decimal.deg.]
  , [Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , [SynI.Quant.Mean..copies.ul.]
  , [SynI.Quantity.Stdev..copies.ul.]
  , [SynIV.Quant.Mean..copies.ul.]
  , [SynIV.Quantity.Stdev..copies.ul.]
  , [SynIV.Comments]
  , [SynI.SynIV]
FROM [446].[table_V2_GeoMICS_data_SYNECHOCOCCUS_clades_qPCR.csv]



________________________________________


SELECT [Event]
  , [Latitude..Decimal.deg.] AS [Longitude..Decimal.deg.]
  , [Longitude..Decimal.deg.] AS [Latitude..Decimal.deg.]
  , [Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , [SynI.Quant.Mean..copies.ul.]
  , [SynI.Quantity.Stdev..copies.ul.]
  , [SynIV.Quant.Mean..copies.ul.]
  , [SynIV.Quantity.Stdev..copies.ul.]
  , [SynIV.Comments]
  , [SynI.SynIV]
FROM [446].[table_V2_GeoMICS_data_SYNECHOCOCCUS_clades_qPCR.csv]



________________________________________


SELECT *
  FROM [446].[Protein_Groups_N_Pacific_802bacteria_BLAST.csv]
WHERE DESCRIPTION LIKE '%Iron%'
 


________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation]
 WHERE Function_1 LIKE '%Iron%'
    OR Function_2 LIKE '%Iron%'
    OR Function_3 LIKE '%Iron%'



________________________________________


SELECT *
  FROM [446].[V2_Horak_GeoMICS data.csv]
 WHERE [Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'



________________________________________


SELECT [Depth..m.] FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] 


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.Event = b.Event


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.Event = b.Event


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.Event = b.Event AND [Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.Event = b.Event AND [Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.Event = b.Event -- AND [Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'


________________________________________


SELECT *
  FROM [446].[Protein_Groups_N_Pacific_802bacteria_BLAST.csv]
WHERE DESCRIPTION LIKE '%Iron%'
 


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.Event = b.Event 


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.Event = b.Event 


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.] AND a.[Depth..m.] = b.[Depth..m.]


________________________________________


SELECT a.[Depth..m.],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.] AND a.[Depth..m.] = b.[Depth..m.]


________________________________________


SELECT a.[Depth..m.],b.[Station],[Tot.Cu.nM.],[Ammonia.oxidation.rate..nmol.l.1.d.1.] FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] AS a, 
  [446].[table_V2_Horak_GeoMICS data.csv] AS b
WHERE a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.] AND a.[Depth..m.] = b.[Depth..m.]


________________________________________


SELECT a.[Depth..m.] AS Depth
     , b.[Station] AS Station
     , [Tot.Cu.nM.] As Tot_Cu_nM
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
AND a.[Depth..m.] = b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'



________________________________________


SELECT * FROM [446].[LineP_CAMERA_annotation]


________________________________________


SELECT a.[Depth..m.] AS Depth
     , b.[Station] AS Station
     , [Tot.Cu.nM.] As Tot_Cu_nM
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
AND a.[Depth..m.] = b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY Tot_Cu_nM


________________________________________


SELECT a.[Depth..m.] AS Depth
     , b.[Station] AS Station
     , [Tot.Cu.nM.] As Tot_Cu_nM
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
AND a.[Depth..m.] = b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY DEPTH


________________________________________


SELECT 801 AS Label,*
  FROM [446].[Protein_Groups_N_Pacific_801bacteria_annotation.csv]
UNION ALL
SELECT 802 AS Label,*
  FROM [446].[Protein_Groups_N_Pacific_802bacteria_annotation.csv]
UNION ALL
SELECT 803 AS Label,*
  FROM [446].[Protein_Groups_N_Pacific_803bacteria_annotation.csv]
UNION ALL
SELECT 804 AS Label,*
  FROM [446].[Protein_Groups_N_Pacific_804bacteria_annotation.csv]


________________________________________


SELECT Label,Function_1,SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
GROUP BY Label,Function_1
ORDER BY Spectra DESC



________________________________________


SELECT Label,Function_1,SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
GROUP BY Label,Function_1
ORDER BY Label ASC, Spectra DESC



________________________________________


SELECT Label,Function_1,SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
GROUP BY Label,Function_1
ORDER BY Spectra DESC, Label ASC



________________________________________


SELECT Label,FinalTaxonomy,SUM(spectra_counts) AS Taxa
FROM [446].[LineP_CAMERA_annotation]
GROUP BY Label,FinalTaxonomy
ORDER BY Taxa DESC, Label ASC



________________________________________


SELECT Label,genus,SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
WHERE genus <> '-'
GROUP BY Label,genus
ORDER BY Spectra DESC, Label ASC



________________________________________


SELECT Label,Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2
ORDER BY spectra_counts DESC, LABEL ASC


________________________________________


SELECT Label,Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2
ORDER BY spectra_counts DESC, LABEL ASC


________________________________________


SELECT Label,Function_1,spectra_counts
FROM [446].[LineP_CAMERA_annotation]
WHERE FinalTaxonomy LIKE '%Pelagibacter%'
AND spectra_counts > 2
ORDER BY spectra_counts DESC, LABEL ASC


________________________________________


SELECT iron.Label
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts)
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Label = iron.Label
GROUP BY iron.Label, iron.[Tot.Fe.nM.]



________________________________________


SELECT iron.Label
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts)
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Label = iron.Label
GROUP BY iron.Label, iron.[Tot.Fe.nM.]



________________________________________


SELECT iron.Label
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts)
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Label = iron.Label
GROUP BY iron.Label, iron.[Tot.Fe.nM.]



________________________________________


SELECT [Event]
  , [Latitude..Decimal.deg.]
  , [Longitude..Decimal.deg.]
  , 'P'+cast([Station] AS varchar) AS [Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , [Tot.Fe.nM.]
  , [Stdev..Fe.]
  , [Tot.Cu.nM.]
  , [Stdev..Cu.]
  , [Tot.Mn.nM.]
  , [Stdev.Mn.]
  , [Tot.Zn.nM.]
  , [Stdev..Zn.]
FROM [446].[table_V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]



________________________________________


SELECT iron.Label
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts)
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation] protein,
     [446].[GeoMICS_key.csv] geokey
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Label = geokey.Label
  AND geokey.[Depth..m.] = iron.[Depth..m.]
  AND geokey.Station = iron.Station
GROUP BY iron.Label, iron.[Tot.Fe.nM.]



________________________________________


SELECT *
  FROM [446].[GeoMICS_key.csv]
 WHERE Label > 800



________________________________________


SELECT geokey.Event
     , geokey.[Latitude..Decimal.deg.]
     , geokey.[Longitude.Decimal.deg.]
     , geokey.Station
     , geokey.[Depth..m.]
     , geokey.Source
     , protein.*
FROM [446].[LineP_CAMERA_annotation] protein,
     [446].[GeoMICS_key.csv] geokey
WHERE geokey.Label = protein.Label



________________________________________


SELECT geokey.Event
     , geokey.[Latitude..Decimal.deg.]
     , geokey.[Longitude..Decimal.deg.]
     , geokey.Station
     , geokey.[Depth..m.]
     , geokey.Source
     , protein.*
FROM [446].[LineP_CAMERA_annotation] protein,
     [446].[GeoMICS_key.csv] geokey
WHERE geokey.Label = protein.Label



________________________________________


SELECT Event,MIN([Depth..m.])
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
GROUP BY Event


________________________________________


SELECT Event,MIN([Depth..m.]) AS MinDepth
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
GROUP BY Event


________________________________________


SELECT Station,MIN([Depth..m.]) AS MinDepth
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
GROUP BY Station


________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT * FROM SurfaceMetals


________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts)
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation_full] protein,
     SurfaceMetals
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation_full] protein,
     SurfaceMetals
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation_full] protein,
     SurfaceMetals
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


SELECT DISTINCT Station
FROM [446].[LineP_CAMERA_annotation_full]


________________________________________


SELECT DISTINCT Station
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]


________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     SurfaceMetals,
     [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation_full] protein,
     SurfaceMetals
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS IronProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation_full] protein,
     SurfaceMetals
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')



________________________________________


SELECT Station,SUM(spectra_counts)
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')
GROUP BY Station



________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_2 LIKE '%Iron%'
       OR protein.FUNCTION_3 LIKE '%Iron%')


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%')


________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation_full] protein,
     SurfaceMetals
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation_full] protein,
     SurfaceMetals
WHERE (protein.FUNCTION_1 LIKE '%iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation_full] protein,
     SurfaceMetals
WHERE (protein.FUNCTION_1 LIKE '%IRon%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[LineP_CAMERA_annotation_full] protein,
     SurfaceMetals
WHERE (protein.FUNCTION_1 LIKE '%IRon%'
       OR protein.FUNCTION_1 LIKE '%fERr%'
       OR protein.FUNCTION_2 LIKE '%iROn%'
       OR protein.FUNCTION_2 LIKE '%fERr%'
       OR protein.FUNCTION_3 LIKE '%iROn%'
       OR protein.FUNCTION_3 LIKE '%fERr%')
  AND protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


SELECT a.[Depth..m.]
     , b.[Station]
     , [Tot.Cu.nM.]
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
AND a.[Depth..m.] = b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY [Depth..m.]


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%')


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%fe%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%fe%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%fe%')


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_1 LIKE '%Fe[^a-z]%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%')


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
--       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_1 LIKE '%Fe[^a-z]%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%')


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_1 LIKE '%Fe[^a-z]%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%')


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
--       OR protein.FUNCTION_1 LIKE '%Fe[^a-z]%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%')


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_1 LIKE '%Fe[^a-z]%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_2 LIKE '%Fe[^a-z]%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%Fe[^a-z]%')


________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


SELECT *
FROM [446].[Iron-related_Proteins]
WHERE [Depth..m.] <> 5



________________________________________


SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station


________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , protein.[Depth..m.] AS SurfacePumpDepth
     , iron.[Depth..m.] AS NiskinDepth
     , SUM(protein.spectra_counts) AS ProteinSpectra
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.], iron.[Depth..m.], protein.[Depth..m.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
     , protein.[Depth..m.] AS SurfacePumpDepth
     , iron.[Depth..m.] AS NiskinDepth
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.], iron.[Depth..m.], protein.[Depth..m.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
     , protein.[Depth..m.] AS [SurfacePumpDepth..m.]
     , iron.[Depth..m.] AS [NiskinDepth..m.]
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.], iron.[Depth..m.], protein.[Depth..m.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT 1341ls.Station
     , 1341ls.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
     , protein.[Depth..m.] AS [SurfacePumpDepth..m.]
     , 1341ls.[Depth..m.] AS [NiskinDepth..m.]
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] 1341ls,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = 1341ls.Station
  AND 1341ls.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = 1341ls.Station
GROUP BY 1341ls.Station, 1341ls.[Tot.Fe.nM.], 1341ls.[Depth..m.], protein.[Depth..m.]



________________________________________


SELECT *
FROM [446].[V2_GeoMICS_NitrateIsotopedata_KLCtemplate.csv] nitrate
    , [446].[Iron_Concentration_and_Iron_Related_Proteins] iron
WHERE iron.Station = nitrate.Station
  AND iron.[NiskinDepth..m.] = nitrate.[Depth..m.]


________________________________________


SELECT nitrate.[d15N.NO3]
     , nitrate.[d18O.NO3]
     , iron.*
FROM [446].[V2_GeoMICS_NitrateIsotopedata_KLCtemplate.csv] nitrate
   , [446].[Iron_Concentration_and_Iron_Related_Proteins] iron
WHERE iron.Station = nitrate.Station
  AND iron.[NiskinDepth..m.] = nitrate.[Depth..m.]


________________________________________


SELECT * FROM 
  [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
  
  



________________________________________


SELECT iron.*
     , nitrate.[d15N.NO3]
     , nitrate.[d18O.NO3]
FROM [446].[V2_GeoMICS_NitrateIsotopedata_KLCtemplate.csv] nitrate
   , [446].[Iron_Concentration_and_Iron_Related_Proteins] iron
WHERE iron.Station = nitrate.Station
  AND iron.[NiskinDepth..m.] = nitrate.[Depth..m.]


________________________________________


SELECT * FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
WHERE iron.Station = protein.Station



________________________________________


SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , nitrate.[d15N.NO3]
     , nitrate.[d18O.NO3]
     , iron.ProteinSpectra
     , iron.[SurfacePumpDepth..m.]
     , iron.[NiskinDepth..m.]
FROM [446].[V2_GeoMICS_NitrateIsotopedata_KLCtemplate.csv] nitrate
   , [446].[Iron_Concentration_and_Iron_Related_Proteins] iron
WHERE iron.Station = nitrate.Station
  AND iron.[NiskinDepth..m.] = nitrate.[Depth..m.]


________________________________________


SELECT iron.Station, protein.Station FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
WHERE iron.Station != protein.Station



________________________________________


SELECT iron.Station, protein.Station FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
WHERE iron.Station = protein.Station



________________________________________


SELECT iron.Station, protein.Station FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
WHERE iron.Station = protein.Station



________________________________________


SELECT iron.Station, protein.* FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
WHERE iron.Station = protein.Station



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
  SELECT * FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
  , SurfaceMetals
  WHERE iron.Station = protein.Station
    AND SurfaceMetals.Station = iron.Station



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
  SELECT count(*) FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
  , SurfaceMetals
  WHERE iron.Station = protein.Station
    AND SurfaceMetals.Station = iron.Station



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
  SELECT count(*) FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
  , SurfaceMetals
  WHERE iron.Station = protein.Station
    AND SurfaceMetals.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
  SELECT iron.[Depth..m.], SurfaceMetals.MinDepth FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
  , SurfaceMetals
  WHERE iron.Station = protein.Station
    AND SurfaceMetals.Station = iron.Station
  --AND iron.[Depth..m.] = SurfaceMetals.MinDepth



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
  SELECT iron.*, iron.[Depth..m.], SurfaceMetals.MinDepth FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
  , SurfaceMetals
  WHERE iron.Station = protein.Station
    AND SurfaceMetals.Station = iron.Station
  --AND iron.[Depth..m.] = SurfaceMetals.MinDepth



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
  SELECT iron.Station, iron.Label, iron.[Depth..m.], SurfaceMetals.MinDepth FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
  , SurfaceMetals
  WHERE iron.Station = protein.Station
    AND SurfaceMetals.Station = iron.Station
  --AND iron.[Depth..m.] = SurfaceMetals.MinDepth



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
  SELECT iron.Station, iron.Label, iron.[Depth..m.], SurfaceMetals.MinDepth FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
  , SurfaceMetals
  WHERE iron.Station = protein.Station
    AND SurfaceMetals.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth



________________________________________


WITH SurfaceMetals AS
       (SELECT Station, [Depth..m.] as MinDepth --MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
       )--GROUP BY Station)
  SELECT iron.Station, iron.Label, iron.[Depth..m.], SurfaceMetals.MinDepth FROM 
    [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron
  , [446].[Iron-related_Proteins] protein
  , SurfaceMetals
  WHERE iron.Station = protein.Station
    AND SurfaceMetals.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth



________________________________________


SELECT * FROM [446].[Iron-related_Proteins]


________________________________________


SELECT TOP 2 Label,Taxa
FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]



________________________________________


SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC)
FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]



________________________________________


SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC)
     , Label
     , FinalTaxonomy
     , Taxa
FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]



________________________________________


SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
     , Label
     , FinalTaxonomy
     , Taxa
FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]




________________________________________


SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
     , Label
     , FinalTaxonomy
     , Taxa
FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]


________________________________________


SELECT *
FROM (SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
           , Label
           , FinalTaxonomy
           , Taxa
      FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]) ordered
where ordered.rownum <= 3



________________________________________


SELECT ordered.Label
     , ordered.FinalTaxonomy
     , ordered.Taxa
FROM (SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
           , Label
           , FinalTaxonomy
           , Taxa
      FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]) ordered
where ordered.rownum <= 3



________________________________________


SELECT TOP 3 ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
           , Label
           , FinalTaxonomy
           , Taxa
      FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]



________________________________________


SELECT ordered.Label
     , ordered.FinalTaxonomy
     , ordered.Taxa
FROM (SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
           , Label
           , FinalTaxonomy
           , Taxa
      FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]) ordered
where ordered.rownum <= 3



________________________________________


SELECT ordered.Label
     , ordered.FinalTaxonomy
     , ordered.Taxa
FROM (SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
           , Label
           , FinalTaxonomy
           , Taxa
      FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]) ordered
WHERE ordered.rownum <= 5



________________________________________


SELECT ordered.Station
     , ordered.FinalTaxonomy
     , ordered.Taxa
FROM (SELECT ROW_NUMBER() OVER (Partition by protein.Label ORDER BY Taxa DESC) AS rownum
           , geokey.Station
           , protein.FinalTaxonomy
           , protein.Taxa
      FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa] protein
      JOIN [446].[GeoMICS_key.csv] geokey
        ON geokey.Label = protein.Label) ordered
WHERE ordered.rownum <= 5



________________________________________


SELECT geokey.Station
     , ordered.FinalTaxonomy
     , ordered.Taxa
FROM (SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
           , Label
           , FinalTaxonomy
           , Taxa
      FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]) ordered
JOIN [446].[GeoMICS_key.csv] geokey
  ON ordered.Label = geokey.Label
WHERE ordered.rownum <= 5



________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT *
FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv] virus
JOIN [446].[GeoMICS_key.csv] geokey
  ON (virus.Label = geokey.Label)


________________________________________


SELECT virus.[VLP.mL]
FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv] virus
JOIN [446].[GeoMICS_key.csv] geokey
  ON (virus.Label = geokey.Label)


________________________________________


SELECT virus.[VLP.mL]
     , ctd.*
FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv] virus
JOIN [446].[V2_GeoMICS_ctd_rawdata_labeled] ctd
  ON (virus.Label = ctd.Label)


________________________________________


SELECT virus.[VLP.mL]
     , ctd.*
FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv] virus
JOIN [446].[V2_GeoMICS_ctd_rawdata_labeled] ctd
  ON (virus.Label = ctd.Label)


________________________________________


SELECT [VLP.ML] as Virus_Counts
     , temperature
FROM [446].[Virus_Count_and_CTD_data]


________________________________________


SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
           , Label
           , FinalTaxonomy
           , Taxa
      FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]


________________________________________


SELECT * FROM
(
  SELECT ROW_NUMBER() OVER (Partition by Label ORDER BY Taxa DESC) AS rownum
           , Label
           , FinalTaxonomy
           , Taxa
      FROM [446].[LineP_CAMERA_annotation_FinalTaxonomy_Taxa]
  ) o
    WHERE  o.rownum <= 3



________________________________________


SELECT a.[Depth..m.]
     , b.[Station]
     , [Tot.Cu.nM.]
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
AND a.[Depth..m.] != b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY [Depth..m.]


________________________________________


SELECT b.[Depth..m.]
     , a.[Depth..m.]
     , b.[Station]
     , [Tot.Cu.nM.]
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
AND a.[Depth..m.] != b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY a.[Depth..m.]


________________________________________


SELECT b.[Depth..m.]
     , a.[Depth..m.]
     , b.[Station]
     , [Tot.Cu.nM.]
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
AND a.[Depth..m.] != b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY a.[Depth..m.], b.[Depth..m.]



________________________________________


SELECT b.[Depth..m.]
     , a.[Depth..m.]
     , b.[Station]
     , [Tot.Cu.nM.]
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
--AND a.[Depth..m.] != b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY a.[Depth..m.], b.[Depth..m.]



________________________________________


SELECT b.[Depth..m.]
     , a.[Depth..m.]
     , b.[Station]
     , [Tot.Cu.nM.]
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
--AND a.[Depth..m.] != b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY b.Station, a.Station, a.[Depth..m.], b.[Depth..m.]



________________________________________


SELECT b.[Depth..m.]
     , a.[Depth..m.]
     , b.[Station], a.[Station]
     , [Tot.Cu.nM.]
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
--AND a.[Depth..m.] != b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY b.Station, a.Station, a.[Depth..m.], b.[Depth..m.]



________________________________________


SELECT b.[Depth..m.]
     , a.[Depth..m.]
     , b.[Station], a.[Station], a.[longitude..Decimal.deg.]
     , [Tot.Cu.nM.]
     , [Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
--AND a.[Depth..m.] != b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY b.Station, a.Station, a.[Depth..m.], b.[Depth..m.]



________________________________________


SELECT b.[Depth..m.]
     , a.[Depth..m.]
     , b.[Station], a.[Station], a.[longitude..Decimal.deg.]
     , a.[Tot.Cu.nM.]
     , b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
--AND a.[Depth..m.] != b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY b.Station, a.Station, a.[Depth..m.], b.[Depth..m.]



________________________________________


SELECT a.[Depth..m.]
     , b.[Depth..m.]
     , b.[Station], a.[Station], a.[longitude..Decimal.deg.]
     , a.[Tot.Cu.nM.]
     , b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] AS Ammonia_oxydation_rate_nmol
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
WHERE
    a.[longitude..Decimal.deg.] = b.[longitude..Decimal.deg.]
--AND a.[Depth..m.] != b.[Depth..m.]
AND b.[Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'
ORDER BY b.Station, a.Station, a.[Depth..m.], b.[Depth..m.]



________________________________________


SELECT count(*)
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   , [446].[V2_Horak_GeoMICS data.csv] b
  WHERE a.Station = b.Station



________________________________________


SELECT count(*)
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   LEFT OUTER JOIN [446].[V2_Horak_GeoMICS data.csv] b
  ON a.Station = b.Station



________________________________________


SELECT count(*)
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
   RIGHT OUTER JOIN [446].[V2_Horak_GeoMICS data.csv] b
  ON a.Station = b.Station



________________________________________


SELECT Station, [longitude..Decimal.deg.], *
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
  -- RIGHT OUTER JOIN [446].[V2_Horak_GeoMICS data.csv] b
  --ON a.Station = b.Station



________________________________________


SELECT distinct Station, [Latitude..Decimal.deg.], [longitude..Decimal.deg.]
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
  -- RIGHT OUTER JOIN [446].[V2_Horak_GeoMICS data.csv] b
  --ON a.Station = b.Station



________________________________________


SELECT distinct 'copper', Station, [Latitude..Decimal.deg.], [longitude..Decimal.deg.]
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
 UNION ALL
SELECT distinct 'ammonia', Station, [Latitude..Decimal.deg.], [longitude..Decimal.deg.]
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a

  -- RIGHT OUTER JOIN [446].[V2_Horak_GeoMICS data.csv] b
  --ON a.Station = b.Station



________________________________________


SELECT * FROM 
  (
    SELECT distinct 'copper' as label, Station, [Latitude..Decimal.deg.], [longitude..Decimal.deg.]
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
  ) copper
  JOIN (
SELECT distinct 'ammonia' as label, Station, [Latitude..Decimal.deg.], [longitude..Decimal.deg.]
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] a
) ammonia
  ON copper.[Latitude..Decimal.deg.] = ammonia.[Latitude..Decimal.deg.]
  -- RIGHT OUTER JOIN [446].[V2_Horak_GeoMICS data.csv] b
  --ON a.Station = b.Station



________________________________________


SELECT c.name AS col_name,
       TYPE_NAME(c.1385_type_id) AS type_name
FROM sys.objects AS o 
JOIN sys.columns AS c  ON o.object_id = c.object_id
WHERE o.name = '[446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]'


________________________________________


SELECT c.name AS col_name,
       TYPE_NAME(c.1385_type_id) AS type_name
FROM sys.objects AS o 
JOIN sys.columns AS c  ON o.object_id = c.object_id
WHERE o.name = 'V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv'


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS g,
  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x
WHERE x.[Event #] = g.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS g,
  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[V2_LineP_chlorophyll_final_formatted.csv] AS c
WHERE x.[Event #] = g.Event AND g.Event = c.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS g,
  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[V2_LineP_chlorophyll_final_formatted.csv] AS c
WHERE x.[Event #] = g.Event AND g.Event = c.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
--  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE x.[Event #] = gdgt.Event AND gdgt.Event = oxy.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x
--  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE x.[Event #] = gdgt.Event  -- AND gdgt.Event = oxy.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x
--  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE x.[Event #] = gdgt.Event  -- AND gdgt.Event = oxy.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE gdgt.Event = oxy.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy
-- WHERE gdgt.Event = oxy.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x
--  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE gdgt.Event = oxy.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x
--  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE gdgt.Event = oxy.Event


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x
--  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE gdgt.Station = oxy.Station


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE gdgt.Station = oxy.Station AND doc.Station = oxy.Station


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE gdgt.Station = oxy.Station AND doc.Station = oxy.Station AND x.Station = doc.Station


________________________________________


SELECT * FROM 
--  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE doc.Station = oxy.Station -- AND doc.Station = oxy.Station AND x.Station = doc.Station


________________________________________


SELECT * FROM 
--  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS gdgt
WHERE doc.Station = gdgt.Station -- AND doc.Station = oxy.Station AND x.Station = doc.Station


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--  [446].[V2_O2_measurements_final.csv] AS oxy
WHERE doc.Station = gdgt.Station AND doc.[Depth..m.] = gdgt.[Depth..m.] -- AND doc.Station = oxy.Station AND x.Station = doc.Station


________________________________________


SELECT *
FROM [446].[V2_GeoMICS_data_AJL.csv] ajl
   , [446].[Virus_Count_and_CTD_data] virus
WHERE virus.Label = ajl.Label


________________________________________


SELECT *
FROM [446].[V2_GeoMICS_data_AJL.csv] ajl
   , [446].[Virus_Count_and_CTD_data] virus
   , [446].[V2_GeoMICS_data_SYNECHOCOCCUS_cladesI-IV_qPCR.csv] syn
WHERE virus.Label = ajl.Label
  AND syn.Label = virus.Label


________________________________________


SELECT * FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
--  [446].[V2_O2_measurements_final.csv] AS oxy
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.]


________________________________________


SELECT 
  doc.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , doc.[Station]
  , doc.[Depth..m.]
  , doc.[Label]
  , doc.[Source]
  , [filter.holder]
  , [target.feature]
  , [filter.pore.size]
  , [type.of.GDGT]
  , [Sample]
  , [Liters.filtered]
  , [X1302]
  , [X1300]
  , [X1298]
  , [X1296]
  , [X1292]
  , [X1292.]
  , [X1050]
  , [X1036]
  , [X1022]
  , [X743]
  , [Amt.IS..ng.]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [TOC.sd]
  , [DOC..UMOL.KG.]
  , [DOC.sd]
  , [uDOC..UMOL.KG.]
  , [uDOC.sd]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
--  [446].[V2_O2_measurements_final.csv] AS oxy
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.]


________________________________________


SELECT *
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT 
    gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.]
  , gdgt.[Label]
  , gdgt.[Source]
  , [filter.holder]
  , [target.feature]
  , [type.of.GDGT]
  , [Sample]
  , [X1302]
  , [X1300]
  , [X1298]
  , [X1296]
  , [X1292]
  , [X1292.]
  , [X1050]
  , [X1036]
  , [X1022]
  , [X743]
  , [Amt.IS..ng.]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT *
FROM [446].[V2_GeoMICS_data_AJL.csv] ajl
   , [446].[Virus_Count_and_CTD_data] virus
   , [446].[V2_GeoMICS_data_SYNECHOCOCCUS_cladesI-IV_qPCR.csv] syn
   , [446].[V2_Morris_GeoMICS_data.csv] bact
WHERE virus.Label = ajl.Label
  AND syn.Label = virus.Label
  AND bact.Label = virus.Label



________________________________________


SELECT 
    gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.]
  , gdgt.[Label]
  , gdgt.[Source]
  , [filter.holder]
  , [target.feature]
  , [type.of.GDGT]
  , [Sample]
  , [X1302]
  , [X1300]
  , [X1298]
  , [X1296]
  , [X1292]
  , [X1292.]
  , [X1050]
  , [X1036]
  , [X1022]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT 
    gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.]
  , gdgt.[Label]
  , gdgt.[Source]
  , [filter.holder]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT 
  gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.]
  , gdgt.[Label]
  , gdgt.[Source]
  , [filter.holder]
  , [target.feature]
  , [type.of.GDGT]
  , [Sample]
  , [X1302]
  , [X1300]
  , [X1298]
  , [X1296]
  , [X1292]
  , [X1292.]
  , [X1050]
  , [X1036]
  , [X1022]
  , [X743]
  , [Amt.IS..ng.]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT 
  gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.]
  , gdgt.[Label]
  , gdgt.[Source]
    , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [target.feature]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT *
FROM [446].[Virus_Count_and_CTD_data] virus
   , [446].[V2_Morris_GeoMICS_data.csv] bact
WHERE virus.Label = bact.Label



________________________________________


SELECT *
FROM [446].[Virus_Count_and_CTD_data] virus
   , [446].[V2_Morris_GeoMICS_data.csv] bact
WHERE virus.Label = bact.Label



________________________________________


SELECT [VLP.mL] as VirusCount
     , [DAPI..cells.ml.] as BactCount
FROM [446].[Virus_Count_vs_Bact_Count]


________________________________________


SELECT [VLP.mL] as VirusCount
     , [DAPI..cells.ml.] as BactCount
FROM [446].[Virus_Count_vs_Bact_Count]
WHERE [VLP.ml] <> 'NA'
  AND [DAPI..cells.ml.] <> 'NA'



________________________________________


SELECT 
  gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.] AS Depth
  , gdgt.[Label]
  , gdgt.[Source]
  , doc.[Depth..m.]   
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [target.feature]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT 
  gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.] AS Depth
  , gdgt.[Label]
  , gdgt.[Source]
  , doc.[Depth..m.] AS D
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [target.feature]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT 
  gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.] AS Depth
  , gdgt.[Label]
  , gdgt.[Source]
  , doc.[Depth..m.] AS D
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [target.feature]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
--  [446].[table_2013 02-10 Kujawinski processed data.csv] AS x,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT 
  gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.] AS Depth
  , gdgt.[Label]
  , gdgt.[Source]
  , doc.[Depth..m.] AS D
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt,
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc,
  [446].[V2_O2_measurements_final.csv] AS oxy,
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
WHERE doc.Station = gdgt.Station AND 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND 
  doc.Station = lip.Station AND 
  doc.[Depth..m.] = lip.[Depth..m.] AND
  doc.Station = oxy.Station AND 
  doc.[Depth..m.] = oxy.[Depth]



________________________________________


SELECT 
  gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.] AS Depth
  , gdgt.[Label]
  , gdgt.[Source]
  , doc.[Depth..m.] AS D
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc ON 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station FULL OUTER JOIN
  [446].[V2_O2_measurements_final.csv] AS oxy ON 
  doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station FULL OUTER JOIN
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip ON 
  doc.[Depth..m.] = lip.[Depth..m.] AND doc.Station = lip.Station


________________________________________


SELECT 
  gdgt.[Event]
  , gdgt.[Latitude]
  , gdgt.[Longitude]
  , gdgt.[Station]
  , gdgt.[Depth..m.] AS Depth
  , gdgt.[Label]
  , gdgt.[Source]
  , doc.[Depth..m.] AS D
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]
  
  FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc ON 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station FULL OUTER JOIN
  [446].[V2_O2_measurements_final.csv] AS oxy ON 
  doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station FULL OUTER JOIN
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip ON 
  doc.[Depth..m.] = lip.[Depth..m.] AND doc.Station = lip.Station


________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , [Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude..Decimal.deg.] AS [Lon (E)]
  , [Latitude..Decimal.deg.] AS [Lat (N)]
  , [Depth..m.] AS [Bot. Depth (m)]
  , [Event]
  , [Source]
  , [Label]
  , [ProteinGroup]
  , [unique_peptide]
  , [spectra_counts]
  , [Match_1]
  , [Function_1]
  , [Match_2]
  , [Function_2]
  , [Match_3]
  , [Function_3]
  , [FinalTaxonomy]
  , [superkingdom]
  , [kingdom]
  , [subkingdom]
  , [superphylum]
  , [phylum]
  , [subphylum]
  , [superclass]
  , [class]
  , [subclass]
  , [infraclass]
  , [superorder]
  , [order]
  , [suborder]
  , [infraorder]
  , [parvorder]
  , [superfamily]
  , [family]
  , [subfamily]
  , [tribe]
  , [subtribe]
  , [genus]
  , [subgenus]
  , [species]
  , [subspecies]
  , [species group]
  , [species subgroup]
  , [forma]
  , [varietas]
  , [no rank]
FROM [446].[LineP_CAMERA_annotation_full]



________________________________________


SELECT * FROM [446].[V2_GeoMICS_ctd_rawdata_labeled]


________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT 
    'GeoMICS' AS [Cruise]
  , gdgt.[Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , gdgt.[Latitude] AS [Lat (N)]
  , gdgt.[Longitude] AS [Lon (E)]
  , gdgt.[Depth..m.] AS [Bot. Depth (m)]
  , gdgt.[Depth..m.] AS Depth
  , gdgt.[Event]
  , gdgt.[Label]
  , gdgt.[Source]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]  
FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc ON 
  doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station FULL OUTER JOIN
  [446].[V2_O2_measurements_final.csv] AS oxy ON 
  doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station FULL OUTER JOIN
  [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip ON 
  doc.[Depth..m.] = lip.[Depth..m.] AND doc.Station = lip.Station


________________________________________


SELECT Station FROM [446].[Merge]


________________________________________


SELECT DISTINCT Station FROM [446].[Merge]


________________________________________


SELECT DISTINCT Station FROM [446].[V2_GDGT Data for Francois database.csv]


________________________________________


SELECT DISTINCT Station FROM [446].[V2_O2_measurements_final.csv]


________________________________________


SELECT DISTINCT Station,Depth FROM [446].[V2_O2_measurements_final.csv]


________________________________________


SELECT DISTINCT Station,[Depth..m.] FROM [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv]


________________________________________


SELECT DISTINCT Station FROM [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv]


________________________________________


SELECT *
FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
  ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station


________________________________________


SELECT *
FROM 
  [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
  [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
  ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
  ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station



________________________________________


SELECT DISTINCT Station FROM [446].[Merge]


________________________________________


SELECT DISTINCT Station FROM [446].[V2_O2_measurements_final.csv]


________________________________________


SELECT DISTINCT carbon.Station
FROM [446].[V2_GDGT Data for Francois database.csv] gdgt
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] carbon
on gdgt.[Depth..m.] = carbon.[Depth..m.]


________________________________________


SELECT DISTINCT carbon.Station
FROM [446].[V2_GDGT Data for Francois database.csv] gdgt
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] carbon
  ON gdgt.[Depth..m.] = carbon.[Depth..m.]
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] o2
  ON gdgt.[Depth..m.] = o2.[Depth] OR carbon.[Depth..m.] = o2.[Depth]


________________________________________


SELECT DISTINCT carbon.Station
FROM [446].[V2_GDGT Data for Francois database.csv] gdgt
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] carbon
  ON (gdgt.[Depth..m.] = carbon.[Depth..m.] AND gdgt.[Station] = carbon.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] o2
  ON gdgt.[Depth..m.] = o2.[Depth] OR carbon.[Depth..m.] = o2.[Depth]


________________________________________


SELECT DISTINCT *
FROM [446].[V2_GDGT Data for Francois database.csv] gdgt
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] carbon
  ON (gdgt.[Depth..m.] = carbon.[Depth..m.] AND gdgt.[Station] = carbon.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] o2
  ON gdgt.[Depth..m.] = o2.[Depth] OR carbon.[Depth..m.] = o2.[Depth]


________________________________________


SELECT *
FROM [446].[V2_GDGT Data for Francois database.csv] gdgt
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] carbon
  ON (gdgt.[Depth..m.] = carbon.[Depth..m.] AND gdgt.[Station] = carbon.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] o2
  ON gdgt.[Depth..m.] = o2.[Depth] OR carbon.[Depth..m.] = o2.[Depth]


________________________________________


SELECT *
FROM [446].[V2_GDGT Data for Francois database.csv] gdgt
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] carbon
  ON (gdgt.[Depth..m.] = carbon.[Depth..m.] AND gdgt.[Station] = carbon.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] o2
  ON ((gdgt.[Depth..m.] = o2.[Depth] and gdgt.Station=o2.station) OR (carbon.[Depth..m.] = o2.[Depth] and carbon.station=o2.station))


________________________________________


SELECT * FROM
   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station


________________________________________


SELECT Station
  FROM [446].[Full_Outer_join_gdgt_doc_oxygen]


________________________________________


SELECT gdgt.[Depth..m.], doc.[Depth..m.], gdgt.[Station], doc.[Station] FROM
   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station


________________________________________


SELECT DISTINCT Station
  FROM [446].[Full_Outer_join_gdgt_doc_oxygen]


________________________________________


SELECT DISTINCT Station
  FROM [446].[Full_Outer_join_gdgt_doc_oxygen]
UNION
SELECT DISTINCT STation2
  FROM [446].[Full_Outer_join_gdgt_doc_oxygen]



________________________________________


SELECT gdgt.[Depth..m.], gdgt.[Station] FROM [446].[V2_GDGT Data for Francois database.csv] gdgt 



________________________________________


SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) FROM [446].[V2_GDGT Data for Francois database.csv] gdgt 



________________________________________


SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
  FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
--  FROM [446].[V2_GDGT Data for Francois database.csv] gdgt 



________________________________________


SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
  FROM (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) gdgt
-- FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
--  FROM [446].[V2_GDGT Data for Francois database.csv] gdgt 



________________________________________


SELECT *
FROM [446].[GeoMICS_key.csv] AS main
FULL OUTER JOIN [446].[V2_GDGT Data for Francois database.csv] AS gdgt
  ON (main.[Depth..m.] = gdgt.[Depth..m.] AND main.[Station] = gdgt.Station)


________________________________________


SELECT *
FROM [446].[GeoMICS_key.csv] AS main
FULL OUTER JOIN [446].[V2_GDGT Data for Francois database.csv] AS gdgt
  ON (main.[Depth..m.] = gdgt.[Depth..m.] AND main.[Station] = gdgt.Station)
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] AS carbon
  ON (main.[Depth..m.] = carbon.[Depth..m.] AND main.[Station] = carbon.Station)


________________________________________


SELECT *
FROM [446].[GeoMICS_key.csv] AS main
FULL OUTER JOIN [446].[V2_GDGT Data for Francois database.csv] AS gdgt
  ON (main.[Depth..m.] = gdgt.[Depth..m.] AND main.[Station] = gdgt.Station)
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] AS carbon
  ON (main.[Depth..m.] = carbon.[Depth..m.] AND main.[Station] = carbon.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS o2
  ON (main.[Depth..m.] = o2.[Depth] AND main.[Station] = o2.Station)


________________________________________


SELECT *
FROM [446].[GeoMICS_key.csv] AS main
FULL OUTER JOIN [446].[V2_GDGT Data for Francois database.csv] AS gdgt
  ON (main.[Depth..m.] = gdgt.[Depth..m.] AND main.[Station] = gdgt.Station)
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] AS carbon
  ON (main.[Depth..m.] = carbon.[Depth..m.] AND main.[Station] = carbon.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS o2
  ON (main.[Depth..m.] = o2.[Depth] AND main.[Station] = o2.Station)
FULL OUTER JOIN [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
  ON (main.[Depth..m.] = lip.[Depth..m.] AND main.[Station] = lip.Station)



________________________________________


SELECT 
   'GeoMICS' AS [Cruise]
  , main.[Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , main.[Latitude..Decimal.deg.] AS [Lat (N)]
  , main.[Longitude..Decimal.deg.] AS [Lon (E)]
  , main.[Depth..m.] AS [Bot. Depth (m)]
  , main.[Depth..m.] AS Depth
  , main.[Event]
  , main.[Label]
  , main.[Source]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]  
FROM [446].[GeoMICS_key.csv] AS main
FULL OUTER JOIN [446].[V2_GDGT Data for Francois database.csv] AS gdgt
  ON (main.[Depth..m.] = gdgt.[Depth..m.] AND main.[Station] = gdgt.Station)
FULL OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] AS carbon
  ON (main.[Depth..m.] = carbon.[Depth..m.] AND main.[Station] = carbon.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS o2
  ON (main.[Depth..m.] = o2.[Depth] AND main.[Station] = o2.Station)
FULL OUTER JOIN [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
  ON (main.[Depth..m.] = lip.[Depth..m.] AND main.[Station] = lip.Station)



________________________________________


SELECT DISTINCT Station FROM [446].[Merge]


________________________________________


--SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
SELECT  gdgt.[Depth..m.],  doc.[Depth..m.]
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  FULL OUTER JOIN  
  [446].[V2_GDGT Data for Francois database.csv] doc 
  ON gdgt.[Depth..m.] = doc.[Depth..m.]
-- FROM (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) gdgt




________________________________________


--SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
SELECT  count(distinct gdgt.[Depth..m.]),  count(distinct doc.[Depth..m.])
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  FULL OUTER JOIN  
  [446].[V2_GDGT Data for Francois database.csv] doc 
  ON gdgt.[Depth..m.] = doc.[Depth..m.]
-- FROM (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) gdgt




________________________________________


SELECT 
   'GeoMICS' AS [Cruise]
  , main.[Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , main.[Latitude..Decimal.deg.] AS [Lat (N)]
  , main.[Longitude..Decimal.deg.] AS [Lon (E)]
  , main.[Depth..m.] AS [Bot. Depth (m)]
  , main.[Depth..m.] AS Depth
  , main.[Event]
  , main.[Label]
  , main.[Source]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]  
FROM [446].[GeoMICS_key.csv] AS main
LEFT OUTER JOIN [446].[V2_GDGT Data for Francois database.csv] AS gdgt
  ON (main.[Depth..m.] = gdgt.[Depth..m.] AND main.[Station] = gdgt.Station)
LEFT OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] AS carbon
  ON (main.[Depth..m.] = carbon.[Depth..m.] AND main.[Station] = carbon.Station)
LEFT OUTER JOIN [446].[V2_O2_measurements_final.csv] AS o2
  ON (main.[Depth..m.] = o2.[Depth] AND main.[Station] = o2.Station)
LEFT OUTER JOIN [446].[table_V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
  ON (main.[Depth..m.] = lip.[Depth..m.] AND main.[Station] = lip.Station)



________________________________________


--SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
SELECT  count(distinct gdgt.[Depth..m.]),  count(distinct doc.[Depth..m.])
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  --FULL OUTER JOIN 
 , 
  [446].[V2_GDGT Data for Francois database.csv] doc 
  --ON gdgt.[Depth..m.] = doc.[Depth..m.]
-- FROM (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) gdgt




________________________________________


--SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
SELECT  count(distinct gdgt.[Depth..m.]),  count(distinct doc.[Depth..m.]),  count(distinct gdgt.[Station]),  count(distinct doc.[Station])
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  --FULL OUTER JOIN 
 , 
  [446].[V2_GDGT Data for Francois database.csv] doc 
  --ON gdgt.[Depth..m.] = doc.[Depth..m.]
-- FROM (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) gdgt




________________________________________


--SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
SELECT  count(distinct gdgt.[Depth..m.]),  count(distinct doc.[Depth..m.]),  count(distinct gdgt.[Station]),  count(distinct doc.[Station])
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  FULL OUTER JOIN 
 --, 
  [446].[V2_GDGT Data for Francois database.csv] doc 
  ON gdgt.[Depth..m.] = doc.[Depth..m.]
-- FROM (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) gdgt




________________________________________


--SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
SELECT  count(distinct gdgt.[Depth..m.]),  count(distinct doc.[Depth..m.]),  count(distinct gdgt.[Station]),  count(distinct doc.[Station])
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  FULL OUTER JOIN 
 --, 
  [446].[V2_GDGT Data for Francois database.csv] doc 
  ON gdgt.[Depth..m.] = doc.[Depth..m.] --AND gdt.[Station] = doc.[Station]
--FULL OUTER JOIN
--   (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) oxy
--  ON 




________________________________________


--SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
SELECT  count(distinct gdgt.[Depth..m.]),  count(distinct doc.[Depth..m.]),  count(distinct gdgt.[Station]),  count(distinct doc.[Station])
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  FULL OUTER JOIN 
 --, 
  [446].[V2_GDGT Data for Francois database.csv] doc 
  ON (gdgt.[Depth..m.] = doc.[Depth..m.] AND gdgt.[Station] = doc.[Station])
--FULL OUTER JOIN
--   (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) oxy
--  ON 




________________________________________


SELECT [Latitude..Decimal.deg.],[Longitude..Decimal.deg.],Station
FROM [446].[GeoMICS_key.csv]


________________________________________


SELECT DISTINCT [Latitude..Decimal.deg.],[Longitude..Decimal.deg.],Station
FROM [446].[GeoMICS_key.csv]


________________________________________


SELECT * FROM
  [446].[GeoMICS_key.csv]


________________________________________


SELECT COUNT(*) FROM
  [446].[GeoMICS_key.csv]


________________________________________


SELECT COUNT(*) FROM
  [446].[V2_O2_measurements_final.csv]


________________________________________


SELECT COUNT(*) FROM
  [446].[V2_GDGT Data for Francois database.csv]


________________________________________


SELECT COUNT(*) FROM
  [446].[V2_GDGT Data for Francois database.csv]
  GROUP BY [Depth..m.]


________________________________________


SELECT [Depth..m.], COUNT(*) FROM
  [446].[V2_GDGT Data for Francois database.csv]
  GROUP BY [Depth..m.]


________________________________________


SELECT Station,[Depth..m.], COUNT(*) FROM
  [446].[V2_GDGT Data for Francois database.csv]
  GROUP BY Station,[Depth..m.]


________________________________________


SELECT Station,[Depth..m.], COUNT(*) FROM
  [446].[V2_Carlson_carbon data_GeoMICS.csv]
  GROUP BY Station,[Depth..m.]


________________________________________


--SELECT count(distinct gdgt.[Depth..m.]), count(distinct gdgt.[Station]) 
--SELECT count(distinct gdoc.gdgt_depth),  count(distinct gdoc.doc_depth)
--  ,  count(distinct gdoc.gdgt_station),  count(distinct gdoc.doc_station)
--  , count(distinct oxy.[Station]), count(distinct oxy.[Depth..m.])
--  FROM
--(
SELECT gdgt.[Depth..m.] as gdgt_depth, doc.[Depth..m.] as doc_depth
     , gdgt.[Station] as gdgt_station, doc.[Station] as doc_station
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  FULL OUTER JOIN 
 --, 
  [446].[V2_GDGT Data for Francois database.csv] doc 
  ON (gdgt.[Depth..m.] = doc.[Depth..m.] AND gdgt.[Station] = doc.[Station])
--  ) gdoc
--FULL OUTER JOIN
--   (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) oxy
--    ON (gdoc.[Depth..m.] = doc.[Depth..m.] AND gdoc.[Station] = doc.[Station])
    




________________________________________


SELECT count(distinct gdoc.gdgt_depth),  count(distinct gdoc.doc_depth)
  ,  count(distinct gdoc.gdgt_station),  count(distinct gdoc.doc_station)
--  , count(distinct oxy.[Station]), count(distinct oxy.[Depth..m.])
  FROM
(
SELECT gdgt.[Depth..m.] as gdgt_depth, doc.[Depth..m.] as doc_depth
     , gdgt.[Station] as gdgt_station, doc.[Station] as doc_station
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  FULL OUTER JOIN 
 --, 
  [446].[V2_GDGT Data for Francois database.csv] doc 
  ON (gdgt.[Depth..m.] = doc.[Depth..m.] AND gdgt.[Station] = doc.[Station])
  ) gdoc
--FULL OUTER JOIN
--   (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) oxy
--    ON (gdoc.[Depth..m.] = doc.[Depth..m.] AND gdoc.[Station] = doc.[Station])
    




________________________________________


SELECT count(distinct gdoc.gdgt_depth),  count(distinct gdoc.doc_depth)
  ,  count(distinct gdoc.gdgt_station),  count(distinct gdoc.doc_station)
--  , count(distinct oxy.[Station]), count(distinct oxy.[Depth..m.])
  FROM
(
SELECT gdgt.[Depth..m.] as gdgt_depth, doc.[Depth..m.] as doc_depth
     , gdgt.[Station] as gdgt_station, doc.[Station] as doc_station
 FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv] gdgt
  FULL OUTER JOIN 
 --, 
  [446].[V2_GDGT Data for Francois database.csv] doc 
  ON (gdgt.[Depth..m.] = doc.[Depth..m.] AND gdgt.[Station] = doc.[Station])
  ) gdoc
FULL OUTER JOIN
   (SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]) oxy
    ON (gdoc.gdgt_depth = oxy.[Depth..m.] AND gdoc.gdgt_station = oxy.[Station])
    




________________________________________


--SELECT gdgt.[Depth..m.], doc.[Depth..m.], gdgt.[Station], doc.[Station] FROM
--   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
--   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station

SELECT Depth as [Depth..m.], Station FROM [446].[V2_O2_measurements_final.csv]


________________________________________


--SELECT gdgt.[Depth..m.], doc.[Depth..m.], gdgt.[Station], doc.[Station] FROM
--   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
--   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station

SELECT 
  --Depth as [Depth..m.],
  distinct Station 
  FROM [446].[V2_O2_measurements_final.csv]


________________________________________


--SELECT gdgt.[Depth..m.], doc.[Depth..m.], gdgt.[Station], doc.[Station] FROM
--   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
--   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station

SELECT 
  --Depth as [Depth..m.],
  distinct Station 
  FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv]


________________________________________


--SELECT gdgt.[Depth..m.], doc.[Depth..m.], gdgt.[Station], doc.[Station] FROM
--   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
--   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station

SELECT 
  --Depth as [Depth..m.],
  distinct Station 
  FROM [446].[V2_GDGT Data for Francois database.csv]


________________________________________


--SELECT gdgt.[Depth..m.], doc.[Depth..m.], gdgt.[Station], doc.[Station] FROM
--   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
--   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station

SELECT 
  --Depth as [Depth..m.],
  distinct Station 
  FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv]


________________________________________


--SELECT gdgt.[Depth..m.], doc.[Depth..m.], gdgt.[Station], doc.[Station] FROM
--   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
--   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station

SELECT 
  distinct [Depth..m.]
  --distinct Station 
  FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv]


________________________________________


SELECT * FROM
   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
   ON (doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
 ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station


________________________________________


SELECT distinct gdgt.Station FROM
   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
   ON (doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
 ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station


________________________________________


SELECT distinct doc.Station FROM
   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
   ON (doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
 ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station


________________________________________


SELECT distinct oxy.Station FROM
   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
   ON (doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
 ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station


________________________________________


--SELECT gdgt.[Depth..m.], doc.[Depth..m.], gdgt.[Station], doc.[Station] FROM
--   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
--   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station

SELECT 
  --distinct [Depth..m.]
  distinct Station 
  FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv]


________________________________________


SELECT distinct doc.Station FROM
   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
   ON (doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
 ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station


________________________________________


SELECT distinct gdgt.Station FROM
   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
   ON (doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station)
FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
 ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station


________________________________________


--SELECT gdgt.[Depth..m.], doc.[Depth..m.], gdgt.[Station], doc.[Station] FROM
--   [446].[V2_GDGT Data for Francois database.csv] AS gdgt FULL OUTER JOIN
--   [446].[table_V2_Carlson_carbon data_GeoMICS.csv] AS doc
--   ON doc.[Depth..m.] = gdgt.[Depth..m.] AND doc.Station = gdgt.Station
--FULL OUTER JOIN [446].[V2_O2_measurements_final.csv] AS oxy
-- ON doc.[Depth..m.] = oxy.[Depth] AND doc.Station = oxy.Station

SELECT 
  --distinct [Depth..m.]
  distinct Station 
  FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv]


________________________________________


SELECT 
   'GeoMICS' AS [Cruise]
  , main.[Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , main.[Latitude..Decimal.deg.] AS [Lat (N)]
  , main.[Longitude..Decimal.deg.] AS [Lon (E)]
  , main.[Depth..m.] AS [Bot. Depth (m)]
  , main.[Depth..m.] AS Depth
  , main.[Event]
  , main.[Label]
  , main.[Source]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [PG.0.2.um.pM]
  , [PE.0.2.um.pM]
  , [PC.0.2.um.pM]
  , [SQDG.0.2.um.pM]
  , [MGDG.0.2.um.pM]
  , [DGDG.0.2.um.pM]
  , [DGCC.0.2.um.pM]
  , [DGTA.0.2.um.pM]
  , [DGTS.0.2.um.pM]
  , [PG.GFF.pM]
  , [PE.GFF.pM]
  , [PC.GFF.pM]
  , [SQDG.GFF.pM]
  , [MGDG.GFF.pM]
  , [DGDG.GFF.pM]
  , [DGCC.GFF.pM]
  , [DGTA.GFF.pM]
  , [DGTS.GFF.pM]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]  
FROM [446].[GeoMICS_key.csv] AS main
LEFT OUTER JOIN [446].[V2_GDGT Data for Francois database.csv] AS gdgt
  ON (main.[Depth..m.] = gdgt.[Depth..m.] AND main.[Station] = gdgt.Station)
LEFT OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] AS carbon
  ON (main.[Depth..m.] = carbon.[Depth..m.] AND main.[Station] = carbon.Station)
LEFT OUTER JOIN [446].[V2_O2_measurements_final.csv] AS o2
  ON (main.[Depth..m.] = o2.[Depth] AND main.[Station] = o2.Station)
LEFT OUTER JOIN [446].[V2_GeoMICS_data_PM_BVM_Lipids.csv] AS lip
  ON (main.[Depth..m.] = lip.[Depth..m.] AND main.[Station] = lip.Station)



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , [Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Depth..m.] AS [Bot. Depth (m)]
  , [Event]
  , [Label]
  , [Source]
  , [filter.holder]
  , [target.feature]
  , [filter.pore.size]
  , [type.of.GDGT]
  , [Sample]
  , [Liters.filtered]
  , [X1302]
  , [X1300]
  , [X1298]
  , [X1296]
  , [X1292]
  , [X1292.]
  , [X1050]
  , [X1036]
  , [X1022]
  , [X743]
  , [Amt.IS..ng.]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [Event]
  , [Latitude..Decimal.deg.]
  , [Longitude..Decimal.deg.]
  , [Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , [TOC..UMOL.KG.]
  , [TOC.sd]
  , [DOC..UMOL.KG.]
  , [DOC.sd]
  , [uDOC..UMOL.KG.]
  , [uDOC.sd]
  , [comments]
FROM [446].[Carbon_vs_GDGT]


________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , [Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Depth..m.] AS [Bot. Depth (m)]
  , [Event]
  , [Label]
  , [Source]
  , CASE WHEN [filter.holder] <> 'NA' THEN [filter.holder] ELSE NULL END AS [filter.holder]
  , [target.feature]
  , [filter.pore.size]
  , [type.of.GDGT]
  , [Sample]
  , [Liters.filtered]
  , [X1302]
  , [X1300]
  , [X1298]
  , [X1296]
  , [X1292]
  , [X1292.]
  , [X1050]
  , [X1036]
  , [X1022]
  , [X743]
  , [Amt.IS..ng.]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [Event]
  , [Latitude..Decimal.deg.]
  , [Longitude..Decimal.deg.]
  , [Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , [TOC..UMOL.KG.]
  , [TOC.sd]
  , [DOC..UMOL.KG.]
  , [DOC.sd]
  , [uDOC..UMOL.KG.]
  , [uDOC.sd]
  , [comments]
FROM [446].[Carbon_vs_GDGT]


________________________________________


SELECT 
   'GeoMICS' AS [Cruise]
  , main.[Station] AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , main.[Latitude..Decimal.deg.] AS [Lat (N)]
  , main.[Longitude..Decimal.deg.] AS [Lon (E)]
  , main.[Depth..m.] AS [Bot. Depth (m)]
  , main.[Depth..m.] AS Depth
  , main.[Event]
  , main.[Label]
  , main.[Source]
  , [Conc.1302]
  , [Conc.1300]
  , [Conc.1298]
  , [Conc.1296]
  , [Conc.1292]
  , [Conc.1292.]
  , [Conc.1050]
  , [Conc.1036]
  , [Conc.1022]
  , [filter.holder]
  , [type.of.GDGT]
  , [Sample]
  , [Amt.IS..ng.]
  , [Sum.Isoprenoid]
  , [Sum.Branched]
  , [BIT.Index]
  , [TEX86.Index]
  , [TEX.Temp]
  , [TOC..UMOL.KG.]
  , [DOC..UMOL.KG.]
  , [uDOC..UMOL.KG.]
  , [O2_corr_mL.L]
  , [SD_mL.L]
  , [O2_umole.L]
  , [SD_O2_umole.L]
  , [O2sat_percent]
  , [SD_O2sat_percent]
  , [diffO2sat_umole.L]  
FROM [446].[GeoMICS_key.csv] AS main
LEFT OUTER JOIN [446].[V2_GDGT Data for Francois database.csv] AS gdgt
  ON (main.[Depth..m.] = gdgt.[Depth..m.] AND main.[Station] = gdgt.Station)
LEFT OUTER JOIN [446].[V2_Carlson_carbon data_GeoMICS.csv] AS carbon
  ON (main.[Depth..m.] = carbon.[Depth..m.] AND main.[Station] = carbon.Station)
LEFT OUTER JOIN [446].[V2_O2_measurements_final.csv] AS o2
  ON (main.[Depth..m.] = o2.[Depth] AND main.[Station] = o2.Station)


________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , '*' AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Event]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , [Depth..m.]
  , CASE WHEN [Label] <> 'NA' THEN [Label] ELSE NULL END AS [Label]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [filter.holder] <> 'NA' THEN [filter.holder] ELSE NULL END AS [filter.holder]
  , CASE WHEN [target.feature] <> 'NA' THEN [target.feature] ELSE NULL END AS [target.feature]
  , [filter.pore.size]
  , CASE WHEN [type.of.GDGT] <> 'NA' THEN [type.of.GDGT] ELSE NULL END AS [type.of.GDGT]
  , CASE WHEN [Sample] <> 'NA' THEN [Sample] ELSE NULL END AS [Sample]
  , [Liters.filtered]
FROM [446].[Carbon_vs_GDGT]



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , '*' AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Event]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , [Depth..m.]
  , CASE WHEN [Label] <> 'NA' THEN [Label] ELSE NULL END AS [Label]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [filter.holder] <> 'NA' THEN [filter.holder] ELSE NULL END AS [filter.holder]
  , CASE WHEN [target.feature] <> 'NA' THEN [target.feature] ELSE NULL END AS [target.feature]
  , [filter.pore.size]
  , CASE WHEN [type.of.GDGT] <> 'NA' THEN [type.of.GDGT] ELSE NULL END AS [type.of.GDGT]
  , CASE WHEN [Sample] <> 'NA' THEN [Sample] ELSE NULL END AS [Sample]
  , [Liters.filtered]
  , CASE WHEN [X1302] <> 'NA' THEN [X1302] ELSE NULL END AS [X1302]
  , CASE WHEN [X1300] <> 'NA' THEN [X1300] ELSE NULL END AS [X1300]
  , CASE WHEN [X1298] <> 'NA' THEN [X1298] ELSE NULL END AS [X1298]
  , CASE WHEN [X1296] <> 'NA' THEN [X1296] ELSE NULL END AS [X1296]
  , CASE WHEN [X1292] <> 'NA' THEN [X1292] ELSE NULL END AS [X1292]
  , CASE WHEN [X1292.] <> 'NA' THEN [X1292.] ELSE NULL END AS [X1292.]
FROM [446].[Carbon_vs_GDGT]



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , '*' AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Event]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , [Depth..m.]
  , CASE WHEN [Label] <> 'NA' THEN [Label] ELSE NULL END AS [Label]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [filter.holder] <> 'NA' THEN [filter.holder] ELSE NULL END AS [filter.holder]
  , CASE WHEN [target.feature] <> 'NA' THEN [target.feature] ELSE NULL END AS [target.feature]
  , [filter.pore.size]
  , CASE WHEN [type.of.GDGT] <> 'NA' THEN [type.of.GDGT] ELSE NULL END AS [type.of.GDGT]
  , CASE WHEN [Sample] <> 'NA' THEN [Sample] ELSE NULL END AS [Sample]
  , [Liters.filtered]
  , CASE WHEN [X1302] <> 'NA' THEN [X1302] ELSE NULL END AS [X1302]
  , CASE WHEN [X1300] <> 'NA' THEN [X1300] ELSE NULL END AS [X1300]
  , CASE WHEN [X1298] <> 'NA' THEN [X1298] ELSE NULL END AS [X1298]
  , CASE WHEN [X1296] <> 'NA' THEN [X1296] ELSE NULL END AS [X1296]
  , CASE WHEN [X1292] <> 'NA' THEN [X1292] ELSE NULL END AS [X1292]
  , CASE WHEN [X1292.] <> 'NA' THEN [X1292.] ELSE NULL END AS [X1292.]
  , CASE WHEN [X1050] <> 'NA' THEN [X1050] ELSE NULL END AS [X1050]
  , CASE WHEN [X1036] <> 'NA' THEN [X1036] ELSE NULL END AS [X1036]
  , CASE WHEN [X1022] <> 'NA' THEN [X1022] ELSE NULL END AS [X1022]
  , CASE WHEN [X743] <> 'NA' THEN [X743] ELSE NULL END AS [X743]
  , [Amt.IS..ng.]
FROM [446].[Carbon_vs_GDGT]



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , '*' AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Event]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , [Depth..m.]
  , CASE WHEN [Label] <> 'NA' THEN [Label] ELSE NULL END AS [Label]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [filter.holder] <> 'NA' THEN [filter.holder] ELSE NULL END AS [filter.holder]
  , CASE WHEN [target.feature] <> 'NA' THEN [target.feature] ELSE NULL END AS [target.feature]
  , [filter.pore.size]
  , CASE WHEN [type.of.GDGT] <> 'NA' THEN [type.of.GDGT] ELSE NULL END AS [type.of.GDGT]
  , CASE WHEN [Sample] <> 'NA' THEN [Sample] ELSE NULL END AS [Sample]
  , [Liters.filtered]
  , CASE WHEN [X1302] <> 'NA' THEN [X1302] ELSE NULL END AS [X1302]
  , CASE WHEN [X1300] <> 'NA' THEN [X1300] ELSE NULL END AS [X1300]
  , CASE WHEN [X1298] <> 'NA' THEN [X1298] ELSE NULL END AS [X1298]
  , CASE WHEN [X1296] <> 'NA' THEN [X1296] ELSE NULL END AS [X1296]
  , CASE WHEN [X1292] <> 'NA' THEN [X1292] ELSE NULL END AS [X1292]
  , CASE WHEN [X1292.] <> 'NA' THEN [X1292.] ELSE NULL END AS [X1292.]
  , CASE WHEN [X1050] <> 'NA' THEN [X1050] ELSE NULL END AS [X1050]
  , CASE WHEN [X1036] <> 'NA' THEN [X1036] ELSE NULL END AS [X1036]
  , CASE WHEN [X1022] <> 'NA' THEN [X1022] ELSE NULL END AS [X1022]
  , CASE WHEN [X743] <> 'NA' THEN [X743] ELSE NULL END AS [X743]
  , [Amt.IS..ng.]
  , CASE WHEN [Conc.1302] <> 'NA' THEN [Conc.1302] ELSE NULL END AS [Conc.1302]
  , CASE WHEN [Conc.1300] <> 'NA' THEN [Conc.1300] ELSE NULL END AS [Conc.1300]
  , CASE WHEN [Conc.1298] <> 'NA' THEN [Conc.1298] ELSE NULL END AS [Conc.1298]
  , CASE WHEN [Conc.1296] <> 'NA' THEN [Conc.1296] ELSE NULL END AS [Conc.1296]
  , CASE WHEN [Conc.1292] <> 'NA' THEN [Conc.1292] ELSE NULL END AS [Conc.1292]
  , CASE WHEN [Conc.1292.] <> 'NA' THEN [Conc.1292.] ELSE NULL END AS [Conc.1292.]
  , CASE WHEN [Conc.1050] <> 'NA' THEN [Conc.1050] ELSE NULL END AS [Conc.1050]
  , CASE WHEN [Conc.1036] <> 'NA' THEN [Conc.1036] ELSE NULL END AS [Conc.1036]
  , CASE WHEN [Conc.1022] <> 'NA' THEN [Conc.1022] ELSE NULL END AS [Conc.1022]
  , CASE WHEN [Sum.Isoprenoid] <> 'NA' THEN [Sum.Isoprenoid] ELSE NULL END AS [Sum.Isoprenoid]
  , CASE WHEN [Sum.Branched] <> 'NA' THEN [Sum.Branched] ELSE NULL END AS [Sum.Branched]
FROM [446].[Carbon_vs_GDGT]



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , '*' AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Event]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , [Depth..m.]
  , CASE WHEN [Label] <> 'NA' THEN [Label] ELSE NULL END AS [Label]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [filter.holder] <> 'NA' THEN [filter.holder] ELSE NULL END AS [filter.holder]
  , CASE WHEN [target.feature] <> 'NA' THEN [target.feature] ELSE NULL END AS [target.feature]
  , [filter.pore.size]
  , CASE WHEN [type.of.GDGT] <> 'NA' THEN [type.of.GDGT] ELSE NULL END AS [type.of.GDGT]
  , CASE WHEN [Sample] <> 'NA' THEN [Sample] ELSE NULL END AS [Sample]
  , [Liters.filtered]
  , CASE WHEN [X1302] <> 'NA' THEN [X1302] ELSE NULL END AS [X1302]
  , CASE WHEN [X1300] <> 'NA' THEN [X1300] ELSE NULL END AS [X1300]
  , CASE WHEN [X1298] <> 'NA' THEN [X1298] ELSE NULL END AS [X1298]
  , CASE WHEN [X1296] <> 'NA' THEN [X1296] ELSE NULL END AS [X1296]
  , CASE WHEN [X1292] <> 'NA' THEN [X1292] ELSE NULL END AS [X1292]
  , CASE WHEN [X1292.] <> 'NA' THEN [X1292.] ELSE NULL END AS [X1292.]
  , CASE WHEN [X1050] <> 'NA' THEN [X1050] ELSE NULL END AS [X1050]
  , CASE WHEN [X1036] <> 'NA' THEN [X1036] ELSE NULL END AS [X1036]
  , CASE WHEN [X1022] <> 'NA' THEN [X1022] ELSE NULL END AS [X1022]
  , CASE WHEN [X743] <> 'NA' THEN [X743] ELSE NULL END AS [X743]
  , [Amt.IS..ng.]
  , CASE WHEN [Conc.1302] <> 'NA' THEN [Conc.1302] ELSE NULL END AS [Conc.1302]
  , CASE WHEN [Conc.1300] <> 'NA' THEN [Conc.1300] ELSE NULL END AS [Conc.1300]
  , CASE WHEN [Conc.1298] <> 'NA' THEN [Conc.1298] ELSE NULL END AS [Conc.1298]
  , CASE WHEN [Conc.1296] <> 'NA' THEN [Conc.1296] ELSE NULL END AS [Conc.1296]
  , CASE WHEN [Conc.1292] <> 'NA' THEN [Conc.1292] ELSE NULL END AS [Conc.1292]
  , CASE WHEN [Conc.1292.] <> 'NA' THEN [Conc.1292.] ELSE NULL END AS [Conc.1292.]
  , CASE WHEN [Conc.1050] <> 'NA' THEN [Conc.1050] ELSE NULL END AS [Conc.1050]
  , CASE WHEN [Conc.1036] <> 'NA' THEN [Conc.1036] ELSE NULL END AS [Conc.1036]
  , CASE WHEN [Conc.1022] <> 'NA' THEN [Conc.1022] ELSE NULL END AS [Conc.1022]
  , CASE WHEN [Sum.Isoprenoid] <> 'NA' THEN [Sum.Isoprenoid] ELSE NULL END AS [Sum.Isoprenoid]
  , CASE WHEN [Sum.Branched] <> 'NA' THEN [Sum.Branched] ELSE NULL END AS [Sum.Branched]
  , CASE WHEN [BIT.Index] <> 'NA' THEN [BIT.Index] ELSE NULL END AS [BIT.Index]
  , CASE WHEN [TEX86.Index] <> 'NA' THEN [TEX86.Index] ELSE NULL END AS [TEX86.Index]
  , CASE WHEN [TEX.Temp] <> 'NA' THEN [TEX.Temp] ELSE NULL END AS [TEX.Temp]
FROM [446].[Carbon_vs_GDGT]



________________________________________


SELECT * FROM [446].[V2_CarbonateChem_final.csv]
  WHERE Station='P6' AND Depth=5



________________________________________


SELECT * FROM [446].[V2_CarbonateChem_final.csv]
  WHERE Depth=5



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , '*' AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Event]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , [Depth..m.]
  , CASE WHEN [Label] <> 'NA' THEN [Label] ELSE NULL END AS [Label]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [filter.holder] <> 'NA' THEN [filter.holder] ELSE NULL END AS [filter.holder]
  , CASE WHEN [target.feature] <> 'NA' THEN [target.feature] ELSE NULL END AS [target.feature]
  , [filter.pore.size]
  , CASE WHEN [type.of.GDGT] <> 'NA' THEN [type.of.GDGT] ELSE NULL END AS [type.of.GDGT]
  , CASE WHEN [Sample] <> 'NA' THEN [Sample] ELSE NULL END AS [Sample]
  , [Liters.filtered]
  , CASE WHEN [X1302] <> 'NA' THEN [X1302] ELSE NULL END AS [X1302]
  , CASE WHEN [X1300] <> 'NA' THEN [X1300] ELSE NULL END AS [X1300]
  , CASE WHEN [X1298] <> 'NA' THEN [X1298] ELSE NULL END AS [X1298]
  , CASE WHEN [X1296] <> 'NA' THEN [X1296] ELSE NULL END AS [X1296]
  , CASE WHEN [X1292] <> 'NA' THEN [X1292] ELSE NULL END AS [X1292]
  , CASE WHEN [X1292.] <> 'NA' THEN [X1292.] ELSE NULL END AS [X1292.]
  , CASE WHEN [X1050] <> 'NA' THEN [X1050] ELSE NULL END AS [X1050]
  , CASE WHEN [X1036] <> 'NA' THEN [X1036] ELSE NULL END AS [X1036]
  , CASE WHEN [X1022] <> 'NA' THEN [X1022] ELSE NULL END AS [X1022]
  , CASE WHEN [X743] <> 'NA' THEN [X743] ELSE NULL END AS [X743]
  , [Amt.IS..ng.]
  , CASE WHEN [Conc.1302] <> 'NA' THEN [Conc.1302] ELSE NULL END AS [Conc.1302]
  , CASE WHEN [Conc.1300] <> 'NA' THEN [Conc.1300] ELSE NULL END AS [Conc.1300]
  , CASE WHEN [Conc.1298] <> 'NA' THEN [Conc.1298] ELSE NULL END AS [Conc.1298]
  , CASE WHEN [Conc.1296] <> 'NA' THEN [Conc.1296] ELSE NULL END AS [Conc.1296]
  , CASE WHEN [Conc.1292] <> 'NA' THEN [Conc.1292] ELSE NULL END AS [Conc.1292]
  , CASE WHEN [Conc.1292.] <> 'NA' THEN [Conc.1292.] ELSE NULL END AS [Conc.1292.]
  , CASE WHEN [Conc.1050] <> 'NA' THEN [Conc.1050] ELSE NULL END AS [Conc.1050]
  , CASE WHEN [Conc.1036] <> 'NA' THEN [Conc.1036] ELSE NULL END AS [Conc.1036]
  , CASE WHEN [Conc.1022] <> 'NA' THEN [Conc.1022] ELSE NULL END AS [Conc.1022]
  , CASE WHEN [Sum.Isoprenoid] <> 'NA' THEN [Sum.Isoprenoid] ELSE NULL END AS [Sum.Isoprenoid]
  , CASE WHEN [Sum.Branched] <> 'NA' THEN [Sum.Branched] ELSE NULL END AS [Sum.Branched]
  , CASE WHEN [BIT.Index] <> 'NA' THEN [BIT.Index] ELSE NULL END AS [BIT.Index]
  , CASE WHEN [TEX86.Index] <> 'NA' THEN [TEX86.Index] ELSE NULL END AS [TEX86.Index]
  , CASE WHEN [TEX.Temp] <> 'NA' THEN [TEX.Temp] ELSE NULL END AS [TEX.Temp]
  , [Latitude..Decimal.deg.]
  , [Longitude..Decimal.deg.]
  , CASE WHEN [TOC..UMOL.KG.] <> 'NA' THEN [TOC..UMOL.KG.] ELSE NULL END AS [TOC..UMOL.KG.]
  , CASE WHEN [TOC.sd] <> 'NA' THEN [TOC.sd] ELSE NULL END AS [TOC.sd]
  , CASE WHEN [DOC..UMOL.KG.] <> 'NA' THEN [DOC..UMOL.KG.] ELSE NULL END AS [DOC..UMOL.KG.]
  , CASE WHEN [DOC.sd] <> 'NA' THEN [DOC.sd] ELSE NULL END AS [DOC.sd]
  , CASE WHEN [uDOC..UMOL.KG.] <> 'NA' THEN [uDOC..UMOL.KG.] ELSE NULL END AS [uDOC..UMOL.KG.]
  , CASE WHEN [uDOC.sd] <> 'NA' THEN [uDOC.sd] ELSE NULL END AS [uDOC.sd]
  , CASE WHEN [comments] <> 'NA' THEN [comments] ELSE NULL END AS [comments]
FROM [446].[Carbon_vs_GDGT]



________________________________________


SELECT *
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as iron
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients


________________________________________


SELECT *
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , [Tot.Fe.nM.]/[X..NO3..] AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Depth..m.] AS [Bot. Depth (m)]
  , [Event]
  , CASE WHEN [Label] <> 'NA' THEN [Label] ELSE NULL END AS [Label]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [filter.holder] <> 'NA' THEN [filter.holder] ELSE NULL END AS [filter.holder]
  , CASE WHEN [target.feature] <> 'NA' THEN [target.feature] ELSE NULL END AS [target.feature]
  , [filter.pore.size]
  , CASE WHEN [type.of.GDGT] <> 'NA' THEN [type.of.GDGT] ELSE NULL END AS [type.of.GDGT]
  , CASE WHEN [Sample] <> 'NA' THEN [Sample] ELSE NULL END AS [Sample]
  , [Liters.filtered]
  , CASE WHEN [X1302] <> 'NA' THEN [X1302] ELSE NULL END AS [X1302]
  , CASE WHEN [X1300] <> 'NA' THEN [X1300] ELSE NULL END AS [X1300]
  , CASE WHEN [X1298] <> 'NA' THEN [X1298] ELSE NULL END AS [X1298]
  , CASE WHEN [X1296] <> 'NA' THEN [X1296] ELSE NULL END AS [X1296]
  , CASE WHEN [X1292] <> 'NA' THEN [X1292] ELSE NULL END AS [X1292]
  , CASE WHEN [X1292.] <> 'NA' THEN [X1292.] ELSE NULL END AS [X1292.]
  , CASE WHEN [X1050] <> 'NA' THEN [X1050] ELSE NULL END AS [X1050]
  , CASE WHEN [X1036] <> 'NA' THEN [X1036] ELSE NULL END AS [X1036]
  , CASE WHEN [X1022] <> 'NA' THEN [X1022] ELSE NULL END AS [X1022]
  , CASE WHEN [X743] <> 'NA' THEN [X743] ELSE NULL END AS [X743]
  , [Amt.IS..ng.]
  , CASE WHEN [Conc.1302] <> 'NA' THEN [Conc.1302] ELSE NULL END AS [Conc.1302]
  , CASE WHEN [Conc.1300] <> 'NA' THEN [Conc.1300] ELSE NULL END AS [Conc.1300]
  , CASE WHEN [Conc.1298] <> 'NA' THEN [Conc.1298] ELSE NULL END AS [Conc.1298]
  , CASE WHEN [Conc.1296] <> 'NA' THEN [Conc.1296] ELSE NULL END AS [Conc.1296]
  , CASE WHEN [Conc.1292] <> 'NA' THEN [Conc.1292] ELSE NULL END AS [Conc.1292]
  , CASE WHEN [Conc.1292.] <> 'NA' THEN [Conc.1292.] ELSE NULL END AS [Conc.1292.]
  , CASE WHEN [Conc.1050] <> 'NA' THEN [Conc.1050] ELSE NULL END AS [Conc.1050]
  , CASE WHEN [Conc.1036] <> 'NA' THEN [Conc.1036] ELSE NULL END AS [Conc.1036]
  , CASE WHEN [Conc.1022] <> 'NA' THEN [Conc.1022] ELSE NULL END AS [Conc.1022]
  , CASE WHEN [Sum.Isoprenoid] <> 'NA' THEN [Sum.Isoprenoid] ELSE NULL END AS [Sum.Isoprenoid]
  , CASE WHEN [Sum.Branched] <> 'NA' THEN [Sum.Branched] ELSE NULL END AS [Sum.Branched]
  , CASE WHEN [BIT.Index] <> 'NA' THEN [BIT.Index] ELSE NULL END AS [BIT.Index]
  , CASE WHEN [TEX86.Index] <> 'NA' THEN [TEX86.Index] ELSE NULL END AS [TEX86.Index]
  , CASE WHEN [TEX.Temp] <> 'NA' THEN [TEX.Temp] ELSE NULL END AS [TEX.Temp]
  , [Latitude..Decimal.deg.]
  , [Longitude..Decimal.deg.]
  , [Depth..m.]
  , CASE WHEN [TOC..UMOL.KG.] <> 'NA' THEN [TOC..UMOL.KG.] ELSE NULL END AS [TOC..UMOL.KG.]
  , CASE WHEN [TOC.sd] <> 'NA' THEN [TOC.sd] ELSE NULL END AS [TOC.sd]
  , CASE WHEN [DOC..UMOL.KG.] <> 'NA' THEN [DOC..UMOL.KG.] ELSE NULL END AS [DOC..UMOL.KG.]
  , CASE WHEN [DOC.sd] <> 'NA' THEN [DOC.sd] ELSE NULL END AS [DOC.sd]
  , CASE WHEN [uDOC..UMOL.KG.] <> 'NA' THEN [uDOC..UMOL.KG.] ELSE NULL END AS [uDOC..UMOL.KG.]
  , CASE WHEN [uDOC.sd] <> 'NA' THEN [uDOC.sd] ELSE NULL END AS [uDOC.sd]
  , CASE WHEN [comments] <> 'NA' THEN [comments] ELSE NULL END AS [comments]
FROM [446].[Carbon_vs_GDGT]



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude] AS [Lon (E)]
  , [Latitude] AS [Lat (N)]
  , [Depth..m.] AS [Bot. Depth (m)]
  , [Event]
  , CASE WHEN [Label] <> 'NA' THEN [Label] ELSE NULL END AS [Label]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [filter.holder] <> 'NA' THEN [filter.holder] ELSE NULL END AS [filter.holder]
  , CASE WHEN [target.feature] <> 'NA' THEN [target.feature] ELSE NULL END AS [target.feature]
  , [filter.pore.size]
  , CASE WHEN [type.of.GDGT] <> 'NA' THEN [type.of.GDGT] ELSE NULL END AS [type.of.GDGT]
  , CASE WHEN [Sample] <> 'NA' THEN [Sample] ELSE NULL END AS [Sample]
  , [Liters.filtered]
  , CASE WHEN [X1302] <> 'NA' THEN [X1302] ELSE NULL END AS [X1302]
  , CASE WHEN [X1300] <> 'NA' THEN [X1300] ELSE NULL END AS [X1300]
  , CASE WHEN [X1298] <> 'NA' THEN [X1298] ELSE NULL END AS [X1298]
  , CASE WHEN [X1296] <> 'NA' THEN [X1296] ELSE NULL END AS [X1296]
  , CASE WHEN [X1292] <> 'NA' THEN [X1292] ELSE NULL END AS [X1292]
  , CASE WHEN [X1292.] <> 'NA' THEN [X1292.] ELSE NULL END AS [X1292.]
  , CASE WHEN [X1050] <> 'NA' THEN [X1050] ELSE NULL END AS [X1050]
  , CASE WHEN [X1036] <> 'NA' THEN [X1036] ELSE NULL END AS [X1036]
  , CASE WHEN [X1022] <> 'NA' THEN [X1022] ELSE NULL END AS [X1022]
  , CASE WHEN [X743] <> 'NA' THEN [X743] ELSE NULL END AS [X743]
  , [Amt.IS..ng.]
  , CASE WHEN [Conc.1302] <> 'NA' THEN [Conc.1302] ELSE NULL END AS [Conc.1302]
  , CASE WHEN [Conc.1300] <> 'NA' THEN [Conc.1300] ELSE NULL END AS [Conc.1300]
  , CASE WHEN [Conc.1298] <> 'NA' THEN [Conc.1298] ELSE NULL END AS [Conc.1298]
  , CASE WHEN [Conc.1296] <> 'NA' THEN [Conc.1296] ELSE NULL END AS [Conc.1296]
  , CASE WHEN [Conc.1292] <> 'NA' THEN [Conc.1292] ELSE NULL END AS [Conc.1292]
  , CASE WHEN [Conc.1292.] <> 'NA' THEN [Conc.1292.] ELSE NULL END AS [Conc.1292.]
  , CASE WHEN [Conc.1050] <> 'NA' THEN [Conc.1050] ELSE NULL END AS [Conc.1050]
  , CASE WHEN [Conc.1036] <> 'NA' THEN [Conc.1036] ELSE NULL END AS [Conc.1036]
  , CASE WHEN [Conc.1022] <> 'NA' THEN [Conc.1022] ELSE NULL END AS [Conc.1022]
  , CASE WHEN [Sum.Isoprenoid] <> 'NA' THEN [Sum.Isoprenoid] ELSE NULL END AS [Sum.Isoprenoid]
  , CASE WHEN [Sum.Branched] <> 'NA' THEN [Sum.Branched] ELSE NULL END AS [Sum.Branched]
  , CASE WHEN [BIT.Index] <> 'NA' THEN [BIT.Index] ELSE NULL END AS [BIT.Index]
  , CASE WHEN [TEX86.Index] <> 'NA' THEN [TEX86.Index] ELSE NULL END AS [TEX86.Index]
  , CASE WHEN [TEX.Temp] <> 'NA' THEN [TEX.Temp] ELSE NULL END AS [TEX.Temp]
  , [Latitude..Decimal.deg.]
  , [Longitude..Decimal.deg.]
  , CASE WHEN [TOC..UMOL.KG.] <> 'NA' THEN [TOC..UMOL.KG.] ELSE NULL END AS [TOC..UMOL.KG.]
  , CASE WHEN [TOC.sd] <> 'NA' THEN [TOC.sd] ELSE NULL END AS [TOC.sd]
  , CASE WHEN [DOC..UMOL.KG.] <> 'NA' THEN [DOC..UMOL.KG.] ELSE NULL END AS [DOC..UMOL.KG.]
  , CASE WHEN [DOC.sd] <> 'NA' THEN [DOC.sd] ELSE NULL END AS [DOC.sd]
  , CASE WHEN [uDOC..UMOL.KG.] <> 'NA' THEN [uDOC..UMOL.KG.] ELSE NULL END AS [uDOC..UMOL.KG.]
  , CASE WHEN [uDOC.sd] <> 'NA' THEN [uDOC.sd] ELSE NULL END AS [uDOC.sd]
  , CASE WHEN [comments] <> 'NA' THEN [comments] ELSE NULL END AS [comments]
FROM [446].[Carbon_vs_GDGT]



________________________________________


SELECT
station,
depth,
[Cd.L],
[Mo.L],
[Al.L],
[Mn.L],
[Fe.L],
[Co.L],
[Cu.L],
[P.L],
[Ti.L],
[V.L],
[Ni.L],
[Zn.L]
FROM [446].[V2_geomics icp data for odv.csv]


________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude..Decimal.deg.] AS [Lon (E)]
  , [Latitude..Decimal.deg.] AS [Lat (N)]
  , [Depth..m.] AS [Bot. Depth (m)]
  , [Event]
  , [Bottle.]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [Replicate] <> 'NA' THEN [Replicate] ELSE NULL END AS [Replicate]
  , [X..PO4..]
  , [X..Si.OH.4..]
  , [X..NO3..]
  , [X..NO2..]
  , [X..NH4..]
  , [Tot.Fe.nM.]
  , [Stdev..Fe.]
  , [Tot.Cu.nM.]
  , [Stdev..Cu.]
  , [Tot.Mn.nM.]
  , [Stdev.Mn.]
  , CASE WHEN [Tot.Zn.nM.] <> 'NA' THEN [Tot.Zn.nM.] ELSE NULL END AS [Tot.Zn.nM.]
  , CASE WHEN [Stdev..Zn.] <> 'NA' THEN [Stdev..Zn.] ELSE NULL END AS [Stdev..Zn.]
  , [Fe_NO3_Ratio]
FROM [446].[1341ls_and_nutrients]



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude..Decimal.deg.] AS [Lon (E)]
  , [Latitude..Decimal.deg.] AS [Lat (N)]
  , 3000 AS [Bot. Depth (m)]
  , [Event]
  , [Depth..m.]
  , [Bottle.]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [Replicate] <> 'NA' THEN [Replicate] ELSE NULL END AS [Replicate]
  , [X..PO4..]
  , [X..Si.OH.4..]
  , [X..NO3..]
  , [X..NO2..]
  , [X..NH4..]
  , [Tot.Fe.nM.]
  , [Stdev..Fe.]
  , [Tot.Cu.nM.]
  , [Stdev..Cu.]
  , [Tot.Mn.nM.]
  , [Stdev.Mn.]
  , CASE WHEN [Tot.Zn.nM.] <> 'NA' THEN [Tot.Zn.nM.] ELSE NULL END AS [Tot.Zn.nM.]
  , CASE WHEN [Stdev..Zn.] <> 'NA' THEN [Stdev..Zn.] ELSE NULL END AS [Stdev..Zn.]
  , [Fe_NO3_Ratio]
FROM [446].[1341ls_and_nutrients]



________________________________________


SELECT * FROM 
  [446].[Saito_Codata_submitted.csv] AS main,
  [446].[1341ls_and_nutrients] AS met
WHERE
  main.Station = met.Station AND 
  main.[Depth (m)] = met.[Depth..m.]



________________________________________


SELECT [X..NO3..]
  FROM [446].[V2_LineP_nutrients_formatted.csv]
WHERE Station = 'P1'



________________________________________


SELECT [Depth..m.], [X..NO3..]
  FROM [446].[V2_LineP_nutrients_formatted.csv]
WHERE Station = 'P1'



________________________________________


SELECT [Depth..m.], [Tot.Fe.nM.]
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
WHERE Station = 'P1'



________________________________________


SELECT [Depth..m.], [Tot.Fe.nM.]
  FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
WHERE Station = 'P1'



________________________________________


SELECT [Depth..m.], [X..NO3..]
  FROM [446].[V2_LineP_nutrients_formatted.csv]
WHERE Station = 'P1'



________________________________________


SELECT * FROM 
  [446].[Saito_Codata_submitted.csv] AS main,
  [446].[1341ls_and_nutrients] AS met
WHERE
  main.Station = met.Station AND 
  main.[Depth (m)] = met.[Depth..m.] AND
  main.[Depth (m)] >499
  
  



________________________________________


SELECT * FROM 
  [446].[Saito_Codata_submitted.csv] AS main,
  [446].[1341ls_and_nutrients] AS met
WHERE
  main.Station = met.Station AND 
  main.[Depth (m)] = met.[Depth..m.] AND
  main.[Depth (m)] >200  
  



________________________________________


SELECT [Tot.Fe.nM.]
     , [X..NO3..]
     , Fe_NO3_Ratio
     , [Depth..m.]
  FROM [446].[1341ls_and_nutrients]
WHERE Station = 'P1'



________________________________________


SELECT [Tot.Fe.nM.]
     , [X..NO3..]
     , Fe_NO3_Ratio
     , [Depth..m.]
     , [Longitude..Decimal.deg.]
  FROM [446].[1341ls_and_nutrients]
WHERE Station = 'P1'



________________________________________


SELECT * FROM 
  [446].[Saito_Codata_submitted.csv] AS main,
  [446].[1341ls_and_nutrients] AS met
WHERE
  main.Station = met.Station AND 
  main.[Depth (m)] = met.[Depth..m.] AND
  met.[Depth..m.] >500



________________________________________


SELECT * FROM [446].[GEOMICS_DOM_MASTER.csv],
  [446].[1341ls_and_nutrients]


________________________________________


SELECT COUNT(*) from 1341ls_and_nutrients


________________________________________


SELECT COUNT(*) from 1341ls_and_nutrients


________________________________________


SELECT * FROM [446].[GEOMICS_DOM_MASTER.csv] AS main,
  [446].[1341ls_and_nutrients] AS met
WHERE 
  main.Station = met.Station AND
  main.depth = met.[Depth..m.]


________________________________________


SELECT * from [446].[V2_LineP_nutrients_formatted.csv]
  WHERE Station='P1'


________________________________________


SELECT DISTINCT [depth..m.] from [446].[V2_LineP_nutrients_formatted.csv]
  WHERE Station='P1'


________________________________________


SELECT DISTINCT [depth..m.] from [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
  WHERE Station='P1'


________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , [Tot.Fe.nM.]/[X..NO3..] AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND cast(1341ls.[Depth..m.] as float) = cast(nutrients.[Depth..m.] as float)



________________________________________


SELECT COUNT(*)
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND cast(1341ls.[Depth..m.] as float) = cast(nutrients.[Depth..m.] as float)



________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , [Tot.Fe.nM.]/[X..NO3..] AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND cast(1341ls.[Depth..m.] as float) = cast(nutrients.[Depth..m.] as float)
AND 1341ls.station = 'P1'


________________________________________


SELECT COUNT(*) FROM [446].[1341ls_and_nutrients]


________________________________________


SELECT COUNT(*) FROM [446].[1341ls_and_nutrients]


________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude..Decimal.deg.] AS [Lon (E)]
  , [Latitude..Decimal.deg.] AS [Lat (N)]
  , 3000 AS [Bot. Depth (m)]
  , [Event]
  , [Depth..m.]
  , [Bottle.]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [Replicate] <> 'NA' THEN [Replicate] ELSE NULL END AS [Replicate]
  , [X..PO4..]
  , [X..Si.OH.4..]
  , [X..NO3..]
  , [X..NO2..]
  , [X..NH4..]
  , [Tot.Fe.nM.]
  , [Stdev..Fe.]
  , [Tot.Cu.nM.]
  , [Stdev..Cu.]
  , [Tot.Mn.nM.]
  , [Stdev.Mn.]
  , CASE WHEN [Tot.Zn.nM.] <> 'NA' THEN [Tot.Zn.nM.] ELSE NULL END AS [Tot.Zn.nM.]
  , CASE WHEN [Stdev..Zn.] <> 'NA' THEN [Stdev..Zn.] ELSE NULL END AS [Stdev..Zn.]
  , [Fe_NO3_Ratio]
FROM [446].[1341ls_and_nutrients]



________________________________________


SELECT [hit.description] FROM [446].[table_P8-B.top1000.sorted.nr.tab]
  



________________________________________


SELECT COUNT(*) FROM [446].[1341ls_and_nutrients_for_odv]


________________________________________


SELECT [Label],
  [TOC..UMOL.KG.]
  FROM [446].[table_V2_Carlson_carbon data_GeoMICS.csv]
 


________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE 100 END AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT 
   *
FROM [446].[GeoMICS_key.csv] AS main
LEFT OUTER JOIN [446].[GEOMICS_DOM_MASTER.csv] AS dom
  ON (main.[Depth..m.] = dom.depth AND main.[Station] = dom.Station)
LEFT OUTER JOIN [446].[1341ls_and_nutrients] AS met
  ON (main.[Depth..m.] = met.[Depth..m.] AND main.[Station] = met.Station)



________________________________________


SELECT 'GeoMICS' AS [Cruise]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude..Decimal.deg.] AS [Lon (E)]
  , [Latitude..Decimal.deg.] AS [Lat (N)]
  , 3000 AS [Bot. Depth (m)]
  , [Event]
  , [Depth..m.]
  , [Bottle.]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [Replicate] <> 'NA' THEN [Replicate] ELSE NULL END AS [Replicate]
  , [X..PO4..]
  , [X..Si.OH.4..]
  , [X..NO3..]
  , [X..NO2..]
  , [X..NH4..]
  , [Tot.Fe.nM.]
  , [Stdev..Fe.]
  , [Tot.Cu.nM.]
  , [Stdev..Cu.]
  , [Tot.Mn.nM.]
  , [Stdev.Mn.]
  , CASE WHEN [Tot.Zn.nM.] <> 'NA' THEN [Tot.Zn.nM.] ELSE NULL END AS [Tot.Zn.nM.]
  , CASE WHEN [Stdev..Zn.] <> 'NA' THEN [Stdev..Zn.] ELSE NULL END AS [Stdev..Zn.]
  , [Fe_NO3_Ratio]
FROM [446].[1341ls_and_nutrients]
  ORDER BY [Station] ASC



________________________________________


SELECT count(*) FROM (
SELECT 'GeoMICS' AS [Cruise]
  , CASE WHEN [Station] <> 'NA' THEN [Station] ELSE NULL END AS [Station]
  , '1/1/2012' AS [mon/day/yr]
  , '00:00' AS [hh:mm]
  , [Longitude..Decimal.deg.] AS [Lon (E)]
  , [Latitude..Decimal.deg.] AS [Lat (N)]
  , 3000 AS [Bot. Depth (m)]
  , [Event]
  , [Depth..m.]
  , [Bottle.]
  , CASE WHEN [Source] <> 'NA' THEN [Source] ELSE NULL END AS [Source]
  , CASE WHEN [Replicate] <> 'NA' THEN [Replicate] ELSE NULL END AS [Replicate]
  , [X..PO4..]
  , [X..Si.OH.4..]
  , [X..NO3..]
  , [X..NO2..]
  , [X..NH4..]
  , [Tot.Fe.nM.]
  , [Stdev..Fe.]
  , [Tot.Cu.nM.]
  , [Stdev..Cu.]
  , [Tot.Mn.nM.]
  , [Stdev.Mn.]
  , CASE WHEN [Tot.Zn.nM.] <> 'NA' THEN [Tot.Zn.nM.] ELSE NULL END AS [Tot.Zn.nM.]
  , CASE WHEN [Stdev..Zn.] <> 'NA' THEN [Stdev..Zn.] ELSE NULL END AS [Stdev..Zn.]
  , [Fe_NO3_Ratio]
FROM [446].[1341ls_and_nutrients]
  --ORDER BY [Station] ASC
  ) c



________________________________________


SELECT [hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] = 'ubiquitin B, isoform CRA_e [Homo sapiens]'


________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT [relative abundance] [hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] = 'ubiquitin B, isoform CRA_e [Homo sapiens]'


________________________________________


SELECT [relative abundance],[hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] = 'ubiquitin B, isoform CRA_e [Homo sapiens]'


________________________________________


SELECT * FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%ubiquitin%'


________________________________________


SELECT [relative abundance],[hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab] WHERE [hit.description] = '*urea*'



________________________________________


SELECT [relative abundance],[hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab] WHERE [hit.description] = 'ribosomal'



________________________________________


SELECT [relative abundance],[hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab] WHERE [hit.description] = '*ribosomal*'



________________________________________


SELECT * FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%urea%'


________________________________________


SELECT * FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%Urea%'


________________________________________


SELECT [relative abundance],[hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab] WHERE [hit.description] = 'PREDICTED: ubiquitin-60S ribosomal protein L40 [Sarcophilus harrisii]'



________________________________________


SELECT * FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%nRamp%'


________________________________________


SELECT * FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%urea%'


________________________________________


SELECT [relative abundance],[hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab] WHERE [hit.description] like '%ribosomal%'



________________________________________


SELECT * FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%sodium%'


________________________________________


SELECT * FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%ribosomal%'


________________________________________


SELECT COUNT(*) FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%ribosomal%'


________________________________________


SELECT COUNT([hit.description]) FROM [446].[table_P8-A.top1000.sorted.nr.tab] WHERE [hit.description] like '%ribosomal%'



________________________________________


SELECT * FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%ribosomal%'


________________________________________


SELECT [hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab] WHERE [hit.description] like '%ribosomal%'



________________________________________


SELECT [relative abundance][hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab] WHERE [hit.description] like '%ribosomal%'



________________________________________


SELECT [relative abundance],[hit.description] FROM [446].[table_P8-A.top1000.sorted.nr.tab] WHERE [hit.description] like '%ribosomal%'



________________________________________


SELECT * FROM [446].[V2_LineP_nutrients_formatted.csv]
  Where station = 'P1'



________________________________________


SELECT * FROM [446].[P8-B.top1000.sorted.nr.tab]
  where [hit.description] like '%flavodoxin%'



________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE 0 END AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT SUM([relative abundance]) FROM [446].[table_P8-A.top1000.sorted.nr.tab]
  WHERE [hit.description] LIKE '%ribosomal%'


________________________________________


SELECT * FROM 
  (SELECT * FROM [446].[P8-B.top1000.sorted.nr.tab]
    union 
    SELECT * FROM [446].[P8-A.top1000.sorted.nr.tab]) AS b
  where [hit.description] like '%flavodoxin%'



________________________________________


SELECT * FROM 
  (SELECT * FROM [446].[P8-B.top1000.sorted.nr.tab]
    union 
    SELECT * FROM [446].[P8-A.top1000.sorted.nr.tab]) AS b
  where [hit.description] like '%iron stress induced%'



________________________________________


SELECT * FROM 
  (SELECT * FROM [446].[P8-B.top1000.sorted.nr.tab]
    union 
    SELECT * FROM [446].[P8-A.top1000.sorted.nr.tab]) AS b
  where [hit.description] like '%iron stress%'



________________________________________


SELECT * FROM 
  (SELECT * FROM [446].[P8-B.top1000.sorted.nr.tab]
    union 
    SELECT * FROM [446].[P8-A.top1000.sorted.nr.tab]) AS b
  where [hit.description] like '%Iron%'



________________________________________


SELECT * FROM 
  (SELECT * FROM [446].[P8-B.top1000.sorted.nr.tab]
    union 
    SELECT * FROM [446].[P8-A.top1000.sorted.nr.tab]) AS b
  where [hit.description] like '%Iron starvation%'



________________________________________


SELECT * FROM [446].[Saito_Codata_with_Metal] AS main,
  [446].[V2_geomics icp data for odv.csv ] AS pmet
  WHERE
  main.Station = pmet.station AND
  main.[Depth (m)]= pmet.depth
  



________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT * FROM [446].[function_map]
  WHERE [function] LIKE '%ramp%'



________________________________________


SELECT * FROM [446].[function_map]
  WHERE [function] LIKE '%nramp%'



________________________________________


SELECT * FROM [446].[Saito_Codata_with_Metal] AS main,
  [446].[V2_geomics icp data for odv.csv ] AS pmet
  WHERE
  main.Station = pmet.station AND
  main.[Depth (m)]= pmet.depth AND
  main.[Depth (m)] <201
  



________________________________________


SELECT * FROM [446].[SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT * FROM [446].[SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT * FROM [446].[Saito_Codata_with_Metal] AS main,
  [446].[V2_geomics icp data for odv.csv ] AS pmet
  WHERE
  main.Station = pmet.station AND
  main.[Depth (m)]= pmet.depth   
  



________________________________________


SELECT *
FROM [446].[GeoMICS_key.csv] AS main
LEFT OUTER JOIN [446].[Saito_Codata_submitted.csv] AS cod
  ON (main.[Depth..m.] = cod.[Depth (m)] AND main.[Station] = cod.Station)
LEFT OUTER JOIN [446].[1341ls_and_nutrients] AS met
  ON (main.[Depth..m.] = met.[Depth..m.] AND main.[Station] = met.Station)


________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
  , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT *
FROM [446].[table_LineP_Bathymetry.csv]
ORDER BY [Bottom Depth (m)] ASC



________________________________________


SELECT *
FROM [446].[table_LineP_Bathymetry.csv]
ORDER BY [Bottom Depth (m)] ASC



________________________________________


SELECT geokey.*
     , bathymetry.[Bottom Depth (m)]
FROM [446].[table_GeoMICS_key.csv] geokey
   , [446].[LineP_bathymetry.csv] bathymetry
WHERE bathymetry.Station = geokey.Station  
  



________________________________________


SELECT geokey.*
     , bathymetry.[Bottom Depth (m)]
FROM [446].[table_GeoMICS_key.csv] geokey
   , [446].[LineP_bathymetry.csv] bathymetry
WHERE bathymetry.Station = geokey.Station  
  



________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event 
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT geokey.[Bottom Depth (m)]
     , nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[GeoMICS_key.csv] geokey
   , [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT geokey.[Bottom Depth (m)]
     , nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[GeoMICS_key.csv] geokey
   , [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]



________________________________________


SELECT geokey.[Bottom Depth (m)]
     , nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[GeoMICS_key.csv] geokey
   , [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]
  AND 1341ls.station = geokey.Station


________________________________________


SELECT bathymetry.[Bottom Depth (m)]
     , nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[LineP_bathymetry.csv] bathymetry
   , [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]
  AND 1341ls.station = bathymetry.Station


________________________________________


SELECT * FROM [446].[table_V2_Horak_GeoMICS data.csv]
  where [Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'



________________________________________


SELECT * FROM [446].[table_V2_Horak_GeoMICS data.csv]
  where [Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'



________________________________________


SELECT bathymetry.[Bottom Depth (m)]
     , nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[LineP_bathymetry.csv] bathymetry
   , [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]
  AND 1341ls.station = bathymetry.Station


________________________________________


SELECT bathymetry.[Bottom Depth (m)]
     , nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[LineP_bathymetry.csv] bathymetry
   , [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]
  AND 1341ls.station = bathymetry.Station


________________________________________


SELECT * FROM [446].[table_V2_Horak_GeoMICS data.csv]
  where [Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'



________________________________________


SELECT * FROM [446].[table_V2_Horak_GeoMICS data.csv]
  where [Ammonia.oxidation.rate..nmol.l.1.d.1.] <> 'NA'



________________________________________


SELECT bathymetry.[Bottom Depth (m)]
     , nutrients.*
     , 1341ls.[Tot.Fe.nM.]
     , 1341ls.[Stdev..Fe.]
     , 1341ls.[Tot.Cu.nM.]
     , 1341ls.[Stdev..Cu.]
     , 1341ls.[Tot.Mn.nM.]
     , 1341ls.[Stdev.Mn.]
     , 1341ls.[Tot.Zn.nM.]
     , 1341ls.[Stdev..Zn.]
     , CASE WHEN [X..NO3..] <> 0 THEN [Tot.Fe.nM.]/[X..NO3..] ELSE NULL END AS Fe_NO3_Ratio
FROM [446].[LineP_bathymetry.csv] bathymetry
   , [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] as 1341ls
   , [446].[V2_LineP_nutrients_formatted.csv] as nutrients
WHERE 1341ls.station = nutrients.station
  AND 1341ls.[Depth..m.] = nutrients.[Depth..m.]
  AND 1341ls.station = bathymetry.Station


________________________________________


SELECT *
     , cast([time.gmt] AS date) as Date
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT *
     , cast([time.gmt] AS datetime) as Date_Time
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________



SELECT *
     , Year(CAST([TIME.GMT] AS datetime)) as [yy]
     , Month(Year(CAST([TIME.GMT] AS datetime))) as [mm]
     , Day(Year(CAST([TIME.GMT] AS datetime))) as [dd]
     , DatePart(hh, Year(CAST([TIME.GMT] AS datetime))) as [hh]
     , DatePart(mm, Year(CAST([TIME.GMT] AS datetime))) as [mm]
     , DatePart(ss, Year(CAST([TIME.GMT] AS datetime))) as [ss]
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________



SELECT *
     , DatePart(yy,[time.GMT]) as [yy]
     , Month(Year(CAST([TIME.GMT] AS datetime))) as [mm]
     , Day(Year(CAST([TIME.GMT] AS datetime))) as [dd]
     , DatePart(hh, Year(CAST([TIME.GMT] AS datetime))) as [hh]
     , DatePart(mm, Year(CAST([TIME.GMT] AS datetime))) as [mm]
     , DatePart(ss, Year(CAST([TIME.GMT] AS datetime))) as [ss]
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________



SELECT *
     , DatePart(yy,[time.GMT]) as [year]
     , DatePart(month,[time.GMT]) as [month]
     , DatePart(day, [time.GMT]) as [day]
     , DatePart(hh, Year(CAST([TIME.GMT] AS datetime))) as [hh]
     , DatePart(mm, Year(CAST([TIME.GMT] AS datetime))) as [mm]
     , DatePart(ss, Year(CAST([TIME.GMT] AS datetime))) as [ss]
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________



SELECT *
     , DatePart(yy,[time.GMT]) as [year]
     , DatePart(month,[time.GMT]) as [month]
     , DatePart(day, [time.GMT]) as [day]
     , DatePart(hh, [time.GMT]) as [hh]
     , DatePart(mm, [time.GMT]) as [mm]
     , DatePart(ss, [time.GMT]) as [ss]
FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT *
     , DatePart(yy,[time]) as [year]
     , DatePart(month,[time]) as [month]
     , DatePart(day, [time]) as [day]
     , DatePart(hh, [time]) as [hh]
     , DatePart(mm, [time]) as [mm]
     , DatePart(ss, [time]) as [ss]
FROM [446].[table_SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT DatePart(yy,[time]) as [year]
     , DatePart(month,[time]) as [month]
     , DatePart(day, [time]) as [day]
     , DatePart(hh, [time]) as [hh]
     , DatePart(mm, [time]) as [mm]
     , DatePart(ss, [time]) as [ss]
     , *
FROM [446].[table_SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT DatePart(yy,[time]) as [year]
     , DatePart(month,[time]) as [month]
     , DatePart(day, [time]) as [day]
     , DatePart(hh, [time]) as [hh]
     , DatePart(mi, [time]) as [mm]
     , DatePart(ss, [time]) as [ss]
     , *
FROM [446].[table_SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT *
     , DatePart(yy,[time.GMT]) as [year]
     , DatePart(month,[time.GMT]) as [month]
     , DatePart(day, [time.GMT]) as [day]
     , DatePart(hh, [time.GMT]) as [hh]
     , DatePart(mi, [time.GMT]) as [mm]
     , DatePart(ss, [time.GMT]) as [ss]
FROM [446].[table_V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT *
     , DatePart(yy,[time]) as [year]
     , DatePart(month,[time]) as [month]
     , DatePart(day, [time]) as [day]
     , DatePart(hh, [time]) as [hh]
     , DatePart(mi, [time]) as [mm]
     , DatePart(ss, [time]) as [ss]
FROM [446].[table_SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT *
     , DatePart(yy,[time]) as [year]
     , DatePart(month,[time]) as [month]
     , DatePart(day, [time]) as [day]
     , DatePart(hh, [time]) as [hh]
     , DatePart(mi, [time]) as [mm]
     , DatePart(ss, [time]) as [ss]
FROM [446].[table_SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT *
FROM [446].[V2_geomics icp data for odv.csv]
WHERE Station='P8' and depth=20



________________________________________


SELECT *
FROM [446].[GeoMICS_key.csv] AS main
LEFT OUTER JOIN [446].[Saito_Codata_submitted.csv] AS cod
  ON (main.[Depth..m.] = cod.[Depth (m)] AND main.[Station] = cod.Station)
LEFT OUTER JOIN [446].[1341ls_and_nutrients] AS met
  ON (main.[Depth..m.] = met.[Depth..m.] AND main.[Station] = met.Station)


________________________________________


SELECT *
FROM [446].[GeoMICS_key.csv] AS main
LEFT OUTER JOIN [446].[Saito_Codata_submitted.csv] AS cod
  ON (main.[Depth..m.] = cod.[Depth (m)] AND main.[Station] = cod.Station)
LEFT OUTER JOIN [446].[1341ls_and_nutrients] AS met
  ON (main.[Depth..m.] = met.[Depth..m.] AND main.[Station] = met.Station)


________________________________________


SELECT * FROM 
  [446].[Saito_Codata_submitted.csv] AS main,
  [446].[1341ls_and_nutrients] AS met
WHERE main.Station = met.Station
  AND main.[Depth (m)] = met.[Depth..m.]
  AND met.Replicate = 'A'



________________________________________


SELECT * FROM [446].[Saito_Codata_with_Metal] AS main,
  [446].[V2_geomics icp data for odv.csv ] AS pmet
  WHERE
  main.Station = pmet.station AND
  main.[Depth (m)]= pmet.depth  AND
  main.Replicate = 'A' 



________________________________________


SELECT * FROM [446].[Saito_Codata_with_Metal] AS main,
  [446].[V2_geomics icp data for odv.csv ] AS pmet
  WHERE
  main.Station = pmet.station AND
  main.[Depth (m)]= pmet.depth  AND
  main.Replicate = 'A' AND
  main.[Depth (m)] <201



________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END
  , [Accession]
  , [BLAST_NR ANNOTATION]
  , [BLAST NR ORGANISM]
  , [BLAST Microbial P col1]
  , [BLAST Microbial P col2]
  , [Molecular Weight]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END AS [Identified Proteins]
  , [Accession]
  , [BLAST_NR ANNOTATION]
  , [BLAST NR ORGANISM]
  , [BLAST Microbial P col1]
  , [BLAST Microbial P col2]
  , [Molecular Weight]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END AS [Identified Proteins]
  , CASE WHEN [Accession] = '#N/A' THEN NULL ELSE [Accession] END AS [Accession]
  , CASE WHEN [BLAST_NR ANNOTATION] = '#N/A' THEN NULL ELSE [BLAST_NR ANNOTATION] END AS [Accession]
  , [BLAST NR ORGANISM]
  , [BLAST Microbial P col1]
  , [BLAST Microbial P col2]
  , [Molecular Weight]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END AS [Identified Proteins]
  , CASE WHEN [Accession] = '#N/A' THEN NULL ELSE [Accession] END AS [Accession]
  , CASE WHEN [BLAST_NR ANNOTATION] = '#N/A' THEN NULL ELSE [BLAST_NR ANNOTATION] END AS [BLAST_NR ANNOTATION]
  , CASE WHEN [BLAST NR ORGANISM] = '#N/A' THEN NULL ELSE [BLAST NR ORGANISM] END AS [BLAST NR ORGANISM]
  , CASE WHEN [BLAST Microbial P col1] = '#N/A' THEN NULL ELSE [BLAST Microbial P col1] END AS [BLAST Microbial P col1]
  , CASE WHEN [BLAST Microbial P col2] = '#N/A' THEN NULL ELSE [BLAST Microbial P col2] END AS [BLAST Microbial P col2]
  , CASE WHEN [Molecular Weight] = '#N/A' THEN NULL ELSE [Molecular Weight] END AS [Molecular Weight]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END AS [Identified Proteins]
  , CASE WHEN [Accession] = '#N/A' THEN NULL ELSE [Accession] END AS [Accession]
  , CASE WHEN [BLAST_NR ANNOTATION] = '#N/A' THEN NULL ELSE [BLAST_NR ANNOTATION] END AS [BLAST_NR ANNOTATION]
  , CASE WHEN [BLAST NR ORGANISM] = '#N/A' THEN NULL ELSE [BLAST NR ORGANISM] END AS [BLAST NR ORGANISM]
  , CASE WHEN [BLAST Microbial P col1] = '#N/A' THEN NULL ELSE [BLAST Microbial P col1] END AS [BLAST Microbial P col1]
  , CASE WHEN [BLAST Microbial P col2] = '#N/A' THEN NULL ELSE [BLAST Microbial P col2] END AS [BLAST Microbial P col2]
  , CASE WHEN [Molecular Weight] = '?' THEN NULL ELSE [Molecular Weight] END AS [Molecular Weight]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT * FROM [446].[Saito_Codata_with_Metal] AS main,
  [446].[V2_geomics icp data for odv.csv ] AS pmet
  WHERE
  main.Station = pmet.station AND
  main.[Depth (m)]= pmet.depth  AND
  main.Replicate = 'A'




________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END AS [Identified Proteins]
  , CASE WHEN [Accession] = '#N/A' THEN NULL ELSE [Accession] END AS [Accession]
  , CASE WHEN [BLAST_NR ANNOTATION] = '#N/A' THEN NULL ELSE [BLAST_NR ANNOTATION] END AS [BLAST_NR ANNOTATION]
  , CASE WHEN [BLAST NR ORGANISM] = '#N/A' THEN NULL ELSE [BLAST NR ORGANISM] END AS [BLAST NR ORGANISM]
  , CASE WHEN [BLAST Microbial P col1] = '#N/A' THEN NULL ELSE [BLAST Microbial P col1] END AS [BLAST Microbial P col1]
  , CASE WHEN [BLAST Microbial P col2] = '#N/A' THEN NULL ELSE [BLAST Microbial P col2] END AS [BLAST Microbial P col2]
  , CASE WHEN CHARINDEX('kDa',[Molecular Weight]) = 0 THEN NULL ELSE CHARINDEX('kDa',[Molecular Weight]) END AS [Molecular Weight (kDa)]
--  , CASE WHEN CHARINDEX('kDa',[Molecular Weight]) = 0 THEN NULL ELSE CAST(SUBSTRING([Molecular Weight], 1, CHARINDEX('kDa',[Molecular Weight])) AS FLOAT) END AS [Molecular Weight (kDa)]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT * FROM [446].[GEOMICS_DOM_MASTER.csv] as main,
    [446].[Saito_Codata_with_Metal] AS met
WHERE main.STATION = met.Station
  AND main.depth = met.[Depth..m.]
  AND met.Replicate = 'A'


________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END AS [Identified Proteins]
  , CASE WHEN [Accession] = '#N/A' THEN NULL ELSE [Accession] END AS [Accession]
  , CASE WHEN [BLAST_NR ANNOTATION] = '#N/A' THEN NULL ELSE [BLAST_NR ANNOTATION] END AS [BLAST_NR ANNOTATION]
  , CASE WHEN [BLAST NR ORGANISM] = '#N/A' THEN NULL ELSE [BLAST NR ORGANISM] END AS [BLAST NR ORGANISM]
  , CASE WHEN [BLAST Microbial P col1] = '#N/A' THEN NULL ELSE [BLAST Microbial P col1] END AS [BLAST Microbial P col1]
  , CASE WHEN [BLAST Microbial P col2] = '#N/A' THEN NULL ELSE [BLAST Microbial P col2] END AS [BLAST Microbial P col2]
  , CASE WHEN CHARINDEX('kDa',[Molecular Weight]) = 0 THEN NULL ELSE SUBSTRING([Molecular Weight], 1, CHARINDEX('kDa',[Molecular Weight])) END AS [Molecular Weight (kDa)]
--  , CASE WHEN CHARINDEX('kDa',[Molecular Weight]) = 0 THEN NULL ELSE CAST(SUBSTRING([Molecular Weight], 1, CHARINDEX('kDa',[Molecular Weight])) AS FLOAT) END AS [Molecular Weight (kDa)]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END AS [Identified Proteins]
  , CASE WHEN [Accession] = '#N/A' THEN NULL ELSE [Accession] END AS [Accession]
  , CASE WHEN [BLAST_NR ANNOTATION] = '#N/A' THEN NULL ELSE [BLAST_NR ANNOTATION] END AS [BLAST_NR ANNOTATION]
  , CASE WHEN [BLAST NR ORGANISM] = '#N/A' THEN NULL ELSE [BLAST NR ORGANISM] END AS [BLAST NR ORGANISM]
  , CASE WHEN [BLAST Microbial P col1] = '#N/A' THEN NULL ELSE [BLAST Microbial P col1] END AS [BLAST Microbial P col1]
  , CASE WHEN [BLAST Microbial P col2] = '#N/A' THEN NULL ELSE [BLAST Microbial P col2] END AS [BLAST Microbial P col2]
  , CASE WHEN CHARINDEX('kDa',[Molecular Weight]) = 0 THEN NULL ELSE SUBSTRING([Molecular Weight], 1, CHARINDEX('kDa',[Molecular Weight])-1) END AS [Molecular Weight (kDa)]
--  , CASE WHEN CHARINDEX('kDa',[Molecular Weight]) = 0 THEN NULL ELSE CAST(SUBSTRING([Molecular Weight], 1, CHARINDEX('kDa',[Molecular Weight])) AS FLOAT) END AS [Molecular Weight (kDa)]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END AS [Identified Proteins]
  , CASE WHEN [Accession] = '#N/A' THEN NULL ELSE [Accession] END AS [Accession]
  , CASE WHEN [BLAST_NR ANNOTATION] = '#N/A' THEN NULL ELSE [BLAST_NR ANNOTATION] END AS [BLAST_NR ANNOTATION]
  , CASE WHEN [BLAST NR ORGANISM] = '#N/A' THEN NULL ELSE [BLAST NR ORGANISM] END AS [BLAST NR ORGANISM]
  , CASE WHEN [BLAST Microbial P col1] = '#N/A' THEN NULL ELSE [BLAST Microbial P col1] END AS [BLAST Microbial P col1]
  , CASE WHEN [BLAST Microbial P col2] = '#N/A' THEN NULL ELSE [BLAST Microbial P col2] END AS [BLAST Microbial P col2]
  , CASE WHEN CHARINDEX('kDa',[Molecular Weight]) = 0 THEN NULL ELSE CAST(SUBSTRING([Molecular Weight], 1, CHARINDEX('kDa',[Molecular Weight])-1) AS FLOAT) END AS [Molecular Weight (kDa)]
--  , CASE WHEN CHARINDEX('kDa',[Molecular Weight]) = 0 THEN NULL ELSE CAST(SUBSTRING([Molecular Weight], 1, CHARINDEX('kDa',[Molecular Weight])) AS FLOAT) END AS [Molecular Weight (kDa)]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT * 
  FROM [446].[GEOMICS_DOM_MASTER.csv] as main
  join [446].[Saito_Codata_with_Metal] AS met
on main.STATION = met.Station
  AND main.depth = met.[Depth..m.]
  AND met.Replicate = 'A'


________________________________________


SELECT * 
  FROM [446].[GEOMICS_DOM_MASTER.csv] as main
  full outer join [446].[Saito_Codata_with_Metal] AS met
on main.STATION = met.Station
  AND main.depth = met.[Depth..m.]
  AND met.Replicate = 'A'


________________________________________


SELECT * 
  FROM [446].[Saito_Codata_with_Metal] AS met
 FULL OUTER JOIN [446].[GEOMICS_DOM_MASTER.csv] as main
  on main.STATION = met.Station
  AND main.depth = met.[Depth..m.]
  AND met.Replicate = 'A'


________________________________________


SELECT [Saito_Id]
  , CASE WHEN [Identified Proteins] = '#N/A' THEN NULL ELSE [Identified Proteins] END AS [Identified Proteins]
  , CASE WHEN [Accession] = '#N/A' THEN NULL ELSE [Accession] END AS [Accession]
  , CASE WHEN [BLAST_NR ANNOTATION] = '#N/A' THEN NULL ELSE [BLAST_NR ANNOTATION] END AS [BLAST_NR ANNOTATION]
  , CASE WHEN [BLAST NR ORGANISM] = '#N/A' THEN NULL ELSE [BLAST NR ORGANISM] END AS [BLAST NR ORGANISM]
  , CASE WHEN [BLAST Microbial P col1] = '#N/A' THEN NULL ELSE [BLAST Microbial P col1] END AS [BLAST Microbial P col1]
  , CASE WHEN [BLAST Microbial P col2] = '#N/A' THEN NULL ELSE [BLAST Microbial P col2] END AS [BLAST Microbial P col2]
  , CASE WHEN CHARINDEX('kDa',[Molecular Weight]) = 0 THEN NULL ELSE CAST(SUBSTRING([Molecular Weight], 1, CHARINDEX('kDa',[Molecular Weight])-1) AS FLOAT) END AS [Molecular Weight (kDa)]
  , [(G13) S1-15m]
  , [(G14)-S1-40m]
  , [(G15)-S1-70m]
  , [(G10)-S4-45m]
  , [(G11)-S4-65m]
  , [(G2)-S8-33m]
  , [(G3)-S8-70m]
  , [(G6)-S6-15m]
  , [(G7)-S6-45m]
FROM [446].[table_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT [Saito_Id]
  , [Identified Proteins]
  , [Accession]
  , [BLAST_NR ANNOTATION]
  , [BLAST NR ORGANISM]
  , [BLAST Microbial P col1]
  , [BLAST Microbial P col2]
  , [Molecular Weight (kDa)]
  , 13 AS Sample
  , 'P1' AS Station
  , 15 AS 'Depth (m)'
  , [(G14)-S1-40m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]




________________________________________


SELECT [Saito_Id]
  , [Identified Proteins]
  , [Accession]
  , [BLAST_NR ANNOTATION]
  , [BLAST NR ORGANISM]
  , [BLAST Microbial P col1]
  , [BLAST Microbial P col2]
  , [Molecular Weight (kDa)]
  , 13 AS Sample
  , 'P1' AS Station
  , 15 AS 'Depth (m)'
  , [(G13) S1-15m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]
UNION ALL
SELECT [Saito_Id]
  , [Identified Proteins]
  , [Accession]
  , [BLAST_NR ANNOTATION]
  , [BLAST NR ORGANISM]
  , [BLAST Microbial P col1]
  , [BLAST Microbial P col2]
  , [Molecular Weight (kDa)]
  , 14 AS Sample
  , 'P1' AS Station
  , 40 AS 'Depth (m)'
  , [(G14)-S1-40m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT * FROM [446].[SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 13 AS Sample
  , 'P1' AS Station
  , 15 AS 'Depth (m)'
  , [(G13) S1-15m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 14 AS Sample
  , 'P1' AS Station
  , 40 AS 'Depth (m)'
  , [(G14)-S1-40m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 15 AS Sample
  , 'P1' AS Station
  , 70 AS 'Depth (m)'
  , [(G15)-S1-70m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 10 AS Sample
  , 'P4' AS Station
  , 45 AS 'Depth (m)'
  , [(G10)-S4-45m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]


UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 11 AS Sample
  , 'P4' AS Station
  , 65 AS 'Depth (m)'
  , [(G11)-S4-65m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 2 AS Sample
  , 'P8' AS Station
  , 33 AS 'Depth (m)'
  , [(G2)-S8-33m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 3 AS Sample
  , 'P8' AS Station
  , 70 AS 'Depth (m)'
  , [(G3)-S8-70m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 6 AS Sample
  , 'P6' AS Station
  , 15 AS 'Depth (m)'
  , [(G6)-S6-15m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 7 AS Sample
  , 'P6' AS Station
  , 45 AS 'Depth (m)'
  , [(G7)-S6-45m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]



________________________________________


SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 13 AS Sample
  , 'P1' AS Station
  , 15 AS 'Depth (m)'
  , [(G13) S1-15m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 14 AS Sample
  , 'P1' AS Station
  , 40 AS 'Depth (m)'
  , [(G14)-S1-40m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 15 AS Sample
  , 'P1' AS Station
  , 70 AS 'Depth (m)'
  , [(G15)-S1-70m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 10 AS Sample
  , 'P4' AS Station
  , 45 AS 'Depth (m)'
  , [(G10)-S4-45m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]


UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 11 AS Sample
  , 'P4' AS Station
  , 65 AS 'Depth (m)'
  , [(G11)-S4-65m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 2 AS Sample
  , 'P8' AS Station
  , 33 AS 'Depth (m)'
  , [(G2)-S8-33m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 3 AS Sample
  , 'P8' AS Station
  , 70 AS 'Depth (m)'
  , [(G3)-S8-70m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 6 AS Sample
  , 'P6' AS Station
  , 15 AS 'Depth (m)'
  , [(G6)-S6-15m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 7 AS Sample
  , 'P6' AS Station
  , 45 AS 'Depth (m)'
  , [(G7)-S6-45m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

ORDER BY STATION DESC


________________________________________


SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 13 AS Sample
  , 'P1' AS Station
  , 15 AS 'Depth (m)'
  , [(G13) S1-15m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 14 AS Sample
  , 'P1' AS Station
  , 40 AS 'Depth (m)'
  , [(G14)-S1-40m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 15 AS Sample
  , 'P1' AS Station
  , 70 AS 'Depth (m)'
  , [(G15)-S1-70m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 10 AS Sample
  , 'P4' AS Station
  , 45 AS 'Depth (m)'
  , [(G10)-S4-45m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]


UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 11 AS Sample
  , 'P4' AS Station
  , 65 AS 'Depth (m)'
  , [(G11)-S4-65m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 2 AS Sample
  , 'P8' AS Station
  , 33 AS 'Depth (m)'
  , [(G2)-S8-33m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 3 AS Sample
  , 'P8' AS Station
  , 70 AS 'Depth (m)'
  , [(G3)-S8-70m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 6 AS Sample
  , 'P6' AS Station
  , 15 AS 'Depth (m)'
  , [(G6)-S6-15m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 7 AS Sample
  , 'P6' AS Station
  , 45 AS 'Depth (m)'
  , [(G7)-S6-45m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

ORDER BY STATION DESC


________________________________________


SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 13 AS Sample
  , 'P1' AS Station
  , 15 AS 'Depth (m)'
  , [(G13) S1-15m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 14 AS Sample
  , 'P1' AS Station
  , 40 AS 'Depth (m)'
  , [(G14)-S1-40m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 15 AS Sample
  , 'P1' AS Station
  , 70 AS 'Depth (m)'
  , [(G15)-S1-70m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 10 AS Sample
  , 'P4' AS Station
  , 45 AS 'Depth (m)'
  , [(G10)-S4-45m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]


UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 11 AS Sample
  , 'P4' AS Station
  , 65 AS 'Depth (m)'
  , [(G11)-S4-65m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 2 AS Sample
  , 'P8' AS Station
  , 33 AS 'Depth (m)'
  , [(G2)-S8-33m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 3 AS Sample
  , 'P8' AS Station
  , 70 AS 'Depth (m)'
  , [(G3)-S8-70m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 6 AS Sample
  , 'P6' AS Station
  , 15 AS 'Depth (m)'
  , [(G6)-S6-15m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]

UNION ALL

SELECT [Saito_Id], [Identified Proteins], [Accession], [BLAST_NR ANNOTATION], [BLAST NR ORGANISM], [BLAST Microbial P col1], [BLAST Microbial P col2], [Molecular Weight (kDa)]
  , 7 AS Sample
  , 'P6' AS Station
  , 45 AS 'Depth (m)'
  , [(G7)-S6-45m] AS [Spectral Count]
FROM [446].[Cleaned_Saito_GEOMICS1D_SubsurfaceProteins_withprelimcounts.csv]
ORDER BY Saito_Id, Station, [Depth (m)] ASC



________________________________________


SELECT *
     , DatePart(yy,[time]) as [year]
     , DatePart(month,[time]) as [month]
     , DatePart(day, [time]) as [day]
     , DatePart(hh, [time]) as [hh]
     , DatePart(mi, [time]) as [mm]
     , DatePart(ss, [time]) as [ss]
FROM [446].[table_SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT
      DatePart(yy,[time]) as [year]
     , DatePart(month,[time]) as [month]
     , DatePart(day, [time]) as [day]
     , DatePart(hh, [time]) as [hh]
     , DatePart(mi, [time]) as [mm]
     , DatePart(ss, [time]) as [ss]
  , *
FROM [446].[table_SeaFlow_GeoMICS_data.tab]


________________________________________


SELECT * 
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]


________________________________________


SELECT * 
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv] as ctd
  join [446].[V2_LineP_nutrients_formatted.csv] as nutrients
  on ctd.event=nutrients.event



________________________________________


SELECT COUNT(*) FROM [446].[table_stn1.protein.headingAD407]


________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event 
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event  
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT * 
  FROM [446].[uw_salaries_2011.txt]
  WHERE Column6 IS NOT NULL



________________________________________


SELECT * 
  FROM [446].[uw_salaries_2011.txt]
  WHERE Column6 IS NULL



________________________________________


SELECT * 
  FROM [446].[uw_salaries_2011.txt]
  WHERE Agency != 360



________________________________________


SELECT * 
  FROM [446].[uw_salaries_2011.txt]
  WHERE [Agency Title] != 'University of Washington'



________________________________________


SELECT Name, [Job Title] as title, [2010 Gross Earnings] as salary2010
  FROM [446].[uw_salaries_2011.txt]




________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event  
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event  
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event  
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event  
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT *
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] 1341ls
JOIN [446].[V2_O2_measurements_final.csv] oxygen
  ON (1341ls.[Station] = oxygen.[station]
      AND 1341ls.[Depth..m.] = oxygen.[Depth])


________________________________________


SELECT *
FROM [446].[GeoMICS_key.csv]
WHERE Event='1002'



________________________________________


SELECT *
FROM [446].[GeoMICS_key.csv]
WHERE Event='1002'



________________________________________


SELECT MAX([Depth..m.]) from [Geomics_key.csv]


________________________________________


SELECT TOP 10 *
FROM [Geomics_key.csv]


________________________________________


SELECT [Station]
     , COUNT([Label])
FROM [Geomics_key.csv]
WHERE [Source] = 'Niskin'
GROUP BY [Station]


________________________________________


SELECT [Station]
     , [Event]
     , COUNT([Label])
FROM [Geomics_key.csv]
WHERE [Source] = 'Niskin'
GROUP BY [Station],[Event]


________________________________________


SELECT [Station]
     , [Event]
     , [Depth..m.]
     , COUNT([Label])
FROM [Geomics_key.csv]
WHERE [Source] = 'Niskin'
GROUP BY [Station],[Event],[Depth..m.]


________________________________________


SELECT [Station]
     , [Event]
     , [Depth..m.]
     , COUNT([Label])
FROM [Geomics_key.csv]
WHERE [Source] = 'Niskin'
GROUP BY [Station],[Event],[Depth..m.]
ORDER BY COUNT(Label) DESC



________________________________________


SELECT [Station]
     , [Event]
     , [Depth..m.]
     , COUNT(DISTINCT [Label])
FROM [Geomics_key.csv]
WHERE [Source] = 'Niskin'
GROUP BY [Station],[Event],[Depth..m.]
ORDER BY COUNT(DISTINCT Label) DESC



________________________________________


SELECT [Station]
     , [Event]
     , [Depth..m.]
     , COUNT([Label])
FROM [Geomics_key.csv]
WHERE [Source] = 'Niskin'
GROUP BY [Station],[Event],[Depth..m.]
ORDER BY COUNT(Label) DESC



________________________________________


SELECT [Station]
     , [Event]
     , [Depth..m.]
     , COUNT(DISTINCT [Label])
FROM [Geomics_key.csv]
WHERE [Source] = 'Niskin'
GROUP BY [Station],[Event],[Depth..m.]
ORDER BY COUNT(DISTINCT Label) DESC



________________________________________


SELECT * FROM [Geomics_key.csv] where event='1033'


________________________________________


SELECT * FROM [446].[table_V2_Horak_GeoMICS data.csv]


________________________________________


SELECT * FROM [446].[table_V2_Horak_GeoMICS data.csv]


________________________________________


SELECT * FROM [446].[table_V2_Horak_GeoMICS data.csv]


________________________________________


SELECT Event,COUNT(*)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Event



________________________________________


SELECT Event,[Depth..m.],COUNT(*)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Event,[Depth..m.]



________________________________________


SELECT Event,[Depth..m.],COUNT(*) as cnt
  FROM [446].[GeoMICS_key.csv]
GROUP BY Event,[Depth..m.]
ORDER BY cnt desc


________________________________________


SELECT Station,[Depth..m.],COUNT(*) as cnt
  FROM [446].[GeoMICS_key.csv]
GROUP BY station,[Depth..m.]
ORDER BY cnt desc


________________________________________


SELECT Station,[Depth..m.],COUNT(*) as cnt
  FROM [446].[GeoMICS_key.csv]
WHERE Source = 'Niskin'
GROUP BY station,[Depth..m.]
ORDER BY cnt desc


________________________________________


SELECT Station,[Depth..m.],COUNT(*) as cnt
  FROM [446].[GeoMICS_key.csv]
WHERE Source = 'McL'
GROUP BY station,[Depth..m.]
ORDER BY cnt desc


________________________________________


SELECT Station,[Depth..m.],COUNT(*) as cnt
  FROM [446].[GeoMICS_key.csv]
WHERE Source = 'GoFlo'
GROUP BY station,[Depth..m.]
ORDER BY cnt desc


________________________________________


SELECT Distinct [Latitude..Decimal.deg.],[Longitude..Decimal.deg.],Station
  FROM [446].[GeoMICS_key.csv]




________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT IS NULL



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT = NULL



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1004



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1005



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1010



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1020



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1046



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1040



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1035



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1037



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1038



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1000 or EVENT > 1037



________________________________________


SELECT *
  FROM [446].[V2_GeoMICS_ctd_rawdata.csv]
  WHERE EVENT < 1001 or EVENT > 1038



________________________________________


SELECT [depth.m]
  FROM [446].[Underway_GeoMICS.csv]
 WHERE [depth.m] <> 'NA'



________________________________________


SELECT COUNT([depth.m])
  FROM [446].[Underway_GeoMICS.csv]
 WHERE [depth.m] <> 'NA'



________________________________________


SELECT DISTINCT
       Station
     , [Bottom Depth (m)]
     , [Latitude..Decimal.deg.]
     , [Longitude..Decimal.deg.]
  FROM [446].[GeoMICS_key.csv]


________________________________________


SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
        + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW],2)) < 0.1
  



________________________________________


SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
        + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW],2)) < 0.5
  



________________________________________


SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
        + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW],2)) < 10
  



________________________________________


SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
      + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW]+360,2)) < 10
  



________________________________________


SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
      + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW]-360,2)) < 10
  



________________________________________


SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
      + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW]-360,2)) < 0.1
  



________________________________________


WITH tmp AS (SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
      + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW]-360,2)) < 0.1)
SELECT DISTINCT Station FROM tmp




________________________________________


WITH tmp AS (SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
      + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW]-360,2)) < 0.1)
SELECT COUNT(*) FROM tmp




________________________________________


WITH tmp AS (SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
      + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW]-360,2)) < 0.2)
SELECT COUNT(*) FROM tmp




________________________________________


WITH tmp AS (SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
      + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW]-360,2)) < 0.1)
SELECT COUNT(*) FROM tmp




________________________________________


WITH tmp AS (SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
      + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW]-360,2)) < 0.01)
SELECT COUNT(*) FROM tmp




________________________________________


SELECT stations.*,underway.*
  FROM [446].[Underway_GeoMICS.csv] underway
  JOIN [446].[Stations] stations
    ON sqrt(
          power(stations.[Latitude..Decimal.deg.] - underway.[lat.degN],2)
      + power(stations.[Longitude..Decimal.deg.] - underway.[long.degW]-360,2)) < 0.01



________________________________________


SELECT *
  FROM [446].[Underway_data_at_station]
  WHERE [Depth.m] <> 'NA'
  AND [Depth.m] < cast([Bottom Depth (m)] as float)



________________________________________


SELECT *
  FROM [446].[Underway_data_at_station]
  WHERE [Depth.m] <> 'NA'
  AND [Depth.m] > cast([Bottom Depth (m)] as float)



________________________________________


SELECT *
  FROM [446].[Underway_data_at_station]
  WHERE [Depth.m] <> 'NA'
  AND [Depth.m] - cast(1000 as float) > cast([Bottom Depth (m)] as float)



________________________________________


SELECT * FROM [446].[event1002.csv]
UNION ALL
SELECT * FROM [446].[event1003.csv]
UNION ALL
SELECT * FROM [446].[event1005.csv]
UNION ALL
SELECT * FROM [446].[event1006.csv]
UNION ALL
SELECT * FROM [446].[event1007.csv]
UNION ALL
SELECT * FROM [446].[event1009.csv]
UNION ALL
SELECT * FROM [446].[event1011.csv]
UNION ALL
SELECT * FROM [446].[event1014.csv]
UNION ALL
SELECT * FROM [446].[event1015.csv]
UNION ALL
SELECT * FROM [446].[event1016.csv]
UNION ALL
SELECT * FROM [446].[event1018.csv]
UNION ALL
SELECT * FROM [446].[event1020.csv]
UNION ALL
SELECT * FROM [446].[event1021.csv]
UNION ALL
SELECT * FROM [446].[event1023.csv]
UNION ALL
SELECT * FROM [446].[event1024.csv]
UNION ALL
SELECT * FROM [446].[event1025.csv]
UNION ALL
SELECT * FROM [446].[event1027.csv]
UNION ALL
SELECT * FROM [446].[event1029.csv]
UNION ALL
SELECT * FROM [446].[event1030.csv]
UNION ALL
SELECT * FROM [446].[event1034.csv]
UNION ALL
SELECT * FROM [446].[event1037.csv]
UNION ALL
SELECT * FROM [446].[event1038.csv]



________________________________________


SELECT geokey.[Station]
     , geokey.[Bottom Depth (m)]
     , ctd.*
FROM [446].[CTD_union_all] AS ctd
JOIN [446].[GeoMICS_key.csv] AS geokey
  ON geokey.event <> 'NA'
     AND geokey.event = ctd.event


________________________________________


SELECT CASE WHEN [Event] <> 'NA' THEN [Event] ELSE NULL END AS [Event]
  , [Latitude..Decimal.deg.]
  , [Longitude..Decimal.deg.]
  , geokey.[Station]
  , [Depth..m.]
  , [Label]
  , [Source]
  , bathymetry.[Bottom Depth (m)]
FROM [446].[table_GeoMICS_key.csv] geokey
JOIN [446].[LineP_bathymetry.csv] bathymetry
  ON bathymetry.Station = geokey.Station



________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event  
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT geokey.Label
     , ctd.*
FROM [446].[V2_GeoMICS_ctd_rawdata.csv] ctd
JOIN [446].[GeoMICS_key.csv] geokey
  ON (ctd.event = geokey.Event
      AND ctd.Depth = geokey.[Depth..m.])


________________________________________


SELECT geokey.[Station]
     , geokey.[Bottom Depth (m)]
     , ctd.*
FROM [446].[CTD_union_all] AS ctd
JOIN [446].[GeoMICS_key.csv] AS geokey
  ON geokey.event = ctd.event


________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation]
 WHERE Function_1 LIKE 'iron'



________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation]
 WHERE Function_1 LIKE 'Fe'



________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation]
 WHERE Function_1 LIKE 'Fe'



________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation]
 WHERE Function_1 LIKE '%Fe%'



________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation]
 WHERE Function_1 LIKE '%iron%'



________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation]
 WHERE Function_1 LIKE '%iron%'
    OR Function_1 LIKE '%Fe%'


________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation]
 WHERE Function_1 LIKE '%iron%'
    OR Function_1 LIKE '%Fe[^a-z]%'


________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation]
 WHERE Function_1 LIKE '%iron%'
    OR Function_1 LIKE '%Fe[^a-z]%'
    OR Function_1 LIKE '%ferr%'



________________________________________


SELECT * FROM [446].[Iron-related_Proteins]


________________________________________


SELECT * FROM [446].[LineP_CAMERA_annotation_full]


________________________________________


SELECT COUNT(*) FROM [446].[LineP_CAMERA_annotation_full]


________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation_full]
 WHERE Function_1 LIKE '%Fe[^a-z]%'
  


________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation_full]
 WHERE Function_1 LIKE '%[^a-z]Fe[^a-z]%'
  


________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation_full]
 WHERE Function_1 LIKE '%Fe[^a-z]%'
  


________________________________________


SELECT *
  FROM [446].[LineP_CAMERA_annotation_full]
 WHERE Function_1 LIKE '%[^a-z]Fe%'
  


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation_full] protein
WHERE (protein.FUNCTION_1 LIKE '%Iron%'
       OR protein.FUNCTION_1 LIKE '%ferr%'
       OR protein.FUNCTION_1 LIKE '%[^a-z]Fe%'
       OR protein.FUNCTION_2 LIKE '%iron%'
       OR protein.FUNCTION_2 LIKE '%ferr%'
       OR protein.FUNCTION_2 LIKE '%[^a-z]Fe%'
       OR protein.FUNCTION_3 LIKE '%iron%'
       OR protein.FUNCTION_3 LIKE '%ferr%'
       OR protein.FUNCTION_3 LIKE '%[^a-z]Fe%')


________________________________________


SELECT * FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv]


________________________________________


SELECT * FROM [446].[V2_GeoMICS_ctd_rawdata_labeled]


________________________________________


SELECT * FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv]


________________________________________


SELECT * FROM [446].[V2_GeoMICS_ctd_rawdata_labeled]


________________________________________


SELECT virus.[VLP.mL]
     , ctd.*
FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv] virus
JOIN [446].[V2_GeoMICS_ctd_rawdata_labeled] ctd
  ON (virus.Label = ctd.Label)


________________________________________


SELECT virus.[VLP.mL]
     , ctd.*
FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv] virus
JOIN [446].[V2_GeoMICS_ctd_rawdata_labeled] ctd
  ON (virus.Label = ctd.Label)


________________________________________


SELECT virus.[VLP.mL]
     , ctd.*
FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv] virus
JOIN [446].[V2_GeoMICS_ctd_rawdata_labeled] ctd
  ON (virus.Label = ctd.Label)


________________________________________


SELECT virus.[VLP.mL]
     , ctd.*
FROM [446].[V2_Carlson_virus_counts_GeoMICS_data_FINAL.csv] virus
JOIN [446].[V2_GeoMICS_ctd_rawdata_labeled] ctd
  ON (virus.Label = ctd.Label) 


________________________________________


SELECT * FROM [446].[Virus_Count_and_CTD_data]


________________________________________


SELECT * FROM [446].[Virus_Count_and_CTD_data]


________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT * 
FROM [446].[Virus_Count_and_CTD_data] virus
   , [446].[V2_Morris_GeoMICS_data.csv] bact
WHERE virus.Label = bact.Label



________________________________________


SELECT * FROM [446].[Virus_Count_vs_Bact_Count]


________________________________________


SELECT DISTINCT GOSlim_bin FROM [1123].[qDOD_Cgigas_GO_GOslim]
  WHERE aspect='P'



________________________________________


select * from [1041].[g111]


________________________________________


SELECT *
FROM [446].[LineP_CAMERA_annotation]


________________________________________


SELECT Source, COUNT(Label)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Source



________________________________________


SELECT Station, Source, COUNT(Label)
  FROM [446].[GeoMICS_key.csv]
GROUP BY Station, Source



________________________________________


    SELECT Function_1, SUM(spectra_counts) AS Spectra
    FROM [446].[LineP_CAMERA_annotation]
    GROUP BY Function_1



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
GROUP BY Function_1



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
GROUP BY Function_1



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
GROUP BY Function_1
ORDER BY Spectra DESC


________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
GROUP BY Function_1


________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT Function_1, SUM(spectra_counts) AS Spectra
FROM [446].[LineP_CAMERA_annotation]
  GROUP BY Function_1
  ORDER BY Spectra DESC



________________________________________


SELECT *
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] 1341ls
JOIN [446].[V2_O2_measurements_final.csv] oxygen
  ON (1341ls.[Station] = oxygen.[station]
      AND 1341ls.[Depth..m.] = oxygen.[Depth])


________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
     , protein.[Depth..m.] AS [SurfacePumpDepth..m.]
     , iron.[Depth..m.] AS [NiskinDepth..m.]
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.], iron.[Depth..m.], protein.[Depth..m.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
     , protein.[Depth..m.] AS [SurfacePumpDepth..m.]
     , iron.[Depth..m.] AS [NiskinDepth..m.]
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.], iron.[Depth..m.], protein.[Depth..m.]



________________________________________


WITH SurfaceMetals AS
       (SELECT Station
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station

     , SUM(protein.spectra_counts) AS ProteinSpectra

FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = iron.Station
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station



________________________________________


WITH SurfaceMetals AS   (SELECT Station FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]  GROUP BY Station) SELECT iron.Station  , SUM(protein.spectra_counts) AS ProteinSpectra FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,     [446].[Iron-related_Proteins] protein,     SurfaceMetals  WHERE protein.Station = iron.Station    AND SurfaceMetals.Station = iron.Station GROUP BY iron.Station
  



________________________________________


WITH SurfaceMetals AS
       (SELECT Station,MIN([Depth..m.]) AS MinDepth
        FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv]
        GROUP BY Station)
SELECT iron.Station
     , iron.[Tot.Fe.nM.]
     , SUM(protein.spectra_counts) AS ProteinSpectra
     , protein.[Depth..m.] AS [SurfacePumpDepth..m.]
     , iron.[Depth..m.] AS [NiskinDepth..m.]
FROM [446].[V2_GEOMICS_Fe-Cu-Mn-Zn-Vedamati.csv] iron,
     [446].[Iron-related_Proteins] protein,
     SurfaceMetals
WHERE protein.Station = iron.Station
  AND iron.[Depth..m.] = SurfaceMetals.MinDepth
  AND SurfaceMetals.Station = iron.Station
GROUP BY iron.Station, iron.[Tot.Fe.nM.], iron.[Depth..m.], protein.[Depth..m.]



________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT * FROM [446].[V2_Morris_GeoMICS_data.csv]


________________________________________


SELECT iron.Station, iron.[Tot.Fe.nM.]
     , nitrate.[d15N.NO3], nitrate.[d18O.NO3]
     , iron.ProteinSpectra
     , iron.[SurfacePumpDepth..m.]
     , iron.[NiskinDepth..m.]
FROM [V2_GeoMICS_NitrateIsotopedata_KLCtemplate.csv] nitrate
   , [Iron_Concentration_and_Iron_Related_Proteins] iron
WHERE iron.Station = nitrate.Station
  AND iron.[NiskinDepth..m.] = nitrate.[Depth..m.]


________________________________________


SELECT iron.Station, iron.[Tot.Fe.nM.]
     , nitrate.[d15N.NO3], nitrate.[d18O.NO3]
     , iron.ProteinSpectra
     , iron.[SurfacePumpDepth..m.]
     , iron.[NiskinDepth..m.]
FROM [V2_GeoMICS_NitrateIsotopedata_KLCtemplate.csv] nitrate
   , [Iron_Concentration_and_Iron_Related_Proteins] iron
WHERE iron.Station = nitrate.Station
  AND iron.[NiskinDepth..m.] = nitrate.[Depth..m.]
  AND nitrate.[d15N.NO3] <> 'NA'



________________________________________


SELECT Source
     , Count(Label)
FROM [446].[GeoMICS_key.csv]
GROUP BY Source



________________________________________


SELECT Source, Station
     , Count(Label)
FROM [446].[GeoMICS_key.csv]
GROUP BY Source, Station



________________________________________


SELECT DISTINCT Source
FROM [446].[GeoMICS_key.csv]


________________________________________


SELECT Station, COUNT(Source)
FROM [446].[GeoMICS_key.csv]
GROUP BY Station


________________________________________


SELECT Station, Source, COUNT(*)
FROM [446].[GeoMICS_key.csv]
GROUP BY Station, Source


________________________________________


SELECT [DMY]
  , [HMS]
  , [LAT]
  , [LON]
  , [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([DMY] AS Date) AS [DMY]
  , [HMS]
  , [LAT]
  , [LON]
  , [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([DMY] AS Date) AS [Date]
  , [LAT]
  , [LON]
  , [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([DMY] AS Date) AS [Date]
  , [DMY] + ' ' + [HMS]
  , [LAT]
  , [LON]
  , [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Date) AS [Date]
  , [DMY] + ' ' + [HMS]
  , [LAT]
  , [LON]
  , [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [Date]
  , [DMY] + ' ' + [HMS]
  , [LAT]
  , [LON]
  , [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [Date]
  , [LAT]
  , [LON]
  , [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [Time]
  , [LAT]
  , [LON]
  , [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [Time]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [Time]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [Time]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [Time]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , [position]
  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [Time]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , CAST(CAST([Time] AS Datetime) AS INTEGER)
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime))
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds2.tab]
ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT [day]
  , [file]
  , [pop]
  , [resamp]
  , [time]
  , [lat]
  , [long]
  , [flow]
  , [bulk_red]
  , [salinity]
  , [temperature]
  , [event_rate]
  , [fluorescence]
  , [evt]
  , [opp]
  , [n]
  , [conc]
  , [fsc_small_mean]
  , [fsc_small_median]
  , [fsc_small_sd]
  , [fsc_small_mode]
  , [fsc_small_width]
  , [fsc_small_npeaks]
  , [fsc_perp_mean]
  , [fsc_perp_median]
  , [fsc_perp_sd]
  , [fsc_perp_mode]
  , [fsc_perp_width]
  , [fsc_perp_npeaks]
  , [fsc_big_mean]
  , [fsc_big_median]
  , [fsc_big_sd]
  , [fsc_big_mode]
  , [fsc_big_width]
  , [fsc_big_npeaks]
  , [pe_mean]
  , [pe_median]
  , [pe_sd]
  , [pe_mode]
  , [pe_width]
  , [pe_npeaks]
  , [chl_small_mean]
  , [chl_small_median]
  , [chl_small_sd]
  , [chl_small_mode]
  , [chl_small_width]
  , [chl_small_npeaks]
  , [chl_big_mean]
  , [chl_big_median]
  , [chl_big_sd]
  , [chl_big_mode]
  , [chl_big_width]
  , [chl_big_npeaks]
FROM [1059].[stats.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , [day]
  , [file]
  , [pop]
  , [resamp]
  , [time]
  , [lat]
  , [long]
  , [flow]
  , [bulk_red]
  , [salinity]
  , [temperature]
  , [event_rate]
  , [fluorescence]
  , [evt]
  , [opp]
  , [n]
  , [conc]
  , [fsc_small_mean]
  , [fsc_small_median]
  , [fsc_small_sd]
  , [fsc_small_mode]
  , [fsc_small_width]
  , [fsc_small_npeaks]
  , [fsc_perp_mean]
  , [fsc_perp_median]
  , [fsc_perp_sd]
  , [fsc_perp_mode]
  , [fsc_perp_width]
  , [fsc_perp_npeaks]
  , [fsc_big_mean]
  , [fsc_big_median]
  , [fsc_big_sd]
  , [fsc_big_mode]
  , [fsc_big_width]
  , [fsc_big_npeaks]
  , [pe_mean]
  , [pe_median]
  , [pe_sd]
  , [pe_mode]
  , [pe_width]
  , [pe_npeaks]
  , [chl_small_mean]
  , [chl_small_median]
  , [chl_small_sd]
  , [chl_small_mode]
  , [chl_small_width]
  , [chl_small_npeaks]
  , [chl_big_mean]
  , [chl_big_median]
  , [chl_big_sd]
  , [chl_big_mode]
  , [chl_big_width]
  , [chl_big_npeaks]
FROM [1059].[stats.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , [pop]
  , [resamp]
  , [time]
  , [lat]
  , [long]
  , [flow]
  , [bulk_red]
  , [salinity]
  , [temperature]
  , [event_rate]
  , [fluorescence]
  , [evt]
  , [opp]
  , [n]
  , [conc]
  , [fsc_small_mean]
  , [fsc_small_median]
  , [fsc_small_sd]
  , [fsc_small_mode]
  , [fsc_small_width]
  , [fsc_small_npeaks]
  , [fsc_perp_mean]
  , [fsc_perp_median]
  , [fsc_perp_sd]
  , [fsc_perp_mode]
  , [fsc_perp_width]
  , [fsc_perp_npeaks]
  , [fsc_big_mean]
  , [fsc_big_median]
  , [fsc_big_sd]
  , [fsc_big_mode]
  , [fsc_big_width]
  , [fsc_big_npeaks]
  , [pe_mean]
  , [pe_median]
  , [pe_sd]
  , [pe_mode]
  , [pe_width]
  , [pe_npeaks]
  , [chl_small_mean]
  , [chl_small_median]
  , [chl_small_sd]
  , [chl_small_mode]
  , [chl_small_width]
  , [chl_small_npeaks]
  , [chl_big_mean]
  , [chl_big_median]
  , [chl_big_sd]
  , [chl_big_mode]
  , [chl_big_width]
  , [chl_big_npeaks]
  , [day]
  , [file]
FROM [1059].[stats.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , [pop]
  , [resamp]
  , [lat]
  , [long]
  , [flow]
  , [bulk_red]
  , [salinity]
  , [temperature]
  , [event_rate]
  , [fluorescence]
  , [evt]
  , [opp]
  , [n]
  , [conc]
  , [fsc_small_mean]
  , [fsc_small_median]
  , [fsc_small_sd]
  , [fsc_small_mode]
  , [fsc_small_width]
  , [fsc_small_npeaks]
  , [fsc_perp_mean]
  , [fsc_perp_median]
  , [fsc_perp_sd]
  , [fsc_perp_mode]
  , [fsc_perp_width]
  , [fsc_perp_npeaks]
  , [fsc_big_mean]
  , [fsc_big_median]
  , [fsc_big_sd]
  , [fsc_big_mode]
  , [fsc_big_width]
  , [fsc_big_npeaks]
  , [pe_mean]
  , [pe_median]
  , [pe_sd]
  , [pe_mode]
  , [pe_width]
  , [pe_npeaks]
  , [chl_small_mean]
  , [chl_small_median]
  , [chl_small_sd]
  , [chl_small_mode]
  , [chl_small_width]
  , [chl_small_npeaks]
  , [chl_big_mean]
  , [chl_big_median]
  , [chl_big_sd]
  , [chl_big_mode]
  , [chl_big_width]
  , [chl_big_npeaks]
  , [day]
  , [file]
  , [time]
FROM [1059].[stats.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , [pop]
  , [resamp]
  , [lat]
  , [long]
  , [flow]
  , [bulk_red]
  , [salinity]
  , [temperature]
  , [event_rate]
  , [fluorescence]
  , [evt]
  , [opp]
  , [n]
  , [conc]
  , [fsc_small_mean]
  , [fsc_small_median]
  , [fsc_small_sd]
  , [fsc_small_mode]
  , [fsc_small_width]
  , [fsc_small_npeaks]
  , [fsc_perp_mean]
  , [fsc_perp_median]
  , [fsc_perp_sd]
  , [fsc_perp_mode]
  , [fsc_perp_width]
  , [fsc_perp_npeaks]
  , [fsc_big_mean]
  , [fsc_big_median]
  , [fsc_big_sd]
  , [fsc_big_mode]
  , [fsc_big_width]
  , [fsc_big_npeaks]
  , [pe_mean]
  , [pe_median]
  , [pe_sd]
  , [pe_mode]
  , [pe_width]
  , [pe_npeaks]
  , [chl_small_mean]
  , [chl_small_median]
  , [chl_small_sd]
  , [chl_small_mode]
  , [chl_small_width]
  , [chl_small_npeaks]
  , [chl_big_mean]
  , [chl_big_median]
  , [chl_big_sd]
  , [chl_big_mode]
  , [chl_big_width]
  , [chl_big_npeaks]
  , [day]
  , [file]
  , [time]
FROM [1059].[stats.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CASE WHEN [pop] = 'NA' THEN NULL ELSE [pop] END AS [pop]
  , [resamp]
  , [lat]
  , [long]
  , [flow]
  , [bulk_red]
  , [salinity]
  , [temperature]
  , [event_rate]
  , [fluorescence]
  , [evt]
  , [opp]
  , [n]
  , [conc]
  , CASE WHEN [fsc_small_mean] = 'NA' THEN NULL ELSE [fsc_small_mean] END AS [fsc_small_mean]
  , CASE WHEN [fsc_small_median] = 'NA' THEN NULL ELSE [fsc_small_median] END AS [fsc_small_median]
  , CASE WHEN [fsc_small_sd] = 'NA' THEN NULL ELSE [fsc_small_sd] END AS [fsc_small_sd]
  , CASE WHEN [fsc_small_mode] = 'NA' THEN NULL ELSE [fsc_small_mode] END AS [fsc_small_mode]
  , CASE WHEN [fsc_small_width] = 'NA' THEN NULL ELSE [fsc_small_width] END AS [fsc_small_width]
  , CASE WHEN [fsc_small_npeaks] = 'NA' THEN NULL ELSE [fsc_small_npeaks] END AS [fsc_small_npeaks]
  , CASE WHEN [fsc_perp_mean] = 'NA' THEN NULL ELSE [fsc_perp_mean] END AS [fsc_perp_mean]
  , CASE WHEN [fsc_perp_median] = 'NA' THEN NULL ELSE [fsc_perp_median] END AS [fsc_perp_median]
  , CASE WHEN [fsc_perp_sd] = 'NA' THEN NULL ELSE [fsc_perp_sd] END AS [fsc_perp_sd]
  , CASE WHEN [fsc_perp_mode] = 'NA' THEN NULL ELSE [fsc_perp_mode] END AS [fsc_perp_mode]
  , CASE WHEN [fsc_perp_width] = 'NA' THEN NULL ELSE [fsc_perp_width] END AS [fsc_perp_width]
  , CASE WHEN [fsc_perp_npeaks] = 'NA' THEN NULL ELSE [fsc_perp_npeaks] END AS [fsc_perp_npeaks]
  , CASE WHEN [fsc_big_mean] = 'NA' THEN NULL ELSE [fsc_big_mean] END AS [fsc_big_mean]
  , CASE WHEN [fsc_big_median] = 'NA' THEN NULL ELSE [fsc_big_median] END AS [fsc_big_median]
  , CASE WHEN [fsc_big_sd] = 'NA' THEN NULL ELSE [fsc_big_sd] END AS [fsc_big_sd]
  , CASE WHEN [fsc_big_mode] = 'NA' THEN NULL ELSE [fsc_big_mode] END AS [fsc_big_mode]
  , CASE WHEN [fsc_big_width] = 'NA' THEN NULL ELSE [fsc_big_width] END AS [fsc_big_width]
  , CASE WHEN [fsc_big_npeaks] = 'NA' THEN NULL ELSE [fsc_big_npeaks] END AS [fsc_big_npeaks]
  , CASE WHEN [pe_mean] = 'NA' THEN NULL ELSE [pe_mean] END AS [pe_mean]
  , CASE WHEN [pe_median] = 'NA' THEN NULL ELSE [pe_median] END AS [pe_median]
  , CASE WHEN [pe_sd] = 'NA' THEN NULL ELSE [pe_sd] END AS [pe_sd]
  , CASE WHEN [pe_mode] = 'NA' THEN NULL ELSE [pe_mode] END AS [pe_mode]
  , CASE WHEN [pe_width] = 'NA' THEN NULL ELSE [pe_width] END AS [pe_width]
  , CASE WHEN [pe_npeaks] = 'NA' THEN NULL ELSE [pe_npeaks] END AS [pe_npeaks]
  , CASE WHEN [chl_small_mean] = 'NA' THEN NULL ELSE [chl_small_mean] END AS [chl_small_mean]
  , CASE WHEN [chl_small_median] = 'NA' THEN NULL ELSE [chl_small_median] END AS [chl_small_median]
  , CASE WHEN [chl_small_sd] = 'NA' THEN NULL ELSE [chl_small_sd] END AS [chl_small_sd]
  , CASE WHEN [chl_small_mode] = 'NA' THEN NULL ELSE [chl_small_mode] END AS [chl_small_mode]
  , CASE WHEN [chl_small_width] = 'NA' THEN NULL ELSE [chl_small_width] END AS [chl_small_width]
  , CASE WHEN [chl_small_npeaks] = 'NA' THEN NULL ELSE [chl_small_npeaks] END AS [chl_small_npeaks]
  , CASE WHEN [chl_big_mean] = 'NA' THEN NULL ELSE [chl_big_mean] END AS [chl_big_mean]
  , CASE WHEN [chl_big_median] = 'NA' THEN NULL ELSE [chl_big_median] END AS [chl_big_median]
  , CASE WHEN [chl_big_sd] = 'NA' THEN NULL ELSE [chl_big_sd] END AS [chl_big_sd]
  , CASE WHEN [chl_big_mode] = 'NA' THEN NULL ELSE [chl_big_mode] END AS [chl_big_mode]
  , CASE WHEN [chl_big_width] = 'NA' THEN NULL ELSE [chl_big_width] END AS [chl_big_width]
  , CASE WHEN [chl_big_npeaks] = 'NA' THEN NULL ELSE [chl_big_npeaks] END AS [chl_big_npeaks]
  , CASE WHEN [day] = 'NA' THEN NULL ELSE [day] END AS [day]
  , [file]
  , CASE WHEN [time] = 'NA' THEN NULL ELSE [time] END AS [time]
FROM [1059].[stats.tab]



________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CASE WHEN [pop] = 'NA' THEN NULL ELSE [pop] END AS [pop]
  , [resamp]
  , [lat]
  , [long]
  , [flow]
  , [bulk_red]
  , [salinity]
  , [temperature]
  , [event_rate]
  , [fluorescence]
  , [evt]
  , [opp]
  , [n]
  , [conc]
  , CASE WHEN [fsc_small_mean] = 'NA' THEN NULL ELSE [fsc_small_mean] END AS [fsc_small_mean]
  , CASE WHEN [fsc_small_median] = 'NA' THEN NULL ELSE [fsc_small_median] END AS [fsc_small_median]
  , CASE WHEN [fsc_small_sd] = 'NA' THEN NULL ELSE [fsc_small_sd] END AS [fsc_small_sd]
  , CASE WHEN [fsc_small_mode] = 'NA' THEN NULL ELSE [fsc_small_mode] END AS [fsc_small_mode]
  , CASE WHEN [fsc_small_width] = 'NA' THEN NULL ELSE [fsc_small_width] END AS [fsc_small_width]
  , CASE WHEN [fsc_small_npeaks] = 'NA' THEN NULL ELSE [fsc_small_npeaks] END AS [fsc_small_npeaks]
  , CASE WHEN [fsc_perp_mean] = 'NA' THEN NULL ELSE [fsc_perp_mean] END AS [fsc_perp_mean]
  , CASE WHEN [fsc_perp_median] = 'NA' THEN NULL ELSE [fsc_perp_median] END AS [fsc_perp_median]
  , CASE WHEN [fsc_perp_sd] = 'NA' THEN NULL ELSE [fsc_perp_sd] END AS [fsc_perp_sd]
  , CASE WHEN [fsc_perp_mode] = 'NA' THEN NULL ELSE [fsc_perp_mode] END AS [fsc_perp_mode]
  , CASE WHEN [fsc_perp_width] = 'NA' THEN NULL ELSE [fsc_perp_width] END AS [fsc_perp_width]
  , CASE WHEN [fsc_perp_npeaks] = 'NA' THEN NULL ELSE [fsc_perp_npeaks] END AS [fsc_perp_npeaks]
  , CASE WHEN [fsc_big_mean] = 'NA' THEN NULL ELSE [fsc_big_mean] END AS [fsc_big_mean]
  , CASE WHEN [fsc_big_median] = 'NA' THEN NULL ELSE [fsc_big_median] END AS [fsc_big_median]
  , CASE WHEN [fsc_big_sd] = 'NA' THEN NULL ELSE [fsc_big_sd] END AS [fsc_big_sd]
  , CASE WHEN [fsc_big_mode] = 'NA' THEN NULL ELSE [fsc_big_mode] END AS [fsc_big_mode]
  , CASE WHEN [fsc_big_width] = 'NA' THEN NULL ELSE [fsc_big_width] END AS [fsc_big_width]
  , CASE WHEN [fsc_big_npeaks] = 'NA' THEN NULL ELSE [fsc_big_npeaks] END AS [fsc_big_npeaks]
  , CASE WHEN [pe_mean] = 'NA' THEN NULL ELSE [pe_mean] END AS [pe_mean]
  , CASE WHEN [pe_median] = 'NA' THEN NULL ELSE [pe_median] END AS [pe_median]
  , CASE WHEN [pe_sd] = 'NA' THEN NULL ELSE [pe_sd] END AS [pe_sd]
  , CASE WHEN [pe_mode] = 'NA' THEN NULL ELSE [pe_mode] END AS [pe_mode]
  , CASE WHEN [pe_width] = 'NA' THEN NULL ELSE [pe_width] END AS [pe_width]
  , CASE WHEN [pe_npeaks] = 'NA' THEN NULL ELSE [pe_npeaks] END AS [pe_npeaks]
  , CASE WHEN [chl_small_mean] = 'NA' THEN NULL ELSE [chl_small_mean] END AS [chl_small_mean]
  , CASE WHEN [chl_small_median] = 'NA' THEN NULL ELSE [chl_small_median] END AS [chl_small_median]
  , CASE WHEN [chl_small_sd] = 'NA' THEN NULL ELSE [chl_small_sd] END AS [chl_small_sd]
  , CASE WHEN [chl_small_mode] = 'NA' THEN NULL ELSE [chl_small_mode] END AS [chl_small_mode]
  , CASE WHEN [chl_small_width] = 'NA' THEN NULL ELSE [chl_small_width] END AS [chl_small_width]
  , CASE WHEN [chl_small_npeaks] = 'NA' THEN NULL ELSE [chl_small_npeaks] END AS [chl_small_npeaks]
  , CASE WHEN [chl_big_mean] = 'NA' THEN NULL ELSE [chl_big_mean] END AS [chl_big_mean]
  , CASE WHEN [chl_big_median] = 'NA' THEN NULL ELSE [chl_big_median] END AS [chl_big_median]
  , CASE WHEN [chl_big_sd] = 'NA' THEN NULL ELSE [chl_big_sd] END AS [chl_big_sd]
  , CASE WHEN [chl_big_mode] = 'NA' THEN NULL ELSE [chl_big_mode] END AS [chl_big_mode]
  , CASE WHEN [chl_big_width] = 'NA' THEN NULL ELSE [chl_big_width] END AS [chl_big_width]
  , CASE WHEN [chl_big_npeaks] = 'NA' THEN NULL ELSE [chl_big_npeaks] END AS [chl_big_npeaks]
  , CASE WHEN [day] = 'NA' THEN NULL ELSE [day] END AS [day]
  , [file]
  , CASE WHEN [time] = 'NA' THEN NULL ELSE [time] END AS [time]
FROM [1059].[stats.tab]
ORDER BY [DateTime] ASC


________________________________________


select DISTINCT Lat,Lon from [1059].[sds_view]


________________________________________


select TOP 100 Lat,Lon FROM (
  SELECT DISTINCT Lat,Lon from [1059].[sds_view]
) x


________________________________________


select COUNT(*) FROM (
  SELECT DISTINCT Lat,Lon from [1059].[sds_view]
) x


________________________________________


SELECT TOP 500 [STREAM.PRESSURE]
FROM [1059].[SDS_VIEW]
ORDER BY [DateTime] DESC  



________________________________________


SELECT TOP 500 [STREAM.PRESSURE], [DateTime]
FROM [1059].[SDS_VIEW]
ORDER BY [DateTime] DESC  



________________________________________


SELECT TOP 500 [STREAM.PRESSURE], [UnixTimestamp]
FROM [1059].[SDS_VIEW]
ORDER BY [UnixTimestamp] DESC  



________________________________________


SELECT TOP 500 [D1D2], [UnixTimestamp]
FROM [1059].[SDS_VIEW]
ORDER BY [UnixTimestamp] DESC  



________________________________________


SELECT TOP 500
       [UnixTimestamp]
     , [evt]/[opp] AS [EVT/OPP]
FROM [1059].[STATS_VIEW]
ORDER BY [UnixTimestamp] DESC


________________________________________


SELECT TOP 500
       [UnixTimestamp]
     , CASE WHEN [opp] = 0
       THEN NULL
       ELSE [evt]/[opp] END AS [EVT/OPP]
FROM [1059].[STATS_VIEW]
ORDER BY [UnixTimestamp] DESC


________________________________________


SELECT TOP 500
       [UnixTimestamp]
     , CASE WHEN [opp] = 0
       THEN NULL
       ELSE CAST([evt] AS FLOAT) /[opp] END AS [EVT/OPP]
FROM [1059].[STATS_VIEW]
ORDER BY [UnixTimestamp] DESC


________________________________________


SELECT DISTINCT
       [UnixTimestamp]
     , CASE WHEN [opp] = 0
       THEN NULL
       ELSE CAST([evt] AS FLOAT) /[opp] END AS [EVT/OPP]
FROM [1059].[STATS_VIEW]
ORDER BY [UnixTimestamp] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [UnixTimestamp]
       , CASE WHEN [opp] = 0
         THEN NULL
         ELSE CAST([evt] AS FLOAT) /[opp] END AS [EVT/OPP]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [UnixTimestamp] DESC



________________________________________


SELECT COUNT(*)
FROM ( select DISTINCT Round(Lat,2) AS Lat ,Round(Lon,2) AS Lon from [1059].[sds_view] ) x


________________________________________


SELECT COUNT(*)
FROM ( select DISTINCT Round(Lat,7) AS Lat ,Round(Lon,7) AS Lon from [1059].[sds_view] ) x


________________________________________


SELECT COUNT(*)
FROM ( select DISTINCT Round(Lat,2) AS Lat ,Round(Lon,2) AS Lon from [1059].[sds_view] ) x


________________________________________


SELECT Sum(Lat) FROM [1059].[sds.tab]


________________________________________


SELECT Sum(Lat) FROM [1059].[sds.tab]


________________________________________


SELECT Sum(Lat) FROM [1059].[sds.tab]


________________________________________


SELECT Sum(Lat) FROM [1059].[sds2.tab]


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , [LAT]
  , [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , [SALINITY]
  , [OCEAN.TEMP]
  , [BULK.RED]
  , [STREAM.PRESSURE]
  , [FILTER.PRESSURE]
  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
  , [Xaccel]
  , [Yaccel]
  , [Zaccel]
  , [MILLISECOND.TIMER]
  , [LASER.POWER]
  , [EVENT.RATE]
  , [FLOW.METER]
  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
  , [CHL]
  , [LightTrans]
  , [acqError]
  , [D1D2]
  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[sds.tab]
ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT * FROM [1059].[Seaflow: Stream pressure vs Time] ORDER BY [UnixTimestamp] DESC


________________________________________


SELECT TOP 500 [STREAM.PRESSURE], [DateTime]
FROM [1059].[SDS_VIEW]
ORDER BY [DateTime] DESC  



________________________________________


SELECT *
FROM [1059].[Seaflow: Stream pressure vs Time]
ORDER BY [DateTime] ASC



________________________________________


SELECT TOP 500 [DateTime], [STREAM.PRESSURE]
FROM [1059].[SDS_VIEW]
ORDER BY [DateTime] DESC  



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , CASE WHEN [opp] = 0
         THEN NULL
         ELSE CAST([evt] AS FLOAT) /[opp] END AS [EVT/OPP]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [D1D2]
  FROM [1059].[SDS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT * FROM [1059].[Seaflow: D1D2 vs Time]


________________________________________


SELECT TOP 500 * FROM (
  SELECT [DateTime],[ultra],[beads],[synecho],[nano]
                 ,[pico],[crypto],[cocco]
  FROM [1059].[STATS_VIEW]
  PIVOT (
    SUM([Conc])
    FOR [pop] IN ([ultra],[beads],[synecho],[nano]
                 ,[pico],[crypto],[cocco])
  ) as pivot_table
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT [DateTime],[ultra],[beads],[synecho],[nano]
                 ,[pico],[crypto],[cocco]
  FROM (SELECT [DateTime],[pop],[Conc] FROM [1059].[STATS_VIEW]) y
  PIVOT (
    SUM([Conc])
    FOR [pop] IN ([ultra],[beads],[synecho],[nano]
                 ,[pico],[crypto],[cocco])
  ) as pivot_table
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT [DateTime]
       , [ultra] AS [Conc.ultra]
       , [beads] AS [Conc.beads]
       , [synecho] AS [Conc.synecho]
       , [nano] AS [Conc.nano]
       , [pico] AS [Conc.pico]
       , [crypto] AS [Conc.crypto]
       , [cocco] AS [Conc.cocco]
  FROM (SELECT [DateTime],[pop],[Conc] FROM [1059].[STATS_VIEW]) y
  PIVOT (
    SUM([Conc])
    FOR [pop] IN ([ultra],[beads],[synecho],[nano]
                 ,[pico],[crypto],[cocco])
  ) as pivot_table
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT [DateTime]
       , [ultra] AS [Conc.ultra]
       , [beads] AS [Conc.beads]
       , [synecho] AS [Conc.synecho]
       , [nano] AS [Conc.nano]
       , [pico] AS [Conc.pico]
       , [crypto] AS [Conc.crypto]
       , [cocco] AS [Conc.cocco]
  FROM (SELECT [DateTime],[pop],[Conc] FROM [1059].[STATS_VIEW]) y
  PIVOT (
    SUM([Conc])
    FOR [pop] IN ([ultra],[beads],[synecho],[nano]
                 ,[pico],[crypto],[cocco])
  ) as pivot_table
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT [DateTime]
       , [ultra] AS [Conc.ultra]
       , [beads] AS [Conc.beads]
       , [synecho] AS [Conc.synecho]
       , [nano] AS [Conc.nano]
       , [pico] AS [Conc.pico]
       , [crypto] AS [Conc.crypto]
       , [cocco] AS [Conc.cocco]
  FROM (SELECT [DateTime],[pop],[Conc] FROM [1059].[STATS_VIEW]) y
  PIVOT (
    SUM([Conc])
    FOR [pop] IN ([ultra],[beads],[synecho],[nano]
                 ,[pico],[crypto],[cocco])
  ) as pivot_table
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT [DateTime]
       , [fsc_small_median]
  FROM [1059].[STATS_VIEW]
  WHERE [pop] = 'beads'
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT [DateTime]
       , [fsc_small_median] as [beads FSC]
  FROM [1059].[STATS_VIEW]
  WHERE [pop] = 'beads'
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [Temperature]
       , [Salinity]
       , [fluorescence]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [Temperature]
       , [Salinity]
       , [fluorescence]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [Temperature]
       , [Salinity]
       , [Fluorescence]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [Temperature]
       , [Salinity]
       , [Fluorescence]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT [DateTime]
       , CAST([fsc_small_median] as INTEGER) as [beads FSC]
  FROM [1059].[STATS_VIEW]
  WHERE [pop] = 'beads'
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT * FROM [1059].[SeaFlow: beads FSC signal]


________________________________________


SELECT * FROM [1059].[Seaflow: Stream pressure vs Time] ORDER BY [DateTime] ASC


________________________________________


SELECT * FROM [1059].[sds.tab]


________________________________________


SELECT 1 --CAST([Time] AS Datetime) AS [DateTime]
--  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
--  , CAST([LAT] AS VARCHAR) AS [LAT]
--  , CAST([LON] AS VARCHAR) AS [LON]
--  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
--  , CAST([SALINITY] AS VARCHAR) AS [SALINITY]
--  , CAST([OCEAN.TEMP] AS VARCHAR) AS [OCEAN.TEMP]
--  , CAST([BULK.RED] AS VARCHAR) AS [BULK.RED]
--  , CAST([STREAM.PRESSURE] AS VARCHAR) AS [STREAM.PRESSURE]
--  , CAST([FILTER.PRESSURE] AS VARCHAR) AS [FILTER.PRESSURE]
--  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
--  , CAST([Xaccel] AS VARCHAR) AS [Xaccel]
--  , CAST([Yaccel] AS VARCHAR) AS [Yaccel]
--  , CAST([Zaccel] AS VARCHAR) AS [Zaccel]
--  , CAST([MILLISECOND.TIMER] AS VARCHAR) AS [MILLISECOND.TIMER]
--  , CAST([LASER.POWER] AS VARCHAR) AS [LASER.POWER]
--  , CAST([EVENT.RATE] AS VARCHAR) AS [EVENT.RATE]
--  , CAST([FLOW.METER] AS VARCHAR) AS [FLOW.METER]
--  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
--  , CAST([CHL] AS VARCHAR) AS [CHL]
--  , CAST([Light.Trans] AS VARCHAR) AS [Light.Trans]
--  , CAST([acq.Error] AS VARCHAR) AS [acq.Error]
--  , CAST([D1.D2] AS VARCHAR) AS [D1.D2]
--  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
--  , CASE WHEN [time] = 'NA' THEN NULL ELSE [time] END AS [time]
--   , CASE WHEN [day] = 'NA' THEN NULL ELSE [day] END AS [day]
--  , CAST([file] AS VARCHAR) AS [file]
--  , CASE WHEN [DMY] = 'NA' THEN NULL ELSE [DMY] END AS [DMY]
--  , CASE WHEN [HMS] = 'NA' THEN NULL ELSE [HMS] END AS [HMS]
FROM [1059].[sds.tab]
--ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
--  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
--  , CAST([LAT] AS VARCHAR) AS [LAT]
--  , CAST([LON] AS VARCHAR) AS [LON]
--  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
--  , CAST([SALINITY] AS VARCHAR) AS [SALINITY]
--  , CAST([OCEAN.TEMP] AS VARCHAR) AS [OCEAN.TEMP]
--  , CAST([BULK.RED] AS VARCHAR) AS [BULK.RED]
--  , CAST([STREAM.PRESSURE] AS VARCHAR) AS [STREAM.PRESSURE]
--  , CAST([FILTER.PRESSURE] AS VARCHAR) AS [FILTER.PRESSURE]
--  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
--  , CAST([Xaccel] AS VARCHAR) AS [Xaccel]
--  , CAST([Yaccel] AS VARCHAR) AS [Yaccel]
--  , CAST([Zaccel] AS VARCHAR) AS [Zaccel]
--  , CAST([MILLISECOND.TIMER] AS VARCHAR) AS [MILLISECOND.TIMER]
--  , CAST([LASER.POWER] AS VARCHAR) AS [LASER.POWER]
--  , CAST([EVENT.RATE] AS VARCHAR) AS [EVENT.RATE]
--  , CAST([FLOW.METER] AS VARCHAR) AS [FLOW.METER]
--  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
--  , CAST([CHL] AS VARCHAR) AS [CHL]
--  , CAST([Light.Trans] AS VARCHAR) AS [Light.Trans]
--  , CAST([acq.Error] AS VARCHAR) AS [acq.Error]
--  , CAST([D1.D2] AS VARCHAR) AS [D1.D2]
--  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
--  , CASE WHEN [time] = 'NA' THEN NULL ELSE [time] END AS [time]
--   , CASE WHEN [day] = 'NA' THEN NULL ELSE [day] END AS [day]
--  , CAST([file] AS VARCHAR) AS [file]
--  , CASE WHEN [DMY] = 'NA' THEN NULL ELSE [DMY] END AS [DMY]
--  , CASE WHEN [HMS] = 'NA' THEN NULL ELSE [HMS] END AS [HMS]
FROM [1059].[sds.tab]
--ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CAST([LAT] AS VARCHAR) AS [LAT]
  , CAST([LON] AS VARCHAR) AS [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , CAST([SALINITY] AS VARCHAR) AS [SALINITY]
--  , CAST([OCEAN.TEMP] AS VARCHAR) AS [OCEAN.TEMP]
--  , CAST([BULK.RED] AS VARCHAR) AS [BULK.RED]
--  , CAST([STREAM.PRESSURE] AS VARCHAR) AS [STREAM.PRESSURE]
--  , CAST([FILTER.PRESSURE] AS VARCHAR) AS [FILTER.PRESSURE]
--  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
--  , CAST([Xaccel] AS VARCHAR) AS [Xaccel]
--  , CAST([Yaccel] AS VARCHAR) AS [Yaccel]
--  , CAST([Zaccel] AS VARCHAR) AS [Zaccel]
--  , CAST([MILLISECOND.TIMER] AS VARCHAR) AS [MILLISECOND.TIMER]
--  , CAST([LASER.POWER] AS VARCHAR) AS [LASER.POWER]
--  , CAST([EVENT.RATE] AS VARCHAR) AS [EVENT.RATE]
--  , CAST([FLOW.METER] AS VARCHAR) AS [FLOW.METER]
--  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
--  , CAST([CHL] AS VARCHAR) AS [CHL]
--  , CAST([Light.Trans] AS VARCHAR) AS [Light.Trans]
--  , CAST([acq.Error] AS VARCHAR) AS [acq.Error]
--  , CAST([D1.D2] AS VARCHAR) AS [D1.D2]
--  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
--  , CASE WHEN [time] = 'NA' THEN NULL ELSE [time] END AS [time]
--   , CASE WHEN [day] = 'NA' THEN NULL ELSE [day] END AS [day]
--  , CAST([file] AS VARCHAR) AS [file]
--  , CASE WHEN [DMY] = 'NA' THEN NULL ELSE [DMY] END AS [DMY]
--  , CASE WHEN [HMS] = 'NA' THEN NULL ELSE [HMS] END AS [HMS]
FROM [1059].[sds.tab]
--ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CAST([LAT] AS VARCHAR) AS [LAT]
  , CAST([LON] AS VARCHAR) AS [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , CAST([SALINITY] AS VARCHAR) AS [SALINITY]
  , CAST([OCEAN.TEMP] AS VARCHAR) AS [OCEAN.TEMP]
  , CAST([BULK.RED] AS VARCHAR) AS [BULK.RED]
  , CAST([STREAM.PRESSURE] AS VARCHAR) AS [STREAM.PRESSURE]
  , CAST([FILTER.PRESSURE] AS VARCHAR) AS [FILTER.PRESSURE]
--  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
--  , CAST([Xaccel] AS VARCHAR) AS [Xaccel]
--  , CAST([Yaccel] AS VARCHAR) AS [Yaccel]
--  , CAST([Zaccel] AS VARCHAR) AS [Zaccel]
--  , CAST([MILLISECOND.TIMER] AS VARCHAR) AS [MILLISECOND.TIMER]
--  , CAST([LASER.POWER] AS VARCHAR) AS [LASER.POWER]
--  , CAST([EVENT.RATE] AS VARCHAR) AS [EVENT.RATE]
--  , CAST([FLOW.METER] AS VARCHAR) AS [FLOW.METER]
--  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
--  , CAST([CHL] AS VARCHAR) AS [CHL]
--  , CAST([Light.Trans] AS VARCHAR) AS [Light.Trans]
--  , CAST([acq.Error] AS VARCHAR) AS [acq.Error]
--  , CAST([D1.D2] AS VARCHAR) AS [D1.D2]
--  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
--  , CASE WHEN [time] = 'NA' THEN NULL ELSE [time] END AS [time]
--   , CASE WHEN [day] = 'NA' THEN NULL ELSE [day] END AS [day]
--  , CAST([file] AS VARCHAR) AS [file]
--  , CASE WHEN [DMY] = 'NA' THEN NULL ELSE [DMY] END AS [DMY]
--  , CASE WHEN [HMS] = 'NA' THEN NULL ELSE [HMS] END AS [HMS]
FROM [1059].[sds.tab]
--ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CAST([LAT] AS VARCHAR) AS [LAT]
  , CAST([LON] AS VARCHAR) AS [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , CAST([SALINITY] AS VARCHAR) AS [SALINITY]
  , CAST([OCEAN.TEMP] AS VARCHAR) AS [OCEAN.TEMP]
  , CAST([BULK.RED] AS VARCHAR) AS [BULK.RED]
  , CAST([STREAM.PRESSURE] AS VARCHAR) AS [STREAM.PRESSURE]
  , CAST([FILTER.PRESSURE] AS VARCHAR) AS [FILTER.PRESSURE]
--  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
--  , CAST([Xaccel] AS VARCHAR) AS [Xaccel]
--  , CAST([Yaccel] AS VARCHAR) AS [Yaccel]
--  , CAST([Zaccel] AS VARCHAR) AS [Zaccel]
--  , CAST([MILLISECOND.TIMER] AS VARCHAR) AS [MILLISECOND.TIMER]
--  , CAST([LASER.POWER] AS VARCHAR) AS [LASER.POWER]
--  , CAST([EVENT.RATE] AS VARCHAR) AS [EVENT.RATE]
--  , CAST([FLOW.METER] AS VARCHAR) AS [FLOW.METER]
--  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
--  , CAST([CHL] AS VARCHAR) AS [CHL]
--  , CAST([Light.Trans] AS VARCHAR) AS [Light.Trans]
--  , CAST([acq.Error] AS VARCHAR) AS [acq.Error]
--  , CAST([D1.D2] AS VARCHAR) AS [D1.D2]
--  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
--  , CASE WHEN [time] = 'NA' THEN NULL ELSE [time] END AS [time]
--   , CASE WHEN [day] = 'NA' THEN NULL ELSE [day] END AS [day]
--  , CAST([file] AS VARCHAR) AS [file]
--  , CASE WHEN [DMY] = 'NA' THEN NULL ELSE [DMY] END AS [DMY]
--  , CASE WHEN [HMS] = 'NA' THEN NULL ELSE [HMS] END AS [HMS]
FROM [1059].[sds.tab]
ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CAST([LAT] AS VARCHAR) AS [LAT]
  , CAST([LON] AS VARCHAR) AS [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , CAST([SALINITY] AS VARCHAR) AS [SALINITY]
  , CAST([OCEAN.TEMP] AS VARCHAR) AS [OCEAN.TEMP]
  , CAST([BULK.RED] AS VARCHAR) AS [BULK.RED]
  , CAST([STREAM.PRESSURE] AS VARCHAR) AS [STREAM.PRESSURE]
  , CAST([FILTER.PRESSURE] AS VARCHAR) AS [FILTER.PRESSURE]
--  , CASE WHEN [MACHINE.TEMP] = 'NA' THEN NULL ELSE [MACHINE.TEMP] END AS [MACHINE.TEMP]
--  , CAST([Xaccel] AS VARCHAR) AS [Xaccel]
--  , CAST([Yaccel] AS VARCHAR) AS [Yaccel]
--  , CAST([Zaccel] AS VARCHAR) AS [Zaccel]
--  , CAST([MILLISECOND.TIMER] AS VARCHAR) AS [MILLISECOND.TIMER]
--  , CAST([LASER.POWER] AS VARCHAR) AS [LASER.POWER]
--  , CAST([EVENT.RATE] AS VARCHAR) AS [EVENT.RATE]
--  , CAST([FLOW.METER] AS VARCHAR) AS [FLOW.METER]
--  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
--  , CAST([CHL] AS VARCHAR) AS [CHL]
--  , CAST([Light.Trans] AS VARCHAR) AS [Light.Trans]
--  , CAST([acq.Error] AS VARCHAR) AS [acq.Error]
--  , CAST([D1.D2] AS VARCHAR) AS [D1.D2]
--  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
--  , CASE WHEN [time] = 'NA' THEN NULL ELSE [time] END AS [time]
--   , CASE WHEN [day] = 'NA' THEN NULL ELSE [day] END AS [day]
--  , CAST([file] AS VARCHAR) AS [file]
--  , CASE WHEN [DMY] = 'NA' THEN NULL ELSE [DMY] END AS [DMY]
--  , CASE WHEN [HMS] = 'NA' THEN NULL ELSE [HMS] END AS [HMS]
FROM [1059].[sds.tab]
ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CAST([LAT] AS VARCHAR) AS [LAT]
  , CAST([LON] AS VARCHAR) AS [LON]
  , CASE WHEN [CONDUCTIVITY] = 'NA' THEN NULL ELSE [CONDUCTIVITY] END AS [CONDUCTIVITY]
  , CAST([SALINITY] AS VARCHAR) AS [SALINITY]
  , CAST([OCEAN.TEMP] AS VARCHAR) AS [OCEAN.TEMP]
  , CAST([BULK.RED] AS VARCHAR) AS [BULK.RED]
  , CAST([STREAM.PRESSURE] AS VARCHAR) AS [STREAM.PRESSURE]
  , CAST([FILTER.PRESSURE] AS VARCHAR) AS [FILTER.PRESSURE]
  , CAST([MACHINE.TEMP] AS VARCHAR) AS [MACHINE.TEMP]
--  , CAST([Xaccel] AS VARCHAR) AS [Xaccel]
--  , CAST([Yaccel] AS VARCHAR) AS [Yaccel]
--  , CAST([Zaccel] AS VARCHAR) AS [Zaccel]
--  , CAST([MILLISECOND.TIMER] AS VARCHAR) AS [MILLISECOND.TIMER]
--  , CAST([LASER.POWER] AS VARCHAR) AS [LASER.POWER]
--  , CAST([EVENT.RATE] AS VARCHAR) AS [EVENT.RATE]
--  , CAST([FLOW.METER] AS VARCHAR) AS [FLOW.METER]
--  , CASE WHEN [position] = 'NA' THEN NULL ELSE [position] END AS [position]
--  , CAST([CHL] AS VARCHAR) AS [CHL]
--  , CAST([Light.Trans] AS VARCHAR) AS [Light.Trans]
--  , CAST([acq.Error] AS VARCHAR) AS [acq.Error]
--  , CAST([D1.D2] AS VARCHAR) AS [D1.D2]
--  , CASE WHEN [PAR] = 'NA' THEN NULL ELSE [PAR] END AS [PAR]
--  , CASE WHEN [time] = 'NA' THEN NULL ELSE [time] END AS [time]
--   , CASE WHEN [day] = 'NA' THEN NULL ELSE [day] END AS [day]
--  , CAST([file] AS VARCHAR) AS [file]
--  , CASE WHEN [DMY] = 'NA' THEN NULL ELSE [DMY] END AS [DMY]
--  , CASE WHEN [HMS] = 'NA' THEN NULL ELSE [HMS] END AS [HMS]
FROM [1059].[sds.tab]
ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CASE WHEN CAST([LAT] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([LAT] AS VARCHAR) END AS [LAT]
  , CASE WHEN CAST([LON] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([LON] AS VARCHAR) END AS [LON]
  , CASE WHEN CAST([CONDUCTIVITY] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([CONDUCTIVITY] AS VARCHAR) END AS [CONDUCTIVITY]
  , CASE WHEN CAST([SALINITY] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([SALINITY] AS VARCHAR) END AS [SALINITY]
  , CASE WHEN CAST([OCEAN.TEMP] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([OCEAN.TEMP] AS VARCHAR) END AS [OCEAN.TEMP]
  , CASE WHEN CAST([BULK.RED] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([BULK.RED] AS VARCHAR) END AS [BULK.RED]
  , CASE WHEN CAST([STREAM.PRESSURE] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([STREAM.PRESSURE] AS VARCHAR) END AS [STREAM.PRESSURE]
  , CASE WHEN CAST([FILTER.PRESSURE] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([FILTER.PRESSURE] AS VARCHAR) END AS [FILTER.PRESSURE]
  , CASE WHEN CAST([MACHINE.TEMP] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([MACHINE.TEMP] AS VARCHAR) END AS [MACHINE.TEMP]
  , CASE WHEN CAST([Xaccel] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([Xaccel] AS VARCHAR) END AS [Xaccel]
  , CASE WHEN CAST([Yaccel] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([Yaccel] AS VARCHAR) END AS [Yaccel]
  , CASE WHEN CAST([Zaccel] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([Zaccel] AS VARCHAR) END AS [Zaccel]
  , CASE WHEN CAST([MILLISECOND.TIMER] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([MILLISECOND.TIMER] AS VARCHAR) END AS [MILLISECOND.TIMER]
  , CASE WHEN CAST([LASER.POWER] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([LASER.POWER] AS VARCHAR) END AS [LASER.POWER]
  , CASE WHEN CAST([EVENT.RATE] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([EVENT.RATE] AS VARCHAR) END AS [EVENT.RATE]
  , CASE WHEN CAST([FLOW.METER] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([FLOW.METER] AS VARCHAR) END AS [FLOW.METER]
  , CASE WHEN CAST([position] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([position] AS VARCHAR) END AS [position]
  , CASE WHEN CAST([CHL] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([CHL] AS VARCHAR) END AS [CHL]
  , CASE WHEN CAST([Light.Trans] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([Light.Trans] AS VARCHAR) END AS [Light.Trans]
  , CASE WHEN CAST([acq.Error] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([acq.Error] AS VARCHAR) END AS [acq.Error]
  , CASE WHEN CAST([D1.D2] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([D1.D2] AS VARCHAR) END AS [D1.D2]
  , CASE WHEN CAST([PAR] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([PAR] AS VARCHAR) END AS [PAR]
  , CASE WHEN CAST([time] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([time] AS VARCHAR) END AS [time]
  , CASE WHEN CAST([day] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([day] AS VARCHAR) END AS [day]
  , CASE WHEN CAST([file] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([file] AS VARCHAR) END AS [file]
  , CASE WHEN CAST([DMY] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([DMY] AS VARCHAR) END AS [DMY]
  , CASE WHEN CAST([HMS] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([HMS] AS VARCHAR) END AS [HMS]
FROM [1059].[sds.tab]
ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CAST([LAT] AS FLOAT) AS [LAT]
  , CAST([LON] AS FLOAT) AS [LON]
  , CAST([CONDUCTIVITY] AS FLOAT) AS [CONDUCTIVITY]
  , CAST([SALINITY] AS FLOAT) AS [SALINITY]
  , CAST([OCEAN.TEMP] AS FLOAT) AS [OCEAN.TEMP]
  , CAST([BULK.RED] AS FLOAT) AS [BULK.RED]
  , CAST([STREAM.PRESSURE] AS FLOAT) AS [STREAM.PRESSURE]
  , CAST([FILTER.PRESSURE] AS FLOAT) AS [FILTER.PRESSURE]
  , CAST([MACHINE.TEMP] AS FLOAT) AS [MACHINE.TEMP]
  , CAST([Xaccel] AS FLOAT) AS [Xaccel]
  , CAST([Yaccel] AS FLOAT) AS [Yaccel]
  , CAST([Zaccel] AS FLOAT) AS [Zaccel]
  , CAST([MILLISECOND.TIMER] AS INTEGER) AS [MILLISECOND.TIMER]
  , CAST([LASER.POWER] AS FLOAT) AS [LASER.POWER]
  , CAST([EVENT.RATE] AS FLOAT) AS [EVENT.RATE]
  , CAST([FLOW.METER] AS FLOAT) AS [FLOW.METER]
  , CAST([position] AS FLOAT) AS [position]
  , CAST([CHL] AS FLOAT) AS [CHL]
  , CAST([Light.Trans] AS FLOAT) AS [Light.Trans]
  , CAST([acq.Error] AS FLOAT) AS [acq.Error]
  , CAST([D1.D2] AS FLOAT) AS [D1.D2]
  , CAST([PAR] AS FLOAT) AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[SDS_VIEW_VARCHAR]
ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [D1.D2]
  FROM [1059].[SDS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT * FROM [1059].[stats.tab]


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CASE WHEN [pop] = 'NA' THEN NULL ELSE [pop] END AS [pop]
  , [n]
  , [fsc_small]
  , [chl_small]
  , [evt]
  , [opp]
  , [lat]
  , [lon]
  , [time]
  , [flowrate]
  , [conc]
  , [day]
  , [file]
  , [pop]
FROM [1059].[stats.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , [n]
  , [fsc_small]
  , [chl_small]
  , [evt]
  , [opp]
  , [lat]
  , [lon]
  , [time]
  , [flowrate]
  , [conc]
  , [day]
  , [file]
  , [pop]
FROM [1059].[stats.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , [n]
  , [fsc_small]
  , [chl_small]
  , [evt]
  , [opp]
  , [lat]
  , [lon]
  , [time]
  , [flowrate]
  , [conc]
  , [day]
  , [file]
  , [pop]
FROM [1059].[stats.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CASE WHEN CAST([n] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([n] AS VARCHAR) END AS [n]
  , CASE WHEN CAST([fsc_small] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([fsc_small] AS VARCHAR) END AS [fsc_small]
  , CASE WHEN CAST([chl_small] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([chl_small] AS VARCHAR) END AS [chl_small]
  , CASE WHEN CAST([evt] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([evt] AS VARCHAR) END AS [evt]
  , CASE WHEN CAST([opp] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([opp] AS VARCHAR) END AS [opp]
  , CASE WHEN CAST([lat] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([lat] AS VARCHAR) END AS [lat]
  , CASE WHEN CAST([lon] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([lon] AS VARCHAR) END AS [lon]
  , CASE WHEN CAST([time] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([time] AS VARCHAR) END AS [time]
  , CASE WHEN CAST([flowrate] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([flowrate] AS VARCHAR) END AS [flowrate]
  , CASE WHEN CAST([conc] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([conc] AS VARCHAR) END AS [conc]
  , CASE WHEN CAST([day] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([day] AS VARCHAR) END AS [day]
  , CASE WHEN CAST([file] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([file] AS VARCHAR) END AS [file]
  , CASE WHEN CAST([pop] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([pop] AS VARCHAR) END AS [pop]
FROM [1059].[stats.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CAST([n] AS INTEGER) AS [n]
  , CAST([fsc_small] AS FLOAT) AS [fsc_small]
  , CAST([chl_small] AS FLOAT) AS [chl_small]
  , CAST([evt] AS INTEGER) AS [evt]
  , CAST([opp] AS INTEGER) AS [opp]
  , CAST([lat] AS FLOAT) AS [lat]
  , CAST([lon] AS FLOAT) AS [lon]
  , [time]
  , CAST([flowrate] AS FLOAT) AS [flowrate]
  , CAST([conc] AS FLOAT) AS [conc]
  , [day]
  , [file]
  , [pop]
FROM [1059].[STATS_VIEW_VARCHAR]
ORDER BY [DateTime] ASC


________________________________________


SELECT TOP 500 * FROM (
  SELECT [DateTime]
       , [fsc_small] as [beads FSC]
  FROM [1059].[STATS_VIEW]
  WHERE [pop] = 'beads'
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [OCEAN.TEMP] AS [Temperature]
       , [Salinity]
--       , [Fluorescence]
  FROM [1059].[SDS_VIEW]
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [OCEAN.TEMP] AS [Temperature]
       , [Salinity]
       , NULL AS [Fluorescence]
  FROM [1059].[SDS_VIEW]
) x
ORDER BY [DateTime] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [OCEAN.TEMP] AS [Temperature]
       , [Salinity]
       , NULL AS [Fluorescence]
  FROM [1059].[SDS_VIEW]
) x
WHERE [Temperature] IS NOT NULL
   OR [Salinity] IS NOT NULL
   OR [Fluorescence] IS NOT NULL
ORDER BY [DateTime] DESC


________________________________________


SELECT min(Lat), max(Lat), min(Lon), max(Lon) 
  FROM [1059].[sds_view]


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CAST([LAT] AS FLOAT)/100.0 AS [LAT]
  , CAST([LON] AS FLOAT)/-100.0 AS [LON]
  , CAST([CONDUCTIVITY] AS FLOAT) AS [CONDUCTIVITY]
  , CAST([SALINITY] AS FLOAT) AS [SALINITY]
  , CAST([OCEAN.TEMP] AS FLOAT) AS [OCEAN.TEMP]
  , CAST([BULK.RED] AS FLOAT) AS [BULK.RED]
  , CAST([STREAM.PRESSURE] AS FLOAT) AS [STREAM.PRESSURE]
  , CAST([FILTER.PRESSURE] AS FLOAT) AS [FILTER.PRESSURE]
  , CAST([MACHINE.TEMP] AS FLOAT) AS [MACHINE.TEMP]
  , CAST([Xaccel] AS FLOAT) AS [Xaccel]
  , CAST([Yaccel] AS FLOAT) AS [Yaccel]
  , CAST([Zaccel] AS FLOAT) AS [Zaccel]
  , CAST([MILLISECOND.TIMER] AS INTEGER) AS [MILLISECOND.TIMER]
  , CAST([LASER.POWER] AS FLOAT) AS [LASER.POWER]
  , CAST([EVENT.RATE] AS FLOAT) AS [EVENT.RATE]
  , CAST([FLOW.METER] AS FLOAT) AS [FLOW.METER]
  , CAST([position] AS FLOAT) AS [position]
  , CAST([CHL] AS FLOAT) AS [CHL]
  , CAST([Light.Trans] AS FLOAT) AS [Light.Trans]
  , CAST([acq.Error] AS FLOAT) AS [acq.Error]
  , CAST([D1.D2] AS FLOAT) AS [D1.D2]
  , CAST([PAR] AS FLOAT) AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[SDS_VIEW_VARCHAR]
ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT TOP 5
   CAST([LAT] AS FLOAT) AS LAT
 , CAST([LON] AS FLOAT) AS LON 
FROM [1059].[SDS_VIEW_VARCHAR]
WHERE [LAT] IS NOT NULL


________________________________________


SELECT TOP 5
   CAST([LAT] AS FLOAT)/100 AS LAT
 , CAST([LON] AS FLOAT)/100 AS LON 
FROM [1059].[SDS_VIEW_VARCHAR]
WHERE [LAT] IS NOT NULL


________________________________________


SELECT TOP 5
    ROUND(CAST([LAT] AS FLOAT)/100, 2, 1) AS LAT
 , CAST([LON] AS FLOAT)/100 AS LON 
FROM [1059].[SDS_VIEW_VARCHAR]
WHERE [LAT] IS NOT NULL


________________________________________


SELECT TOP 5
   ROUND(CAST([LAT] AS FLOAT)/100, 0, 1) AS LAT
 , CAST([LON] AS FLOAT)/100 AS LON 
FROM [1059].[SDS_VIEW_VARCHAR]
WHERE [LAT] IS NOT NULL


________________________________________


SELECT TOP 5
   ROUND(CAST([LAT] AS FLOAT)/100, 0, 1) AS LAT
 , ROUND(CAST([LON] AS FLOAT)/-100, 0, 1) AS LON 
FROM [1059].[SDS_VIEW_VARCHAR]
WHERE [LAT] IS NOT NULL


________________________________________


WITH DEGMIN (DLAT, DLON) AS
  (SELECT CAST([LAT] AS FLOAT)/100 AS DLAT
        , CAST([LON] AS FLOAT)/-100 AS DLON
   FROM [1059].[SDS_VIEW_VARCHAR])
SELECT TOP 5
   ROUND(DLAT, 0, 1) + 
   [DLAT] - ROUND(DLAT, 0, 1) AS LAT
FROM DEGMIN
WHERE [DLAT] IS NOT NULL


________________________________________


WITH DEGMIN (DLAT, DLON) AS
  (SELECT CAST([LAT] AS FLOAT)/100 AS DLAT
        , CAST([LON] AS FLOAT)/-100 AS DLON
   FROM [1059].[SDS_VIEW_VARCHAR])
SELECT TOP 5
   ROUND(DLAT, 0, 1) + 
  ([DLAT] - ROUND(DLAT, 0, 1))*100/60 AS LAT
FROM DEGMIN
WHERE [DLAT] IS NOT NULL


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , ROUND(CAST([LAT] AS FLOAT)/100, 0, 1) + 
   (CAST([LAT] AS FLOAT)/100 - ROUND(CAST([LAT] AS FLOAT)/100, 0, 1))*100/60 AS LAT
  , CAST([LON] AS FLOAT)/-100.0 AS [LON]
  , CAST([CONDUCTIVITY] AS FLOAT) AS [CONDUCTIVITY]
  , CAST([SALINITY] AS FLOAT) AS [SALINITY]
  , CAST([OCEAN.TEMP] AS FLOAT) AS [OCEAN.TEMP]
  , CAST([BULK.RED] AS FLOAT) AS [BULK.RED]
  , CAST([STREAM.PRESSURE] AS FLOAT) AS [STREAM.PRESSURE]
  , CAST([FILTER.PRESSURE] AS FLOAT) AS [FILTER.PRESSURE]
  , CAST([MACHINE.TEMP] AS FLOAT) AS [MACHINE.TEMP]
  , CAST([Xaccel] AS FLOAT) AS [Xaccel]
  , CAST([Yaccel] AS FLOAT) AS [Yaccel]
  , CAST([Zaccel] AS FLOAT) AS [Zaccel]
  , CAST([MILLISECOND.TIMER] AS INTEGER) AS [MILLISECOND.TIMER]
  , CAST([LASER.POWER] AS FLOAT) AS [LASER.POWER]
  , CAST([EVENT.RATE] AS FLOAT) AS [EVENT.RATE]
  , CAST([FLOW.METER] AS FLOAT) AS [FLOW.METER]
  , CAST([position] AS FLOAT) AS [position]
  , CAST([CHL] AS FLOAT) AS [CHL]
  , CAST([Light.Trans] AS FLOAT) AS [Light.Trans]
  , CAST([acq.Error] AS FLOAT) AS [acq.Error]
  , CAST([D1.D2] AS FLOAT) AS [D1.D2]
  , CAST([PAR] AS FLOAT) AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[SDS_VIEW_VARCHAR]
ORDER BY [UnixTimestamp] ASC


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , ROUND(CAST([LAT] AS FLOAT)/100, 0, 1) + 
   (CAST([LAT] AS FLOAT)/100 - ROUND(CAST([LAT] AS FLOAT)/100, 0, 1))*100/60 AS LAT
  , -(ROUND(CAST([LON] AS FLOAT)/100, 0, 1) + 
    (CAST([LON] AS FLOAT)/100 - ROUND(CAST([LON] AS FLOAT)/100, 0, 1))*100/60) AS LON
  , CAST([CONDUCTIVITY] AS FLOAT) AS [CONDUCTIVITY]
  , CAST([SALINITY] AS FLOAT) AS [SALINITY]
  , CAST([OCEAN.TEMP] AS FLOAT) AS [OCEAN.TEMP]
  , CAST([BULK.RED] AS FLOAT) AS [BULK.RED]
  , CAST([STREAM.PRESSURE] AS FLOAT) AS [STREAM.PRESSURE]
  , CAST([FILTER.PRESSURE] AS FLOAT) AS [FILTER.PRESSURE]
  , CAST([MACHINE.TEMP] AS FLOAT) AS [MACHINE.TEMP]
  , CAST([Xaccel] AS FLOAT) AS [Xaccel]
  , CAST([Yaccel] AS FLOAT) AS [Yaccel]
  , CAST([Zaccel] AS FLOAT) AS [Zaccel]
  , CAST([MILLISECOND.TIMER] AS INTEGER) AS [MILLISECOND.TIMER]
  , CAST([LASER.POWER] AS FLOAT) AS [LASER.POWER]
  , CAST([EVENT.RATE] AS FLOAT) AS [EVENT.RATE]
  , CAST([FLOW.METER] AS FLOAT) AS [FLOW.METER]
  , CAST([position] AS FLOAT) AS [position]
  , CAST([CHL] AS FLOAT) AS [CHL]
  , CAST([Light.Trans] AS FLOAT) AS [Light.Trans]
  , CAST([acq.Error] AS FLOAT) AS [acq.Error]
  , CAST([D1.D2] AS FLOAT) AS [D1.D2]
  , CAST([PAR] AS FLOAT) AS [PAR]
  , [time]
  , [day]
  , [file]
  , [DMY]
  , [HMS]
FROM [1059].[SDS_VIEW_VARCHAR]
ORDER BY [UnixTimestamp] ASC


________________________________________


WITH Numbered AS
  (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
    FROM [1059].[SDS_VIEW])
SELECT TOP 1 *
FROM Numbered


________________________________________


WITH Numbered AS
  (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
    FROM [1059].[SDS_VIEW])
SELECT TOP 10 *
FROM Numbered


________________________________________


WITH Numbered AS
  (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
    FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2)) AS Euclid
FROM Numbered a
JOIN Numbered b
  ON a.[Row] = b.[Row]



________________________________________


WITH Numbered AS
  (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
    FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2)) AS Euclid
FROM Numbered a
JOIN Numbered b
  ON a.[Row] + 1 = b.[Row]



________________________________________


WITH Numbered AS
  (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
    FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2)) AS Euclid
FROM Numbered a
JOIN Numbered b
  ON a.[Row] + 1 = b.[Row]
ORDER BY [DateTime] DESC



________________________________________


WITH Radius AS (SELECT 6378100 AS Radius)
  , Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2)) AS Euclid
FROM Numbered a
JOIN Numbered b
  ON a.[Row] + 1 = b.[Row]
ORDER BY [DateTime] DESC



________________________________________


WITH Radius AS (SELECT 6378100 AS Radius)
  , Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , Radius * (SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2))) / 360 * 2 * 3.1415926 * Radius AS Euclid
FROM Numbered a
JOIN Numbered b
  ON a.[Row] + 1 = b.[Row]
CROSS JOIN Radius 
ORDER BY [DateTime] DESC



________________________________________


WITH Radius AS (SELECT 6378100 AS Radius)
  , Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , Radius * (SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2))) / 360 * 2 * 3.1415926 * Radius AS Euclid
FROM Numbered a
CROSS JOIN Radius 
JOIN Numbered b
  ON a.[Row] + 1 = b.[Row]
ORDER BY [DateTime] DESC



________________________________________


WITH Radius AS (SELECT 6378100 AS Radius)
  , Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , Radius * (SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2))) / 360 * 2 * 3.1415926 * Radius AS Euclid
FROM Numbered a
   , Numbered b
   , Radius
WHERE a.[Row] + 1 = b.[Row]
ORDER BY [DateTime] DESC



________________________________________


WITH Radius AS (SELECT 6378100 AS Radius)
  , Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , (SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2))) / 360 * 2 * 3.1415926 * Radius AS Euclid
FROM Numbered a
   , Numbered b
   , Radius
WHERE a.[Row] + 1 = b.[Row]
ORDER BY [DateTime] DESC



________________________________________


WITH Radius AS (SELECT 6378100 AS Radius)
  , Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , (SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2))) / 360 / 360 * 2 * 3.1415926 * Radius AS Euclid
FROM Numbered a
   , Numbered b
   , Radius
WHERE a.[Row] + 1 = b.[Row]
ORDER BY [DateTime] DESC



________________________________________


WITH Radius AS (SELECT 6378100 AS Radius)
  , Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
SELECT b.[DateTime]
  , (SQRT(POWER(b.[LAT]-a.[LAT],2) + POWER(b.[LON]-a.[LON],2))) / 360 / 180 * 2 * 3.1415926 * Radius AS Euclid
FROM Numbered a
   , Numbered b
   , Radius
WHERE a.[Row] + 1 = b.[Row]
ORDER BY [DateTime] DESC



________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] AS [lat1]
            , a.[LON] as [lon1]
            , b.[LAT] AS [lat2]
            , b.[LON] as [lon2]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
SELECT TOP 1 * FROM Paired


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] AS [lat1]
            , a.[LON] as [lon1]
            , b.[LAT] AS [lat2]
            , b.[LON] as [lon2]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
SELECT TOP 1 * FROM Paired
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] * PI() / 180 AS [lat1]
            , a.[LON] * PI() / 180  as [lon1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , b.[LON] * PI() / 180  as [lon2]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])

SELECT TOP 1 * FROM Paired
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  
SELECT TOP 1 * FROM Paired
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT POWER(SIN(dlat/2),2)
        + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
    AS val FROM Paired)
SELECT TOP 1 * FROM Paired
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT [DateTime]
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT TOP 1 * FROM Trig
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT [DateTime]
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT TOP 1 [DateTime]
     , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT TOP 1 [DateTime]
     , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT TOP 1 *
     , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] AS [lat1deg]
            , b.[LAT] AS [lat2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT TOP 1 *
     , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT TOP 1 *
     , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT TOP 1 *
     , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT *
     , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig
ORDER BY [DateTime] DESC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT *
     , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig
ORDER BY [DateTime] ASC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
  (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
SELECT *
     , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig



________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT TOP 1 * FROM Distance


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , b.[DateTime] - a.[DateTime] AS [Elapsed]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT TOP 1 * FROM Distance


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, b.[DateTime], a.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT TOP 1 * FROM Distance


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT TOP 1 * FROM Distance


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT TOP 1 *
  , [Distance (m)] / [Elapsed (s)] AS [Velocity (m/s)]
FROM Distance


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT TOP 1 *
  , [Distance (m)] / [Elapsed (s)] AS [Velocity (m/s)]
FROM Distance
ORDER BY [Velocity (m/s)] DESC



________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT TOP 1 *
  , [Distance (m)] / [Elapsed (s)] AS [Velocity (m/s)]
FROM Distance


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / [Elapsed (s)] AS [Velocity (m/s)]
FROM Distance


________________________________________


SELECT [DateTime],[Velocity (m/s)] 
  FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] ASC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , CASE WHEN [Elapsed (s)] IS NULL THEN NULL ELSE [Distance (m)] / [Elapsed (s)] END AS [Velocity (m/s)]
FROM Distance


________________________________________


SELECT [DateTime],[Velocity (m/s)] 
FROM [1059].[SeaFlow: velocity]
ORDER BY [DateTime] ASC


________________________________________


SELECT [DateTime],[Velocity (m/s)] 
FROM [1059].[SeaFlow: velocity]
ORDER BY [DateTime] DESC


________________________________________


SELECT [DateTime],[Velocity (m/s)] 
FROM [1059].[SeaFlow: velocity]
ORDER BY [Velocity (m/s)] DESC


________________________________________


SELECT [DateTime],[Velocity (m/s)] 
FROM [1059].[SeaFlow: velocity]
WHERE [Velocity (m/s)] IS NOT NULL
ORDER BY [Velocity (m/s)] DESC


________________________________________


SELECT [DateTime],[Velocity (m/s)] 
FROM [1059].[SeaFlow: velocity]
WHERE [Velocity (m/s)] IS NOT NULL
ORDER BY [Velocity (m/s)] DESC


________________________________________


SELECT [DateTime],[Velocity (m/s)] 
FROM [1059].[SeaFlow: velocity]
WHERE [Velocity (m/s)] IS NOT NULL
ORDER BY [Velocity (m/s)] ASC


________________________________________


SELECT [DateTime],[lat1],[Velocity (m/s)] 
FROM [1059].[SeaFlow: velocity]
WHERE [lat1] IS NOT NULL
ORDER BY [DateTime] ASC


________________________________________


SELECT [DateTime],[lat1],[Velocity (m/s)] 
FROM [1059].[SeaFlow: velocity]
WHERE [lat1] IS NOT NULL
ORDER BY [DateTime] ASC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / nullif([Elapsed (s)],0) AS [Velocity (m/s)]
FROM Distance


________________________________________


SELECT [DateTime],[Velocity (m/s)] 
FROM [1059].[SeaFlow: velocity]
WHERE [Velocity (m/s)] IS NOT NULL
ORDER BY [DateTime] ASC


________________________________________


WITH Numbered AS
      (SELECT [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [DateTime] ASC) AS [Row]
       FROM [1059].[SDS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT TOP 500 *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) AS [Velocity (m/s)]
FROM Distance


________________________________________


SELECT CAST([Time] AS Datetime) AS [DateTime]
  , DATEDIFF(SECOND,{d '1970-01-01'}, CAST([Time] AS Datetime)) AS [UnixTimestamp]
  , CASE WHEN CAST([n] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([n] AS VARCHAR) END AS [n]
  , CASE WHEN CAST([fsc_small] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([fsc_small] AS VARCHAR) END AS [fsc_small]
  , CASE WHEN CAST([chl_small] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([chl_small] AS VARCHAR) END AS [chl_small]
  , CASE WHEN CAST([evt] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([evt] AS VARCHAR) END AS [evt]
  , CASE WHEN CAST([opp] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([opp] AS VARCHAR) END AS [opp]
  , CASE WHEN CAST([lat] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([lat] AS VARCHAR) END AS [lat]
  , CASE WHEN CAST([long] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([long] AS VARCHAR) END AS [lon]
  , CASE WHEN CAST([time] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([time] AS VARCHAR) END AS [time]
  , CASE WHEN CAST([flowrate] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([flowrate] AS VARCHAR) END AS [flowrate]
  , CASE WHEN CAST([conc] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([conc] AS VARCHAR) END AS [conc]
  , CASE WHEN CAST([day] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([day] AS VARCHAR) END AS [day]
  , CASE WHEN CAST([file] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([file] AS VARCHAR) END AS [file]
  , CASE WHEN CAST([pop] AS VARCHAR) = 'NA' THEN NULL ELSE CAST([pop] AS VARCHAR) END AS [pop]
FROM [1059].[stats.tab]
ORDER BY [DateTime] ASC


________________________________________


SELECT * FROM [1059].[STATS_VIEW]


________________________________________


SELECT LAT, LON FROM [1059].[sds.tab]
ORDER BY [file] desc
  



________________________________________


SELECT LAT, LON FROM [1059].[sds.tab]
ORDER BY [millisecond.timer] desc
  



________________________________________


SELECT * FROM [1059].[SDS_VIEW_VARCHAR]


________________________________________


SELECT *
FROM [1059].[km1314-waypoints-decimal.csv]


________________________________________


SELECT *
FROM [1059].[km1314-waypoints-base60.csv]


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [evt] AS [Event Rate]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [evt]/1000 AS [Event Rate (K)]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [evt]/180000.0 AS [Event Rate (K/s)]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [evt]/180000.0 AS [Evt Rate (K/s)]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [evt]/180.0 AS [Events/Sec]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [evt]/180.0/1000 AS [Events (K)/Sec]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , CASE WHEN [opp] = 0
         THEN NULL
         ELSE CAST([evt]*100 AS FLOAT) /[opp] END AS [EVT/OPP]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [EVENT.RATE]/180.0/1000 AS [Events (K)/Sec]
  FROM [1059].[SDS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [event.rate]/180.0/1000 AS [Events (K)/Sec]
  FROM [1059].[SDS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [event.rate]/180.0/1000 AS [Events (K)/Sec]
  FROM [1059].[SDS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [DateTime]
       , [event.rate]/1000 AS [Events (K)/Sec]
  FROM [1059].[SDS_VIEW]
) x
ORDER BY [DateTime] DESC



________________________________________


SELECT * FROM (SELECT TOP 1000 Lat, Lon, UnixTimestamp FROM [1059].[sds_view] WHERE UnixTimestamp > 0 ORDER BY UnixTimestamp DESC) x ORDER BY UnixTimestamp ASC


________________________________________


SELECT Lat, Lon, UnixTimestamp
FROM [1059].[SDS_VIEW]
WHERE UnixTimestamp > 0
ORDER BY UnixTimestamp DESC


________________________________________


WITH num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
SELECT * FROM num_tracks



________________________________________


WITH num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0),
     gps_tracks AS (SELECT Lat, Lon, UnixTimestamp
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
SELECT * FROM num_tracks, gps_tracks



________________________________________


WITH new_sds AS (SELECT *
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
SELECT * FROM num_tracks



________________________________________


WITH new_sds AS (SELECT *
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
SELECT ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC)
FROM new_sds



________________________________________


WITH new_sds AS (SELECT *
        , ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) AS row
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
   , granularity AS (SELECT CASE WHEN num_tracks < 1000
        THEN 1
        ELSE CONVERT(INT, num_tracks/1000)
        END AS granularity
        FROM num_tracks)
SELECT *
FROM new_sds, num_tracks, granularity
WHERE row-num_tracks % granularity = 0


________________________________________


WITH new_sds AS (SELECT *
        , ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) AS row
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
   , granularity AS (SELECT CASE WHEN num_tracks < 1000
        THEN 1
        ELSE CONVERT(INT, num_tracks/1000)
        END AS granularity
        FROM num_tracks)
SELECT *
FROM new_sds, num_tracks, granularity
WHERE row-num_tracks % granularity = 0


________________________________________


WITH new_sds AS (SELECT *
        , ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) AS row
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
   , granularity AS (SELECT CASE WHEN num_tracks < 1000
        THEN 1
        ELSE CONVERT(INT, num_tracks/1000)
        END AS granularity
        FROM num_tracks)
SELECT *
FROM new_sds, num_tracks, granularity
WHERE (row-num_tracks) % granularity = 0


________________________________________


WITH new_sds AS (SELECT *
        , ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) AS row
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
   , granularity AS (SELECT CASE WHEN num_tracks < 1000
        THEN 1
        ELSE CONVERT(INT, num_tracks/1000)
        END AS granularity
        FROM num_tracks)
SELECT *
FROM new_sds, num_tracks, granularity
WHERE (row-num_tracks) % granularity = 0


________________________________________


WITH new_sds AS (SELECT *
        , ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) AS row
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
   , granularity AS (SELECT CASE WHEN num_tracks < 1000
        THEN 1
        ELSE CONVERT(INT, num_tracks/1000)
        END AS granularity
        FROM num_tracks)
  SELECT COUNT(*)
FROM new_sds, num_tracks, granularity
WHERE (row-num_tracks) % granularity = 0


________________________________________


WITH new_sds AS (SELECT *
        , ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) AS row
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
   , granularity AS (SELECT CASE WHEN num_tracks < 1000
        THEN 1
        ELSE CONVERT(INT, (num_tracks+999)/1000)
        END AS granularity
        FROM num_tracks)
SELECT COUNT(*)
FROM new_sds, num_tracks, granularity
WHERE (row-num_tracks) % granularity = 0


________________________________________


WITH new_sds AS (SELECT *
        , ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) AS row
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
   , granularity AS (SELECT CASE WHEN num_tracks < 1000
        THEN 1
        ELSE CONVERT(INT, (num_tracks+999)/1000)
        END AS granularity
        FROM num_tracks)
SELECT *
FROM new_sds, num_tracks, granularity
WHERE (row-num_tracks) % granularity = 0


________________________________________


WITH new_sds AS (SELECT *
        , ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) AS row
        FROM [1059].[SDS_VIEW]
        WHERE UnixTimestamp > 0)
   , num_tracks AS (SELECT COUNT(*) as num_tracks
        FROM new_sds)
   , granularity AS (SELECT CASE WHEN num_tracks < 1000
        THEN 1
        ELSE CONVERT(INT, (num_tracks+999)/1000)
        END AS granularity
        FROM num_tracks)
SELECT Lat, Lon, UnixTimestamp
FROM new_sds, num_tracks, granularity
WHERE (row-num_tracks) % granularity = 0


________________________________________


SELECT * FROM [1059].[sds.tab]
  WHERE HMS < 60



________________________________________


SELECT * FROM [1059].[KM1314 Snapshot of 1059.SeaFlow: population-wise concentrations]


________________________________________


SELECT * FROM [1059].[SeaFlow: population-wise concentrations]


________________________________________


SELECT * FROM [materialized_KM1314 Snapshot of 1059.SeaFlow: population-wise concentrations]


________________________________________


SELECT * FROM [1059].[1354ssssss of 1059.SeaFlow: population-wise concentrations]


________________________________________


SELECT * FROM [1059].[sagagagagagagagagar of 1059.SeaFlow: population-wise concentrations]


________________________________________


WITH new_sds AS (SELECT *, ROW_NUMBER() OVER (ORDER BY UnixTimestamp ASC) AS row FROM [1059].[SDS_VIEW])
    , num_tracks AS (SELECT COUNT(*) as num_tracks FROM new_sds)
    , granularity AS (SELECT CASE WHEN num_tracks < 1000
                             THEN 1
                             ELSE CONVERT(INT, (num_tracks+999)/1000) END AS granularity
                              FROM num_tracks)

SELECT Lat, Lon, UnixTimestamp 
FROM new_sds, num_tracks, granularity
WHERE (row-num_tracks) % granularity = 0
ORDER BY UnixTimestamp ASC



________________________________________


SELECT distinct pop FROM [1059].[stat.csv]


________________________________________


SELECT cruise, convert(datetime2, [time]) as time
FROM [1059].[stat.csv]


________________________________________


SELECT cruise, cast([time] as datetime2) as time
FROM [1059].[stat.csv]


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , abundance
     , fsc_small
     , chl_small
     , pe
FROM [1059].[stat.csv]


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , abundance
     , fsc_small
     , chl_small
     , pe
FROM [1059].[stat.csv]


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , abundance
     , fsc_small
     , chl_small
     , pe
FROM [1059].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT [time], [pop], [n_count]
FROM [1059].[STATS_VIEW]


________________________________________


WITH pop AS (SELECT [time], [pop], [n_count]
  FROM [1059].[STATS_VIEW])
SELECT 1 FROM pop


________________________________________


WITH pops
  AS (SELECT [time], [pop], [n_count]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pops
PIVOT (
  SUM([n_count])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [unknown])
) as pivot_table
ORDER BY [time] DESC


________________________________________


WITH pop
  AS (SELECT [time], [pop], [n_count]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([n_count])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [unknown])
) as pivot_table
ORDER BY [time] DESC


________________________________________


WITH pop
  AS (SELECT [time], [pop], [n_count]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([n_count])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [unknown])
) as pivot_table
ORDER BY [time] DESC


________________________________________


WITH pop
  AS (SELECT [time], [pop], [n_count]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([n_count])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [unknown])
) as pivot_table



________________________________________


select cast(0 as datetime)


________________________________________


select cast(1404486169 as timestamp)


________________________________________


WITH pop
  AS (SELECT [time], [pop], [abundance]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [unknown])
) as pivot_table



________________________________________


WITH Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM [1059].[STATS_VIEW])
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) AS [Velocity (m/s)]
FROM Distance


________________________________________


WITH UniquePos AS
      (SELECT DISTINCT [time], [LAT], [LON] FROM [1059].[STATS_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) AS [Velocity (m/s)]
FROM Distance


________________________________________


WITH UniquePos AS
      (SELECT DISTINCT [time], [LAT], [LON] FROM [1059].[STATS_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) / 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


WITH UniquePos AS
      (SELECT DISTINCT [time], [LAT], [LON] FROM [1059].[STATS_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) * 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


WITH pop
  AS (SELECT [time], [pop], [abundance]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [pennates], [unknown])
) as pivot_table



________________________________________


WITH pop
  AS (SELECT [time], [pop], [abundance]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [pennates], [unknown])
) as pivot_table
ORDER BY [time] DESC



________________________________________


WITH pop
  AS (SELECT [time], [pop], [abundance]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [pennates], [unknown])
) as pivot_table


________________________________________


WITH pop
  AS (SELECT [time], [pop], [fsc_small]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([fsc_small])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [pennates], [unknown])
) as pivot_table


________________________________________


WITH pop
  AS (SELECT [time], [pop], [fsc_small]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([fsc_small])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [pennates], [unknown])
) as pivot_table


________________________________________


WITH pop
  AS (SELECT [time], [pop], log([fsc_small], 10) as [fsc_small]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([fsc_small])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [pennates], [unknown])
) as pivot_table


________________________________________


WITH pop
  AS (SELECT [time], [pop], log([fsc_small], 10) as [fsc_small]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([fsc_small])
  FOR [pop] in ([beads], [picoeuk], [prochloro], [synecho], [pennates], [unknown])
) as pivot_table


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[SFL_VIEW]


________________________________________


SELECT [time], salinity, ocean_tmp
FROM [1059].[SFL_VIEW]


________________________________________


SELECT [time], salinity, ocean_tmp
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC


________________________________________


SELECT [time], bulk_red
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC


________________________________________


WITH UniquePos AS
      (SELECT DISTINCT [time], [LAT], [LON] FROM [1059].[SFL_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) * 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


WITH UniquePos AS
      (SELECT [time], [LAT], [LON] FROM [1059].[SFL_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) * 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


SELECT top 10 * FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] DESC


________________________________________


SELECT top 10 * FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] DESC


________________________________________


SELECT top 10 * FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] DESC


________________________________________


SELECT top 500 * FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] DESC


________________________________________


SELECT * FROM (SELECT top 500 * FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] DESC) x ORDER BY [DateTime] ASC


________________________________________


SELECT * FROM (SELECT top 500 * FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] DESC) x ORDER BY [DateTime] ASC


________________________________________


SELECT * FROM (SELECT top 500 * FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] DESC) x ORDER BY [DateTime] ASC


________________________________________


SELECT * FROM (SELECT top 500 * FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] DESC) x ORDER BY [DateTime] ASC


________________________________________


SELECT * FROM (SELECT top 500 * FROM [1059].[SeaFlow: velocity]
  ORDER BY [DateTime] DESC) x ORDER BY [DateTime] ASC


________________________________________


SELECT DATEDIFF(minute, MAX([Time]), GETDATE()) AS Lag FROM [1059].[stats_view]


________________________________________


SELECT MAX([Time]) FROM [1059].[stats_view]


________________________________________


WITH pop
  AS (SELECT [time], [pop], [abundance]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([prochloro], [synecho], [picoeuk], [beads])
) as pivot_table


________________________________________


WITH pop
  AS (SELECT [time], [pop], log([fsc_small], 10) as [fsc_small]
      FROM [1059].[STATS_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([fsc_small])
  FOR [pop] in ([prochloro], [synecho],[picoeuk], [beads])
) as pivot_table


________________________________________


SELECT * FROM [1059].[SeaFlow: bulk_red vs time]


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[SeaFlow: bulk_red vs time]


________________________________________


SELECT [time], bulk_red
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC


________________________________________


SELECT [time], par
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC


________________________________________


SELECT [time], par
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC


________________________________________


SELECT [time], par
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC


________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         [time]
       , [event_rate]/1000 AS [Events (K)/Sec]
  FROM [1059].[SFL_VIEW]
) x
ORDER BY [time] DESC



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         cast([time] as datetime2) as time,
         [opp_evt_ratio]
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [time] DESC



________________________________________


SELECT TOP 500 [time], [stream_pressure]
FROM [1059].[SFL_VIEW]
ORDER BY [time] DESC  



________________________________________


SELECT TOP 500 * FROM (
  SELECT DISTINCT
         cast([time] as datetime2) as time,
         [opp_evt_ratio] * 100 AS opp_evt_ratio
  FROM [1059].[STATS_VIEW]
) x
ORDER BY [time] DESC



________________________________________


SELECT TOP 500 [time], par
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC


________________________________________


SELECT TOP 500 [time], par
FROM [1059].[SFL_VIEW]
ORDER BY [time] DESC


________________________________________


SELECT TOP 500 [time], ocean_tmp
FROM [1059].[SFL_VIEW]
ORDER BY [time] DESC


________________________________________


SELECT TOP 500 [time], salinity
FROM [1059].[SFL_VIEW]
ORDER BY [time] DESC


________________________________________


SELECT [time], bulk_red
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC


________________________________________


SELECT TOP 500 [time], bulk_red
FROM [1059].[SFL_VIEW]
ORDER BY [time] DESC


________________________________________


SELECT TOP 500 * FROM (
  SELECT [time]
       , [fsc_small] as [beads FSC]
  FROM [1059].[STATS_VIEW]
  WHERE [pop] = 'beads'
) x
ORDER BY [time] DESC


________________________________________


SELECT [time], ocean_tmp
FROM [1059].[SFL_VIEW]
ORDER BY [time] DESC


________________________________________


SELECT [time], ocean_tmp
FROM [1059].[SFL_VIEW]
ORDER BY [time] DESC


________________________________________


SELECT [time], ocean_tmp
FROM [1059].[SFL_VIEW]
ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[SFL_VIEW]


________________________________________


SELECT * FROM [1059].[SFL_VIEW]


________________________________________


SELECT TOP 500 [time], salinity, ocean_tmp, par
  FROM [1059].[SFL_VIEW]
  ORDER BY [time] DESC


________________________________________


SELECT [time], salinity, ocean_tmp, par
  FROM [1059].[SFL_VIEW]
  ORDER BY [time] DESC


________________________________________


SELECT *
  FROM [1059].[SFL_VIEW] as a, [1059].[SeaFlow: population-wise concentrations] as b
  WHERE a.[time] = b.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT TOP 500 *
  FROM [1059].[SFL_VIEW] as a, [1059].[SeaFlow: population-wise concentrations] as b
  WHERE a.[time] = b.[time]
  ORDER BY a.[time] ASC


________________________________________


SELECT *
  FROM [1059].[SFL_VIEW] as a, [1059].[SeaFlow: population-wise concentrations] as b
  WHERE a.[time] = b.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT TOP 500 [time], ocean_tmp FROM [1059].[seaflow all query]


________________________________________


SELECT [time], ocean_tmp FROM [1059].[seaflow all query]


________________________________________


SELECT [time], ocean_tmp FROM [1059].[seaflow all query] ORDER BY [time] ASC



________________________________________


SELECT [time], ocean_tmp FROM [1059].[seaflow all query] ORDER BY [time] DESC



________________________________________


SELECT [time], ocean_tmp FROM [1059].[seaflow all query]



________________________________________


SELECT [time], ocean_tmp FROM [1059].[seaflow all query] ORDER BY [time] DESC



________________________________________


SELECT a.[time], salinity, ocean_tmp, par, prochloro, synecho, picoeuk, beads
  FROM [1059].[SFL_VIEW] as a, [1059].[SeaFlow: population-wise concentrations] as b
  WHERE a.[time] = b.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT a.[time], salinity, ocean_tmp, par, b.prochloro, b.synecho, b.picoeuk, b.beads, c.prochloro, c.synecho, c.picoeuk, c.beads
  FROM [1059].[SFL_VIEW] as a, [1059].[SeaFlow: population-wise concentrations] as b, [1059].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT a.[time], salinity, ocean_tmp, par, b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc, c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM [1059].[SFL_VIEW] as a, [1059].[SeaFlow: population-wise concentrations] as b, [1059].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, 
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM [1059].[SFL_VIEW] as a, [1059].[SeaFlow: population-wise concentrations] as b, [1059].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, 
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] DESC


________________________________________


SELECT * FROM [1059].[seaflow all query] ORDER BY [time] ASC


________________________________________


SELECT [time], abundance as conc, fsc_small as size FROM [1059].[table_stat.csv]


________________________________________


SELECT [time], abundance as conc, fsc_small as size FROM [1059].[table_stat.csv]


________________________________________


SELECT [time], abundance as conc, fsc_small as size FROM [1059].[table_stat.csv] ORDER BY [time] ASC


________________________________________


SELECT [time], pop, abundance as conc, fsc_small as size FROM [1059].[table_stat.csv] ORDER BY [time] ASC


________________________________________


SELECT par FROM [1059].[seaflow all query] WHERE par < 0


________________________________________


SELECT [time], [pop], [abundance], [fsc_small]
FROM [1059].[STATS_VIEW]
ORDER BY [time] ASC   


________________________________________


SELECT [time], [pop], [abundance], [fsc_small]
FROM [1059].[STATS_VIEW]
  WHERE pop IN ('prochloro', 'synecho', 'picoeuk', 'beads')
ORDER BY [time] ASC


________________________________________


SELECT [time], [pop], [abundance] as con, [fsc_small] as size
FROM [1059].[STATS_VIEW]
  WHERE pop IN ('prochloro', 'synecho', 'picoeuk', 'beads')
ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[Seaflow: populations stats]


________________________________________


SELECT *, (prochloro_conc + synecho_conc + picoeuk_conc + beads_conc) as total_conc FROM [1059].[seaflow all query]


________________________________________


SELECT * from [1059].[seaflow all query]


________________________________________


SELECT *, (prochloro_conc + synecho_conc + picoeuk_conc + beads_conc) as total_conc from [1059].[seaflow all query]
  WHERE prochloro_conc IS NULL


________________________________________


SELECT *, (prochloro_conc + synecho_conc + picoeuk_conc + beads_conc) as total_conc from [1059].[seaflow all query]
  


________________________________________


SELECT *, (prochloro_conc + synecho_conc + picoeuk_conc + beads_conc) as total_conc from [1059].[seaflow all query]
  WHERE prochloro_size IS NULL
  


________________________________________


SELECT *, (prochloro_conc + synecho_conc + picoeuk_conc + beads_conc) as total_conc from [1059].[seaflow all query]
  ORDER BY prochloro_size ASC
  


________________________________________


SELECT *, (prochloro_conc + synecho_conc + picoeuk_conc + beads_conc) as total_conc from [1059].[seaflow all query]
  ORDER BY beads_size ASC
  


________________________________________


SELECT *, (IsNull(prochloro_conc, 0) + IsNull(synecho_conc, 0) + IsNull(picoeuk_conc, 0) + IsNull(beads_conc, 0)) as total_conc from [1059].[seaflow all query]
  ORDER BY beads_size ASC
  


________________________________________


select * from [1059].[seaflow all query]



________________________________________


select [time], [ocean_tmp] from [1059].[seaflow all query]



________________________________________


select [time], [ocean_tmp] from [1059].[seaflow all query] ORDER BY [time] ASC



________________________________________


select [time], [ocean_tmp] from [1059].[seaflow all query] ORDER BY [time] DESC



________________________________________


select [time], DAY([time]), [ocean_tmp] from [1059].[seaflow all query] ORDER BY [time] DESC



________________________________________


select [time], [ocean_tmp] from [1059].[seaflow all query]



________________________________________


select [time], [ocean_tmp] from [1059].[seaflow all query] WHERE [time] <= '12/9/2014 12:15:03 AM'



________________________________________


select [time], [ocean_tmp] from [1059].[seaflow all query] WHERE [time] <= '12/9/2014 12:15:03'



________________________________________


select [time], [ocean_tmp] from [1059].[seaflow all query] WHERE [time] <= '12/9/2014 12:15:03 AM'



________________________________________


select [time], [ocean_tmp] from [1059].[seaflow all query] WHERE [time] <= '12/9/2014 00:15:03'



________________________________________


select [time], [ocean_tmp] from [1059].[seaflow all query] ORDER BY [time] DESC



________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)],
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, IIF(par < 0, 0, par), [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size,
  (IsNull(b.prochloro, 0) + IsNull(b.synecho, 0) + IsNull(b.picoeuk, 0) + IsNull(b.beads, 0)) as total_conc
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, IIF(par < 0, 0, par) as par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size,
  (IsNull(b.prochloro, 0) + IsNull(b.synecho, 0) + IsNull(b.picoeuk, 0) + IsNull(b.beads, 0)) as total_conc
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, IIF(par < 0, 0, par) as par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size,
  (IsNull(b.prochloro, 0) + IsNull(b.synecho, 0) + IsNull(b.picoeuk, 0) + IsNull(b.beads, 0)) as total_conc
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  AND
  a.[time] > '12/09/2014 6:30:13 AM'
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, IIF(par < 0, 0, par) as par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size,
  (IsNull(b.prochloro, 0) + IsNull(b.synecho, 0) + IsNull(b.picoeuk, 0) + IsNull(b.beads, 0)) as total_conc
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  AND
  a.[time] > '12/09/2014 6:30:13 AM'
  ORDER BY a.[time] ASC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size,
  (IsNull(b.prochloro, 0) + IsNull(b.synecho, 0) + IsNull(b.picoeuk, 0) + IsNull(b.beads, 0)) as total_conc
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  AND
  a.[time] > '12/09/2014 6:30:13 AM'
  ORDER BY a.[time] ASC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size,
  (IsNull(b.prochloro, 0) + IsNull(b.synecho, 0) + IsNull(b.picoeuk, 0) + IsNull(b.beads, 0)) as total_conc
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  AND
  a.[time] > '12/10/2014 18:00:13 PM'
  ORDER BY a.[time] ASC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size,
  (IsNull(b.prochloro, 0) + IsNull(b.synecho, 0) + IsNull(b.picoeuk, 0) + IsNull(b.beads, 0)) as total_conc
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  AND
  a.[time] > '12/10/2014 17:30:13 PM'
  ORDER BY a.[time] ASC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size,
  (IsNull(b.prochloro, 0) + IsNull(b.synecho, 0) + IsNull(b.picoeuk, 0) + IsNull(b.beads, 0)) as total_conc
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] ASC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, IIF(par < 0, 0, par) as par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, IIF(par < 0, 0, par) as par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size,
  (IsNull(b.prochloro, 0) + IsNull(b.synecho, 0) + IsNull(b.picoeuk, 0) + IsNull(b.beads, 0)) as total_conc
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, IIF(par < 0, 0, par) as par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, IIF(par < 0, 0, par) as par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([date] as datetime2) as time
     , lat
     , lon
     , CASE WHEN conductivity='NA'
       THEN NULL
       ELSE conductivity END AS conductivity
     , salinity
     , ocean_tmp
     , par
     , bulk_red
     , stream_pressure
     , flow_rate
     , CASE WHEN event_rate='NA'
       THEN NULL
       ELSE event_rate END AS event_rate
FROM [1059].[sfl.csv]
ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[SeaFlow All Data] ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[SeaFlow All Data] ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[SFL_VIEW] ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[STATS_VIEW] ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[SeaFlow All Data] ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[SFL_VIEW] ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[SFL_VIEW] ORDER BY [time] DESC


________________________________________


WITH UniquePos AS
      (SELECT [time], [LAT], [LON] FROM [1059].[SFL_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime0]
            , b.[DateTime] AS [DateTime1]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) * 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


WITH UniquePos AS
      (SELECT [time], [LAT], [LON] FROM [1059].[SFL_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) * 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


WITH UniquePos AS
      (SELECT [time], [LAT], [LON] FROM [1059].[SFL_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT a.[DateTime] AS [DateTime0]
            , b.[DateTime] AS [DateTime1]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) * 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


WITH UniquePos AS
      (SELECT [time], [LAT], [LON] FROM [1059].[SFL_VIEW]),
     Numbered AS
      (SELECT [time] as [DateTime], [LAT], [LON], ROW_NUMBER() OVER (ORDER BY [Time] ASC) AS [Row]
       FROM UniquePos)
   , Paired AS
      (SELECT b.[DateTime] AS [DateTime]
            , a.[DateTime] AS [DateTime0]
            , b.[DateTime] AS [DateTime1]
            , DATEDIFF(second, a.[DateTime], b.[DateTime]) AS [Elapsed (s)]
            , a.[LAT] AS [lat1deg]
            , a.[LON] AS [lon1deg]
            , b.[LAT] AS [lat2deg]
            , b.[LON] AS [lon2deg]
            , a.[LAT] * PI() / 180 AS [lat1]
            , b.[LAT] * PI() / 180  AS [lat2]
            , (a.[LAT] - b.[LAT]) * PI() / 180 AS [dlat]
            , (a.[LON] - b.[LON]) * PI() / 180 AS [dlon]
       FROM Numbered a
       JOIN Numbered b
         ON a.[Row]+1 = b.[Row])
  , Trig AS
     (SELECT *
        , POWER(SIN(dlat/2),2)
          + POWER(SIN(dlon/2),2) * COS(lat1) * COS(lat2)
          AS val FROM Paired)
  , Distance AS
      (SELECT *
        , 6378100 * 2 * atn2(sqrt(val), sqrt(1-val)) AS [Distance (m)] FROM Trig)
SELECT *
  , [Distance (m)] / NULLIF([Elapsed (s)],0) * 1.94384 AS [Velocity (knots)]
FROM Distance


________________________________________


select * from [1059].[SeaFlow All Data] ORDER BY [time] DESC


________________________________________


select * from [1059].[SeaFlow All Data] ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[cstar.csv]


________________________________________


SELECT SUBSTRING(V2, 1, 24) as [time], V7 as attenuation FROM [1059].[cstar.csv]


________________________________________


SELECT SUBSTRING(V2, 1, 23) as [time], V7 as attenuation FROM [1059].[cstar.csv]


________________________________________


SELECT CAST(SUBSTRING(V2, 1, 23) as datetime) as [time], V7 as attenuation FROM [1059].[cstar.csv]


________________________________________


SELECT CAST(SUBSTRING(V2, 1, 23) as datetime) as [time], V2, V7 as attenuation FROM [1059].[cstar.csv]


________________________________________


SELECT CAST(SUBSTRING(V2, 1, 23) as datetime) as [time], V7 as attenuation FROM [1059].[cstar.csv] ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[CSTAR_VIEW]


________________________________________


SELECT DATEPART(YEAR, [time]), [time], attenuation FROM [1059].[CSTAR_VIEW]




________________________________________


SELECT [time], AVG(attenuation) FROM [1059].[CSTAR_VIEW]
  GROUP BY [time], DATEPART(YEAR, [time])




________________________________________


SELECT [time], AVG(attenuation) FROM [1059].[CSTAR_VIEW]
  GROUP BY [time], DATEPART(YEAR, [time]) ORDER BY [time] ASC




________________________________________


SELECT MIN([time]), AVG(attenuation) FROM [1059].[CSTAR_VIEW]
  GROUP BY DATEPART(YEAR, [time]) 




________________________________________


SELECT MIN([time]), AVG(attenuation) FROM [1059].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(MINUTE, [time])
  




________________________________________


SELECT MIN([time]), AVG(attenuation) FROM [1059].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(MINUTE, [time])
  ORDER BY MIN([time])




________________________________________


SELECT MIN([time]), AVG(attenuation) FROM [1059].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  DATEPART(MINUTE, [time])
  ORDER BY MIN([time])


________________________________________


SELECT MIN([time]), AVG(attenuation) FROM [1059].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
  ORDER BY MIN([time])


________________________________________


SELECT MIN([time]) AS [time], AVG(attenuation) AS attenuation FROM [1059].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
  ORDER BY MIN([time])


________________________________________


SELECT 
  a.[time], salinity, ocean_tmp, par, [Velocity (knots)] as velocity,
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM 
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c,
  [1059].[SeaFlow: velocity] as d
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  AND
  a.[time] = d.[DateTime]
  ORDER BY a.[time] DESC


________________________________________


SELECT CAST(SUBSTRING(V2, 1, 23) as datetime) as [time], V7 as attenuation FROM [1059].[cstar.csv] ORDER BY [time] ASC


________________________________________


select * from [CSTAR_VIEW]


________________________________________


select * from [CSTAR_VIEW] ORDER BY [time] DESC


________________________________________


select * from [CSTAR_VIEW] ORDER BY [time] ASC


________________________________________


SELECT MIN([time]) AS [time], AVG(attenuation) AS attenuation FROM [1059].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
  ORDER BY MIN([time])


________________________________________


SELECT * FROM [1059].[SeaFlow: 3 minute attenuation] WHERE [time] > '2015-03-22 16:57:00 PM' ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[SeaFlow: 3 minute attenuation] WHERE [time] > '2015-03-22 16:57:00' ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[SeaFlow: 3 minute attenuation] WHERE [time] > '2015-03-22 16:56:00' ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[SeaFlow: 3 minute attenuation] WHERE [time] > '2015-03-22 16:58:00' ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[SeaFlow: 3 minute attenuation] WHERE [time] > '2015-03-22 16:57:01' ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[SeaFlow: 3 minute attenuation] WHERE [time] > '2015-03-22T16:57:00.000Z' ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[SeaFlow: 3 minute attenuation] WHERE [time] > '2015-03-22T16:57:01.000Z' ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[SeaFlow: 3 minute attenuation] ORDER BY [time] DESC


________________________________________


SELECT
  MIN([time]) AS [time],
  AVG(attenuation) AS attenuation,
  "type" =
  CASE
  WHEN MAX(attenuation) < .019 THEN 'filtered'
  WHEN MAX(attenuation) >= .019 AND MIN(attenuation) < .019 THEN 'mixed'
  ELSE 'whole'
  END
FROM
  [1059].[CSTAR_VIEW]
GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
ORDER BY
  MIN([time])



________________________________________


SELECT
  MIN([time]) AS [time],
  AVG(attenuation) AS attenuation,
  "type" =
  CASE
  WHEN MAX(attenuation) < .019 THEN 'filtered'
  WHEN MAX(attenuation) >= .019 AND MIN(attenuation) < .019 THEN 'mixed'
  ELSE 'whole'
  END
FROM
  [1059].[CSTAR_VIEW]
GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
ORDER BY
  MIN([time]) DESC



________________________________________


SELECT
  MIN([time]) AS [time],
  AVG(attenuation) AS attenuation,
  COUNT(CASE WHEN attenuation < 0.19 THEN 1 END) as filteredCount,
  COUNT(CASE WHEN attenuation >= 0.19 THEN 1 END) as wholeCount
FROM
  [1059].[CSTAR_VIEW]
GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
ORDER BY
  MIN([time]) DESC



________________________________________


SELECT
  MIN([time]) AS [time],
  AVG(attenuation) AS attenuation,
  COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) as filteredCount,
  COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) as wholeCount
FROM
  [1059].[CSTAR_VIEW]
GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
ORDER BY
  MIN([time]) DESC



________________________________________


SELECT
  MIN([time]) AS [time],
  AVG(attenuation) AS attenuation,
  COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) as filteredCount,
  COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) as wholeCount
FROM
  [1059].[CSTAR_VIEW]
WHERE
  [time] < '2015-03-22 00:00:00 AM'
GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
ORDER BY
  MIN([time]) DESC



________________________________________


SELECT
  MIN([time]) AS [time],
  AVG(attenuation) AS attenuation,
  COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) as filteredCount,
  COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) as wholeCount
FROM
  [1059].[CSTAR_VIEW]
WHERE
  [time] < '2015-03-22 00:00:00 AM'
GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
ORDER BY
  MIN([time]) DESC


________________________________________


SELECT
  MIN([time]) AS [time],
  AVG(attenuation) AS attenuation,
  COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) as filteredCount,
  COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) as wholeCount
FROM
  [1059].[CSTAR_VIEW]
WHERE
  [time] >= '2015-03-22 00:00:00 AM'
GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
ORDER BY
  MIN([time]) DESC


________________________________________


SELECT
  MIN([time]) AS [time],
  AVG(attenuation) AS attenuation,
  COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) as filteredCount,
  COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) as wholeCount
FROM
  [1059].[CSTAR_VIEW]
WHERE
  [time] >= '2015-03-22 00:00:00 AM'
GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
ORDER BY
  MIN([time]) ASC


________________________________________


SELECT
  MIN([time]) AS [time],
  AVG(attenuation) AS attenuation,
  COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) as filteredCount,
  COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) as wholeCount
FROM
  [1059].[CSTAR_VIEW]
WHERE
  [time] >= '2015-03-22 03:00:00 AM'
GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
ORDER BY
  MIN([time]) ASC


________________________________________


SELECT * FROM
  (
    SELECT * FROM
    [1059].[CSTAR_VIEW]
  ) AS subbie




________________________________________


SELECT [time], attenuation
FROM
  (
    SELECT * FROM
    [1059].[CSTAR_VIEW]
  ) AS subbie




________________________________________


SELECT [time], attenuation
FROM
  (
    SELECT [time], attenuation
    FROM
    [1059].[CSTAR_VIEW]
  ) AS subbie




________________________________________


SELECT [time], attenuation
FROM
  (
    SELECT
    MIN([time]) AS TIME,
    AVG(attenuation) AS attenuation
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s




________________________________________


SELECT [time], attenuation
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s




________________________________________


SELECT [time], attenuation
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) AS wholeCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s




________________________________________


SELECT [time], attenuation, filteredCount, wholeCount, [count]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) AS wholeCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s




________________________________________


SELECT [time], attenuation, filteredCount, wholeCount, [count]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) AS wholeCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    WHERE
    [time] >= '2015-03-22 03:00:00 AM'
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s




________________________________________


SELECT [time], attenuation, filteredCount, wholeCount, [count]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) AS wholeCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    WHERE
    [time] >= '2015-03-22 03:00:00 AM'
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
  ORDER BY [time] ASC




________________________________________


SELECT
  [time], attenuation, filteredCount, wholeCount, [count],
  (CASE WHEN [count] = 0 THEN 0 ELSE CAST(filteredCount AS float)/CAST([count] AS float) END) AS fracFiltered
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) AS wholeCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    WHERE
    [time] >= '2015-03-22 03:00:00 AM'
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
  ORDER BY [time] ASC




________________________________________


SELECT
  [time], attenuation, filteredCount, wholeCount, [count],
  (CASE WHEN [count] = 0 THEN 0 ELSE CAST(filteredCount AS float)/CAST([count] AS float) END) AS fracFiltered
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) AS wholeCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
  ORDER BY [time] ASC




________________________________________


SELECT
  [time], attenuation, filteredCount, wholeCount, [count],
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .9 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) AS wholeCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
  ORDER BY [time] ASC




________________________________________


SELECT
  [time], attenuation, filteredCount, wholeCount, [count],
  (CAST(filteredCount AS float)/CAST([count] AS float)) AS filteredFraction,
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .9 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) AS wholeCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
  ORDER BY [time] ASC




________________________________________


SELECT
  [time], attenuation, filteredCount, wholeCount, [count],
  (CAST(filteredCount AS float)/CAST([count] AS float)) AS filteredFraction,
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .9 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(CASE WHEN attenuation >= 0.019 THEN 1 END) AS wholeCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
ORDER BY [time] ASC




________________________________________


SELECT * FROM [1059].[SeaFlow: 3 minute attenuation typed] WHERE [type] != 'mixed'
  



________________________________________


select * from [SeaFlow: 3 minute attenuation typed] ORDER BY [time] DESC



________________________________________


SELECT
  [time], attenuation, filteredCount, [count],
  (CAST(filteredCount AS float)/CAST([count] AS float)) AS filteredFraction,
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .9 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
ORDER BY [time] ASC




________________________________________


SELECT [time], attenuation, [type] FROM [1059].[SeaFlow: 3 minute attenuation typed] WHERE [time] > '2015-03-24T20:57:01.000Z' AND [type] != 'mixed' ORDER BY [time] ASC



________________________________________


SELECT [time], attenuation, [type] FROM [1059].[SeaFlow: 3 minute attenuation typed] WHERE [time] > '2015-03-24T19:57:01.000Z' AND [type] != 'mixed' ORDER BY [time] ASC



________________________________________


SELECT * FROM [SeaFlow: 3 minute attenuation] WHERE [time] > '2015-03-23' ORDER BY [time] ASC



________________________________________


SELECT * FROM [SeaFlow: 3 minute attenuation typed] WHERE [time] > '2015-03-23' ORDER BY [time] ASC



________________________________________


SELECT
  [time], attenuation, filteredCount, [count],
  (CAST(filteredCount AS float)/CAST([count] AS float)) AS filteredFraction,
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .85 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
ORDER BY [time] ASC




________________________________________


select * from [SeaFlow: 3 minute attenuation typed] ORDER BY [time] ASC



________________________________________


select * from [SeaFlow: 3 minute attenuation typed] ORDER BY [time] DESC



________________________________________


SELECT [time], attenuation, [type] FROM [1059].[SeaFlow: 3 minute attenuation typed] WHERE [time] > '2015-03-24T20:57:01.000Z' AND [type] != 'mixed' ORDER BY [time] ASC



________________________________________


SELECT [time], attenuation, [type] FROM [1059].[SeaFlow: 3 minute attenuation typed] WHERE [type] != 'mixed' ORDER BY [time] DESC



________________________________________


SELECT [time], attenuation, [type] FROM [1059].[SeaFlow: 3 minute attenuation typed] WHERE [time] > '2015-03-24T20:57:01.000Z' AND [type] != 'mixed' ORDER BY [time] DESC



________________________________________


SELECT
  [time], attenuation, filteredCount, [count],
  (CAST(filteredCount AS float)/CAST([count] AS float)) AS filteredFraction,
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN filteredCount = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .85 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
ORDER BY [time] ASC




________________________________________


SELECT
  [time], attenuation, filteredCount, [count],
  (CAST(filteredCount AS float)/CAST([count] AS float)) AS filteredFraction,
  (CASE
    WHEN [count] = 0 THEN NULL
    WHEN filteredCount = 0 THEN 'whole'
    WHEN (CAST(filteredCount AS float)/CAST([count] AS float)) >= .85 THEN 'filtered'
    ELSE 'mixed'
    END) AS [type]
FROM
  (
    SELECT
    MIN([time]) AS [time],
    AVG(attenuation) AS attenuation,
    COUNT(CASE WHEN attenuation < 0.019 THEN 1 END) AS filteredCount,
    COUNT(*) AS [count]
    FROM
    [1059].[CSTAR_VIEW]
    GROUP BY
    DATEPART(YEAR, [time]),
    DATEPART(MONTH, [time]),
    DATEPART(DAY, [time]),
    DATEPART(HOUR, [time]),
    (DATEPART(MINUTE, [time]) / 3)
  ) AS s
ORDER BY [time] ASC




________________________________________


SELECT MIN([time]) AS [time], AVG(attenuation) AS attenuation FROM [1059].[CSTAR_VIEW]
  GROUP BY
  DATEPART(YEAR, [time]),
  DATEPART(MONTH, [time]),
  DATEPART(DAY, [time]),
  DATEPART(HOUR, [time]),
  (DATEPART(MINUTE, [time]) / 3)
  ORDER BY MIN([time])


________________________________________


SELECT * FROM [1059].[table_sfl.csv]


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , abundance
     , fsc_small
     , chl_small
     , pe
FROM [1059].[stat.csv]
ORDER BY [time] DESC


________________________________________


select DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '[1059].[STATS_VIEW]' and column_name = 'abundance';


________________________________________


select DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '[1059].[STATS_VIEW]' and COLUMN_NAME = 'abundance';


________________________________________


select DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '[1059].[STATS_VIEW]';


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , abundance
     , fsc_small
     , chl_small
     , pe
FROM [1059].[stat-gga2dd.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , abundance
     , fsc_small
     , chl_small
     , pe
FROM [1059].[stat-gga2dd.csv]
ORDER BY [time] ASC


________________________________________


WITH pop
  AS (SELECT [time], [pop], [abundance]
      FROM [1059].[STATS-GGA2DD_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([prochloro], [synecho], [picoeuk], [beads])
) as pivot_table


________________________________________


WITH pop
  AS (SELECT [time], [pop], CAST([abundance] AS real) AS [abundance]
      FROM [1059].[STATS-GGA2DD_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([prochloro], [synecho], [picoeuk], [beads])
) as pivot_table


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT)
     , fsc_small
     , chl_small
     , pe
FROM [1059].[stat-gga2dd.csv]
ORDER BY [time] DESC


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT) as abundance
     , fsc_small
     , chl_small
     , pe
FROM [1059].[stat-gga2dd.csv]
ORDER BY [time] DESC


________________________________________


WITH pop
  AS (SELECT [time], [pop], [abundance]
      FROM [1059].[STATS-GGA2DD_VIEW])
SELECT *
FROM pop
PIVOT (
  SUM([abundance])
  FOR [pop] in ([prochloro], [synecho], [picoeuk], [beads])
) as pivot_table


________________________________________


SELECT cruise
     , [file]
     , cast([time] as datetime2) as time
     , lat
     , lon
     , opp_evt_ratio
     , flow_rate
     , file_duration
     , pop
     , n_count
     , CAST(CASE WHEN isnumeric(abundance) = 0 THEN NULL ELSE abundance END as FLOAT) as abundance
     , fsc_small
     , chl_small
     , pe
FROM [1059].[stat.csv]
ORDER BY [time] DESC


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
  WHERE lon < 0


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
  WHERE lon > 0


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]



________________________________________


SELECT * FROM [1059].[table_stat.csv2570E]
  WHERE lon > 0


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon = -158.2725


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon > 0


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon > 0


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon < -159


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon < -159


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon > -158


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon > -157.5


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon < -30


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon > -30


________________________________________


SELECT * FROM [1059].[table_sfl.csv7A9FF]
WHERE lon > -155


________________________________________


SELECT * FROM [1059].[table_sfl.csvEC0E4]
  WHERE lon < -30



________________________________________


SELECT CAST([time] as datetime) as [time], attenuation
  FROM [1059].[cstar3min.csv]
  ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[CSTAR_VIEW]


________________________________________


SELECT * FROM [1059].[CSTAR_VIEW] ORDER BY [time] ASC



________________________________________


SELECT CAST([time] as datetime) as [time], attenuation
  FROM [1059].[cstar3min.csv]
  WHERE attenuation < 1.0
  ORDER BY [time] ASC



________________________________________


select * from [1059].[cstar.csv]



________________________________________


select * from [1059].[cstar.csv] order by [V2] desc



________________________________________


SELECT [time], lat, lon, salinity, ocean_tmp, par
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC



________________________________________


SELECT
  a.[time],
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] ASC 


________________________________________


SELECT
  CONVERT(VARCHAR, a.[time], 126) as [time],
  b.prochloro as prochloro_conc, b.synecho as synecho_conc, b.picoeuk as picoeuk_conc, b.beads as beads_conc,
  c.prochloro as prochloro_size, c.synecho as synecho_size, c.picoeuk as picoeuk_size, c.beads as beads_size
  FROM
  [1059].[SFL_VIEW] as a,
  [1059].[SeaFlow: population-wise concentrations] as b,
  [1059].[SeaFlow: population-wise size (fsc_small)] as c
  WHERE 
  a.[time] = b.[time]
  AND
  a.[time] = c.[time]
  ORDER BY a.[time] ASC 


________________________________________


SELECT CONVERT(VARCHAR, [time], 126) as [time], lat, lon, salinity, ocean_tmp, par
FROM [1059].[SFL_VIEW]
ORDER BY [time] ASC



________________________________________


SELECT CONVERT(VARCHAR, [time], 126) as [time], fsc_small, abundance, pop
  FROM [1059].[STATS_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT CONVERT(VARCHAR, [time], 126) as [time], attenuation FROM [1059].[CSTAR3MIN_VIEW] ORDER BY [time] ASC


________________________________________


SELECT CONVERT(VARCHAR, [time], 126) as [time], fsc_small, abundance, pop
  FROM [1059].[STATS_VIEW]
  ORDER BY [time] ASC


________________________________________


SELECT * FROM [1059].[table_stat.csv7C14F]


________________________________________


SELECT * FROM [1041].[table_sqlshare1358.txt]


________________________________________


SELECT * FROM [1002].[Tokyo_2_merged_data_time_binned]
  



________________________________________


SELECT * FROM [1002].[Tokyo_2_merged_data_time_binned]


________________________________________


SELECT * FROM [1041].[table_13542_square.csv] UNION ALL SELECT * FROM [1041].[table_13542_square.csv]



________________________________________


SELECT * FROM [1041].[sqlshare1358.txt]


________________________________________


SELECT *
FROM   g1211
UNION ALL
SELECT *
FROM   g1212


________________________________________


SELECT *
FROM   g221
UNION ALL
SELECT *
FROM   g222
UNION ALL
SELECT * 
FROM g223


________________________________________


SELECT *
FROM   g22
UNION ALL
SELECT *
FROM   g21


________________________________________


SELECT *
FROM   g12
UNION ALL
SELECT *
FROM   g11


________________________________________


SELECT *
FROM   g1
UNION ALL
SELECT *
FROM   g2
UNION ALL
SELECT *
FROM   g3



________________________________________


SELECT * FROM [1314howe].[reuters_terms.csv]


________________________________________


SELECT * FROM [1314howe].[reuters_terms.csv]


________________________________________


SELECT * FROM [1314howe].[reuters_terms.csv]


________________________________________


SELECT * FROM [1041].[g0]


________________________________________


SELECT * FROM [1041].[g0]


________________________________________


SELECT * FROM [1041].[g0]


________________________________________


select * from g0


________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , convert(varchar(max), county) as county
     , NULL as date
     , year
     , month
     , NULL as day
     , convert(varchar(max), lat) as LATITUDE
     , convert(varchar(max), long) as LONGITUDE
     , convert(varchar(max), source) as source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]
  
 UNION ALL

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co  as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , source as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]

  UNION ALL
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]
  
  UNION ALL
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , convert(varchar(max), county) as county
     , NULL as date
     , year
     , month
     , NULL as day
     , convert(varchar(max), lat) as LATITUDE
     , convert(varchar(max), long) as LONGITUDE
     , convert(varchar(max), source) as source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]
  
 UNION ALL

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co  as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , source as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]

  UNION ALL
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]
  
  UNION ALL
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , convert(varchar(max), county) as county
     , NULL as date
     , year
     , month
     , NULL as day
     , convert(varchar(max), lat) as LATITUDE
     , convert(varchar(max), long) as LONGITUDE
     , convert(varchar(max), source) as source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]
  
 UNION ALL

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , Co  as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , source as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family  
  FROM [1231].[ArboretumData.csv]

  UNION ALL
  
SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]
  
  UNION ALL
  
SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed'  OR QUESTION = 'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


select * from g111


________________________________________


SELECT * FROM [354].[Gene_Description_And_Methylation_Ratio_Oyster_direct]


________________________________________


SELECT * FROM [354].[Gene_Description_And_Methylation_Ratio_Oyster_direct]


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT * FROM [1041].[Gene_Description_and_Methylation_Ratio_Oyster.csv]


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


select * from g0


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT * FROM [1041].[13581.csv]


________________________________________


SELECT * FROM [1041].[13581.csv]


________________________________________


SELECT * FROM [1041].[1358dataset]


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))



________________________________________


SELECT * FROM [1041].[Gene_Description_and_Methylation_Ratio_Oyster.csv]


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID, 
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID, 
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =  
         SUBSTRING(allCG.GroupID, 
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT binid
  , round(avg(cast(Fluo as float)),3) as Fluo
  , round(avg(cast(T1 as float)),3) as T1
  , round(avg(cast(C1 as float)),3) as C1
  , round(avg(cast(S as float)),3) as S
  , round(avg(cast(SV as float)),3) as SV
  , round(avg(cast(T2 as float)),3) as T2
  , round(avg(cast(Oxygen as float)),3) as Oxygen
  , round(avg(cast(Nitrate_uM as float)),3) as Nitrate_uM
  , round(avg(cast(longitude as float)),3) as longitude
  , round(avg(cast(latitude as float)),3) as latitude
FROM (
  SELECT  cast(floor(ts) + floor((ts - floor(ts))*24*60/binsize)*binsize / (24*60) as datetime) as binid
        , *
  FROM (
    SELECT *, cast(timestamp as float) as ts, 3.0 as binsize
      FROM [1002].[Tokyo_2_merged_data_time.csv]
  ) x
) bins
GROUP BY binid
  order by binid asc


________________________________________


select top 20 * from [354].[table_SPID_GOnumber.txt33304]


________________________________________


select * from [354].[table_SPID_GOnumber.txt33304]
UNION ALL
  select * from [354].[table_SPID_GOnumber.txtC5F89]


________________________________________


SELECT top 10 * FROM [1041].[danielsdata]


________________________________________


SELECT * FROM [1041].[table__o_13581_c_.csv]


________________________________________


SELECT * FROM [354].[tmpColumnNameTest]


________________________________________


SELECT latitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT numSpecies FROM [354].[tmpColumnNameTest]


________________________________________


SELECT longitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT numSpecies FROM [354].[tmpColumnNameTest]


________________________________________


SELECT latitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT longitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT numSpecies FROM [354].[tmpColumnNameTest]


________________________________________


SELECT * FROM [354].[tmpColumnNameTest]


________________________________________


SELECT cast(latitude as INT) FROM [354].[tmpColumnNameTest]


________________________________________


SELECT cast(numSpecies as INT) FROM [354].[tmpColumnNameTest]


________________________________________


SELECT latitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT top 100 * FROM [1143].[author_view]


________________________________________


SELECT top 100 * FROM [1143].[author_view]


________________________________________


SELECT top 100 * FROM [1143].[author_view]


________________________________________


SELECT * FROM [1143].[author_view]


________________________________________


SELECT * FROM [1041].[authorview1358]


________________________________________


SELECT * FROM [materialized_Snapshot of authtry1]


________________________________________


SELECT * FROM [materialized_Snapshot daniel2]


________________________________________


select * from [1041].[table_13581.csv]


________________________________________


select * from [1041].[table_13581.csv]


________________________________________


select * from [1041].[table_Gene_Description_and_Methylation_Ratio_Oyster.csv]


________________________________________


select * from [1041].[table_Gene_Description_and_Methylation_Ratio_Oyster.csv]


________________________________________


select * from [354].[Dan's binning]


________________________________________


select numSpecies from [354].[Dan's binning]


________________________________________


SELECT * FROM [354].[tmpColumnNameTest]


________________________________________


SELECT longitude FROM [354].[tmpColumnNameTest]


________________________________________


SELECT 'A' FROM [1041].[table_okfile.csv]


________________________________________


SELECT *  FROM [1041].[table_okfile.csv]


________________________________________


SELECT 'C'  FROM [1041].[table_okfile.csv]


________________________________________


WITH data AS (SELECT * FROM [690].[All3col]) 
SELECT * FROM data ORDER BY latitude 



________________________________________


SELECT * FROM [690].[All3col] 



________________________________________


WITH data AS 
(SELECT * FROM [690].[All3col]) 
SELECT * FROM data





________________________________________


WITH data AS 
(SELECT * FROM [690].[All3col]) 
  SELECT * FROM data  ORDER BY latitude





________________________________________


WITH data AS 
(SELECT * FROM [690].[All3col]) 
SELECT * FROM data ORDER BY latitude 



________________________________________



(SELECT * FROM [690].[All3col])  ORDER BY latitude 



________________________________________



SELECT * FROM [690].[All3col]  ORDER BY latitude 



________________________________________



SELECT * FROM [690].[All3col]



________________________________________



SELECT * FROM [690].[All3col] ORDER BY species



________________________________________



SELECT * FROM [690].[All3col] ORDER BY latitude



________________________________________



SELECT * FROM [690].[All3col]



________________________________________



SELECT latitude,longitude FROM [690].[All3col]



________________________________________



SELECT latitude,longitude FROM [690].[All3col] ORDER BY latitude



________________________________________


SELECT * FROM [1041].[table_Gene_Description_and_Methylation_Ratio_Oyster.csv]


________________________________________


select * from [1041].[Snapshot daniel2]


________________________________________


select top 10 * from [1041].[Snapshot daniel2]


________________________________________


SELECT * FROM [1041].[table_MyTable_dmedv.csv]


________________________________________


SELECT * FROM [1041].[table_MyTable_dmedv.csv] ORDER BY field


________________________________________


SELECT * FROM [1041].[table_MyTable_dmedv.csv] ORDER BY field*mode*mode


________________________________________


SELECT * FROM [1041].[table_MyTable_dmedv.csv] ORDER BY field*mode*mode*obj


________________________________________


SELECT * FROM [1041].[table_MyTable_dmedv.csv] ORDER BY obj


________________________________________


SElECT * from (SELECT top 100 * FROM [1041].[table_MyTable_dmedv.csv] ORDER BY obj) qry


________________________________________


SElECT top 10 * from (SELECT top 500 * FROM [1041].[table_MyTable_dmedv.csv] ORDER BY obj) qry order by qry.rowc


________________________________________


SELECT top 1 * from (SElECT top 10 * from (SELECT top 500 * FROM [1041].[table_MyTable_dmedv.csv] ORDER BY obj) qry order by qry.rowc) qry2 order by qry2.rowcErr


________________________________________


SELECT top 5 * from (SElECT top 500 * from (SELECT top 500 * FROM [1041].[table_MyTable_dmedv.csv] ORDER BY obj) qry order by qry.rowc) qry2 order by qry2.rowcErr


________________________________________


SELECT top 5 * from (SElECT top 500 * from (SELECT top 500 * FROM [1041].[table_MyTable_dmedv.csv] ORDER BY obj*type*field) qry order by qry.rowc) qry2 order by qry2.rowcErr


________________________________________


select * from 13541358dquery


________________________________________


SELECT * FROM [1041].[MyTable_dmedv.csv]


________________________________________


SELECT * FROM [1041].[table_MyTable_dmedv_newfile.csv]


________________________________________


SELECT run FROM [1041].[table_MyTable_dmedv_newfile.csv]


________________________________________


SELECT * FROM [1314howe].[table_reuters_terms.csv]


________________________________________


CREATE VIEW [1041].[reuters_13582] ([doc_id],[term_id],[frequency]) AS SELECT * FROM [1314howe].[table_reuters_terms.csv]



________________________________________


SELECT geneDesc.* , COALESCE(1.0*methCGcnt/allCGcnt,0) as MethRatio
FROM [354].[methylated_CG_gene_count] methCG
RIGHT OUTER JOIN [354].[all_CG_gene_count] allCG
  ON methCG.GroupID = allCG.GroupID
JOIN [354].[TJGR_Gene_SPID_evalue_Description.txt] geneDesc
  ON geneDesc.Column1 =
         SUBSTRING(allCG.GroupID,
                   CHARINDEX('CGI', allCG.GroupID),
                   LEN(allCG.GroupID))


________________________________________


SELECT * FROM [1041].[order_emails.csv]


________________________________________


SELECT * FROM [1041].[table_okfile.csv]


________________________________________


SELECT * FROM [1041].[aa_1358_file.csv]


________________________________________


SELECT Django, Upload,Test FROM [1041].[aa_1358_file.csv]


________________________________________


SELECT Color as newcol FROM [1041].[fruit.csv]


________________________________________


SELECT * FROM [1041].[table_fruit.csv]


________________________________________


SELECT * FROM [1041].[small.txt]


________________________________________


SELECT * FROM [1041].[danielsdata]


________________________________________


select * from [1041].[table_small.txt]


________________________________________


select column1 from [1041].[table_small.txt]


________________________________________


select *   from [1041].[table_small.txt]


________________________________________


select skyVersion from 
  [1041].[table_MyTable_dmedv_newfile1_2.csv]


________________________________________


select * from [1143].[author_view]


________________________________________


SELECT * FROM [1041].[table_fruit.csv]


________________________________________


select * from danielsdata


________________________________________


SELECT * FROM [1041].[danielsdata]


________________________________________


select count(*) from [uniprot_enzyme_map.csv]


________________________________________


select * from [uniprot_enzyme_map.csv]


________________________________________


select accession, "EC NUmbers" from [uniprot_enzyme_map.csv]


________________________________________


SELECT * FROM [uniprot_enzyme_map.csv]


________________________________________


SELECT count(*) FROM [uniprot_enzyme_map.csv]


________________________________________


select count(distinct (accession + "EC NUmbers")) from [uniprot_enzyme_map.csv]


________________________________________


SELECT * FROM [uniprot_enzyme_map.csv]


________________________________________


SELECT distinct
accession
FROM [uniprot_enzyme_map.csv]


________________________________________


SELECT distinct
 count(accession)
FROM [uniprot_enzyme_map.csv]


________________________________________


select * from [uniprot_enzyme_map.csv]


________________________________________


SELECT distinct
 count("EC Numbers")
FROM [uniprot_enzyme_map.csv]


________________________________________


select * from [uniprot_enzyme_map.csv]


________________________________________


select accession, "EC Numbers", max("Intermediate ID"), "Database" 
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database" 



________________________________________


SELECT *
  from [uniprot_enzyme_map.csv]


________________________________________


SELECT accession, "EC Numbers", max("Intermediate ID"), "Database"
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database"



________________________________________


SELECT accession, "EC Numbers", max("Intermediate ID"), "Database"
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database"



________________________________________


select count(*) from (select accession, "EC Numbers", max("Intermediate ID") as enzyme_id, "Database" 
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database" ) AS foo



________________________________________


SELECT count(*) from (select accession, "EC Numbers", max("Intermediate ID") as enzyme_ID, "Database"
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database") as temp



________________________________________


select accession, "EC Numbers", max("Intermediate ID") as enzyme_id, "Database" 
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database"



________________________________________


select accession, "EC Numbers", max("Intermediate ID") as enzyme_id, "Database"
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database"


________________________________________


select accession, "EC Numbers", max("Intermediate ID") as enzyme_ID, "Database"
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database"


________________________________________


SELECT count(*) from (select accession, "EC Numbers", max("Intermediate ID") as enzyme_ID, "Database"
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database") as temp



________________________________________


SELECT count(*) from (select accession, "EC Numbers", max("Intermediate ID") as enzyme_ID, "Database"
  from [uniprot_enzyme_map.csv]
  group by accession, "EC Numbers", "Database") as temp



________________________________________


select * 
  from [uniprot_enzyme_map.csv]
  where Accession like '%B6KJ74%'
 


________________________________________


select * from [uniprot_enzyme_map.csv]
  where accession = 'B6KJ74'


________________________________________


select * 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)


________________________________________


select * from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)


________________________________________


select s.ssgcidid, ec."EC Numbers", s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where s.annotation like '%.%.%.%'



________________________________________


select s.ssgcidid, ec."EC Numbers", ec.*, s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where s.annotation like '%.%.%.%'



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where s.annotation like '%.%.%.%'



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where annotation like '%.%.%.%'



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where s.annotation like '%.%.%.%'
  and "Database" <> 'UniProt'



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where annotation like '%.%.%.%' and ec."Database" <> 'UniProt%'
  order by ec."Database", ec."EC Numbers"



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where annotation like '%.%.%.%' and ec."Database" <> '%UniProt%'
  order by ec."Database", ec."EC Numbers"



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where annotation like '%.%.%.%' and ec."Database" not like '%UniProt%'
  order by ec."Database", ec."EC Numbers"



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where s.annotation like '%.%.%.%'
  and "Database" not like '%UniProt%'



________________________________________


select count(*) from (
select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where annotation like '%.%.%.%' and ec."Database" not like '%UniProt%') as temp



________________________________________


select count(*) from (
select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where ec."Database" not like '%UniProt%') as temp



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database", s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where s.annotation like '%.%.%.%'
  and "Database" not like '%UniProt%'



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where ec."Database" not like '%UniProt%'



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where ec."Database" not like '%UniProt%'
  order by ec."Database", ec."EC Numbers"



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database", ec.*, s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where s.annotation like '%.%.%.%'
  and "Database" not like '%UniProt%'



________________________________________


select s.ssgcidid, ec."EC Numbers", ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where ec."Database" not like '%UniProt%' and s.annotation like '%.%.%.%'
  order by ec."Database", ec."EC Numbers"



________________________________________


select s.ssgcidid, ec."EC Numbers", s.uniprot, ec."Database", s.annotation
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where ec."Database" not like '%UniProt%' and s.annotation like '%.%.%.%'
  order by ec."Database", ec."EC Numbers"



________________________________________


select count(*) from (select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database", s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where  "Database" not like '%UniProt%') as foo



________________________________________


select count(*) from (select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database", s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  where  "Database" like '%UniProt%') as foo



________________________________________


select count(*) from (select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database", s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)) as foo



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database", s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database" as ec_source, s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database" as ec_source, ec.enzyme_id as ec_source_id, s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


SELECT * FROM [797].[PathwayCoverageByGenusPercentage]


________________________________________


SELECT * FROM [797].[PathwayCoverageByGenusPercentage]


________________________________________


SELECT * FROM [797].[PathwayCoverageByGenusPercentage]


________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database" as ec_source, ec.enzyme_id as ec_source_id, s.annotation 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database" as ec_source, ec.enzyme_id as ec_source_id, s.annotation, s.genus 
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select * 
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)


________________________________________


select se.ssgcidid, se.uniprot, se."EC Numbers", se.ec_source, se.annotation, ecp.pathway_id, ecp.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  


________________________________________


select distinct
  se.ssgcidid, se.uniprot, se."EC Numbers", se.ec_source, se.annotation, ecp.pathway_id, ecp.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  


________________________________________


select pathway_name, ssgcidid, ec.ec_number 
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)


________________________________________


select count(*) from
  (select distinct
  se.ssgcidid, se.uniprot, se."EC Numbers", se.ec_source, se.annotation, ecp.pathway_id, ecp.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers") as foo
  


________________________________________


select distinct
  se.ssgcidid, se.uniprot, se."EC Numbers", se.ec_source, se.annotation, ecp.pathway_id, ecp.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  


________________________________________


select pathway_name, ssgcidid, ec.ec_number, s.*
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)


________________________________________


select pathway_name, ssgcidid, ec.ec_number, ec.*
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)


________________________________________


select distinct
  se.ssgcidid, se.uniprot, se."EC Numbers", se.ec_source, se.annotation, ecp.pathway_id, ecp.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  where ecp.pathway_name is not null
  


________________________________________


select pathway_name, ssgcidid, ec.ec_number, ec.*
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name is not null



________________________________________


select count (*) from (select distinct
  se.ssgcidid, se.uniprot, se."EC Numbers", se.ec_source, se.annotation, ecp.pathway_id, ecp.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  where ecp.pathway_name is not null) as temp
  


________________________________________


select distinct
  se.ssgcidid, se.uniprot, se."EC Numbers", se.ec_source, se.annotation, ecp.pathway_id, ecp.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  where ecp.pathway_name is not null
  


________________________________________


select pathway_name, ssgcidid, ec.ec_number, ec.*
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name is not null



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database" as ec_source, ec.enzyme_id as ec_source_id, 
  s.annotation, s.genus, s.class, s.superkingdom
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database" as ec_source, ec.enzyme_id as ec_source_id, 
  s.annotation, s.genus, s.class, s.superkingdom, s.familyID
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select pathway_name, ssgcidid, ec.ec_number, s.genus
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name is not null



________________________________________


select pathway_name, ec.ec_number, s.genus
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name is not null



________________________________________


select pathway_name, s.genus, count(distinct ec.ec_number)
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name is not null
  group by pathway_name, s.genus



________________________________________


select pathway_name, s.genus, count(distinct ec.ec_number)
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_name, s.genus



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database" as ec_source, ec.enzyme_id as ec_source_id, 
  s.annotation, s.genus, s.class, s.superkingdom, s.familyID
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database" as ec_source, ec.enzyme_id as ec_source_id, 
  s.annotation, s.genus, s.class, s.superkingdom, s.familyID
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers", ec."Database" as ec_source, ec.enzyme_id as ec_source_id, 
  s.annotation, s.genus, s.class, s.superkingdom, s.familyID
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select pathway_name, s.genus, count(distinct ec.ec_number) as EC_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_name, s.genus



________________________________________


select pathway_name, s.genus, count(distinct ec.ec_number) as EC_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_name, s.genus
order by pathway_name, s.genus


________________________________________


select * from [ec_pathway.csv] ec


________________________________________


select *
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"



________________________________________


select *
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"



________________________________________


select pathway_name, count(distinct ec_number)
  from [ec_pathway.csv] ec
  group by pathway_name
  order by pathway_name



________________________________________


select *
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"



________________________________________


select pathway_name, count(distinct ec_number)
  from [ec_pathway.csv] ec
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select pathway_name, count(distinct ec_number)
  from [ec_pathway.csv] ec
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select pathway_name, count(distinct ec_number) as ECs_in_pathway
  from [ec_pathway.csv] ec
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select ec.ec_number
  from [ec_pathway.csv] ec
  join [ec_pdb_genus.csv] ep on (ec.ec_number = ep.ec_number)




________________________________________


select pathway_name, s.genus, count(distinct ec.ec_number) as count_EC_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_name, s.genus
order by pathway_name, s.genus


________________________________________


select pathway_name, count(distinct ec_number) as count_EC_in_general_pathway
  from [ec_pathway.csv] ec
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select pathway_name, count(distinct ec_number) as count_EC_in_general_pathway
  from [ec_pathway.csv] ec
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select ec.ec_number, ec.pathway_id, ec.pathway_name, ep.genus, ep.pdbid
  from [ec_pathway.csv] ec
  join [ec_pdb_genus.csv] ep on (ec.ec_number = ep.ec_number)




________________________________________


select se.ssgcidid, se.uniprot, se."EC Numbers", se.ec_source, se.ec_source_id, 
  se.annotation, se.genus, se.class, se.superkingdom, se.familyID
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"



________________________________________


select distinct ec.ec_number, ec.pathway_id, ec.pathway_name, ep.genus, ep.pdbid
  from [ec_pathway.csv] ec
  join [ec_pdb_genus.csv] ep on (ec.ec_number = ep.ec_number)




________________________________________


select se.ssgcidid, se.uniprot, se."EC Numbers", se.ec_source, se.ec_source_id, se.annotation,
  se.genus
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"



________________________________________


select se.ssgcidid, se.uniprot, se."EC Numbers", ecp.ec_number, se.ec_source, se.ec_source_id, se.annotation,
  se.genus
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"



________________________________________


select pathway_name, count(distinct ec_number)
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select ec.ec_number, ec.pathway_id, ec.pathway_name, ep.genus, ep.pdbid
  from [ec_pathway.csv] ec
  join [ec_pdb_genus.csv] ep on (ec.ec_number = ep.ec_number)




________________________________________


select se.ssgcidid, se.uniprot, se."EC Numbers", ecp.ec_number, ecp.pathway_id, se.ec_source, se.ec_source_id, se.annotation,
  se.genus
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"



________________________________________


select pathway_name, s.genus, count(distinct ec.ec_number) as EC_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_name, s.genus
order by pathway_name, s.genus


________________________________________


select se.ssgcidid, se.uniprot, se."EC Numbers", ecp.ec_number, ecp.pathway_id, se.ec_source, se.ec_source_id, se.annotation,
  se.genus
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  order by se.genus, ecp.pathway_id



________________________________________


select pathway_name, count(distinct ec_number) as EC_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select pathway_name, s.genus, count(distinct ec.ec_number) as ECs_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_name, s.genus
order by pathway_name, s.genus


________________________________________


select pathway_name, count(distinct ec_number) as ECs_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select se.ssgcidid, se.uniprot, se.genus, ecp.ec_number, ecp.pathway_id, se.ec_source, se.ec_source_id, se.annotation
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  order by se.genus, ecp.pathway_id



________________________________________


select pathway_name, count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_name, s.genus
order by pathway_name, s.genus


________________________________________


select se.ssgcidid, se.uniprot, se.genus, ecp.ec_number, ecp.pathway_id, se.ec_source, se.ec_source_id, se.annotation
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  order by se.genus, ecp.pathway_id



________________________________________


select se.genus, ecp.ec_number, ecp.pathway_id
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  order by se.genus, ecp.pathway_id



________________________________________


select ecp.ec_number, se.genus, ecp.pathway_id
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  order by se.genus, ecp.pathway_id



________________________________________


select ecp.pathway_id, ecp.ec_number, se.genus
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  order by se.genus, ecp.pathway_id



________________________________________


select ecp.pathway_id, se.genus, ecp.ec_number
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  order by se.genus, ecp.pathway_id



________________________________________


select ecp.pathway_id, se.genus, count(ecp.ec_number)
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  group by ecp.pathway_id, se.genus



________________________________________


select ecp.pathway_name, se.genus, count(ecp.ec_number)
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  group by ecp.pathway_name, se.genus



________________________________________


select ec.pathway_name, ec.pathway_id, ec.ec_number, ep.genus
  from [ec_pathway.csv] ec
  join [ec_pdb_genus.csv] ep on (ec.ec_number = ep.ec_number)





________________________________________


select *
  from [ssgcid_EC_map]


________________________________________


select *
  from [ssgcid_EC_map] ss
  join [ec_pathway.csv] ec on (ec.ec_number = ss."ec numbers")



________________________________________


select ss.genus, ec.pathway_name, ec.ec_number 
  from [ssgcid_EC_map] ss
  join [ec_pathway.csv] ec on (ec.ec_number = ss."ec numbers")



________________________________________


select ss.genus, ec.pathway_name, ec.ec_number 
  from [ssgcid_EC_map] ss
  join [ec_pathway.csv] ec on (ec.ec_number = ss."ec numbers")
  where pathway_name <> ''


________________________________________


select ecp.pathway_name, se.genus, count(ecp.ec_number)
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  where ecp.pathway_name is not null
  group by ecp.pathway_name, se.genus



________________________________________


select ecp.pathway_name, se.genus, count(ecp.ec_number)
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  where ecp.pathway_name <> ''
  group by ecp.pathway_name, se.genus



________________________________________


select ecp.pathway_name, se.genus, count(distinct ecp.ec_number)
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  where ecp.pathway_name <> ''
  group by ecp.pathway_name, se.genus



________________________________________


select ss.genus, ec.pathway_name, count( distinct ec.ec_number )
  from [ssgcid_EC_map] ss
  join [ec_pathway.csv] ec on (ec.ec_number = ss."ec numbers")
  where pathway_name <> ''
  
group by ss.genus, ec.pathway_name


________________________________________


select ss.genus, ec.pathway_name, count( distinct ec.ec_number )
  from [ssgcid_EC_map] ss
  join [ec_pathway.csv] ec on (ec.ec_number = ss."ec numbers")
  where pathway_name <> ''
  
group by ec.pathway_name, ss.genus 


________________________________________


select ss.genus, ec.pathway_name, count( distinct ec.ec_number )
  from [ssgcid_EC_map] ss
  join [ec_pathway.csv] ec on (ec.ec_number = ss."ec numbers")
  where pathway_name <> ''
  
  group by ec.pathway_name, ss.genus order by ec.pathway_name, ss.genus



________________________________________


select ec.pathway_name, ss.genus, count( distinct ec.ec_number )
  from [ssgcid_EC_map] ss
  join [ec_pathway.csv] ec on (ec.ec_number = ss."ec numbers")
  where pathway_name <> ''
  
  group by ec.pathway_name, ss.genus order by ec.pathway_name, ss.genus



________________________________________


select ecp.pathway_name, se.genus, count(distinct ecp.ec_number)
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ecp on ecp.ec_number = se."EC Numbers"
  where ecp.pathway_name <> ''
  group by ecp.pathway_name, se.genus
  order by se.genus



________________________________________


select ec.pathway_name, ss.genus, count( distinct ec.ec_number )
  from [ssgcid_EC_map] ss
  join [ec_pathway.csv] ec on (ec.ec_number = ss."ec numbers")
  
  where pathway_name <> ''
  
  group by ec.pathway_name, ss.genus 
  order by ec.pathway_name, ss.genus



________________________________________


select pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_name, s.genus
order by enzymes_selected desc


________________________________________


select pathway_name, count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_name
  order by pathway_name



________________________________________


select tep.pathway_name, (teg.enzymes_selected/tep.enzymes_in_pathway)*100
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name



________________________________________


select tep.pathway_name, (teg.enzymes_selected/tep.enzymes_in_pathway)
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name



________________________________________


select tep.pathway_name, (teg.enzymes_selected/tep.enzymes_in_pathway) as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  order by percentage_covered desc



________________________________________


select tep.pathway_name, (teg.enzymes_selected/tep.enzymes_in_pathway)*100 as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  order by percentage_covered desc



________________________________________


select pathway_id, pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (teg.enzymes_selected/tep.enzymes_in_pathway)*100 as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  order by percentage_covered desc



________________________________________


select pathway_id, pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_id, pathway_name, s.genus
order by enzymes_selected desc


________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (teg.enzymes_selected/tep.enzymes_in_pathway)*100 as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (teg.enzymes_selected/tep.enzymes_in_pathway)*100 as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway <> 1
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (teg.enzymes_selected/tep.enzymes_in_pathway)*100 as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (teg.enzymes_selected/tep.enzymes_in_pathway) as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (100*teg.enzymes_selected/100*tep.enzymes_in_pathway) as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (teg.enzymes_selected/tep.enzymes_in_pathway) as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (teg.enzymes_selected/tep.enzymes_in_pathway)*100 as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (10000*teg.enzymes_selected/100*tep.enzymes_in_pathway) as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (teg.enzymes_selected/tep.enzymes_in_pathway) as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, 100*(teg.enzymes_selected/tep.enzymes_in_pathway) as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, ((10000*teg.enzymes_selected)/(100*tep.enzymes_in_pathway)) as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by teg.genus, percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by tep.pathway_name, percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select pathway_id, pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_id, pathway_name, s.genus
order by pathway_name


________________________________________


select * from  [Pathway_genus_coverage]


________________________________________


select count(distinct pathway_name)
  from  [Pathway_genus_coverage]


________________________________________


select *
  from  [Pathway_genus_coverage]


________________________________________


select *
  from  [Pathway_genus_coverage]
  order by percentage_covered desc



________________________________________


select substring(pathway_id, 5, 7), pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select substring(pathway_id, 6, 8), pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select substring(pathway_id, 6, 8) as pathway_id, pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select substring(pathway_id, 6, 8) as pathway_id, pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
 -- where pathway_name <> ''
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select * 
  from [ec_pathway.csv]
  where pathway_id='path:ko00250'


________________________________________


select substring(pathway_id, 6, 8) as pathway_id, pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
 -- where pathway_name <> ''
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select * from [ec_pathway.csv]
  where pathway_id='path:ko00250'


________________________________________


delete FROM [188].[table_ec_pathway.csv]


________________________________________


select substring(pathway_id, 6, 8) as pathway_id, pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select * from [total_enzymes_per_pathway]
  where pathway_id = 'path:ko00250'


________________________________________


select * from [total_enzymes_per_pathway]




________________________________________


select tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by tep.pathway_name, percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by tep.pathway_name, percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select substring(pathway_id, 6, 8) as pathway_id, pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select substring(pathway_id, 6, 8) as pathway_id, pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  where pathway_name <> ''
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


SELECT * FROM [188].[table_ec_pathway.csv]
  where ec_number is null



________________________________________


SELECT * FROM [188].[table_ec_pathway.csv]
  where ec_number = ''



________________________________________


SELECT * FROM [188].[table_ec_pathway.csv]
  where ec_number <> ''



________________________________________


select substring(pathway_id, 6, 8) as pathway_id, pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select * from [ec_pathway.csv]
  where pathway_id like '%ko00312'


________________________________________


select tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by tep.pathway_name, percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select substring(pathway_id, 6, 8), pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_id, pathway_name, s.genus
order by enzymes_selected desc


________________________________________


select substring(pathway_id, 6, 7), pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_id, pathway_name, s.genus
order by enzymes_selected desc


________________________________________


select substring(pathway_id, 6, 6), pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_id, pathway_name, s.genus
order by enzymes_selected desc


________________________________________


select substring(pathway_id, 6, 7), pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_id, pathway_name, s.genus
order by enzymes_selected desc


________________________________________


select substring(pathway_id, 6, 7) as pathway_id, pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s."EC Numbers" = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_id, pathway_name, s.genus
order by enzymes_selected desc


________________________________________


select * 
  from [ec_pdb_genus.csv] e
  join [Pathway_genus_coverage] p on (p.genus=e.genus)


________________________________________


select *
  from [ec_pdb_genus.csv] e
  join [total_enzymes_per_genus] p on (p.genus=e.genus)


________________________________________


select p.pathway_id, p.pathway_name, p.genus, p.enzymes_selected, count(distinct pdbid)
  from [ec_pdb_genus.csv] e
  join [total_enzymes_per_genus] p on (p.genus=e.genus)
  group by p.pathway_id, p.pathway_name, p.genus, p.enzymes_selected



________________________________________


select p.pathway_id, p.pathway_name, p.genus, p.enzymes_selected, count(distinct e.ec_number)
  from [ec_pdb_genus.csv] e
  join [total_enzymes_per_genus] p on (p.genus=e.genus)
  group by p.pathway_id, p.pathway_name, p.genus, p.enzymes_selected



________________________________________


select *
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)




________________________________________


select p.pathway_id, p.pathway_name, e.genus, count(distinct e.ec_number) as enzymes_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  group by p.pathway_id, p.pathway_name, e.genus




________________________________________


select p.pathway_id, p.pathway_name, e.genus, count(distinct e.ec_number) as enzymes_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  group by p.pathway_id, p.pathway_name, e.genus
  order by enzymes_in_pdb desc




________________________________________


select p.pathway_id, p.pathway_name, e.genus, count(distinct e.ec_number) as enzymes_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  group by p.pathway_id, p.pathway_name, e.genus



________________________________________


select  ss.ssgcidid , ss.uniprot, sx.pdbid
  from [ssgcid_uniprot.csv] ss
  join [ssgcid_pdb.csv] sx on (ss.ssgcidid = sx.ssgcidid)


________________________________________


select  ss.ssgcidid , ss.uniprot, ss.genus, ss.species, sx.pdbid
  from [ssgcid_uniprot.csv] ss
  join [ssgcid_pdb.csv] sx on (ss.ssgcidid = sx.ssgcidid)


________________________________________


select *
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)


________________________________________


select *
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  where pathway_id='path:ko00982'



________________________________________


select  ss.ssgcidid , ss.uniprot, ss.genus, ss.species, sx.pdbid
  from [ssgcid_uniprot.csv] ss
  join [ssgcid_pdb.csv] sx on (ss.ssgcidid = sx.ssgcidid)
  



________________________________________


select  ss.ssgcidid , ss.genus, ss.species, sx.pdbid, ss.uniprot
  from [ssgcid_uniprot.csv] ss
  join [ssgcid_pdb.csv] sx on (ss.ssgcidid = sx.ssgcidid)
  
  order by ss.uniprot



________________________________________


select  ss.ssgcidid , ss.genus, ss.species, sx.pdbid, ss.uniprot
  from [ssgcid_uniprot.csv] ss
  join [ssgcid_pdb.csv] sx on (ss.ssgcidid = sx.ssgcidid)
  
  order by ss.uniprot



________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers" as ec_number, ec."Database" as ec_source, ec.enzyme_id as ec_source_id, 
  s.annotation, s.genus, s.class, s.superkingdom, s.familyID
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)



________________________________________


select *
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where pathway_id='path:ko00982'
  



________________________________________


select *
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  and pathway_id='path:ko00982'
  



________________________________________


select *
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid)
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number
  order by p.pathway_id, s.genus



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by p.pathway_id, e.genus



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by structures_in_pdb asc



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by structures_in_pdb asc



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  right outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by structures_in_pdb asc



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by structures_in_pdb asc



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  full outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by structures_in_pdb asc



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  having count(distinct pdbid) = 0



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
--  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  having count(distinct pdbid) = 0



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number,  SUM(CASE WHEN e.pdbid IS NULL THEN 0 ELSE 1 END) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  having count(distinct pdbid) = 0



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number,  SUM(CASE WHEN e.pdbid IS NULL THEN 0 ELSE 1 END) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  having count(distinct pdbid) = 0



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number,  SUM(CASE WHEN e.pdbid IS NULL THEN 0 ELSE 1 END) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by structures_in_pdb asc



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number,  SUM(CASE WHEN e.pdbid IS NULL THEN 0 ELSE 1 END) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on (s.ec_number = p.ec_number)
  where (e.genus = s.genus) or s.genus is null
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by structures_in_pdb asc



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number,  SUM(CASE WHEN e.pdbid IS NULL THEN 0 ELSE 1 END) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  where (e.genus = s.genus) or s.genus is null
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by structures_in_pdb asc



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number,  SUM(CASE WHEN e.pdbid IS NULL THEN 0 ELSE 1 END) as structures_in_pdb
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  where s.genus is null
  group by p.pathway_id, p.pathway_name, e.genus, e.ec_number
  order by structures_in_pdb asc



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, e.pdbid
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  where e.genus = s.genus

  



________________________________________


select p.pathway_id, p.pathway_name, e.genus, e.ec_number, e.pdbid
  from [ec_pdb_genus.csv] e
  join [ec_pathway.csv] p on (e.ec_number = p.ec_number)
  left outer join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)


  



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, e.pdbid
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on (p.ec_number = e.ec_number)
  
  



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, e.pdbid
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on (p.ec_number = e.ec_number)
  where e.pdbid is null
  
  



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, e.pdbid
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on (e.ec_number =  p.ec_number)
  where e.pdbid is null
  
  



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, e.pdbid
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on (e.ec_number =  p.ec_number)

  
  



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, e.pdbid
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  right outer join [ec_pdb_genus.csv] e on (e.ec_number =  p.ec_number)

  
  



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, e.pdbid
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on (e.genus =  s.genus)




________________________________________


select p.pathway_id, p.pathway_name, s.*
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  




________________________________________


select p.pathway_id, p.pathway_name, s.ec_number, SUM(CASE WHEN e.pdbid IS NULL THEN 0 ELSE 1 END) as structures
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.ec_number
  




________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, SUM(CASE WHEN e.pdbid IS NULL THEN 0 ELSE 1 END) as structures
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number
  




________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number
  




________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number
  




________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  right outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number


________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number


________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number having count(distinct pdbid) = 0


________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number having count(distinct pdbid) = 0



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number 



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number having count(distinct pdbid) = 0



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number 



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  right join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number 



________________________________________


select substring(pathway_id, 6, 7) as pathway_id, pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s.ec_number = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_id, pathway_name, s.genus
order by enzymes_selected desc


________________________________________


select tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by tep.pathway_name, percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_id, tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by tep.pathway_name, percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select *
  from [Pathway_genus_coverage] p
  join [total_enzymes_in_pdb_per_pathway_per_genus] e on (e.pathway_id = p.pathway_id)
  where p.genus = e.genus


________________________________________


select pathway_id as pathway_id, pathway_name, s.genus, count(distinct ec.ec_number) as enzymes_selected
  from [ec_pathway.csv] ec
  join [ssgcid_EC_map] s on (s.ec_number = ec.ec_number)
  where pathway_name <> '' 
  group by pathway_id, pathway_name, s.genus
order by enzymes_selected desc


________________________________________


select *
  from [Pathway_genus_coverage] p
  join [total_enzymes_in_pdb_per_pathway_per_genus] e on (e.pathway_id = p.pathway_id)
  where p.genus = e.genus


________________________________________


select tep.pathway_id, tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 2
  order by tep.pathway_name, percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select pathway_id as pathway_id, pathway_name,  count(distinct ec_number) as enzymes_in_pathway
  from [ec_pathway.csv]
  group by pathway_id, pathway_name
  order by pathway_name



________________________________________


select *
  from [Pathway_genus_coverage] p
  join [total_enzymes_in_pdb_per_pathway_per_genus] e on (e.pathway_id = p.pathway_id)
  where p.genus = e.genus


________________________________________


select p.*, e.enzymes_in_pdb
  from [Pathway_genus_coverage] p
  join [total_enzymes_in_pdb_per_pathway_per_genus] e on (e.pathway_id = p.pathway_id)
  where p.genus = e.genus


________________________________________


select p.*, e.*
  from [Pathway_genus_coverage] p
  join [total_enzymes_in_pdb_per_pathway_per_genus] e on (e.pathway_id = p.pathway_id)
  where p.genus = e.genus


________________________________________


select p.pathway_id, p.pathway_name, p.enzymes_in_pathway, p.enzymes_selected, p.percentage_covered, e.enzymes_in_pdb
  from [Pathway_genus_coverage] p
  join [total_enzymes_in_pdb_per_pathway_per_genus] e on (e.pathway_id = p.pathway_id)
  where p.genus = e.genus


________________________________________


select p.pathway_id, p.pathway_name, p.genus, p.enzymes_in_pathway, p.enzymes_selected, p.percentage_covered, e.enzymes_in_pdb
  from [Pathway_genus_coverage] p
  join [total_enzymes_in_pdb_per_pathway_per_genus] e on (e.pathway_id = p.pathway_id)
  where p.genus = e.genus


________________________________________


select p.pathway_id, p.pathway_name, p.genus, p.enzymes_in_pathway, p.enzymes_selected, p.percentage_covered, e.enzymes_in_pdb
  from [Pathway_genus_coverage] p
  join [total_enzymes_in_pdb_per_pathway_per_genus] e on (e.pathway_id = p.pathway_id)
  where p.genus = e.genus
  order by percentage_covered desc



________________________________________


select p.pathway_id, p.pathway_name, s.genus, s.ec_number, count(distinct pdbid) as structures_in_pdb
  from [ec_pathway.csv] p 
  join [ssgcid_EC_map] s on ( p.ec_number=  s.ec_number)
  left outer join [ec_pdb_genus.csv] e on ( s.ec_number = e.ec_number )
  where s.genus = e.genus
  and e.pdbid in
  (SELECT PDBID FROM [188].[table_ssgcid_pdb.csv])
  group by p.pathway_id, p.pathway_name, s.genus, s.ec_number


________________________________________


SELECT * FROM ssgcid_EC_map



________________________________________


SELECT SSGCIDID, ec_number FROM ssgcid_EC_map



________________________________________


SELECT ssgcid_EC_map.SSGCIDID, ec_number, PDBID
 
  FROM ssgcid_EC_map
INNER JOIN 
  [188].[table_ssgcid_pdb.csv] on  ssgcid_EC_map.SSGCIDID = [188].[table_ssgcid_pdb.csv].[ssgcidid]


________________________________________


SELECT ssgcid_EC_map.SSGCIDID, ec_number, PDBID
 
  FROM ssgcid_EC_map
RIGHT JOIN 
  [188].[table_ssgcid_pdb.csv] on  ssgcid_EC_map.SSGCIDID = [188].[table_ssgcid_pdb.csv].[ssgcidid]


________________________________________


select tep.pathway_id, tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 0
  order by tep.pathway_name, percentage_covered desc, tep.enzymes_in_pathway desc



________________________________________


select tep.pathway_id, tep.pathway_name, teg.enzymes_selected, teg.genus, tep.enzymes_in_pathway, (100*teg.enzymes_selected)/tep.enzymes_in_pathway as percentage_covered
  from [total_enzymes_per_pathway] tep
  join [total_enzymes_per_genus] teg on teg.pathway_name = tep.pathway_name
  where tep.enzymes_in_pathway > 0
  order by tep.enzymes_in_pathway desc, tep.pathway_name, percentage_covered desc


________________________________________


SELECT * FROM [188].[table_ec_pathway.csv]
  where ec_number <> ''
  order by pathway_name



________________________________________


select c.*
  from kappe_LSall_unique2LS c
  join kappe_pyoleii_lifestages l
  on (c.id=l.id)


________________________________________


select count(*)
  from kappe_LSall_unique2LS c
  join kappe_pyoleii_lifestages l
  on (c.id=l.id)


________________________________________


select c.id
  from kappe_LSall_unique2LS c
 except
 select l.id 
  from kappe_pyoleii_lifestages l




________________________________________


update kappe_LSall_unique2LS 
  set id='PY05755', name='40S ribosomal protein S12'
  where id='PY07755'




________________________________________


select * 
  from kappe_LSall_unique2LS
  where id='PY05577'


________________________________________


select * 
  from kappe_LSall_unique2LS
  where id='PY05755'


________________________________________


select c.*
  from kappe_LSall_unique2LS c
  where id='PY05755'


________________________________________


select c.*, l.*
  from kappe_LSall_unique2LS c
  join kappe_pyoleii_lifestages l on (c.id=l.id)
  where l.id='PY05755'


________________________________________


select c.*, l.ls24h, l.ls40h, l.ls50h
  from kappe_LSall_unique2LS c
  join kappe_pyoleii_lifestages l on (c.id=l.id)
  where l.id='PY05755'


________________________________________


select c.*, l.ls24h, l.ls40h, l.ls50h
  from kappe_LSall_unique2LS c
  join kappe_pyoleii_lifestages l on (c.id=l.id)
order by c.id


________________________________________


SELECT 'INSERT INTO EcPathway (EcNumber,PathwayId,PathwayName) 
  VALUES (''' + ec_number + ''',''' + pathway_id 
  + ''',''' + pathway_name + ''')'
  
  
  
  
  FROM [188].[table_ec_pathway.csv]
  where ec_number <> ''


________________________________________


SELECT SsgcidId, ec_number, ec_source, ec_source_id
  
  
  FROM [188].[ssgcid_EC_map]


________________________________________


SELECT FeatureID, T1.SsgcidId, ec_number, ec_source, ec_source_id
  
  
  FROM [188].[ssgcid_EC_map] as T1
  
  LEFT JOIN [188].[table_ssgcidid_featureid.csv] as T2
ON T1.SSGCIDID = T2.SSGCIDID


________________________________________


SELECT FeatureID, ec_number, ec_source, ec_source_id
  
  
  FROM [188].[ssgcid_EC_map] as T1
  
  LEFT JOIN [188].[table_ssgcidid_featureid.csv] as T2
ON T1.SSGCIDID = T2.SSGCIDID


________________________________________


SELECT FeatureID, ec_number as EcNumber, ec_source as EcSource, ec_source_id as EcSourceID
  
  
  FROM [188].[ssgcid_EC_map] as T1
  
  LEFT JOIN [188].[table_ssgcidid_featureid.csv] as T2
ON T1.SSGCIDID = T2.SSGCIDID


________________________________________


SELECT 'INSERT INTO EcNumberFeature (FeatureID, EcNumber, EcSource
  EcSourceId) VALUES (' + CAST(FeatureID as varchar(50)) + ',''' + EcNumber + 
  ''',''' + EcSource + ''',''' + EcSourceID +''')' as Statement

  FROM [188].[EcNumberPerTarget]


________________________________________


SELECT 'INSERT INTO EcNumberFeature (FeatureID, EcNumber, EcSource,
  EcSourceId) VALUES (' + CAST(FeatureID as varchar(50)) + ',''' + EcNumber + 
  ''',''' + EcSource + ''',''' + EcSourceID +''')' as Statement

  FROM [188].[EcNumberPerTarget]


________________________________________


SELECT distinct pathway_id, pathway_name FROM [materialized_Snapshot of total_enzymes_per_genus]


________________________________________


SELECT distinct pathway_id, pathway_name FROM [materialized_Snapshot of total_enzymes_per_genus]
  order by pathway_name



________________________________________


select *
  from ssgcid_EC_map sem
  join [ec_pathway.csv] ep on (sem.ec_number = ep.ec_number)


________________________________________


select *
  from ssgcid_EC_map sem
  join [ec_pathway.csv] ep on (sem.ec_number = ep.ec_number)
  where ep.pathway_id like '%ko00401'



________________________________________


SELECT 
  
  Pathway_ID as PathwayId,
  Genus,
  Enzymes_IN_PDB as EnzymesInPdb
  
  FROM [188].[total_enzymes_in_pdb_per_pathway_per_genus]


________________________________________


select * from [CTTdb_Requestors.csv] ct
  join [CRdb_requestors.csv] cr on (cr.email = ct.PI_email)



________________________________________


select * from [CTTdb_Requestors.csv] ct
  join [CRdb_requestors.csv] cr on (cr.email = ct.PI_email)
  order by externalrequestorid


________________________________________


select * from [CRdb_requestors.csv] cr
  join [CTTdb_Requestors.csv] ct on (ct.PI_name = cr.PI_name)


________________________________________


select * from [CRdb_requestors.csv] cr
  left join [CTTdb_Requestors.csv] ct on (ct.PI_name = cr.PI_name)


________________________________________


select * from [CRdb_requestors.csv] cr
  left join [CTTdb_Requestors.csv] ct on (ct.PI_name = cr.PI_name)
  order by ExternalRequestorID desc



________________________________________


select * from [CRdb_requestors.csv] cr
  left join [CTTdb_Requestors.csv] ct on (ct.PI_name = cr.PI_name)
  order by ExternalRequestorID



________________________________________


select count(*) [CTTdb_Requestors.csv]


________________________________________


select count(PI_name) from [CTTdb_Requestors.csv]


________________________________________


select count(*) from [CTTdb_Requestors.csv]


________________________________________


select count(*) from [CRdb_requestors.csv]


________________________________________


select count(*) from [CRdb_requestors.csv] cr
  left join [CTTdb_Requestors.csv] ct on (ct.PI_name = cr.PI_name)



________________________________________


select count(*) from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)



________________________________________


select count(*) from [CTTdb_Requestors.csv] ct
  right join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)



________________________________________


select count(*) from [CTTdb_Requestors.csv] ct
  left outer join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)



________________________________________


select count(*) from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)



________________________________________


select * from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)



________________________________________


select * from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)
  order by ExternalRequestorID



________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)
  order by ExternalRequestorID



________________________________________


SELECT 'INSERT INTO PathwayGenusPdb (PathwayId,Genus,EnzymesInPdb) VALUES 
  (''' + PathwayId + ''',''' + Genus + ''',' + CAST(EnzymesInPdb as varchar(4)) + ')' as Statement
  
  
  
  
  FROM [188].[tmp_TotalEnzymesForGenusIDApplication]


________________________________________


select ct1.PI_Name
  from [CTTdb_Requestors.csv] ct1
  where ct1.PI_Name not in
(select ct2.PI_Name
  from [CTTdb_Requestors.csv] ct2
  left join [CRdb_requestors.csv] cr2 on (ct2.PI_name = cr2.PI_name)
  )



________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)
  order by cr.PI_Name



________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)
  where ct.PI_Name like '%rinkman%'


________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)
  where cr.PI_Name is null



________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)
  where cr.PI_Name is null and ct.ExternalRequestorID is not null



________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)
  where cr.PI_Name is null



________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.email as CR_PIemail,
  cr.id as CR_contactID
  from [CTTdb_Requestors_cleaned.csv] ct
  left join [CRdb_requestors_cleaned.csv] cr on (ct.PI_name = cr.PI_name)
  where cr.PI_Name is null and ct.ExternalRequestorID is not null



________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors_cleaned.csv] ct
  left join [CRdb_requestors_cleaned.csv] cr on (ct.PI_name = cr.PI_name)
  where cr.PI_Name is null and ct.ExternalRequestorID is not null


________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors_cleaned.csv] ct
  left join [CRdb_requestors_cleaned.csv] cr on (ct.PI_name = cr.PI_name)
  where cr.PI_Name is null
  -- and ct.ExternalRequestorID is not null


________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)
  where cr.PI_Name is null
  
  -- and ct.ExternalRequestorID is not null



________________________________________


select ct.PI_Name as CTT_PIname,
  ct.PI_email as CTT_PIemail,
  ct.ExternalRequestorID as CT_ExtReqID,
  cr.PI_Name as CR_PIname,
  cr.PI_email as CR_PIemail,
  cr.contact_id as CR_contactID
  from [CTTdb_Requestors.csv] ct
  left join [CRdb_requestors.csv] cr on (ct.PI_name = cr.PI_name)
  where cr.PI_Name is null
  order by ct.ExternalRequestorID
  -- and ct.ExternalRequestorID is not null



________________________________________


SELECT * FROM [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv].[Isolate ID] is not null



________________________________________


SELECT * FROM [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv].[Isolate ID] like 'sn0%'



________________________________________


SELECT * FROM [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv].[Isolate ID] like 'sm0%'



________________________________________


SELECT * FROM [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv].[Isolate ID] like '%0%'



________________________________________


SELECT count(*) FROM [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv].[Isolate ID] like '%0%'



________________________________________


SELECT count(*) FROM [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv].[Subject ID] = 1


________________________________________


SELECT count(*) FROM [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv].[Subject ID] = 160


________________________________________


SELECT count(*) FROM [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv].[Sub ?] like '661%'


________________________________________


SELECT count(*) FROM [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv].[Sample ID] like '008%'


________________________________________


SELECT count(*) FROM [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv].[Location row - column] like '5-'


________________________________________


SELECT count(*) FROM [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv].[Location row - column] like '5-%'


________________________________________


SELECT count(*) FROM [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv].[Location row - column] like '%,%'


________________________________________


SELECT * FROM [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv].[Location row - column] like '%,%'


________________________________________


SELECT * FROM [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv].[Arc1327e Box] like '%,%'


________________________________________


SELECT * FROM [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv]
  where [188].[table_Sorted_Arc1327es_SUBS_CPs30Aug.csv].[Arc1327e Box] = '1'


________________________________________


SELECT * FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv]
  where [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv].[Arc1327e Box] = '1'


________________________________________


SELECT * FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  where t1.[Arc1327e Box] = '1'


________________________________________


SELECT * FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])




________________________________________


SELECT * FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] is not null




________________________________________


SELECT t1.[Sample ID], t17.[Isolate ID], t1.[Arc1327e Box], t17.[Arc1327e Box] FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] is not null




________________________________________


SELECT t1.[Sample ID], t17.[Isolate ID], t1.[Arc1327e Box], t17.[Arc1327e Box] FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] is not null and t1.[Sample ID] is not null




________________________________________


SELECT t1.[Sample ID], t17.[Isolate ID], t1.[Arc1327e Box], t17.[Arc1327e Box] FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] is null and t1.[Sample ID] is null




________________________________________


SELECT t1.[Sample ID], t17.[Isolate ID], t1.[Arc1327e Box], t17.[Arc1327e Box] FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] is null 
  --and t1.[Sample ID] is null




________________________________________


SELECT t1.[Sample ID], t17.[Isolate ID], t1.[Arc1327e Box], t17.[Arc1327e Box] FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where --t17.[Isolate ID] is null 
  --and 
  t1.[Sample ID] is null




________________________________________


SELECT t1.[Sample ID], t17.[Isolate ID], t1.[Arc1327e Box], t17.[Arc1327e Box] FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] <> ' '
 -- and t1.[Sample ID] is not like ' %'




________________________________________


SELECT t1.[Sample ID], t17.[Isolate ID], t1.[Arc1327e Box], t17.[Arc1327e Box] FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] <> ' '
  
  --and t1.[Sample ID] is <> ' '




________________________________________


SELECT t1.[Sample ID], t17.[Isolate ID], t1.[Arc1327e Box], t17.[Arc1327e Box] FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  left join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] <> ' '
  
  --and t1.[Sample ID] is <> ' '




________________________________________


SELECT t1.[Sample ID], t17.[Isolate ID], t1.[Arc1327e Box], t17.[Arc1327e Box] FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  left join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] <> ' '
  and t1.[Sample ID] <> ' '




________________________________________


SELECT count(*)
  FROM [table_Sorted_Arc1327es_SUBS_CPs30Aug.csv] t1
  left join [table_Sorted_Arc1327es_SUBS_CPs_Annie_18Sept.csv] t17 on (t1.[Sample ID] = t17.[Isolate ID])
  where t17.[Isolate ID] <> ' '
  and t1.[Sample ID] <> ' '




________________________________________


SELECT * FROM [table_t01_30Aug.csv] t01
  join [table_t02_30Aug_1.csv] t02 on(t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT * FROM [table_t01_30Aug.csv] t01
  full outer join [table_t02_30Aug_1.csv] t02 on(t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(*) FROM [table_t01_30Aug.csv] t01
  join [table_t02_30Aug_1.csv] t02 on(t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(t01.[Isolate ID]) FROM [table_t01_30Aug.csv] t01
  join [table_t02_30Aug_1.csv] t02 on(t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(*) FROM [188].[table_t01_30Aug.csv]


________________________________________


SELECT count(*) FROM [188].[table_t02_30Aug_1.csv]


________________________________________


SELECT count(t01.[Isolate ID]) FROM [table_t01_30Aug.csv] t01
  join [table_t02_30Aug_1.csv] t02 on (t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT t01.[Isolate ID], t02.[Isolate ID] FROM [table_t01_30Aug.csv] t01
  join [table_t02_30Aug_1.csv] t02 on (t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(*) FROM [table_t01_30Aug.csv] t01
  join [table_t02_30Aug_1.csv] t02 on (t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(*) FROM [table_t01_30Aug.csv] t01
  left join [table_t02_30Aug_1.csv] t02 on (t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(*) FROM [table_t01_30Aug.csv] t01
  left outer join [table_t02_30Aug_1.csv] t02 on (t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(*) FROM [table_t01_30Aug.csv] t01
  full outer join [table_t02_30Aug_1.csv] t02 on (t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(*) FROM [table_t01_30Aug.csv] t01
  right outer join [table_t02_30Aug_1.csv] t02 on (t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(*) FROM [table_t01_30Aug.csv] t01
  right join [table_t02_30Aug_1.csv] t02 on (t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT count(*) FROM [table_t01_30Aug.csv] t01
  inner join [table_t02_30Aug_1.csv] t02 on (t01.[Isolate ID] = t02.[Isolate ID])



________________________________________


SELECT t1.[Isolate ID], t2.[Isolate ID], t1.[Arc1327e Box], t2.[Arc1327e Box] FROM [table_t01_30Aug.csv] t1
  join [table_t02_30Aug_1.csv] t2 on (t1.[Isolate ID] = t2.[Isolate ID])



________________________________________


SELECT t1.[Isolate ID], t2.[Isolate ID], t1.[Arc1327e Box], t2.[Arc1327e Box] FROM [table_t01_30Aug.csv] t1
  join [table_t02_30Aug_1.csv] t2 on (t1.[Isolate ID] = t2.[Isolate ID])
  where t1.[Isolate ID] is not null and t2.[Isolate ID] is not null



________________________________________


SELECT t1.[Isolate ID], t2.[Isolate ID], t1.[Arc1327e Box], t2.[Arc1327e Box] FROM [table_t01_30Aug.csv] t1
  join [table_t02_30Aug_1.csv] t2 on (t1.[Isolate ID] = t2.[Isolate ID])
  where t1.[Isolate ID] <> ' ' and t2.[Isolate ID] <> ' '



________________________________________


SELECT count(t1.[Isolate ID])
  -- , t2.[Isolate ID], t1.[Arc1327e Box], t2.[Arc1327e Box]
  FROM [table_t01_30Aug.csv] t1
  join [table_t02_30Aug_1.csv] t2 on (t1.[Isolate ID] = t2.[Isolate ID])
  where t1.[Isolate ID] <> ' ' and t2.[Isolate ID] <> ' '



________________________________________


SELECT count(t1.[Isolate ID])
  -- , t2.[Isolate ID], t1.[Arc1327e Box], t2.[Arc1327e Box]
  FROM [table_t01_30Aug.csv] t1
  join [table_t02_30Aug_1.csv] t2 on (t1.[Isolate ID] = t2.[Isolate ID])
  --where t1.[Isolate ID] <> ' ' and t2.[Isolate ID] <> ' '



________________________________________


SELECT count(t1.[Isolate ID])
  FROM [table_t01_30Aug.csv] t1


________________________________________


SELECT count(t2.[Isolate ID])
  FROM [table_t02_30Aug_1.csv] t2


________________________________________


SELECT DISTINCT EC_Number FROM [188].[table_ec_pdb_genus.csv]


________________________________________


SELECT DISTINCT EC_Number, '1' as InPdb FROM [188].[table_ec_pdb_genus.csv]


________________________________________


SELECT * FROM [188].[table_ec_pdb_genus.csv]


________________________________________


SELECT 
  'INSERT INTO EcNumberPdbIdGenus (EcNumber,PDBID,Genus) VALUES (''' + ec_Number + ''',''' + pdbid + ''',''' + genus + ''')' as Statement
  
  
  FROM [188].[table_ec_pdb_genus.csv]


________________________________________


SELECT 
  *  
  FROM [188].[table_ec_pdb_genus.csv]


________________________________________


SELECT 
  *  
  FROM [188].[table_ec_pdb_genus.csv]
  WHERE Genus LIKE '%''%'



________________________________________


SELECT 
  Distinct GENUS  
  FROM [188].[table_ec_pdb_genus.csv]
  WHERE Genus LIKE '%''%'



________________________________________


SELECT 
  * 
  FROM [188].[table_ec_pdb_genus.csv]
  WHERE len(genus) > 50



________________________________________


SELECT 
  * 
  FROM [188].[table_ec_pdb_genus.csv]
  WHERE len(genus) > 49



________________________________________


SELECT 
  DISTINCT Len(GENUS) as GenusLength 
  FROM [188].[table_ec_pdb_genus.csv]
ORDER BY GenusLength DESC



________________________________________


SELECT 
  *
  FROM [188].[table_ec_pdb_genus.csv]
WHERE GENUS = 'SARS'



________________________________________


SELECT Count(*) FROM [188].[table_ec_pdb_genus.csv]


________________________________________


SELECT 
  'INSERT INTO EcNumber (EcNumber, EnzymeName) VALUES (''' + EcNumber + ''',''' + EnzymeName + ''')' as STATEMENT 
FROM [188].[table_EcNumbersEcNames.csv]


________________________________________


select sub.subject_id, iso.[all lowercase]
  from [table_isolate_id_mapping.csv] iso
  join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)



________________________________________


select count(iso.[all lowercase])
  from [table_isolate_id_mapping.csv] iso
  join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)



________________________________________


select count(iso.[all lowercase])
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)



________________________________________


select count(iso.[all lowercase])
  from [table_isolate_id_mapping.csv] iso
  full outer join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)



________________________________________


select count(iso.[all lowercase])
  from [table_isolate_id_mapping.csv] iso
  full join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)



________________________________________


select count(iso.[all lowercase])
  from [table_isolate_id_mapping.csv] iso
  left outer join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)



________________________________________


select count(iso.[all lowercase])
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)



________________________________________


select count(iso.[all lowercase])
  from [table_isolate_id_mapping.csv] iso
  right join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)



________________________________________


select count(iso.[all lowercase])
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)



________________________________________


select sub.subject_id, iso.[all lowercase]
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)


________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)



________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  where sbn.sub_bag_no is not null and sbn.sub_bag_no <> ''



________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)



________________________________________


SELECT 
  
  REPLACE(EnzymeName, '''', '''''')  
  
  FROM [188].[table_EcNumbersEcNames.csv]


________________________________________


SELECT 
  
  REPLACE(EnzymeName, '''', '''''')  
  
  FROM [188].[table_EcNumbersEcNames.csv]
  
  WHERE EcNumber = '2.7.99.B1'


________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)



________________________________________


SELECT 
  
  Rtrim(LTrim(REPLACE(EnzymeName, '''', '''''')))  
  
  FROM [188].[table_EcNumbersEcNames.csv]
  




________________________________________


SELECT 
  'INSERT INTO EcNumber (EcNumber, EnzymeName) VALUES (''', EcNumber + ''',''' + Rtrim(LTrim(REPLACE(EnzymeName, '''', ''''''))) + '',')' as Statement  
  
  FROM [188].[table_EcNumbersEcNames.csv]
  




________________________________________


SELECT 
  'INSERT INTO EcNumber (EcNumber, EnzymeName) VALUES (''' + EcNumber + ''',''' + Rtrim(LTrim(REPLACE(EnzymeName, '''', ''''''))) + '',')' as Statement  
  
  FROM [188].[table_EcNumbersEcNames.csv]
  




________________________________________


SELECT 
  'INSERT INTO EcNumber (EcNumber, EnzymeName) VALUES (''' + EcNumber + ''',''' + Rtrim(LTrim(REPLACE(EnzymeName, '''', ''''''))) + ''')' as Statement  
  
  FROM [188].[table_EcNumbersEcNames.csv]
  




________________________________________


SELECT 
  Max(Len(EnzymeName))  
  FROM [188].[table_EcNumbersEcNames.csv]
  
  




________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)



________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)



________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)



________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2, r.to_be_regrown
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)
  left join [table_isolate_11to_be_regrown.csv] r on (r.isolate_id = iso.isolate_id)



________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2, r.to_be_regrown, a.arc1327e_q, ab.arc1327e_box, l.location, ad.arc1327e_date
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)
  left join [table_isolate_11to_be_regrown.csv] r on (r.isolate_id = iso.isolate_id)
  left join [table_isolate_12arc1327e_q.csv] a on (a.isolate_id = iso.isolate_id)
  left join [table_isolate_13arc1327e_box.csv] ab on (ab.isolate_id = iso.isolate_id)
  left join [table_isolate_14location.csv] l on (l.isolate_id = iso.isolate_id)
  left join [table_isolate_15arc1327e_date.csv] ad on (ad.isolate_id = iso.isolate_id)
  


________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2, r.to_be_regrown, a.arc1327e_q, ab.arc1327e_box, l.location, ad.arc1327e_date, n.notes
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)
  left join [table_isolate_11to_be_regrown.csv] r on (r.isolate_id = iso.isolate_id)
  left join [table_isolate_12arc1327e_q.csv] a on (a.isolate_id = iso.isolate_id)
  left join [table_isolate_13arc1327e_box.csv] ab on (ab.isolate_id = iso.isolate_id)
  left join [table_isolate_14location.csv] l on (l.isolate_id = iso.isolate_id)
  left join [table_isolate_15arc1327e_date.csv] ad on (ad.isolate_id = iso.isolate_id)
  left join [table_isolate_16notes.csv] n on (n.isolate_id = iso.isolate_id)


________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2, r.to_be_regrown, a.arc1327e_q, ab.arc1327e_box, l.location, ad.arc1327e_date, n.notes
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)
  left join [table_isolate_11to_be_regrown.csv] r on (r.isolate_id = iso.isolate_id)
  left join [table_isolate_12arc1327e_q.csv] a on (a.isolate_id = iso.isolate_id)
  left join [table_isolate_13arc1327e_box.csv] ab on (ab.isolate_id = iso.isolate_id)
  left join [table_isolate_14location.csv] l on (l.isolate_id = iso.isolate_id)
  left join [table_isolate_15arc1327e_date.csv] ad on (ad.isolate_id = iso.isolate_id)
  left join [table_isolate_16notes.csv] n on (n.isolate_id = iso.isolate_id)
  where n.notes is not null



________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2, r.to_be_regrown, a.arc1327e_q, ab.arc1327e_box, l.location, ad.arc1327e_date, n.notes
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)
  left join [table_isolate_11to_be_regrown.csv] r on (r.isolate_id = iso.isolate_id)
  left join [table_isolate_12arc1327e_q.csv] a on (a.isolate_id = iso.isolate_id)
  left join [table_isolate_13arc1327e_box.csv] ab on (ab.isolate_id = iso.isolate_id)
  left join [table_isolate_14location.csv] l on (l.isolate_id = iso.isolate_id)
  left join [table_isolate_15arc1327e_date.csv] ad on (ad.isolate_id = iso.isolate_id)
  left join [table_isolate_16notes.csv] n on (n.isolate_id = iso.isolate_id)



________________________________________


select count([all lowercase]) from Lakey_join_columns_on_isolateID


________________________________________


select distinct count([all lowercase]) from Lakey_join_columns_on_isolateID


________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2, r.to_be_regrown, a.arc1327e_q, ab.arc1327e_box, l.location, ad.arc1327e_date, n.notes
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)
  left join [table_isolate_11to_be_regrown.csv] r on (r.isolate_id = iso.isolate_id)
  left join [table_isolate_12arc1327e_q.csv] a on (a.isolate_id = iso.isolate_id)
  left join [table_isolate_13arc1327e_box.csv] ab on (ab.isolate_id = iso.isolate_id)
  left join [table_isolate_14location.csv] l on (l.isolate_id = iso.isolate_id)
  left join [table_isolate_15arc1327e_date.csv] ad on (ad.isolate_id = iso.isolate_id)
  left join [table_isolate_16notes.csv] n on (n.isolate_id = iso.isolate_id)


________________________________________


select distinct count([all lowercase]) from [table_isolate_id_mapping.csv]


________________________________________


select distinct count([isolate_id]) from [table_isolate_id_mapping.csv]


________________________________________


select * from [table_isolate_id_mapping.csv]
  where isolate_id like '%-%'



________________________________________


select * from [table_isolate_id_mapping.csv]
  where isolate_id like '% - %'



________________________________________


select * from [table_isolate_id_mapping.csv]
  where isolate_id like '330%-%'



________________________________________


select * from [table_isolate_id_mapping.csv]
  where isolate_id like '330 m-%'



________________________________________


select * from [table_isolate_id_mapping.csv]
  where isolate_id like '330 m -%'



________________________________________


select * from [table_isolate_id_mapping.csv]
  where isolate_id like '330 m%6%'



________________________________________


select * from [table_isolate_id_mapping.csv]
  where isolate_id like '330 m%6% '



________________________________________


select * from [table_isolate_id_mapping.csv]
  where isolate_id like '% -% '



________________________________________


select * from [table_isolate_id_mapping.csv]
  where isolate_id like '% -%'



________________________________________


select * from Lakey_join_columns_on_isolateID
  where subject_id is null


________________________________________


select * 
  from [ec_pathway.csv]




________________________________________


select * 
  from [ec_pathway.csv]
  where ec_number ='2.3.2.2'




________________________________________


select sub.subject_id, iso.[all lowercase], sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2, r.to_be_regrown, a.arc1327e_q, ab.arc1327e_box, l.location, ad.arc1327e_date, n.notes
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)
  left join [table_isolate_11to_be_regrown.csv] r on (r.isolate_id = iso.isolate_id)
  left join [table_isolate_12arc1327e_q.csv] a on (a.isolate_id = iso.isolate_id)
  left join [table_isolate_13arc1327e_box.csv] ab on (ab.isolate_id = iso.isolate_id)
  left join [table_isolate_14location.csv] l on (l.isolate_id = iso.isolate_id)
  left join [table_isolate_15arc1327e_date.csv] ad on (ad.isolate_id = iso.isolate_id)
  left join [table_isolate_16notes.csv] n on (n.isolate_id = iso.isolate_id)



________________________________________


select * from Lakey_join_columns_on_isolateID


________________________________________


select subject_id, [all lowercase], sub_bag_no, sub_q, date, date_trashed, cp_q, cp_bag_no, date_2, date_trashed_2, to_be_regrown, arc1327e_q, arc1327e_box, location, well, arc1327e_date, notes
  from Lakey_join_columns_on_isolateID l
  left join [table_empty_locations_in_boxes.csv] e on (e.Well = l.location)
  order by e.[Order]



________________________________________


select subject_id, [all lowercase], sub_bag_no, sub_q, date, date_trashed, cp_q, cp_bag_no, date_2, date_trashed_2, to_be_regrown, arc1327e_q, arc1327e_box, location, well, arc1327e_date, notes
  from Lakey_join_columns_on_isolateID l
  full outer join [table_empty_locations_in_boxes.csv] e on (e.Well = l.location)
  order by e.[Order]



________________________________________


select * 
  from [ec_pathway.csv]
  where ec_number ='1.16.3.1'




________________________________________


select l.[all lowercase], l.location, e.well
  from Lakey_join_columns_on_isolateID l
  full outer join [table_empty_locations_in_boxes.csv] e on (e.Well = l.location)
  order by e.[Order]



________________________________________


select distinct iso.[all lowercase], sub.subject_id, sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2, r.to_be_regrown, a.arc1327e_q, ab.arc1327e_box, l.location, ad.arc1327e_date, n.notes
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)
  left join [table_isolate_11to_be_regrown.csv] r on (r.isolate_id = iso.isolate_id)
  left join [table_isolate_12arc1327e_q.csv] a on (a.isolate_id = iso.isolate_id)
  left join [table_isolate_13arc1327e_box.csv] ab on (ab.isolate_id = iso.isolate_id)
  left join [table_isolate_14location.csv] l on (l.isolate_id = iso.isolate_id)
  left join [table_isolate_15arc1327e_date.csv] ad on (ad.isolate_id = iso.isolate_id)
  left join [table_isolate_16notes.csv] n on (n.isolate_id = iso.isolate_id)



________________________________________


select * 
  from [ec_pathway.csv]
  where ec_number ='2.1.1.79'




________________________________________


SELECT distinct nw.isolate_id
  FROM [table_nearly_winnowed_subqry.csv] nw


________________________________________


SELECT distinct n.isolate_id, s.subject_ids, n.sub_bag_no, n.sub_q, n.date, n.date_trashed, n.cp_q, n.cp_bag_no, n.date_2, n.date_trashed_2, n.to_be_regrown, n.arc1327e_q, a.concat_arc1327e_boxes, l.concat_locations, ad.concat_arc1327e_dates, n.notes
  FROM [table_nearly_winnowed_subqry.csv] n
  full outer join [table_isol_concat_subj_id.csv] s on (s.isolate_id = n.isolate_id)
  full outer join [table_isol_concat_arch_box.csv] a on (a.isolate_id = n.isolate_id)
  full outer join [table_isol_concat_locn.csv] l on (l.isolate_id = n.isolate_id)
  full outer join [table_isol_concat_arch_date.csv] ad on (ad.isolate_id = n.isolate_id)



________________________________________


select e.well, e.[Order], e.Box, n.isolate_id, n.subject_ids, n.sub_bag_no, n.sub_q, n.date, n.date_trashed, n.cp_q, n.cp_bag_no, n.date_2, n.date_trashed_2, n.to_be_regrown, n.arc1327e_q, n.concat_arc1327e_boxes, n.concat_locations, n.concat_arc1327e_dates, n.notes
  from [table_empty_locations_in_boxes.csv] e
  full outer join nearly_winnowed_join_concat_fields n on (e.well = n.concat_locations)



________________________________________


select e.well, e.[Order], e.Box, n.isolate_id, n.subject_ids, n.sub_bag_no, n.sub_q, n.date, n.date_trashed, n.cp_q, n.cp_bag_no, n.date_2, n.date_trashed_2, n.to_be_regrown, n.arc1327e_q, n.concat_arc1327e_boxes, n.concat_locations, n.concat_arc1327e_dates, n.notes
  from [table_empty_locations_in_boxes.csv] e
  full outer join nearly_winnowed_join_concat_fields n on (e.well = n.concat_locations)
  order by e.[Order]



________________________________________


select distinct e.[Order], e.well, e.Box, n.isolate_id, n.subject_ids, n.sub_bag_no, n.sub_q, n.date, n.date_trashed, n.cp_q, n.cp_bag_no, n.date_2, n.date_trashed_2, n.to_be_regrown, n.arc1327e_q, n.concat_arc1327e_boxes, n.concat_locations, n.concat_arc1327e_dates, n.notes
  from [table_empty_locations_in_boxes.csv] e
  full outer join nearly_winnowed_join_concat_fields n on (e.well = n.concat_locations)
  order by e.[Order]



________________________________________


SELECT distinct n.isolate_id, s.subject_ids, n.sub_bag_no, n.sub_q, n.date, n.date_trashed, n.cp_q, n.cp_bag_no, n.date_2, n.date_trashed_2, n.to_be_regrown, n.arc1327e_q, a.concat_arc1327e_boxes, l.concat_locations, ad.concat_arc1327e_dates, n.notes
  FROM [table_nearly_winnowed_subqry.csv] n
  full outer join [table_isol_concat_subj_id.csv] s on (s.isolate_id = n.isolate_id)
  full outer join [table_isol_concat_arch_box.csv] a on (a.isolate_id = n.isolate_id)
  full outer join [table_isol_concat_locn.csv] l on (l.isolate_id = n.isolate_id)
  full outer join [table_isol_concat_arch_date.csv] ad on (ad.isolate_id = n.isolate_id)



________________________________________


select distinct iso.all_lowercase, sub.subject_id, sbn.sub_bag_no, sq.sub_q, d.date, dt.date_trashed, cp.cp_q, cbn.cp_bag_no, d2.date_2, dt2.date_trashed_2, r.to_be_regrown, a.arc1327e_q, ab.arc1327e_box, l.location, ad.arc1327e_date, n.notes
  from [table_isolate_id_mapping.csv] iso
  left join [table_isolate_1subject.csv] sub on (sub.isolate_id = iso.isolate_id)
  left join [table_isolate_3sub_bag_no.csv] sbn on (sbn.isolate_id = iso.isolate_id)
  left join [table_isolate_4sub_q.csv] sq on (sq.isolate_id = iso.isolate_id)
  left join [table_isolate_5date.csv] d on (d.isolate_id = iso.isolate_id)
  left join [table_isolate_6date_trashed.csv] dt on (dt.isolate_id = iso.isolate_id)
  left join [table_isolate_7cp_q.csv] cp on (cp.isolate_id = iso.isolate_id)
  left join [table_isolate_8cp_bag_no.csv] cbn on (cbn.isolate_id = iso.isolate_id)
  left join [table_isolate_9date_2.csv] d2 on (d2.isolate_id = iso.isolate_id)
  left join [table_isolate_10date_trashed_2.csv] dt2 on (dt2.isolate_id = iso.isolate_id)
  left join [table_isolate_11to_be_regrown.csv] r on (r.isolate_id = iso.isolate_id)
  left join [table_isolate_12arc1327e_q.csv] a on (a.isolate_id = iso.isolate_id)
  left join [table_isolate_13arc1327e_box.csv] ab on (ab.isolate_id = iso.isolate_id)
  left join [table_isolate_14location.csv] l on (l.isolate_id = iso.isolate_id)
  left join [table_isolate_15arc1327e_date.csv] ad on (ad.isolate_id = iso.isolate_id)
  left join [table_isolate_16notes.csv] n on (n.isolate_id = iso.isolate_id)



________________________________________


select count(*) 
  from [ec_pathway.csv]



________________________________________


select pathway_id
  from [pathways_by_ssgcid_enzyme.csv]
except
  select pathway_id
  from [ec_pathway_biocyc.csv]



________________________________________


SELECT * FROM [188].[table_ec_pathway_biocyc.csv]
  order by pathway_id



________________________________________


select count(*) from [ec_pathway_biocyc.csv]


________________________________________


select count(*) from [ec_pathway.csv]


________________________________________


select l.subject_id, l.all_lowercase, l.sub_bag_no, l.sub_q, l.[date], l.date_trashed, l.cp_q, l.cp_bag_no, l.date_2, l.date_trashed_2, l.to_be_regrown, l.arc1327e_q, l.arc1327e_box, l.location, e.Box, e.well, l.arc1327e_date, l.notes
  from Lakey_join_columns_on_distinct_isolateID_v2 l
  join [table_empty_locations_in_boxes.csv] e on (e.Well = l.location and e.Box = l.arc1327e_box and e.Box not like '%,%' and l.arc1327e_box not like '%,%' and e.Box not like '%*' and l.arc1327e_box not like '%*')
  order by e.[Order]


________________________________________


select l.subject_id, l.all_lowercase, l.sub_bag_no, l.sub_q, l.[date], l.date_trashed, l.cp_q, l.cp_bag_no, l.date_2, l.date_trashed_2, l.to_be_regrown, l.arc1327e_q, l.arc1327e_box, l.location, e.Box, e.well, l.arc1327e_date, l.notes
  from Lakey_join_columns_on_distinct_isolateID_v2 l
  join [table_empty_locations_in_boxes.csv] e on (e.Well = l.location and e.Box = l.arc1327e_box and l.arc1327e_box not like '%,%' and l.arc1327e_box not like '%*')
  order by e.[Order]


________________________________________


select l.subject_id, l.all_lowercase, l.sub_bag_no, l.sub_q, l.[date], l.date_trashed, l.cp_q, l.cp_bag_no, l.date_2, l.date_trashed_2, l.to_be_regrown, l.arc1327e_q, l.arc1327e_box, l.location, e.Box, e.well, l.arc1327e_date, l.notes
  from [table_empty_locations_in_boxes.csv] e 
  join Lakey_join_columns_on_distinct_isolateID_v2 l on (e.Well = l.location and e.Box = l.arc1327e_box and l.arc1327e_box not like '%,%' and l.arc1327e_box not like '%*')
  order by e.[Order]


________________________________________


select l.subject_id, l.all_lowercase, l.sub_bag_no, l.sub_q, l.[date], l.date_trashed, l.cp_q, l.cp_bag_no, l.date_2, l.date_trashed_2, l.to_be_regrown, l.arc1327e_q, l.arc1327e_box, l.location, e.Box, e.well, l.arc1327e_date, l.notes
  from [table_empty_locations_in_boxes.csv] e 
  left join Lakey_join_columns_on_distinct_isolateID_v2 l on (e.Well = l.location and e.Box = l.arc1327e_box and l.arc1327e_box not like '%,%' and l.arc1327e_box not like '%*')
  order by e.[Order]


________________________________________


select l.subject_id, l.all_lowercase, l.sub_bag_no, l.sub_q, l.[date], l.date_trashed, l.cp_q, l.cp_bag_no, l.date_2, l.date_trashed_2, l.to_be_regrown, l.arc1327e_q, l.arc1327e_box, l.location, e.Box, e.well, l.arc1327e_date, l.notes
  from [table_empty_locations_in_boxes.csv] e 
  left join Lakey_join_columns_on_distinct_isolateID_v2 l on (e.Well = l.location and e.Box = l.arc1327e_box and l.arc1327e_box not like '%,%' and l.arc1327e_box not like '%*' and e.Box < 31)
  order by e.[Order]


________________________________________


select count(*) 
  from [xstal_tracker.csv]
  where [crystals?] is not null



________________________________________


select [protein code-1]
  from [xstal_tracker.csv]
 



________________________________________


select a.* from 
  [anacor_cttdb_proteins.csv] a
  where exists
  (
    select * from [xstal_tracker.csv] x
    where x.[protein code-1] = a.proteinssgcidid
  )



________________________________________


select a.* from 
  [anacor_cttdb_proteins.csv] a
  where exists
  (
    select * from [xstal_tracker.csv] x
    where x.[protein code-1] = a.proteinssgcidid
    and [Crystals?] = 'FALSE'
  )



________________________________________


select a.* from 
  [anacor_cttdb_proteins.csv] a
  join [xstal_tracker.csv] x on (x.[protein code-1] = a.proteinssgcidid and [Crystals?] = 'FALSE')




________________________________________


select x.[Crystals?], a.* from 
  [anacor_cttdb_proteins.csv] a
  join [xstal_tracker.csv] x on (x.[protein code-1] = a.proteinssgcidid and x.[Crystals?] = 'FALSE')




________________________________________


select a.*, x.[Crystals?] from 
  [anacor_cttdb_proteins.csv] a
  join [xstal_tracker.csv] x on (x.[protein code-1] = a.proteinssgcidid and x.[Crystals?] = 'FALSE')




________________________________________


select a.*, x.[Crystals?] from 
  [anacor_cttdb_proteins.csv] a
  join [xstal_tracker.csv] x on ( (x.[protein code-1] = a.proteinssgcidid) and x.[Crystals?] = 'FALSE')




________________________________________


select u.[ec numbers] as enzyme, a.* 
  from report_anacor a
  join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)
  
  



________________________________________


select count(*) from
  (select u.[ec numbers] as enzyme, a.* 
  from report_anacor a
  join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)
  ) as foo
  



________________________________________


select count(*) from
  (select u.[ec numbers] as enzyme, a.* 
  from report_anacor a
  left join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)
  ) as foo
  



________________________________________


select count(*) from
  (select u.[ec numbers] as enzyme, a.* 
  from report_anacor a
  left outer join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)
  ) as foo
  



________________________________________


select count(*) from
  (select u.[ec numbers] as enzyme, a.* 
  from report_anacor a
  right join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)
  ) as foo
  



________________________________________


select count(*) from
  (select u.[ec numbers] as enzyme, a.* 
  from report_anacor a
  left join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)
  ) as foo
  



________________________________________


select u.[ec numbers] as enzyme, a.* 
  from report_anacor a
  left join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)




________________________________________


select u.[ec numbers] as enzyme, a.proteinssgcidid
  from report_anacor a
  left join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)




________________________________________


select u.[ec numbers] as enzyme, a.proteinssgcidid
  from report_anacor a
  join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)




________________________________________


select count(*)
  from
  (select u.[ec numbers] as enzyme, a.proteinssgcidid
  from report_anacor a
  join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)
  join [ec_pathway_biocyc.csv] e on (e.ec_number = u.[ec numbers])
  ) as foo



________________________________________


select u.[ec numbers] as enzyme, e.enzyme_name, a.proteinssgcidid
  from report_anacor a
  join [uniprot_enzyme_map.csv] u on (u.accession = a.uniprot)
  join [ec_pathway_biocyc.csv] e on (e.ec_number = u.[ec numbers])




________________________________________


select * from
  [pathways_by_ssgcid_enzyme.csv]
  where pathway_name like '%<%'



________________________________________


select * from
  [pathways_by_ssgcid_enzyme.csv]
  where pathway_name like '%&%'



________________________________________


select * from [xstal_tracker.csv]
where [Protein Code-1] like 'EnhiA.00182%'


________________________________________


select *
  from [xstal_tracker.csv]


________________________________________


select *
  from [xstal_tracker.csv]
  where [initial trials set up] < '05-01-2011'



________________________________________


select count(*)
  from [xstal_tracker.csv]
  where [initial trials set up] < '05-01-2011'



________________________________________


select count(*)
  from [xstal_tracker.csv]
--  where [initial trials set up] < '05-01-2011'



________________________________________


select count(*)
  from [xstal_tracker.csv]
  where [initial trials set up] < '05-01-11'



________________________________________


select count(*) 
  from [xstal_tracker.csv]



________________________________________


select count(*) 
  from [xstal_tracker.csv]
  where [Initial trials set up] < '08-01-2011'



________________________________________


select *
  from [xstal_tracker.csv]
  where [Initial trials set up] < '08-01-2011'
  order by [Initial trials set up] desc



________________________________________


select count(*)
  from [xstal_tracker.csv]
  where [Initial trials set up] < '08-01-2011'




________________________________________


select count(*)
  from [xstal_tracker.csv]
--  where [Initial trials set up] < '08-01-2011'




________________________________________


select *
  from [xstal_tracker.csv]
  where [Initial trials set up] < '08-01-2011'




________________________________________


select [crystals?], count ([protein code-1])
  from [xstal_tracker.csv]
  where [Initial trials set up] < '08-01-2011'
  group by [crystals?]




________________________________________


select [crystals?], count (distinct [protein code-1])
  from [xstal_tracker.csv]
  where [Initial trials set up] < '08-01-2011'
  group by [crystals?]




________________________________________


select * 
  from [xstal_tracker.csv] x
  join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])



________________________________________


select count(*) 
  from [xstal_tracker.csv] x
  join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])



________________________________________


select count(*) 
  from [xstal_tracker.csv] x
--  join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])



________________________________________


select count(*) 
  from [xstal_tracker.csv] x
  join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])



________________________________________


select count(*) 
  from [xstal_tracker.csv] x
  join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'



________________________________________


select count(*) 
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'



________________________________________


select count([Protein Code-1]) 
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'



________________________________________


select count(distinct [Protein Code-1]) 
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'



________________________________________


select count([Protein Code-1]) 
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'



________________________________________


select [crystals?], count([Protein Code-1]) 
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'
  group by [crystals?]



________________________________________


select [crystals?], cleaved, count([Protein Code-1]) 
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'
  group by [crystals?], cleaved



________________________________________


select [crystals?], cleaved, [Protein Code-1]
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'
  and cleaved is null



________________________________________


select [crystals?], cleaved, [Protein Code-1]
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'
  and cleaved is null
 and [crystals?] = 'TRUE'



________________________________________


select [crystals?], cleaved, [Protein Code-1]
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'
  and cleaved is null
 and [crystals?] = 'TRUE'
 and top_pdb is not null



________________________________________


select [crystals?], cleaved, count([Protein Code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'
group by [crystals?], cleaved



________________________________________


select [crystals?], cleaved, count([Protein Code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'
  and top_pdb is not null
group by [crystals?], cleaved



________________________________________


select [crystals?], cleaved, count([Protein Code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1] and top_pdb is not null)
  where [Initial trials set up] < '08-01-2011'
  
group by [crystals?], cleaved



________________________________________


select [crystals?], cleaved, count([Protein Code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'
  and top_pdb <> ''
group by [crystals?], cleaved



________________________________________


select [crystals?], cleaved, [Protein Code-1], p.*
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[Protein Code-1])
  where [Initial trials set up] < '08-01-2011'
  and top_pdb <> ''
and [crystals?] = 'FALSE'



________________________________________


select count(*)
  from proteins_cleaved_pdb
  where top_pdb <> ''


________________________________________


select ssgcidid
  from proteins_cleaved_pdb
  where top_pdb <> ''
  except
  select [protein code-1]
  from [xstal_tracker.csv]



________________________________________


select ssgcidid, top_pdb
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

  where top_pdb <> ''




________________________________________


select count(ssgcidid)
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

  where top_pdb <> ''




________________________________________


select count(ssgcidid), cleaved
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

  where top_pdb <> ''
  group by cleaved




________________________________________


select count(ssgcidid), cleaved, x.[crystals?]
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

  where top_pdb <> ''
  group by cleaved, x.[crystals?]





________________________________________


select count(ssgcidid), cleaved, x.[crystals?]
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

  where top_pdb <> ''
  group by cleaved, x.[crystals?]





________________________________________


select count(distinct ssgcidid), cleaved, x.[crystals?]
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

  where top_pdb <> ''
  group by cleaved, x.[crystals?]





________________________________________


select count(ssgcidid), cleaved, x.[crystals?]
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

  where top_pdb <> ''
  group by cleaved, x.[crystals?]





________________________________________


select p.*
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

  where top_pdb <> ''
  and x.[crystals?] = 'FALSE'





________________________________________


select p.*, x.*
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

  where top_pdb <> ''
  and x.[crystals?] = 'FALSE'





________________________________________


select x.*
from [xstal_tracker.csv] x 






________________________________________


select x.[crystals?], count(*)
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

group by x.[crystals?]


________________________________________


select x.[crystals?], cleaved, count(*)
  from proteins_cleaved_pdb p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

group by x.[crystals?], cleaved


________________________________________


select x.[crystals?], cleaved, count(*)
  from proteins_cleaved_pdb p
  left join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

group by x.[crystals?], cleaved


________________________________________


select x.[crystals?], cleaved, count([protein code-1])
  from proteins_cleaved_pdb p
  left join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

group by x.[crystals?], cleaved


________________________________________


select x.[crystals?], cleaved, count(distinct [protein code-1])
  from proteins_cleaved_pdb p
  left join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

group by x.[crystals?], cleaved


________________________________________


select x.[crystals?], cleaved, count(distinct ssgcidid)
  from proteins_cleaved_pdb p
  left join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)

group by x.[crystals?], cleaved


________________________________________


select x.[crystals?], cleaved, count(distinct ssgcidid)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (x.[protein code-1] = p.ssgcidid)

group by x.[crystals?], cleaved


________________________________________


select x.[crystals?], cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (x.[protein code-1] = p.ssgcidid)

group by x.[crystals?], cleaved


________________________________________


select x.[crystals?], cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (x.[protein code-1] = p.ssgcidid)

  group by x.[crystals?], cleaved
  order by cleaved



________________________________________


select x.[crystals?], cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (x.[protein code-1] = p.ssgcidid)
where [Initial trials set up] < '08-01-2011'
  group by x.[crystals?], cleaved
  order by cleaved



________________________________________


select x.[crystals?], cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (x.[protein code-1] = p.ssgcidid)
where [Initial trials set up] < '05-01-2011'
  group by x.[crystals?], cleaved
  order by cleaved



________________________________________


select se.ssgcidid, se.uniprot, se.ec_number, ep.pathway_id, ep.pathway_name, se.ec_source, se.ec_source_id, 
  se.annotation, se.genus, se.class, se.superkingdom, se.familyID
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)



________________________________________


select se.ssgcidid, se.uniprot, se.ec_number, ep.pathway_id, ep.pathway_name, se.ec_source, se.ec_source_id, 
  se.annotation, se.genus, se.class, se.superkingdom, se.familyID
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)
  order by se.ec_number



________________________________________


select se.ec_number, ep.pathway_id, ep.pathway_name, se.ec_source, se.ec_source_id, 
  se.annotation, se.genus, se.class, se.superkingdom, se.familyID
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)
  order by se.ec_number



________________________________________


select se.ec_number, ep.pathway_id, ep.pathway_name, se.annotation
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)
  order by se.ec_number



________________________________________


select se.ec_number, ep.pathway_id, ep.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)
  order by se.ec_number



________________________________________


select se.ec_number, ep.pathway_id, ep.pathway_name
  from [ssgcid_EC_map] se
  right join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)
  order by se.ec_number



________________________________________


select se.ec_number, ep.pathway_id, ep.pathway_name
  from [ssgcid_EC_map] se
  right join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)
  order by se.ec_number desc



________________________________________


select distinct se.ec_number, ep.pathway_id, ep.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)
  order by se.ec_number desc



________________________________________


select distinct se.ec_number, ep.pathway_id, ep.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)
  order by se.ec_number



________________________________________


select se.ec_number, ep.pathway_id, ep.pathway_name
  from [ssgcid_EC_map] se
  join [ec_pathway.csv] ep on (se.ec_number = ep.ec_number)
  order by se.ec_number



________________________________________


select * 
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  


________________________________________


select * 
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  left join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  right join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  right join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
--  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
--  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  left join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
--  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
--  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  right join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
--  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  right join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
   join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(top_pdb) 
  from [proteins_cleaved_pdb] p
   join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select count(distinct top_pdb) 
  from [proteins_cleaved_pdb] p
   join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  


________________________________________


select cleaved, count(distinct top_pdb) 
  from [proteins_cleaved_pdb] p
   join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  group by cleaved


________________________________________


select cleaved, count(distinct ssgcidid) 
  from [proteins_cleaved_pdb] p
   join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  group by cleaved


________________________________________


select cleaved, p.top_pdb
  from [proteins_cleaved_pdb] p
   join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'




________________________________________


select cleaved, p.top_pdb
  from [proteins_cleaved_pdb] p
   join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''




________________________________________


select cleaved, count(p.top_pdb)
  from [proteins_cleaved_pdb] p
   join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


select cleaved, count(*)
  from [proteins_cleaved_pdb] p
   join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


select cleaved, count(*)
  from [proteins_cleaved_pdb] p
   right join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


select cleaved, count(*)
  from [proteins_cleaved_pdb] p
   left join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


select cleaved, count(*)
  from [proteins_cleaved_pdb] p
   left outer join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


select cleaved, count(*)
  from [proteins_cleaved_pdb] p
   right outer join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
   right outer join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '01-05-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved




________________________________________


/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select count(*) 
  from [proteins_cleaved_pdb]
  where top_pdb <> ''
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] < '05-01-2011'
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select count(*) 
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '05-01-2011'
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '05-01-2011'
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '05-01-2011'
  order by x.[Initial trials set up] desc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '2011-05-01'
  order by x.[Initial trials set up] desc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '2011'
  order by x.[Initial trials set up] desc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '01-05-2011'
  order by x.[Initial trials set up] desc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '05-01-2011'
  order by x.[Initial trials set up] desc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '05-01-2011'
  order by x.[Initial trials set up] asc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '05-01-2011%'
  order by x.[Initial trials set up] asc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
  and x.[Initial trials set up] > '05-01-2011'
  order by x.[Initial trials set up] asc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
--  and x.[Initial trials set up] > '05-01-2011'
  order by x.[Initial trials set up] asc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  right join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid)
  where top_pdb <> ''
--  and x.[Initial trials set up] > '05-01-2011'
  order by x.[Initial trials set up] asc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid and x.[Initial trials set up] is not null)
  where top_pdb <> ''
--  and x.[Initial trials set up] > '05-01-2011'
  order by x.[Initial trials set up] asc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid and x.[Initial trials set up] <> '')
  where top_pdb <> ''
--  and x.[Initial trials set up] > '05-01-2011'
  order by x.[Initial trials set up] asc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid and x.[Initial trials set up] <> '')
  where top_pdb <> ''
--  and x.[Initial trials set up] > '05-01-2011'
  order by x.[Initial trials set up] desc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid and x.[Initial trials set up] <> '')
  where top_pdb <> ''
--  and x.[Initial trials set up] > '05/01/2011'
  order by x.[Initial trials set up] desc
/*select cleaved, count(*)
  from [xstal_tracker.csv] x
   left join [proteins_cleaved_pdb] p on (x.[protein code-1] = p.ssgcidid)
  where x.[Initial trials set up] < '05-01-2011'
  and top_pdb <> ''
  group by cleaved*/




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid and x.[Initial trials set up] <> '')
  where top_pdb <> ''
--  and x.[Initial trials set up] > '05/01/2011'
  order by x.[Initial trials set up] desc




________________________________________


select x.[Initial trials set up]
  from [proteins_cleaved_pdb] p
  join [xstal_tracker.csv] x on (x.[protein code-1] = p.ssgcidid and x.[Initial trials set up] <> '')
  where top_pdb <> ''
--  and x.[Initial trials set up] > '05/01/2011'
  order by x.[Initial trials set up] asc




________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
--  and x.[Initial trials set up] > '05/01/2011'
  order by x.[Initial trials set up] desc




________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
--  and x.[Initial trials set up] > '05/01/2011'
  order by x.[Initial trials set up] desc




________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
--  and x.[Initial trials set up] > '05/01/2011'
  order by x.[Initial trials set up] asc




________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
--  and x.[Initial trials set up] > '05/01/2011'
  order by x.[Initial trials set up] desc




________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] is null





________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] <> ''





________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] = ''





________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] <> ''





________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] <> ''
  order by x.[Initial trials set up] desc





________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] <> ''
  order by CONVERT(DATETIME, x.[Initial trials set up]) desc





________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] <> ''
  order by CONVERT(DATETIME, x.[Initial trials set up]) asc





________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  order by CONVERT(DATETIME, x.[Initial trials set up]) asc





________________________________________


select x.[Initial trials set up]
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  order by CONVERT(DATETIME, x.[Initial trials set up]) desc





________________________________________


select *
  from [xstal_tracker.csv] x
  where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  





________________________________________


select *
  from [xstal_tracker.csv] x
  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
  where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  





________________________________________


select count(*)
  from [xstal_tracker.csv] x
--  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
--  where x.[Initial trials set up] <> ''
--  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  





________________________________________


select count(*)
  from [xstal_tracker.csv] x
--  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
  where x.[Initial trials set up] <> ''
--  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  





________________________________________


select count(*)
  from [xstal_tracker.csv] x
--  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
--  where x.[Initial trials set up] <> ''
--  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  





________________________________________


select count(*)
  from [xstal_tracker.csv] x
--  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
--  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  





________________________________________


select count(*)
  from [xstal_tracker.csv] x
--  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  





________________________________________


select count(*)
  from [xstal_tracker.csv] x
  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  





________________________________________


select [crystals?], count(*)
  from [xstal_tracker.csv] x
  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by [crystals?]
  





________________________________________


select [crystals?], count(*)
  from [xstal_tracker.csv] x
  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by [crystals?]
  





________________________________________


select [crystals?], count(x.[protein code-1])
  from [xstal_tracker.csv] x
  join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by [crystals?]
  





________________________________________


select [crystals?], count(x.[protein code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by [crystals?]
  





________________________________________


select [crystals?], cleaved, count(x.[protein code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by [crystals?], cleaved
  





________________________________________


select [crystals?], cleaved, count(x.[protein code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
--  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by [crystals?], cleaved
  





________________________________________


select [crystals?], cleaved, count(x.[protein code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by [crystals?], cleaved
  





________________________________________


select  cleaved, count(x.[protein code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by [crystals?], cleaved
  





________________________________________


select  cleaved, count(x.[protein code-1])
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by cleaved
  





________________________________________


select  cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by cleaved
  





________________________________________


select [crystals?], cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  group by [crystals?],cleaved
  





________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
  and [crystals?] = 'TRUE'
  group by cleaved
  





________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
and top_pdb <> ''
  group by cleaved
  





________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
--  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
and top_pdb <> ''
  group by cleaved
  





________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
and top_pdb <> ''
  group by cleaved
  





________________________________________


select cleaved, count(distinct top_pdb)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
and top_pdb <> ''
  group by cleaved
  





________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
and top_pdb <> ''
  group by cleaved
  





________________________________________


select cleaved, count(*)
  from [xstal_tracker.csv] x
  left join proteins_cleaved_pdb p on (p.ssgcidid = x.[protein code-1])
 where x.[Initial trials set up] <> ''
  and CONVERT(DATETIME, x.[Initial trials set up]) < '05-01-2011'
--and top_pdb <> ''
  group by cleaved
  





________________________________________


SELECT 
 
  'INSERT INTO EcPathway (EcNumber, PathwayId, PathwayName) VALUES (''' + ec_number + ''',''' + pathway_id + ''',''' + pathway_name + ''')'
  as Statement
  
  
  
  FROM [188].[ec_pathway_biocyc.csv]


________________________________________


SELECT 
 
  'INSERT INTO EcPathway (EcNumber, PathwayId, PathwayName) VALUES (''' + ec_number + ''',''' + pathway_id + ''',''' + REPLACE(pathway_name, '''','''''')  + ''')'
  as Statement
  
  
  
  FROM [188].[ec_pathway_biocyc.csv]


________________________________________


select * from  [pathways_by_ssgcid_enzyme.csv]
where pathway_id in ('PWY-3162', 'PWY-3941', 'PWY-5397', 'PWY-5839', 'PWY-5856', 'PWY-5857', 'PWY-5871', 'PWY-5872', 'PWY-6185', 'PWY-6435', 'PWY-6837')



________________________________________


select * from  ssgcid_EC_map
where ec_number in ('1.1.1.1', '1.1.1.35', '1.2.99.3', '1.3.1.34', '1.3.99.3', '2.1.1.163', '2.1.1.201', '2.1.1.201', '2.1.1.201', '2.1.1.201', '2.3.1.16', '3.1.1.24', '4.2.1.17')



________________________________________


select * from  ssgcid_EC_map
  where ec_number in ('1.1.1.1', '1.1.1.35', '1.2.99.3', '1.3.1.34', '1.3.99.3', '2.1.1.163', '2.1.1.201', '2.1.1.201', '2.1.1.201', '2.1.1.201', '2.3.1.16', '3.1.1.24', '4.2.1.17')
  order by ec_number


________________________________________


select distinct ec_number from  ssgcid_EC_map
  where ec_number in ('1.1.1.1', '1.1.1.35', '1.2.99.3', '1.3.1.34', '1.3.99.3', '2.1.1.163', '2.1.1.201', '2.1.1.201', '2.1.1.201', '2.1.1.201', '2.3.1.16', '3.1.1.24', '4.2.1.17')
  order by ec_number


________________________________________


select distinct ec_number from  ssgcid_EC_map
  where ec_number in ('1.1.1.1', '1.1.1.35', '1.2.99.3', '1.3.1.34', '1.3.99.3', '2.1.1.163', '2.1.1.201', '2.3.1.16', '3.1.1.24', '4.2.1.17')
  order by ec_number


________________________________________


select p.ec_number, p.pathway_id, p.pathway_name, s.ssgcidid
  from  [pathways_by_ssgcid_enzyme.csv] p
  join ssgcid_EC_map s on (s.ec_number = p.ec_number)
  where p.pathway_id in ('PWY-3162', 'PWY-3941', 'PWY-5397', 'PWY-5839', 'PWY-5856', 'PWY-5857', 'PWY-5871', 'PWY-5872', 'PWY-6185', 'PWY-6435', 'PWY-6837')



________________________________________


select p.ec_number, p.pathway_id, p.pathway_name, s.ssgcidid
  from  [pathways_by_ssgcid_enzyme.csv] p
  join ssgcid_EC_map s on (s.ec_number = p.ec_number)
  where p.pathway_id in ('PWY-3162', 'PWY-3941', 'PWY-5397', 'PWY-5839', 'PWY-5856', 'PWY-5857', 'PWY-5871', 'PWY-5872', 'PWY-6185', 'PWY-6435', 'PWY-6837')
  order by p.ec_number, s.ssgcidid


________________________________________


select distinct p.ec_number, p.pathway_id, p.pathway_name
  from  [pathways_by_ssgcid_enzyme.csv] p
  join ssgcid_EC_map s on (s.ec_number = p.ec_number)
  where p.pathway_id in ('PWY-3162', 'PWY-3941', 'PWY-5397', 'PWY-5839', 'PWY-5856', 'PWY-5857', 'PWY-5871', 'PWY-5872', 'PWY-6185', 'PWY-6435', 'PWY-6837')



________________________________________


select distinct p.ec_number, p.pathway_id, p.pathway_name
  from  [pathways_by_ssgcid_enzyme.csv] p
  join ssgcid_EC_map s on (s.ec_number = p.ec_number)
  where p.pathway_id in ('PWY-3162', 'PWY-3941', 'PWY-5397', 'PWY-5839', 'PWY-5856', 'PWY-5857', 'PWY-5871', 'PWY-5872', 'PWY-6185', 'PWY-6435', 'PWY-6837')
  order by p.ec_number



________________________________________


select distinct p.ec_number, p.pathway_id, p.pathway_name
  from  [pathways_by_ssgcid_enzyme.csv] p
  join ssgcid_EC_map s on (s.ec_number = p.ec_number)
  where p.pathway_id in ('PWY-3162', 'PWY-3941', 'PWY-5397', 'PWY-5839', 'PWY-5856', 'PWY-5857', 'PWY-5871', 'PWY-5872', 'PWY-6185', 'PWY-6435', 'PWY-6837')
  order by p.pathway_id



________________________________________


select *
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select *, [crystals?], [diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select left([protein code-1], 5), [crystals?], [diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select left([protein code-1], 5) as organism, substring([protein code-1], 7, 12)  [crystals?], [diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select left([protein code-1], 5) as organism, substring([protein code-1], 7, 5)  [crystals?], [diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select count(*)
--select left([protein code-1], 5) as organism, substring([protein code-1], 7, 5)  [crystals?], [diffraction?], [data set?]
f
from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select left([protein code-1], 5) as organism, substring([protein code-1], 7, 5)  [crystals?], [diffraction?], [data set?]
from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select left([protein code-1], 5) as organism, substring([protein code-1], 7, 5),  [crystals?], [diffraction?], [data set?]
from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select left([protein code-1], 5) as organism, substring([protein code-1], 7, 5) as family,  [crystals?], [diffraction?], [data set?]
from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select distinct left([protein code-1], 5) as organism, substring([protein code-1], 7, 5) as family,  [crystals?], [diffraction?], [data set?]
from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select distinct substring([protein code-1], 7, 5) as family,  [crystals?], [diffraction?], [data set?]
from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select [protein code-1], substring([protein code-1], 7, 5) as family,  [crystals?], [diffraction?], [data set?]
from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'


________________________________________


select count([protein code-1]), [crystals?], [diffraction?], [data set?]
--substring([protein code-1], 7, 5) as family,  
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
  group by [crystals?], [diffraction?], [data set?]



________________________________________


select count([protein code-1]), [crystals?]--, [diffraction?], [data set?]
--substring([protein code-1], 7, 5) as family,  
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
  group by [crystals?], [diffraction?], [data set?]



________________________________________


select count([protein code-1]), [crystals?]--, [diffraction?], [data set?]
--substring([protein code-1], 7, 5) as family,  
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
  group by [crystals?]--, [diffraction?], [data set?]



________________________________________


select count([protein code-1]), [diffraction?]
--substring([protein code-1], 7, 5) as family,  
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
  group by [diffraction?] --[data set?][crystals?]



________________________________________


select count([protein code-1]), [data set?]
--substring([protein code-1], 7, 5) as family,  
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
  group by  [data set?]--[diffraction?][crystals?]



________________________________________


select count(substring([protein code-1], 7, 5))
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
--  group by  [data set?],[diffraction?],[crystals?]



________________________________________


select count(distinct substring([protein code-1], 7, 5))
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
--  group by  [data set?],[diffraction?],[crystals?]



________________________________________


select count(distinct substring([protein code-1], 7, 7))
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
--  group by  [data set?],[diffraction?],[crystals?]



________________________________________


select distinct substring([protein code-1], 7, 7), [data set?],[diffraction?],[crystals?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
--  group by  [data set?],[diffraction?],[crystals?]



________________________________________


select distinct substring([protein code-1], 7, 7) as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
--  group by  [data set?],[diffraction?],[crystals?]



________________________________________


select [protein code-1] as xstal_trial, left ([protein code-1], 13) as target,  substring([protein code-1], 7, 7) as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
--  group by  [data set?],[diffraction?],[crystals?]



________________________________________


select [protein code-1] as xstal_trial, left ([protein code-1], 13) as feature,  substring([protein code-1], 7, 5) as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'Myth%'
--  group by  [data set?],[diffraction?],[crystals?]



________________________________________


select [protein code-1] as xstal_trial, left ([protein code-1], 13) as feature,  substring([protein code-1], 7, 5) as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'MytuD%'
  and substring([protein code-1], 7, 5)  in
  (select  substring([protein code-1], 7, 5) as family
    from [xstal_tracker.csv] x
  where x.[protein code-1] like 'MythA%'
)




________________________________________


select [protein code-1] as xstal_trial, left ([protein code-1], 13) as feature,  substring([protein code-1], 7, 5) as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'MytuD%'
  and substring([protein code-1], 7, 5)  in
  (select  substring([protein code-1], 7, 5) as family
    from [xstal_tracker.csv] x
  where x.[protein code-1] like 'MythA%'
)




________________________________________


select count([protein code-1]) as xstal_trial--, left ([protein code-1], 13) as feature,  substring([protein code-1], 7, 5) as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'MytuD%'
  and substring([protein code-1], 7, 5)  in
  (select  substring([protein code-1], 7, 5) as family
    from [xstal_tracker.csv] x
  where x.[protein code-1] like 'MythA%'
)




________________________________________


select /* count([protein code-1]) as xstal_trial,*/ left ([protein code-1], 13) as feature --,  substring([protein code-1], 7, 5) as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'MytuD%'
  and substring([protein code-1], 7, 5)  in
  (select  substring([protein code-1], 7, 5) as family
    from [xstal_tracker.csv] x
  where x.[protein code-1] like 'MythA%'
)




________________________________________


select /* count([protein code-1]) as xstal_trial,*/ count(distinct left ([protein code-1], 13) ) --,  substring([protein code-1], 7, 5) as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'MytuD%'
  and substring([protein code-1], 7, 5)  in
  (select  substring([protein code-1], 7, 5) as family
    from [xstal_tracker.csv] x
  where x.[protein code-1] like 'MythA%'
)




________________________________________


select /* count([protein code-1]) as xstal_trial, left ([protein code-1], 13) ,*/  substring([protein code-1], 7, 5) as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'MytuD%'
  and substring([protein code-1], 7, 5)  in
  (select  substring([protein code-1], 7, 5) as family
    from [xstal_tracker.csv] x
  where x.[protein code-1] like 'MythA%'
)




________________________________________


select /* count([protein code-1]) as xstal_trial, left ([protein code-1], 13) ,*/  count( distinct substring([protein code-1], 7, 5) ) --as family,[crystals?],[diffraction?], [data set?]
  from [xstal_tracker.csv]
  where [protein code-1] like 'MytuD%'
  and substring([protein code-1], 7, 5)  in
  (select  substring([protein code-1], 7, 5) as family
    from [xstal_tracker.csv] x
  where x.[protein code-1] like 'MythA%'
)




________________________________________


select count(*)   from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)


________________________________________


select s.ssgcidid, s.uniprot, ec."EC Numbers" as ec_number, ec."Database" as ec_source, ec.enzyme_id as ec_source_id, 
  s.annotation, s.genus, s.class, s.superkingdom, s.familyID
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  
  WHERE  ec."EC Numbers" = '1.14.99.42'



________________________________________


select distinct p.ec_number, p.pathway_id, p.pathway_name
  from  [pathways_by_ssgcid_enzyme.csv] p
  join ssgcid_EC_map s on (s.ec_number = p.ec_number)
  where p.pathway_id in ('PWY-3162')
  order by p.pathway_id



________________________________________


SELECT * FROM [188].[ec_pathway_biocyc.csv]
  WHERE Pathway_ID = 'PWY-3162'



________________________________________


SELECT * FROM 
  [188].[pathways_by_ssgcid_enzyme.csv] 
  WHERE Pathway_ID = 'PWY-3162'



________________________________________


select distinct p.ec_number, p.pathway_id, p.pathway_name
  from  [ec_pathway_biocyc.csv] p
--  join ssgcid_EC_map s on (s.ec_number = p.ec_number)
  where p.pathway_id in ('PWY-3162', 'PWY-3941', 'PWY-5397', 'PWY-5839', 'PWY-5856', 'PWY-5857', 'PWY-5871', 'PWY-5872', 'PWY-6185', 'PWY-6435', 'PWY-6837')
  order by p.pathway_id



________________________________________


select distinct p.ec_number, p.pathway_id, p.pathway_name
  from  [ec_pathway_biocyc.csv] p
  join ssgcid_EC_map s on (s.ec_number = p.ec_number)
  where p.pathway_id in ('PWY-3162', 'PWY-3941', 'PWY-5397', 'PWY-5839', 'PWY-5856', 'PWY-5857', 'PWY-5871', 'PWY-5872', 'PWY-6185', 'PWY-6435', 'PWY-6837')
  order by p.pathway_id



________________________________________


SELECT * FROM [188].[ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID='PWY-3162'



________________________________________


select p.ec_number, p.pathway_id, e.pathway_id, p.pathway_name, e.pathway_name
  from [pathways_by_ssgcid_enzyme.csv] p
  join [ec_pathway_biocyc.csv] e on (e.ec_number = p.ec_number)


________________________________________


SELECT * FROM [188].[ssgcid_EC_map]
  WHERE ec_number = '1.13.99.3'



________________________________________


select e.ec_number, e.pathway_name
  from [ec_pathway_biocyc.csv] e
  join ssgcid_EC_map s on (s.ec_number = e.ec_number) 


________________________________________


select count(*)
  from [ec_pathway_biocyc.csv] e
  join ssgcid_EC_map s on (s.ec_number = e.ec_number) 


________________________________________


select distinct e.ec_number
  from [ec_pathway_biocyc.csv] e
--  join ssgcid_EC_map s on (s.ec_number = e.ec_number) 


________________________________________


select distinct count(e.ec_number)
  from [ec_pathway_biocyc.csv] e
--  join ssgcid_EC_map s on (s.ec_number = e.ec_number) 


________________________________________


select count(distinct ec_number)
  from [ec_pathway_biocyc.csv]


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-3162'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-3162'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-3941'


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-3941'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-3941'


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-3941'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-3941'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-3941'


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-3941'


________________________________________


SELECT * FROM [ssgcid_EC_map]


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.1.1.59',
'2.6.1.18',
'4.2.1.116',
    '6.2.1.17')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.3.99.3')




________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-5397'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.2.99.3')




________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-5397'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.14.99.42')




________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-5839'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('2.5.1.74')




________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-5839'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('2.1.1.163')




________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-5856'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-5856'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('2.1.1.64',
'2.5.1.39')




________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-5857'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('2.1.1.64',
'2.5.1.39')




________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-5857'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('2.1.1.201')




________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-5871'


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-5871'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-5871'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('2.1.1.114')




________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-5872'


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-5872'


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-6185'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-6185'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('5.3.3.4',
'5.4.99.14',
'5.5.1.7')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('3.1.1.24')




________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-6435'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('3.1.2.23',
'6.2.1.12')




________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-6435'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.1.1.35',
'2.3.1.16',
'4.2.1.17')




________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-6837'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-6837'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.3.3.6',
'5.3.3.8')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.3.1.34')




________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-3162'


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-3162'


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-1501'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-1501'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.1.99.31',
'1.2.1.28',
'1.2.1.7',
'4.1.1.7',
'5.1.2.2')




________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE Pathway_ID = 'PWY-2221'


________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE Pathway_ID = 'PWY-2221'


________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.1.1.47',
'1.2.1.3',
'2.7.1.40',
'2.7.1.45',
'3.1.1.17',
'4.1.2.14',
'4.2.1.11',
'4.2.1.39',
'5.1.3.3',
'5.4.2.1')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.1.1.47',
'1.2.1.3',
'2.7.1.40',
'2.7.1.45',
'3.1.1.17',
'4.1.2.14',
'4.2.1.39',
'5.1.3.3',
'5.4.2.1')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.1.1.47',
'2.7.1.40',
'2.7.1.45',
'3.1.1.17',
'4.1.2.14',
'4.2.1.39',
'5.1.3.3',
'5.4.2.1')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.1.1.47',
'2.7.1.40',
'2.7.1.45',
'3.1.1.17',
'4.1.2.14',
'4.2.1.39',
'5.1.3.3')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.1.1.47',
'2.7.1.45',
'3.1.1.17',
'4.1.2.14',
'4.2.1.39',
'5.1.3.3')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.1.1.47',
'2.7.1.45',
'3.1.1.17',
'4.2.1.39',
'5.1.3.3')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('2.7.1.45',
'3.1.1.17',
'4.2.1.39',
'5.1.3.3')




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('3.1.2.4')




________________________________________


SELECT * 
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]
  
  WHERE ec_number = '2.5.1.39'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE ec_number = '2.5.1.39'


________________________________________


SELECT * 
  
  FROM [188].[table_ec_pathway_biocyc.csv]
  
  WHERE ec_number = '2.1.1.201'


________________________________________


SELECT 
  
  COUNT(*)
  
  FROM [188].[table_ec_pathway_biocyc.csv]




________________________________________


SELECT 
  
  COUNT(*)
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]




________________________________________


SELECT * FROM [ssgcid_EC_map]
  WHERE ec_number in
  ('1.3.99.3')




________________________________________


SELECT 
  
*
  
  FROM [188].[table_pathways_by_ssgcid_enzyme.csv]

  WHERE ec_number = '1.3.99.3'



________________________________________


SELECT 
  
*
  
  FROM [188].[table_ec_pathway_biocyc.csv]

  WHERE ec_number = '1.3.99.3'



________________________________________



  
  select s.ssgcidid, s.uniprot, ec."EC Numbers" as ec_number, ec."Database" as ec_source, ec.enzyme_id as ec_source_id, 
  s.annotation, s.genus, s.class, s.superkingdom, s.familyID
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  WHERE ec."EC Numbers" = '1.3.99.3'



________________________________________



  
select DISTINCT(s.annotation)
  from [Unique_EC_mapped_to_UniProt] ec
  join [ssgcid_uniprot.csv] s on (s.uniprot = ec.accession)
  WHERE ec."EC Numbers" = '1.3.99.3'



________________________________________


SELECT 
  
  Count(*)
  
  FROM [188].[table_ec_pathway_biocyc.csv]

  WHERE ec_number = '1.3.99.3'



________________________________________


SELECT 
  
  Count(*)
  
  FROM [188].[table_ec_pathway_biocyc.csv]





________________________________________


SELECT 
  
  Count(*)
  
  FROM [188].[pathways_by_ssgcid_enzyme.csv]





________________________________________


SELECT * FROM [188].[table_ec_pathway_biocyc.csv]
  WHERE ec_number NOT IN (SELECT ec_number FROM [ssgcid_ec_map])




________________________________________


SELECT Count(*) FROM [188].[table_ec_pathway_biocyc.csv]
  WHERE ec_number NOT IN (SELECT ec_number FROM [ssgcid_ec_map])




________________________________________


SELECT * FROM [188].[table_ec_pathway_biocyc.csv]
  WHERE ec_number NOT IN (SELECT ec_number FROM [ssgcid_ec_map])




________________________________________


select count(*)
  from [ec_pathway_biocyc.csv]



________________________________________


SELECT * FROM [188].[table_ec_pathway_biocyc.csv]


________________________________________


SELECT 
  'Insert INTO EcPathway (EcNumber, PathwayId, PathwayName) VALUES (''' + ec_number + ''',''' + pathway_id + ''',''' + REPLACE(pathway_name, '''','''''') + ''')'
 as Statement 
  
  FROM [188].[table_ec_pathway_biocyc.csv]


________________________________________


SELECT COUNT(*) 
  
  FROM [188].[table_ec_pathway_biocyc.csv]


________________________________________


select * from
  [pathways_by_ssgcid_enzyme.csv]
  where pathway_name like 'pentose%'



________________________________________


select s.ssgcidid, s.annotation, p.pathway_name
  from [ssgcid_EC_map] s
  join  [pathways_by_ssgcid_enzyme.csv] p on (s.ec_number = p.ec_number)
  and pathway_name like 'pentose%'



________________________________________


select distinct s.ssgcidid, s.familyID, p.pathway_name
  from [ssgcid_EC_map] s
  join  [pathways_by_ssgcid_enzyme.csv] p on (s.ec_number = p.ec_number)
  and pathway_name like 'pentose%'



________________________________________


select distinct s.ssgcidid, s.familyID, p.pathway_name
  from [ssgcid_EC_map] s
  join  [pathways_by_ssgcid_enzyme.csv] p on (s.ec_number = p.ec_number)
  where pathway_name like 'pentose%'
  and s.genus='Burkholderia'



________________________________________


select distinct s.ssgcidid, s.familyID, p.pathway_name
  from [ssgcid_EC_map] s
  join  [pathways_by_ssgcid_enzyme.csv] p on (s.ec_number = p.ec_number)
  where pathway_name like 'pentose%'
  and s.genus='Burkholderia'



________________________________________


select distinct s.ssgcidid, s.annotation, p.pathway_name
  from [ssgcid_EC_map] s
  join  [pathways_by_ssgcid_enzyme.csv] p on (s.ec_number = p.ec_number)
  where pathway_name like 'pentose%'
  and s.genus='Burkholderia'



________________________________________


select count(*)
  from [Xstal Tracker.csv]
  where pdb is not null



________________________________________


select count(*)
  from [Xstal Tracker.csv]
  where pdb <> ''



________________________________________


select *
  from [select_SECbySite_report.csv]
  where purificationbatchNumber='PS00036'



________________________________________


select *
  from [select_SECbySite_report.csv]
  where purificationbatchNumber='S00036'



________________________________________


select s.*, x.[Crystals?], x.[Diffraction?], x.[Data Set?]
  from [sec_pdb.csv] s
  left outer join [Xstal Tracker.csv] x on (x.[Protein Code-1] = s.proteinSSGCIDID)


________________________________________


select s.*, x.[Crystals?], x.[Diffraction?], x.[Data Set?]
  from [sec_pdb.csv] s
  left outer join [Xstal Tracker.csv] x on (x.[Protein Code-1] = s.proteinSSGCIDID)
 


________________________________________


select * from ssgcid_proteins
  where target like 'Myth%'
  or target like 'MytuD%'


________________________________________


select s.*, x.[Crystals?], x.[Diffraction?], x.[Data Set?]
  from [sec_pdb.csv] s
  left outer join [Xstal Tracker.csv] x on (x.[Protein Code-1] = s.proteinSSGCIDID)
 



________________________________________


select s.*, x.[Crystals?], x.[Diffraction?], x.[Data Set?]
  from [sec_pdb.csv] s
  left outer join [Xstal Tracker.csv] x on (x.[Protein Code-1] = s.proteinSSGCIDID)
 



________________________________________


select s.*, x.[Crystals?], x.[Diffraction?], x.[Data Set?]
  from [sec_pdb.csv] s
  left outer join [Xstal Tracker.csv] x on (x.[Protein Code-1] = s.proteinSSGCIDID)


________________________________________


select count(*) from
  (select s.*, x.[Crystals?], x.[Diffraction?], x.[Data Set?]
  from [sec_pdb.csv] s
    left outer join [Xstal Tracker.csv] x on (x.[Protein Code-1] = s.proteinSSGCIDID)) as foo


________________________________________


select s.*, x.[Crystals?], x.[Diffraction?], x.[Data Set?]
  from [sec_pdb.csv] s
    left outer join [Xstal Tracker.csv] x on (x.[Protein Code-1] = s.proteinSSGCIDID)


________________________________________


select * from 
  glycerol_beir_candidates
  where glycerolID not in 
  (select glycerol
  from glycerols)


________________________________________


select proteinssgcidid, [inpdb?]
  from ssgcid_proteins
  where proteinssgcidid is not null



________________________________________


select proteinssgcidid, [inpdb?]
  from ssgcid_proteins
  where proteinssgcidid <> ''



________________________________________


select proteinssgcidid, [inpdb?]
  from ssgcid_proteins
  where proteinssgcidid <> ''
  and [inPDB?] = 'TRUE'



________________________________________


select substring(proteinssgcidid, 1, 13), [inpdb?]
  from ssgcid_proteins
  where proteinssgcidid <> ''
  and [inPDB?] = 'TRUE'



________________________________________


select * from glycerol_beir_candidates
  where glycerolID not in
  (select glycerol
    from glycerols)
  and [inPDB?] = 'TRUE'


________________________________________


select * from glycerol_beir_candidates
  where glycerolID not in
  (select glycerol
    from glycerols)
 -- and [inPDB?] = 'TRUE'


________________________________________


select count(*) from glycerol_beir_candidates
  where glycerolID not in
  (select glycerol
    from glycerols)
 -- and [inPDB?] = 'TRUE'


________________________________________


select * from glycerol_beir_candidates
  where glycerolID not in
  (select glycerol
    from glycerols)
 -- and [inPDB?] = 'TRUE'


________________________________________


select * from [table_DtoA_candidates.csv]


________________________________________


select u.Container, u.Clone_name, d.DtoA as bad_ones
  from [table_DtoA_candidates.csv] d
  join [table_qryUWExportConstructs.csv] u on (u.Clone_name = d.DtoA)



________________________________________


select u.Container, u.Clone_name, d.DtoA as bad_ones
  from [table_DtoA_candidates.csv] d
  left join [table_qryUWExportConstructs.csv] u on (u.Clone_name = d.DtoA)



________________________________________


select u.Container as SetNo, u.Clone_name as uw_constructID, d.DtoA as bad_ones
  from [table_DtoA_candidates.csv] d
  left join [table_qryUWExportConstructs.csv] u on (u.Clone_name = d.DtoA)



________________________________________


select d.DtoA as bad_ones, u.Container as SetNo, u.Clone_name as uw_constructID, u.nt_seq_uncleaved
  from [table_DtoA_candidates.csv] d
  left join [table_qryUWExportConstructs.csv] u on (u.Clone_name = d.DtoA)



________________________________________


select u.Container, u.Clone_name
  from [table_qryUWExportConstructs.csv] u
  where u.Clone_name like 'TogoA.01305.a%' or u.Clone_name like 'TogoA.01236.a%'



________________________________________


select u.Container, u.Clone_name
  from [table_qryUWExportConstructs.csv] u
  where u.Clone_name like 'TogoA.01305.a%' or u.Clone_name like 'TogoA.01236.a%'


________________________________________


select u.Container, u.Clone_name
  from [table_qryUWExportConstructs.csv] u
  where u.Clone_name like 'TogoA.01305%' or u.Clone_name like 'TogoA.01236%'


________________________________________


select u.Container, u.Clone_name
  from [table_qryUWExportConstructs.csv] u
  where u.Clone_name like '%01305.a.A2%' or u.Clone_name like '%01236.a.A3%'


________________________________________


select d.DtoA as bad_ones, u.Container as SetNo, u.Clone_name as uw_constructID, u.nt_seq_uncleaved, u.aa_seq_uncleaved
  from [table_DtoA_candidates.csv] d
  left join [table_qryUWExportConstructs.csv] u on (u.Clone_name = d.DtoA)



________________________________________


select * from [pdb2cath.csv]
  where pdb not in
  (select column2 from isatmp)


________________________________________


select p.* from [pdb2cath.csv] p
  where p.pdb not in
  (select column2 from isatmp)


________________________________________


select p.*, e.ec
  from [pdb2cath.csv] p
  join [ec2cath.csv] e on (p.cath = e.cath)
  where p.pdb not in
  (select column2 from isatmp)


________________________________________


select p.*, count(e.ec)
  from [pdb2cath.csv] p
  join [ec2cath.csv] e on (p.cath = e.cath)
  where p.pdb not in
  (select column2 from isatmp)
  group by p.pdb, p.cath having count(e.ec) = 1



________________________________________


SELECT * FROM [188].[table_ec2cath.csv]
  where cath = '00001.00020.00090.00010'



________________________________________


SELECT cath, count(ec)
  FROM [188].[table_ec2cath.csv]
  group by cath having count(ec) = 1




________________________________________


SELECT cath, count(ec)
  FROM [188].[table_ec2cath.csv]
  group by cath




________________________________________


SELECT cath, count(ec) as count_ec
  FROM [188].[table_ec2cath.csv]
  group by cath




________________________________________


select p.*,  e.ec
  from [pdb2cath.csv] p
  join [cath_ec_count] c on (p.cath = c.cath and c.count_ec = 1)
  join [ec2cath.csv] e on (c.cath = e.cath)
  where p.pdb not in
  (select column2 from isatmp)



________________________________________


select p.*,  e.ec
  from [pdb2cath.csv] p
  join [cath_ec_count] c on (p.cath = c.cath and c.count_ec = 1)
  join [ec2cath.csv] e on (c.cath = e.cath)
  
  where p.pdb not in
  (select column2 from isatmp)



________________________________________


select p2c.pdb, e2c.ec
  
  from [pdb2cath.csv] p2c
  join cath_ec_count cec on (cec.cath = p2c.cath and cec.count_ec = 1)
  join [ec2cath.csv] e2c on (e2c.cath = cec.cath)
  


________________________________________


select * 
  from pdb_uniprot_ec
  where ecnumber like '%-%'


________________________________________


select * from [table_ProtNotInCTTdb.csv]
  where [XstalTracker Protein Name] is not null



________________________________________


select * from [table_ProtNotInCTTdb.csv]
  where [XstalTracker Protein Name] <> ''



________________________________________


select count(*) from [table_ProtNotInCTTdb.csv]
  where [XstalTracker Protein Name] <> ''



________________________________________


select p.column2 as pdb, e.ecnumber, p.column4 as taxid
  from [missing_pdb_ec.csv] p
  join [uniprot_kegg_ec.csv] e on ( e.uniprot = p.column1)



________________________________________


select count(*) from  (select p.column2 as pdb, e.ecnumber, p.column4 as taxid
  from [missing_pdb_ec.csv] p
  join [uniprot_kegg_ec.csv] e on ( e.uniprot = p.column1)) as bla



________________________________________


select p.column2 as pdb, e.ecnumber, p.column4 as taxid
  from [missing_pdb_ec.csv] p
  join [uniprot_kegg_ec.csv] e on ( e.uniprot = p.column1)



________________________________________


select p.column2 as pdb, e.ecnumber, p.column4 as taxid, p.column3
  from [missing_pdb_ec.csv] p
  join [uniprot_kegg_ec.csv] e on ( e.uniprot = p.column1)


________________________________________


select p.column2 as pdb, e.ecnumber, p.column4 as taxid, p.column3, p.column1
  from [missing_pdb_ec.csv] p
  join [uniprot_kegg_ec.csv] e on ( e.uniprot = p.column1)


________________________________________


select p.column2 as pdb, e.ecnumber, p.column4 as taxid, p.column3, p.column1
  from [missing_pdb_ec.csv] p
  join [uniprot_kegg_ec.csv] e on ( e.uniprot = p.column1)
  where p.column3 is not null



________________________________________


select p.column2 as pdb, e.ecnumber, p.column4 as taxid, p.column3, p.column1
  from [missing_pdb_ec.csv] p
  join [uniprot_kegg_ec.csv] e on ( e.uniprot = p.column1)
  where p.column3 <> ''



________________________________________


SELECT count(*) FROM [188].[table_uniprot_pdb_ec.csv]


________________________________________


SELECT count(*) FROM [188].kegg_pdb_ec


________________________________________


SELECT count(*) FROM
  (select * from [188].kegg_pdb_ec
    UNION
    select * from uniprot_pdb_ec) as foo



________________________________________


select * from [188].kegg_pdb_ec
    UNION
    select * from uniprot_pdb_ec



________________________________________


select *, 'KEGG' from [188].kegg_pdb_ec
    UNION
    select *, 'UniProt' from uniprot_pdb_ec



________________________________________


select *, 'KEGG' as source from [188].kegg_pdb_ec
    UNION
    select *, 'UniProt' as source from uniprot_pdb_ec




________________________________________


select *, 'KEGG' as source from [188].kegg_pdb_ec
    except
    select *, 'UniProt' as source from uniprot_pdb_ec




________________________________________


select *  from [188].kegg_pdb_ec
    except
    select *  from uniprot_pdb_ec




________________________________________


select count(*) from (select *  from [188].kegg_pdb_ec
    except
  select *  from uniprot_pdb_ec) as foo




________________________________________


SELECT * FROM kegg_pdb_ec
  except
  select * from uniprot_pdb_ec



________________________________________


select m.*, s.*
  from ssgcid_more m
  join ssgcid_structures s on (s.dbxrefname = m.uniprot)


________________________________________


select s.pdbid, m.ecnumber, m.taxid
  from ssgcid_more m
  join ssgcid_structures s on (s.dbxrefname = m.uniprot)


________________________________________


SELECT * FROM [541].experiment


________________________________________


SELECT * FROM [541].experiment


________________________________________


SELECT * FROM [188].[table_ec_pathway_biocyc.csv]


________________________________________


select * from [ec_pathway_biocyc.csv]


________________________________________


select * from [ec_pathway_biocyc.csv] e
  where pathway_id like 'PW%'


________________________________________


select * from [s87_SV.csv]


________________________________________


select distinct sv.construct,
(select sv2.dnasamplename + ','
  from  [s87_SV.csv] sv2
  where  sv2.construct = sv.construct
  for xml path('')) as bla
from  [s87_SV.csv] sv


________________________________________


select distinct sv.construct,
(select sv2.dnasamplename + ','
  from  [s87_SV.csv] sv2
  where  sv2.construct = sv.construct
  for xml path('')) as seq_runs,
(select sv3.status + ','
  from  [s87_SV.csv] sv3
  where sv3.construct = sv.construct
  for xml path('')) as status
from  [s87_SV.csv] sv


________________________________________


select distinct sv.construct,
(select sv2.dnasamplename + ','
  from  [s87_SV.csv] sv2
  where  sv2.construct = sv.construct
  for xml path('')) as seq_runs,
(select sv3.status + ','
  from  [s87_SV.csv] sv3
  where sv3.construct = sv.construct
  for xml path('')) as status
from  [s87_SV.csv] sv


________________________________________


select distinct sv.construct,
(select sv2.dnasamplename + ','
  from  [s87_SV.csv] sv2
  where  sv2.construct = sv.construct
  for xml path('')) as seq_runs,
(select sv3.status + ','
  from  [s87_SV.csv] sv3
  where sv3.construct = sv.construct
  for xml path('')) as status
from  [s87_SV.csv] sv


________________________________________


select distinct sv.construct,
(select sv2.dnasamplename + ','
  from  [s89_SV.csv] sv2
  where  sv2.construct = sv.construct
  for xml path('')) as seq_runs,
(select sv3.status + ','
  from  [s89_SV.csv] sv3
  where sv3.construct = sv.construct
  for xml path('')) as status
from  [s89_SV.csv] sv


________________________________________


select * from CTTdb_Mtb_expr c
  join RMoritz_MtbProteins_20120307 r on (r.From_Req = c.feat_ssgcidid)


________________________________________


select distinct sv.construct,
(select sv2.dnasamplename + ','
  from  [s89_SV_v2] sv2
  where  sv2.construct = sv.construct
  for xml path('')) as seq_runs,
(select sv3.status + ','
  from  [s89_SV_v2] sv3
  where sv3.construct = sv.construct
  for xml path('')) as status
from  [s89_SV_v2] sv


________________________________________


select distinct sv.construct,
(select sv2.dnasamplename + ','
  from  [s89_SV_v2.csv] sv2
  where  sv2.construct = sv.construct
  for xml path('')) as seq_runs,
(select sv3.status + ','
  from  [s89_SV_v2.csv] sv3
  where sv3.construct = sv.construct
  for xml path('')) as status
from  [s89_SV_v2.csv] sv


________________________________________


select distinct sv.construct,
(select sv2.dnasamplename + ','
  from  [s89_SV_v2.csv] sv2
  where  sv2.construct = sv.construct
  for xml path('')) as seq_runs,
(select sv3.status + ','
  from  [s89_SV_v2.csv] sv3
  where sv3.construct = sv.construct
  for xml path('')) as status
from  [s89_SV_v2.csv] sv


________________________________________


select distinct sv.construct,
(select sv2.dnasamplename + ','
  from  [s89_SV_v2.csv] sv2
  where  sv2.construct = sv.construct
  for xml path('')) as seq_runs,
(select sv3.status + ','
  from  [s89_SV_v2.csv] sv3
  where sv3.construct = sv.construct
  for xml path('')) as status
from  [s89_SV_v2.csv] sv


________________________________________


select r.*
  , g.[Vessel label]
  , g.Address
  
  from [RobMoritz_CloneCandidates_20120320.csv] r
  left join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select distinct (g.[Glycerol Stock ID]),
  r.*
  , g.[Vessel label]
  , g.Address
  
  from [RobMoritz_CloneCandidates_20120320.csv] r
  left join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select distinct r.*
  , g.[Vessel label]
  , g.Address
  
  from [RobMoritz_CloneCandidates_20120320.csv] r
  left join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select distinct r.*
  , g.[Vessel label]
  , g.Address
  
  from [RobMoritz_CloneCandidates_20120320.csv] r
  left join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select count (distinct r.Target)
  from [RobMoritz_CloneCandidates_20120320.csv] r
  left join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select count (distinct r.Target)
  from [RobMoritz_CloneCandidates_20120320.csv] r
  left join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select count (distinct g.[Glycerol Name])
  from [RobMoritz_CloneCandidates_20120320.csv] r
  left join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select count (distinct g.[Glycerol Name])
  from Glycerol_Stocks_Locations g


________________________________________


select count (distinct r.Target)
  from Glycerol_Stocks_Locations g
  left outer join [RobMoritz_CloneCandidates_20120320.csv] r on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select count (distinct r.Target)
  from [RobMoritz_CloneCandidates_20120320.csv] r 
  left outer join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select count (distinct r.ExpressionGlycerol)
  from [RobMoritz_CloneCandidates_20120320.csv] r 
  left outer join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select count(*)
--  , g.[Vessel label]
--  , g.Address
  
  from [RobMoritz_CloneCandidates_20120320.csv] r
  left join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select r.*
  , g.[Vessel label]
  , g.Address
  
  from [RobMoritz_CloneCandidates_20120320.csv] r
  left outer join Glycerol_Stocks_Locations g on g.[Glycerol Name] = r.ExpressionGlycerol


________________________________________


select *
  from Glycerol_Stocks_Locations
  where [Glycerol Stock ID] like '%25247%' or [Glycerol Name] like '%25247%'


________________________________________


select *
  from Glycerol_Stocks_Locations
  where [Glycerol Stock ID] like '%25343%' or [Glycerol Name] like '%25343%'


________________________________________


select *
  from Glycerol_Stocks_Locations
  where [Glycerol Stock ID] like '%25811%' or [Glycerol Name] like '%25811%'


________________________________________


select *
  from Glycerol_Stocks_Locations
  where Target_name like 'MytuD.00010.a.A1%'


________________________________________


select *
  from cr_status s
  join cr_tm t on (t.ssgcid=s.target)


________________________________________


select * from [Author.csv]


________________________________________


select
  ra.PersonalName,
  ap.PMID
from
  [Research-Affiliation] ra
join Author_PMID ap on (ap.PersonalName = ra.PersonalName)


________________________________________


select
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation
from
  [Research-Affiliation] ra
join Author_PMID ap on (ap.PersonalName = ra.PersonalName)


________________________________________


select
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation,
  p.Project,
  p.Country
from
  [Research-Affiliation] ra
join Author_PMID ap on (ap.PersonalName = ra.PersonalName)
join project p on (p.ResearchAffiliation = ra.ResearchAffiliation)
where ra.PersonalName like 'N%'
  



________________________________________


select
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation,
  p.Project,
  p.Country
from
  [Research-Affiliation] ra
left join Author_PMID ap on (ap.PersonalName = ra.PersonalName)
left join project p on (p.ResearchAffiliation = ra.ResearchAffiliation)
where ra.PersonalName like 'N%'
  



________________________________________


select
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation,
  ci.Project,
  p.Country
from
  [Research-Affiliation] ra
left join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)
left join
  project p on (p.ResearchAffiliation = ra.ResearchAffiliation)
left join
  Center_Institution ci on (ci.Project =  p.Project)
where
  ra.PersonalName like 'N%'
  



________________________________________


select
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation,
  ci.Project,
  p.Country
from
  [Research-Affiliation] ra
left join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)
left join
  project p on (p.ResearchAffiliation = ra.ResearchAffiliation)
left join
  Center_Institution ci on (ci.Project =  p.Project)
where
  ap.PMID is null
  



________________________________________


select distinct --on ra.PersonalName)
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation,
  ci.Project,
  p.Country
from
  [Research-Affiliation] ra
left join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)
left join
  project p on (p.ResearchAffiliation = ra.ResearchAffiliation)
left join
  Center_Institution ci on (ci.Project =  p.Project)
where
  ap.PMID is null
  



________________________________________


select --distinct --on ra.PersonalName)
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation,
  ci.Project,
  p.Country
from
  [Research-Affiliation] ra
left join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)
left join
  project p on (p.ResearchAffiliation = ra.ResearchAffiliation)
left join
  Center_Institution ci on (ci.Project =  p.Project)
where
  ap.PMID is null
  



________________________________________


select --distinct --on ra.PersonalName)
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation
--  ci.Project,
--  p.Country
from
  [Research-Affiliation] ra
left join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)



________________________________________


select --distinct --on ra.PersonalName)
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation
--  ci.Project,
--  p.Country
from
  [Research-Affiliation] ra
left join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)
where
  ap.PersonalName like 'Crispe%'



________________________________________


select --distinct --on ra.PersonalName)
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation
--  ci.Project,
--  p.Country
from
  [Research-Affiliation] ra
left join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)
where
  ap.PersonalName like 'Crisp%'



________________________________________


select --distinct --on ra.PersonalName)
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation
--  ci.Project,
--  p.Country
from
  [Research-Affiliation] ra
left join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)
where
  ra.PersonalName like 'Crisp%'



________________________________________


select --distinct --on ra.PersonalName)
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation
--  ci.Project,
--  p.Country
from
  [Research-Affiliation] ra
left outer join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)
where
  ra.PersonalName like 'Crisp%' or ap.PersonalName like 'Crisp%'



________________________________________


select --distinct --on ra.PersonalName)
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation
--  ci.Project,
--  p.Country
from
  [Research-Affiliation] ra
left join
  Author_PMID ap on (ap.PersonalName = ra.PersonalName)
where
  ra.PersonalName like 'Crisp%' or ap.PersonalName like 'Crisp%'



________________________________________


select --distinct --on ra.PersonalName)
  ra.PersonalName,
  ap.PMID,
  ra.ResearchAffiliation
--  ci.Project,
--  p.Country
from
  Author_PMID ap
left join
   [Research-Affiliation] ra on (ap.PersonalName = ra.PersonalName)
where
  ra.PersonalName like 'Crisp%' or ap.PersonalName like 'Crisp%'



________________________________________


SELECT
  s.dnasamplename,
  e.Total_expression_level,
  e.Soluble_expression_level,
  s.id
FROM [qryUWExportExpression_s103.csv] e
LEFT JOIN [qryPassSV_s103.csv] s on s.constructname = e.Clone_name


________________________________________


SELECT
  s.dnasamplename,
  e.Total_expression_level,
  e.Soluble_expression_level,
  s.id
FROM [qryUWExportExpression_s103.csv] e
JOIN [qryPassSV_s103.csv] s on s.constructname = e.Clone_name


________________________________________


SELECT
  s.dnasamplename,
  e.Total_expression_level,
  e.Soluble_expression_level,
  s.id
FROM [qryUWExportExpression_s103.csv] e
JOIN [qryPassSV_s103.csv] s on s.constructname = e.Clone_name
WHERE e.Soluble_expression_level like '1:%'


________________________________________


SELECT
  s.dnasamplename,
  e.Total_expression_level,
  e.Soluble_expression_level,
  s.id
FROM [qryUWExportExpression_s103.csv] e
JOIN [qryPassSV_s103.csv] s on s.constructname = e.Clone_name
WHERE e.Total_expression_level like '1:%'


________________________________________


SELECT
  s.dnasamplename,
  e.Total_expression_level,
  e.Soluble_expression_level,
  s.id
FROM [qryUWExportExpression_s103.csv] e
JOIN [qryPassSV_s103.csv] s on s.constructname = e.Clone_name
WHERE e.Total_expression_level like '0:%'


________________________________________


SELECT
  s.dnasamplename,
  e.Total_expression_level,
  e.Soluble_expression_level,
  s.id
FROM [qryUWExportExpression_s103.csv] e
JOIN [qryPassSV_s103.csv] s on s.constructname = e.Clone_name
WHERE e.Soluble_expression_level like '0:%'


________________________________________


SELECT * FROM [206].[SQLTest1.txt]


________________________________________


SELECT * FROM [206].[SQLTest7.txt]


________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column2 < 150 and Column1 <1200
  



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column2 < 150 and Column1 >1200
  



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column2 < 150 and Column1 >1200


  



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column2 < 150 and Column1 >1200


  



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column2 < 150 and Column1 >1200


  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where value >1000



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where value >1000
  and price >.15
  and year >1900



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country = 'aden'
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in('aden', 'austria')
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')or 
  duty <>0
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')or 
  (duty <>0 or year >1900)
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and
  (duty <>0 or year >1900)
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and (
    (duty <>0 or year >1900)) 
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and (
    (duty <>0 or year >1900) or 'data source' ='US') 
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and (
    (duty <>0 or year >1900) or 'data source' <>'US') 
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and (
    (duty <>0 or year >1900) or 'data source' <>'US') 
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and (
    (duty <>0 or year >1900) or 'data source' <>'US') 
  order by year
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and (
    (duty <>0 or year >1900) or 'data source' <>'US') 
  order by pounds
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and (
    (duty <>0 or year >1900) or 'data source' <>'US') 
  order by year, pounds
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and (
    (duty <>0 or year >1900) or 'data source' <>'US') 
  order by year, pounds
  
  



________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]
  where country in ('aden', 'austria', 'cuba')and (
    (duty <>0 or year >1900) or 'data source' <>'US') 
  order by year, pounds
  
  



________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]
  where last = 'smith'



________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]
  where last = 'yager'



________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]
  where middle ='O'



________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]
  where middle ='A'



________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]
  where middle ='T'



________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]
  where middle ='A'



________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]
  where last = 'yager'



________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]
  where last = 'yager'



________________________________________


SELECT * FROM [1314howe].[orcasound-detections with day or night]


________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]


________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]


________________________________________


SELECT * FROM [1314howe].[orcasound-detections with day or night]


________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]


________________________________________


SELECT * FROM [1314howe].[orcasound-detections with day or night]


________________________________________


SELECT * FROM [1314howe].[orcasound-detections with day or night]


________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]


________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]


________________________________________


SELECT * FROM [1314howe].[orcasound-detections with day or night]


________________________________________


SELECT * FROM [1314howe].[orcasound-detections with day or night]


________________________________________


SELECT * FROM [1317].[COFFEEEEEEEEEE]


________________________________________


SELECT * FROM [206].[1358DataList.csv]


________________________________________


SELECT * FROM [1314howe].[orcasound-detections with day or night]


________________________________________


WAITFOR DELAY '00:02:00' SELECT * FROM [206].[table_1358DataList.csv]


________________________________________


SELECT * FROM [206].[table_1358DataList.csv]


________________________________________


WAITFOR DELAY '00:02:00' SELECT * FROM [206].[table_1358DataList.csv]


________________________________________


WAITFOR DELAY '00:02:00' SELECT * FROM [206].[table_1358DataList.csv]


________________________________________


WAITFOR DELAY '00:02:00' SELECT * FROM [206].[table_1358DataList.csv]



________________________________________


WAITFOR DELAY '00:02:00' SELECT * FROM [206].[table_1358DataList.csv]



________________________________________


SELECT * FROM [1324].[attic.txt]


________________________________________


SELECT * FROM [206].[bomanis_resaved]


________________________________________


SELECT * FROM [206].[1358DataListLonger.txt]


________________________________________


SELECT * FROM [206].[1358DataListLonger.txt]


________________________________________


SELECT * FROM [206].[table_1358DataList.csv]
  where Column1 <1000



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column2 >100
  



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column2 >100
  



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column2 >100
  



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column2 >100
  



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column1 <500



________________________________________


SELECT * FROM [206].[1358DataList.csv]
  where Column1 <500


________________________________________


SELECT * FROM [1117].[Orca Sound Classifications- Resident ONLY]


________________________________________


SELECT * FROM [1117].[orcasound-classifications-all]


________________________________________


SELECT * FROM [1117].[orcasound-classifications-all]


________________________________________


SELECT top 3 * FROM [206].[table_null13581.txt]


________________________________________






________________________________________


SELECT * FROM [206].[null13582.txt]
  
  where third >2



________________________________________


SELECT * FROM [206].[table_null13581.txt]


________________________________________


SELECT * FROM [206].[null13581SavedSharing.txt]


________________________________________


SELECT * FROM [807].[CSESalariesWithFalsePositives]


________________________________________


SELECT * FROM [807].[CSESalariesWithFalsePositives]


________________________________________


SELECT * FROM [807].[CSESalariesWithFalsePositives]
  


________________________________________


SELECT * FROM [807].[CSESalariesWithFalsePositives]
  


________________________________________


SELECT * FROM [807].[CSESalariesWithFalsePositives]
  where sal > 10000



________________________________________


SELECT * FROM [206].[updating query again]


________________________________________


SELECT * FROM [206].[updating query again]


________________________________________


SELECT * FROM [206].[updating query again]


________________________________________


SELECT * FROM [206].[updating query again]



________________________________________


SELECT * FROM [807].[CSESalariesWithFalsePositives]


________________________________________


SELECT last, first, sal FROM [807].[CSESalariesWithFalsePositives]


________________________________________


SELECT last, first, sal FROM [807].[CSESalariesWithFalsePositives]
  where last ='Allen'



________________________________________


SELECT last, first, sal FROM [807].[CSESalariesWithFalsePositives]
  where last like 'A*'



________________________________________


SELECT last, first, sal FROM [807].[CSESalariesWithFalsePositives]
  where last like 'A*'



________________________________________


SELECT last, first, sal FROM [807].[CSESalariesWithFalsePositives]
  where last > 'A'



________________________________________


SELECT last, first, sal FROM [807].[CSESalariesWithFalsePositives]
  where last > 'A'
  and last < 'D'



________________________________________


SELECT * FROM [206].[SQLTest5.txt]


________________________________________


SELECT * FROM [206].[SQLTest5.txt]
  WHERE Column1 ='$550,004.23'
  



________________________________________


SELECT * FROM [206].[SQLTest5.txt]
  WHERE Column1 <>'$550,004.23'
  



________________________________________


SELECT * FROM [206].[SQLTest5.txt]
  WHERE Column1 <>'$550,004.23'
  and Column1 <>'$550,000.23'
  



________________________________________


SELECT * FROM [206].[SQLTest5.txt]
  WHERE Column1 <>'$550,004.23'
  and Column1 <>'$500,000.23'
  



________________________________________


SELECT * FROM [206].[SQLTest5.txt]
  WHERE Column1 <>'$550,004.23'
  and Column1 <>'$500,000.23'
   and Column1 <>'$523,000.23'



________________________________________


SELECT * FROM [206].[SQLTest5.txt]
  WHERE Column1 not in ('$550,004.23','$500,000.23','$523,000.23')



________________________________________


SELECT * FROM [206].[SQLTest5.txt]
  WHERE Column1 not in ('$550,004.23',
    '$500,000.23',
    '$523,000.23')



________________________________________


SELECT * FROM [206].[SQLTest5.txt]
  WHERE Column1 not in ('$550,004.23',
    '$500,000.23',
    '$523,000.23'
  )



________________________________________


SELECT * FROM [206].[SQLTest5.txt]
  WHERE Column1 not in ('$550,004.23',

    '$523,000.23'
  )



________________________________________


SELECT * FROM [206].[ReallyBigOrca]


________________________________________


SELECT * FROM [206].[new dataset for me part 2]


________________________________________


SELECT * FROM [206].[reallyBigOrca2.txt]
  where ID = '1000'



________________________________________


SELECT * FROM [206].[new orca dataset]
  where CALLCOUNT ='More'



________________________________________


SELECT * FROM [206].[new orca dataset]
  where CALLCOUNT ='More'


________________________________________


SELECT * FROM [1117].[Orca Sound Classifications- Resident ONLY]


________________________________________


SELECT * FROM [206].[reallyBigOrca.txt]


________________________________________


SELECT * FROM [206].[reallyBigOrca2.txt]
  where ID = '1000'



________________________________________


SELECT * FROM [206].[reallyBigOrca2.txt]
  where ID = '1000' and ORCA ='Resident Call'



________________________________________


SELECT * FROM [1117].[Orca Sound Classifications- Resident ONLY]


________________________________________


SELECT * FROM [206].[sfffsfs]
  where CALLCOUNT ='More'
  



________________________________________


SELECT * FROM [206].[sfffsfs]
  where CALLCOUNT ='More'
  



________________________________________


SELECT * FROM [206].[sfffsfs]


________________________________________


SELECT * FROM [206].[reallyBigOrca2.txt]
  where ID = '1000' and ORCA ='Resident Call'
  and ID_DETECTION >26237



________________________________________


SELECT * FROM [206].[reallyBigOrca2.txt]
  where ID = '1000' and ORCA ='Resident Call'
  and ID_DETECTION = 26237



________________________________________


SELECT * FROM [206].[reallyBigOrca2.txt]
  where ID = '1000' and ORCA ='Resident Call'
  and ID_DETECTION = 26237



________________________________________


SELECT * FROM [206].[reallyBigOrca2.txt]
  where ID = '1000' and ORCA ='Resident Call'



________________________________________


SELECT * FROM [206].[reallyBigOrca2.txt]
  where ID <> '1000' and ORCA ='Resident Call'



________________________________________


SELECT * FROM [206].[sfffsfs]
  where CALLCOUNT ='More'
  and ORCA = 'Resident Call'



________________________________________


SELECT * FROM [206].[sfffsfs]
  where CALLCOUNT ='More'
  and ORCA <> 'Resident Call'



________________________________________


SELECT * FROM [206].[sfffsfs]
  where CALLCOUNT <>'More'
  and ORCA = 'Resident Call'



________________________________________


SELECT * FROM [206].[sfffsfs]
  where CALLCOUNT ='More'
  and ORCA = 'Resident Call'



________________________________________


SELECT * FROM [206].[sfffsfs]
  where CALLCOUNT ='More'
  and ORCA = 'Resident Call'
  and ID = 1000



________________________________________


SELECT * FROM [206].[sharing upload part 2]


________________________________________


select * from [206].[sharing upload part 2]
  where Column1 >500000



________________________________________


SELECT COUNT(*) from sys.tables 



________________________________________


SELECT COUNT (*) FROM [206].[Test Sharing Upload]


________________________________________


SELECT COUNT(Column1) FROM [206].[Test Sharing Upload]


________________________________________


SELECT COUNT(Column1) FROM [206].[Test Sharing Upload]


________________________________________


SELECT COUNT(*) FROM [206].[Test Sharing Upload]


________________________________________


SELECT MAX(Column1) FROM [206].[Test Sharing Upload]


________________________________________


SELECT MIN(Column1) FROM [206].[Test Sharing Upload]


________________________________________


SELECT max(Column1) FROM [206].[Test Sharing Upload]


________________________________________


SELECT * FROM [206].[table_SQLTest5.txt]


________________________________________


SELECT * FROM [206].[SQLTestNullValue_SQL300newagain]


________________________________________


SELECT * FROM [206].[SQLTestNullValue_SQL300newagain]
  where third <7
  



________________________________________


SELECT * FROM [206].[SQLTestNullValue_SQL300newagain]
  where third <7
  and fourth <=3
  
  



________________________________________


SELECT * FROM [206].[SQLTestNullValue_SQL300newagain]
  where third <7
  and fourth <=3
  
  



________________________________________


SELECT * FROM [206].[table_SQLTest5-1.txt]
  where column1 ='$500'



________________________________________


SELECT * FROM [206].[SQLTest5-1.txt]
  where column1='$500'



________________________________________


SELECT * FROM [206].[SQLTest5-1.txt]
  where Column1='$500'



________________________________________


SELECT * FROM [206].[SQLTest5-1.txt]


________________________________________


SELECT * FROM [206].[SQLTestHeadersOff.txt]


________________________________________


SELECT * FROM [206].[SQLTestHeadersOff.txt]


________________________________________


SELECT * FROM [206].[SQLShareCatfileNohdr]


________________________________________


SELECT * FROM [206].[SQLShareCatfileNohdr]
  where country ='animal'



________________________________________


SELECT * FROM [206].[hdrTest]


________________________________________


SELECT * FROM [206].[reallyBigOrca3.txt]


________________________________________


SELECT * FROM [206].[reallyBigOrca3.txt]
  where ID='1000'



________________________________________


SELECT * FROM [206].[SQLShareCatfileNohdr]
  where country='animal'



________________________________________


SELECT * FROM [206].[SQLTestHeadersOff.txt]
  where Column1=3



________________________________________


SELECT * FROM [206].[SQLShareCatfileNohdr]
  where Column1='animal'



________________________________________


select (1)



________________________________________


select (1)



________________________________________


select (1)



________________________________________


select (1)



________________________________________


SELECT * FROM [1324].[table_SQLTest5.txt]


________________________________________


SELECT distinct * FROM [1324].[table_SQLTest5.txt]


________________________________________


SELECT count(*) FROM [1324].[table_SQLTest5.txt]
  GROUP BY column1, column2, column3



________________________________________


SELECT count(*), * FROM [1324].[table_SQLTest5.txt]
  GROUP BY column1, column2, column3



________________________________________


SELECT count(*) as count, * FROM [1324].[table_SQLTest5.txt]
  GROUP BY column1, column2, column3



________________________________________


SELECT * FROM [1117].[orcasound-classifications call count]


________________________________________


SELECT * FROM [1324].[table_SQLTest5.txt]


________________________________________


select count(*) from sys.tables



________________________________________


select * from sys.tables 



________________________________________


SELECT 'historic' as datasource
    , OBSERVER_ID
    , species_id as Species_code
    , NULL as common_name
    , NULL as scientific_name
    , question as questionable
    , state
    , county
    , NULL as date
    , year
    , month
    , NULL as day
    , convert(varchar(max), lat) as LATITUDE
    , convert(varchar(max), long) as LONGITUDE
    , source
    , quantity
    , estimate
    , habitat1 as habitat1
    , null as habitat2
    , comments
    , null as family
 FROM [1231].[NatureMapping_historic1.csv]

 UNION

SELECT 'arboretum' as datasource
    , Obs_id
    , NULL as species_code
    , species as common_name
    , NULL as scientific_name
    , q as questionable
    , st as state
    , cast(Co as varchar(max)) as county
    , convert(datetime, [date]) as date
    , datepart(year, convert(datetime, [date])) as year
    , datepart(month, convert(datetime, [date])) as month
    , datepart(day, convert(datetime, [date])) as day
    , convert(varchar(max), latitude) as latitude
    , convert(varchar(max), longitude) as longitude
    , cast(source as varchar(max)) as source
    , qty as quantity
    , null as estimate
    , habitat as habitat1
    , null as habitat2
    , comment as comments
    , species_type as family
 FROM [1231].[ArboretumData.csv]

 UNION

SELECT 'online_export' as datasource
    , OBSERVER_ID
    , Species_id as species_code
    , SPECIES_NAME as common_name
    , null as scientific_name
    , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
    , STATE
    , COUNTY
    , convert(datetime, OBSERVATION_DATE) as date
    , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
    , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
    , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
    , convert(varchar(max), latitude) as latitude
    , convert(varchar(max), longitude) as longitude
    , SOURCE
    , QUANTITY
    , ESTIMATE
    , HABITAT1
    , habitat2
    , COMMENTS
    , null as family
 FROM [1231].[online_export_080410_edit.csv]

 UNION

SELECT 'ebird' as datasource
    , NULL as OBSERVER_ID
    , convert(varchar(max), species_code) as species_code
    , common_NAME as common_name
    , null as scientific_name
    , case when QUESTION = 'Not valid and reviewed'  OR QUESTION =
'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
    , STATE
    , COUNTY
    , date as date
    , years as year
    , months as month
    , days as day
    , convert(varchar(max), latitude) as latitude
    , convert(varchar(max), longitude) as longitude
    , NULL as SOURCE
    , QUANTITY
    , null as ESTIMATE
    , null as HABITAT1
    , null as habitat2
    , COMMENTS
    , null as family
 FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT count(*) FROM [1324].[table_unlinked_tables_3-1-11.csv]


________________________________________


SELECT count(*) FROM [1324].[table_unlinked_tables_3-1-11.csv]


________________________________________


waitfor delay '00:00:30' SELECT * FROM [1324].[unlinked_tables_3-1-11.csv]


________________________________________


waitfor delay '00:00:30' SELECT * FROM [1324].[table_callS1.Table.1.selections.txt]


________________________________________


SELECT * FROM [1324].[table_1358.txt] where column4 is null



________________________________________


SELECT * FROM [1324].[table_1358.txt] where column4 is null



________________________________________


SELECT * FROM [88].[may10_S1_count.csv with distributions]


________________________________________



SELECT * FROM [88].[may10_S1_count.csv with distributions]
  UNION ALL
SELECT * FROM [1324].[may10_S1_count.csv with distributions]  




________________________________________


SELECT count(*) FROM (
SELECT * FROM [88].[may10_S1_count.csv with distributions]
  UNION ALL
SELECT * FROM [1324].[may10_S1_count.csv with distributions]  
) x



________________________________________


SELECT * FROM (
SELECT * FROM [88].[may10_S1_count.csv with distributions]
  UNION ALL
SELECT * FROM [1324].[may10_S1_count.csv with distributions]  
) c



________________________________________






________________________________________


SELECT [Date],
[Time],
[Image #],

Time_in, 
S1, 
number_of_whales, 
Date1, 
[Image #1], 
Time1, 
Distribution, 
number_of_whales1, 
State 
  FROM (
SELECT * FROM [88].[may10_S1_count.csv with distributions]
  UNION ALL
SELECT * FROM [1324].[may10_S1_count.csv with distributions]  
) c



________________________________________


SELECT [Date],
[Time],
[Image #],
[file],
Time_in, 
S1, 
number_of_whales, 
Date1, 
[Image #1], 
Time1, 
Distribution, 
number_of_whales1, 
State 
  FROM (
SELECT * FROM [88].[may10_S1_count.csv with distributions]
  UNION ALL
SELECT * FROM [1324].[may10_S1_count.csv with distributions]  
) c



________________________________________


SELECT DISTINCT * FROM
(
SELECT * FROM [88].[may10_S1_count.csv with distributions]
  UNION ALL
SELECT * FROM [1324].[may10_S1_count.csv with distributions]  
) c




________________________________________


SELECT COUNT(*) FROM (SELECT DISTINCT * FROM
(
SELECT * FROM [88].[may10_S1_count.csv with distributions]
  UNION ALL
SELECT * FROM [1324].[may10_S1_count.csv with distributions]  
) c

  ) x


________________________________________


SELECT COUNT(*) FROM (SELECT * FROM
(
SELECT * FROM [88].[may10_S1_count.csv with distributions]
  UNION ALL
SELECT * FROM [1324].[may10_S1_count.csv with distributions]  
) c

  ) x


________________________________________


select * from sys.tables



________________________________________


select * from sys.tables



________________________________________


SELECT [Men's 12M - Injection Drug].* FROM [Men's 12M - Injection Drug] WHERE [Men's 12M - Injection Drug].[v12sbald] = '22'


________________________________________


SELECT [qcstatelabel] FROM [Women's 6M - Sexual Behavior]


________________________________________


SELECT [Women's 6M - Sexual Behavior].* FROM [Women's 6M - Sexual Behavior], [Women's Baseline - Alcohol/Drug] WHERE [Women's 6M - Sexual Behavior].[participantid]=[Women's Baseline - Alcohol/Drug].[participantid]


________________________________________


SELECT [w6smsx] FROM [Women's 6M - Sexual Behavior]


________________________________________


SELECT [w6smsxno] FROM [Women's 6M - Sexual Behavior]


________________________________________


SELECT [participantid],[sequencenum],[qcstatelabel] FROM [Men's 12M - Injection Drug] UNION SELECT [participantid],[sequencenum],[qcstatelabel] FROM [Men's 12M - Other]


________________________________________


SELECT [participantid],[sequencenum],[qcstatelabel] FROM [Men's 12M - Injection Drug] UNION SELECT [participantid],[sequencenum],[qcstatelabel] FROM [Men's 12M - Other]


________________________________________


SELECT [participantid],[sequencenum],[qcstatelabel] FROM [Men's 12M - Injection Drug] 
  --UNION SELECT [participantid],[sequencenum],[qcstatelabel] FROM [Men's 12M - Other]


________________________________________


SELECT [participantid], [v12gonlr], [v12gonlo], [v12syp], 
[v12herp], [v12herpg], [v12herpr], [v12herpo]
[v12grw], [m12bwu], [m12sop], [m12sir]
  FROM [Men's 12M - Health]


________________________________________


SELECT [Men's 18M - Closeout].[v18intvw], min([Men's 18M - Closeout].[participantid]), max([Men's 18M - Closeout].[participantid]), avg([Men's 18M - Closeout].[participantid]), 
sum([Men's 18M - Closeout].[participantid]), count([Men's 18M - Closeout].[participantid])
  FROM [Men's 18M - Closeout]
GROUP BY [Men's 18M - Closeout].[v18intvw]


________________________________________


SELECT [Men's 12M - Demographics].[enrsite], min([Men's 12M - Demographics].[participantid]) as min, max([Men's 12M - Demographics].[participantid]) as max, avg([Men's 12M - Demographics].[participantid]) as avg, 
sum([Men's 12M - Demographics].[participantid]) as sum, count([Men's 12M - Demographics].[participantid]) as count
  FROM [Men's 12M - Demographics]
GROUP BY [Men's 12M - Demographics].[enrsite]


________________________________________


SELECT [Men's 12M - Health].[v12sfv], min([Men's 12M - Health].[participantid]) as minv12sfv, max([Men's 12M - Health].[participantid]) as maxv12sfv, avg([Men's 12M - Health].[participantid]) as avgv12sfv, 
sum([Men's 12M - Health].[participantid]) as sumv12sfv, count([Men's 12M - Health].[participantid]) as count
  FROM [Men's 12M - Health]
GROUP BY [Men's 12M - Health].[v12sfv]


________________________________________


SELECT [Men's 12M - Injection Drug].*, [Men's 12M - Demographics].*, [Men's 12M - Health].*
  FROM [Men's 12M - Injection Drug]
     , [Men's 12M - Demographics]
     , [Men's 12M - Health]
 WHERE [Men's 12M - Injection Drug].[participantid] = [Men's 12M - Demographics].[participantid]
   AND [Men's 12M - Demographics].[participantid] = [Men's 12M - Health].[participantid]
   AND [Men's 12M - Health].[v12herpr] = 'N'


________________________________________


SELECT [Men's 18M - Alcohol/Drug].*, [Men's 12M - Other].*, [Men's 12M - Demographics].*, [Men's 12M - Health].*, [Men's 12M - Sexual Behavior].*, [Men's 12M - Closeout].*, [Men's 12M - Injection Drug].*, [Men's 18M - Demographic].*
  FROM [Men's 18M - Alcohol/Drug]
     , [Men's 12M - Other]
     , [Men's 12M - Demographics]
     , [Men's 12M - Health]
     , [Men's 12M - Sexual Behavior]
     , [Men's 12M - Closeout]
     , [Men's 12M - Injection Drug]
     , [Men's 18M - Demographic]
 WHERE [Men's 18M - Alcohol/Drug].[participantid] = [Men's 12M - Other].[participantid]
   AND [Men's 12M - Other].[participantid] = [Men's 12M - Demographics].[participantid]
   AND [Men's 12M - Other].[participantid] = [Men's 12M - Closeout].[participantid]
   AND [Men's 12M - Demographics].[participantid] = [Men's 12M - Health].[participantid]
   AND [Men's 12M - Demographics].[participantid] = [Men's 12M - Sexual Behavior].[participantid]
   AND [Men's 12M - Demographics].[participantid] = [Men's 12M - Injection Drug].[participantid]
   AND [Men's 12M - Injection Drug].[participantid] = [Men's 18M - Demographic].[participantid]
   AND [Men's 12M - Injection Drug].[v12bkldd] > 2 AND [Men's 12M - Injection Drug].[v12bkldd] <= 4


________________________________________


SELECT [Men's 12M - Health].*
  FROM [Men's 12M - Health]
 WHERE [Men's 12M - Health].[v12herpr] = 'N'


________________________________________


SELECT [Men's 12M - Health].*
  FROM [Men's 12M - Health]
 WHERE [Men's 12M - Health].[v12herpr] = 'N'


________________________________________


SELECT * FROM [71].[table_Birds.csv]


________________________________________


SELECT id, species, name FROM [71].[table_Birds.csv]


________________________________________


SELECT * FROM [71].[table_Birds.csv]


________________________________________


SELECT species, subspec, name, bodymass FROM [71].[Birds.csv]
  WHERE id > = 1 and id <= 20



________________________________________


SELECT * FROM [71].[table_Book1.csv]


________________________________________


SELECT name, [Avg Speed] FROM [71].[table_Book1.csv]


________________________________________


SELECT * FROM [71].[table_Book1.csv]


________________________________________


Select * from [table_table_en.csv], [table_CPV_Elenco_completo.csv]
  where [table_table_en.csv].[CPV code 2003] = [table_CPV_Elenco_completo.csv].[CODE]



________________________________________


Select [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[Description], [table_CPV_Elenco_completo.csv].[CODE], [table_CPV_Elenco_completo.csv].[ENGLISH] from [table_table_en.csv], [table_CPV_Elenco_completo.csv]
  where [table_table_en.csv].[CPV code 2003] = [table_CPV_Elenco_completo.csv].[CODE]



________________________________________


Select  [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[Description], [table_CPV_Elenco_completo.csv].[CODE], [table_CPV_Elenco_completo.csv].[ENGLISH] from [table_table_en.csv], [table_CPV_Elenco_completo.csv]
  where [table_table_en.csv].[CPV code 2003] = [table_CPV_Elenco_completo.csv].[CODE]




________________________________________


Select  [table_0081433.csv].[code], [table_0081433.csv].[Description], [table_PPC_PROCESO_06-1-3709_199999999_4183.csv].[CODE], [table_PPC_PROCESO_06-1-3709_199999999_4183.csv].[ENGLISH_titles] from  [table_0081433.csv], [table_PPC_PROCESO_06-1-3709_199999999_4183.csv]
  where [table_0081433.csv].[code] = [table_PPC_PROCESO_06-1-3709_199999999_4183.csv].[CODE]



________________________________________


select [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[Description],[table_0081433.csv].[code], [table_0081433.csv].[Description] from [table_table_en.csv], [table_0081433.csv]
  where [table_table_en.csv].[Description]=[table_0081433.csv].[Description]


________________________________________


select [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[Description],[table_0081433.csv].[code], [table_0081433.csv].[Description] from [table_table_en.csv], [table_0081433.csv]
  where [table_table_en.csv].[Description]+'.'=[table_0081433.csv].[Description]


________________________________________


select [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[Description],[table_0081433.csv].[code], [table_0081433.csv].[Description] from [table_table_en.csv], [table_0081433.csv]
  where [table_table_en.csv].[Description]+'.'=[table_0081433.csv].[Description]


________________________________________


select [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[Description],[table_0081433.csv].[code], [table_0081433.csv].[Description] from [table_table_en.csv], [table_0081433.csv]
  where [table_table_en.csv].[Description] like [table_0081433.csv].[Description]


________________________________________


select [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[Description],[table_0081433.csv].[code], [table_0081433.csv].[Description] from [table_table_en.csv], [table_0081433.csv]
  where [table_table_en.csv].[Description] = [table_0081433.csv].[Description]


________________________________________


select [table_PPC_PROCESO_06-1-3709_199999999_4183.csv].code, [table_PPC_PROCESO_06-1-3709_199999999_4183.csv].English_titles, [table_0081433.csv].code, [table_0081433.csv].description from [table_PPC_PROCESO_06-1-3709_199999999_4183.csv],[table_0081433.csv]
  where [table_PPC_PROCESO_06-1-3709_199999999_4183.csv].code = [table_0081433.csv].code



________________________________________


select [table_annex_s4_cpv_codes.csv].[column1], [table_annex_s4_cpv_codes.csv].[column2], [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[description] from [table_annex_s4_cpv_codes.csv] join [table_table_en.csv]
  on [table_annex_s4_cpv_codes.csv].[column1] = [table_table_en.csv].[CPV code 2003]



________________________________________


select [table_annex_s4_cpv_codes.csv].[column1], [table_annex_s4_cpv_codes.csv].[column2], [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[description] from [table_annex_s4_cpv_codes.csv] left join [table_table_en.csv]
  on [table_annex_s4_cpv_codes.csv].[column1] = [table_table_en.csv].[CPV code 2003]



________________________________________


select [table_annex_s4_cpv_codes.csv].[column1], [table_annex_s4_cpv_codes.csv].[column2], [table_table_en.csv].[CPV code 2003], [table_table_en.csv].[description] from [table_annex_s4_cpv_codes.csv] join [table_table_en.csv]
  on [table_annex_s4_cpv_codes.csv].[column1] = [table_table_en.csv].[CPV code 2003]



________________________________________



 select [table_cpv_ro_en1.csv].[Coduri CPV sortate alfabetic dupa nume produs], [table_cpv_ro_en1.csv].Column2, [table_CPV_Elenco_completo.csv].CODE, [table_CPV_Elenco_completo.csv].ENGLISH from [table_cpv_ro_en1.csv] join [table_CPV_Elenco_completo.csv]
  on [table_cpv_ro_en1.csv].[Coduri CPV sortate alfabetic dupa nume produs]=[table_CPV_Elenco_completo.csv].CODE


________________________________________


select [table_cpv_ro_en1.csv].[Coduri CPV sortate alfabetic dupa nume produs] as code1, [table_cpv_ro_en1.csv].Column2 as desc1, [table_CPV_Elenco_completo.csv].CODE as code2, [table_CPV_Elenco_completo.csv].ENGLISH as desc2 from [table_cpv_ro_en1.csv] join [table_CPV_Elenco_completo.csv]
  on [table_cpv_ro_en1.csv].[Coduri CPV sortate alfabetic dupa nume produs]=[table_CPV_Elenco_completo.csv].CODE


________________________________________


select [table_annex_s4_cpv_codes.csv].[column1] as code1, [table_annex_s4_cpv_codes.csv].[column2] as desc1, [table_table_en.csv].[CPV code 2003] as code2, [table_table_en.csv].[description] as desc2 from [table_annex_s4_cpv_codes.csv] join [table_table_en.csv]
  on [table_annex_s4_cpv_codes.csv].[column1] = [table_table_en.csv].[CPV code 2003]



________________________________________


select [Annex_TableEn].code1, [Annex_TableEn].desc1,[Annex_TableEn].code2, [Annex_TableEn].desc2, [CPVRO_CPVELENCO].code1,[CPVRO_CPVELENCO].desc1,[CPVRO_CPVELENCO].code2,[CPVRO_CPVELENCO].desc2 from [Annex_TableEn] join [CPVRO_CPVELENCO]
  on [Annex_TableEn].code1=[CPVRO_CPVELENCO].code1



________________________________________


SELECT *
  FROM [1314howe].[categorized_fat_with_calories] 


________________________________________


SELECT * FROM 
(SELECT row_number() over (order by [Total Fat] DESC) as row
     , *
  FROM [1314howe].[categorized_fat_with_calories] c) x
  where x.row>0


________________________________________


SELECT * FROM [1314howe].[categorized_fat_with_calories] c
  


________________________________________


SELECT * FROM [1314howe].[categorized_fat_with_calories] c
  


________________________________________


SELECT Date, [Total Calories], [Total Fat] FROM [1314howe].[categorized_fat_with_calories]
  WHERE seafood_calories > nut_calories
  AND vegetable_calories > chocolate_calories


________________________________________


SELECT [Date]
  , [Total Fat] 
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '8/16/2011'


________________________________________


SELECT [Date]
  , [Total Fat] 
  FROM [1314howe].[total_fat_6_month_projection] 
  where [Date] > '8/16/2011'


________________________________________


SELECT [Date]
  , [Total Fat] 
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '8/16/2011'


________________________________________


SELECT [Date]
  , [Total Fat] 
  FROM [1314howe].[total_fat_6_month_projection] 
  where [Date] > '8/16/2011'


________________________________________


SELECT [Date]
  , [Total Fat] 
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '8/16/2011'


________________________________________


SELECT [Date]
  , [Total Fat] 
  FROM [1314howe].[total_fat_6_month_projection] 
  where [Date] > '8/16/2011'


________________________________________


SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < '01/17/2014 00:00:00 am'


________________________________________


SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < '01/17/2014'


________________________________________


SELECT avg([Total Fat]) as running
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < '01/17/2014' 


________________________________________


SELECT * FROM [1314howe].[total_fat_6_month_projection]


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now2.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now2
  where [Date] > '8/16/2011'



________________________________________


SELECT * from [1314howe].[total_fat_6_month_projection] 



________________________________________


SELECT * from [1314howe].[total_fat_6_month_projection] t
order by t.[Date]


________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  WHERE [200ng/ul Water] < 0



________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  WHERE [Sample]=null or [Conc (ng/ul)]=null or [200ng/ul Water] = null



________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  WHERE [Sample]=''or [Conc (ng/ul)]='' or [200ng/ul Water] = ''


________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  WHERE [Sample]=''and [Conc (ng/ul)]='' and [200ng/ul Water] = '' and [200ng/ul DNA]=''


________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  WHERE [Sample]='' and [Conc (ng/ul)]='' and [200ng/ul Water] = '' and [200ng/ul DNA]=''


________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  WHERE [Sample]='' and [Conc (ng/ul)]='' and [200ng/ul Water] = '' 


________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  WHERE [Sample]='' or [Conc (ng/ul)]='' or [200ng/ul Water] = '' or [200ng/ul DNA]=''


________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  WHERE [200ng/ul Water] < 0


________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  


________________________________________


SELECT * FROM [71].[PlasmidDNA1.csv]
  WHERE [Plasmid] like  'A%'


________________________________________


SELECT count([Plasmid]) FROM [71].[PlasmidDNA1.csv]
  group by UPPER(LEFT([Plasmid],1))


________________________________________


SELECT UPPER(LEFT([Plasmid],1)), count([Plasmid]) FROM [71].[PlasmidDNA1.csv]
  group by UPPER(LEFT([Plasmid],1))


________________________________________


SELECT UPPER(LEFT([Plasmid],1)) as Plasmid_Group, count([Plasmid]) as Frequency_Count FROM [71].[PlasmidDNA1.csv]
  group by UPPER(LEFT([Plasmid],1))


________________________________________


SELECT * FROM [71].[PlasmidDNA_2.csv] P1, [71].[PlasmidDNA1.csv] P2  
  WHERE P1.[Plasmid]= P2.[Plasmid]



________________________________________


SELECT * FROM [71].[PlasmidDNA_2.csv] P1, [71].[PlasmidDNA1.csv] P2  
  WHERE P1.[Plasmid]= P2.[Plasmid]
  ORDER BY P1.[Plasmid]



________________________________________


SELECT * FROM [71].[PlasmidDNA_2.csv] P1 INNER JOIN [71].[PlasmidDNA1.csv] P2  
  ON P1.[Plasmid]= P2.[Plasmid]
  ORDER BY P1.[Plasmid]



________________________________________


SELECT P1.[Plasmid], P1.[Sample], P1.[Conc (ng/ul)], P1.[200ng/ul Water], P1.[200ng/ul DNA], P2.[Total Vol], P2.[Mulitplier], P2.[water], P2.[DNA], P2.[glycerol stock]
 FROM [71].[PlasmidDNA1.csv]  P1 INNER JOIN [71].[PlasmidDNA_2.csv] P2  
  ON P1.[Plasmid]= P2.[Plasmid]
  ORDER BY P1.[Plasmid]



________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '8/16/2012'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '1/16/2012'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '5/16/2012'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '4/16/2012'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '2/16/2012'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '1/16/2012'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '1/1/2012'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '1/25/2012'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '2/10/2012'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '2/10/2007'


________________________________________


SELECT [Date]
  , [Total Fat], (
  SELECT avg([Total Fat]) 
  FROM [1314howe].[total_fat_6_month_projection] past
  WHERE past.[Date] < now.[Date]
) as running_average_fat_grams
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '2/10/2012'


________________________________________


SELECT [Date]
  , [Total Fat]
  FROM [1314howe].[total_fat_6_month_projection] now
  where [Date] > '2/10/2012'


________________________________________


SELECT UPPER(LEFT([Plasmid],1)) as Plasmid_Group, count([Plasmid]) as Frequency_Count FROM [71].[PlasmidDNA1.csv]
  group by UPPER(LEFT([Plasmid],1))


________________________________________


SELECT * FROM [790].[table_1344.txt]
  where [a]>2 and b>12 



________________________________________


SELECT * FROM [790].[table_1344.txt]
  where [a]>2 and b>2  



________________________________________


SELECT * FROM [790].[table_1344.txt]
  where [a]>0 and b>2  



________________________________________


SELECT * FROM [790].[table_1344.txt]
  



________________________________________


SELECT * FROM [790].[PhoneBook.csv]
  where [name]='hossein'



________________________________________


SELECT * FROM [790].[PhoneBook.csv]
  where [name]='hosserin'



________________________________________


--SELECT * FROM 

Alter table [790].[table_PhoneBook.csv]
  add cellphone int  


________________________________________



insert into [table_PhoneBook.csv]
  (name)
  values ('Sara' )





________________________________________


--SELECT * FROM [790].[table_PhoneBook.csv]

insert into [table_PhoneBook.csv]
  (name)
  values ('Sara' )


________________________________________


--SELECT * FROM [790].[table_PhoneBook.csv]

insert into [790].[table_PhoneBook.csv]
  (name)
  values ('Sara' )


________________________________________


insert into [790].[table_PhoneBook.csv]
  (name)
  values ('Sara' )


________________________________________


insert into [790].[table_PhoneBook.csv]
  ([name],[last name],[home])
  values ('sara','kim',23)



________________________________________


SELECT * FROM [790].[table_PhoneBook.csv]


________________________________________


--SELECT * FROM 
 delete from [790].[table_PhoneBook.csv]
   where [name]='Sara'



________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
   



________________________________________



   
insert into [790].[table_PhoneBook.csv]
  ([name],[last name],[address])
  values ('Sara','Paxton','98012 Ave NE')


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
   
---insert into 
  --([name],[last name],[address])
  ---values ('Sara','Paxton','98012 Ave NE')


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
    where 'name'='sara'
   
--insert into [790].[table_PhoneBook.csv]
 --([cellphone])
 -- values (0123457678)
 -- where name='sara'


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
    where 'name'='Sara'
   
--insert into [790].[table_PhoneBook.csv]
 --([cellphone])
 -- values (0123457678)
 -- where name='sara'


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
    where name='Sara'
   
--insert into [790].[table_PhoneBook.csv]
 --([cellphone])
 -- values (0123457678)
 -- where name='sara'


________________________________________


--SELECT * FROM  [790].[table_PhoneBook.csv]
   -- where name='Sara'
   
update [790].[table_PhoneBook.csv]
 set [cellphone]= (0123457678)
  where name='sara'


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
    where name='Sara'
   
update [790].[table_PhoneBook.csv]
 set [cellphone]= (0123457678)
  where name='sara'


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
   


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
  



________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
  where [name]='Manijeh'



________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
  



________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
   


________________________________________


SELECT * FROM [790].[table_1344.txt]


________________________________________


SELECT * FROM [790].[table_1344.txt]
  where [a]>=1 and [c]>4 



________________________________________


SELECT * FROM [790].[table_1344.txt]


________________________________________


SELECT * FROM [790].[table_1344.txt]


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
  


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
  where [name]='Mery'


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
  where [name]='Mery'


________________________________________


SELECT * FROM [790].[table_1344.txt]
  where [a]>=1 and [c]>4 



________________________________________


select * from [one&six_1.csv] 


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where [Major]<= 80 and [Minor]>=8 



________________________________________


SELECT * FROM [790].[table_1344.txt]
  where [a]>=1 and [c]>4 



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Major<120 and Minor>=8



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Major<80 and Minor>=8



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Minor<12



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Minor<12 and Major>80



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Minor<12 and Major>80



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Minor<12 and Major>80



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Minor<12 and Major>80



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Major<20



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Major<25



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Major<25


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Major<25


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Major<25 and AccyType=31


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]




________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Major<85



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where Major<85 and AccyType=31



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity>=2


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity<2


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  and Unit<>0


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  and Unit<>0 and Grade>3


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  and Unit<>0 


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  and Unit<>0 and Grade>3


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  and Unit<>0 and Grade>3


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  and Unit<>0 and Grade>3


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  and Unit<>0 and Grade>3


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  and Unit<>0 and Grade>3


________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<6 and Quantity>2  and Unit<>0 and Grade>3



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<4 and Quantity>2  and Unit<>0 and Grade>3



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<4 and Quantity>2  and Unit<>0 and Grade>3



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<4 and Quantity>2  and Unit<>0 and Grade>3



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]
  where AccyType=31 and Size<>0 and Quantity<4 and Quantity>2  and Unit<>0 and Grade>3



________________________________________


SELECT * FROM [790].[table_EXTR_Accessory_V.csv]


________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]


________________________________________


--SELECT * FROM  [790].[table_PhoneBook.csv]
  insert into [790].[table_PhoneBook.csv] 
    values ('Sara','Estiri',76,98,'iran',980)



________________________________________


SELECT * FROM  [790].[table_PhoneBook.csv]
  --insert into [790].[table_PhoneBook.csv] 
    --values ('Sara','Estiri',76,98,'iran',980)



________________________________________



SELECT * FROM [1307].[Forty columns of HIV survey data]



________________________________________


SELECT year,month,observedSwo,smoothedSwo,observedFlux,smoothedFlux FROM NoaaSwpcSolarIndecies



________________________________________


SELECT * FROM NoaaSwpcSolarIndecies



________________________________________


SELECT * FROM [1307].[10.7 cm Solar Flux]



________________________________________


SELECT * FROM [1307].[Forty columns of HIV survey data]



________________________________________


SELECT common_name, county, count(*)
  FROM [1231].[NatureMapping]
  WHERE  common_name is not null
  group by common_name, county
  order by count(*) desc



________________________________________


SELECT common_name, county, count(*)
  FROM [1231].[NatureMapping]
  WHERE  common_name is not null
  AND county IS NOT NULL
  group by common_name, county
  order by count(*) desc



________________________________________


SELECT common_name, county, count(*)
  FROM [1231].[NatureMapping]
  WHERE  common_name is not null
  group by common_name, county
  order by count(*) desc



________________________________________


SELECT common_name, county, count(*)
  FROM [1231].[NatureMapping]
  WHERE  common_name is not null
  and county = 'Pierce'
  group by common_name, county
  order by count(*) desc



________________________________________


SELECT common_name, county, count(*)
  FROM [1231].[NatureMapping]
  WHERE  common_name is not null
    and county = 'King'
  group by common_name, county
  order by count(*) desc



________________________________________


SELECT common_name, county, count(*)
  FROM [1231].[NatureMapping]
  WHERE  common_name is not null
  group by common_name, county
  order by count(*) desc



________________________________________


SELECT s.TIGRFam, normalized_hit_count, m.* FROM [1352].[Amazon Sample Metadata] m, [1352].[Amazon: TIGRFam Hit Counts by Sample] s WHERE m.Sample = s.Sample



________________________________________



SELECT latitude, longitude FROM [1307].[Alicia TIGRFam]



________________________________________


SELECT * FROM [1307].[table_cinq_cents_objets_1312nomiques.csv]


________________________________________


SELECT * FROM [1307].[cinq cents objets 1312nomiques]


________________________________________






________________________________________






________________________________________


SELECT * FROM [1307].[table_vingt_objets_1312nomiques.csv]


________________________________________


SELECT * FROM [1307].[table_vingt_objets_1312nomiques.csv]



________________________________________


SELECT year, observedFlux FROM [1307].[10.7 cm Solar Flux]


________________________________________


SELECT year, month, observedFlux FROM [1307].[10.7 cm Solar Flux]


________________________________________


SELECT s.TIGRFam, normalized_hit_count, m.* FROM [1352].[Amazon Sample Metadata] m, [1352].[Amazon: TIGRFam Hit Counts by Sample] s WHERE m.Sample = s.Sample


________________________________________


SELECT cast(datepart(hour, binid) as varchar(2)) + ':00' as hour, binid as timestamp, lat, lon, salinity as salinity, ocean_temp as ocean_temp, fluorescence, transmission, [(O2/Ar)sat] as oxygen_sat, pop as seaflow_pop, conc as seaflow_conc, chl_big as seaflow_chl, fsc_big as seaflow_fsc, pe as seaflow_pe FROM [1314howe].[SDS and Seaflow Joined with Biological productivity] ORDER BY binid asc



________________________________________


SELECT cast(datepart(hour, binid) as varchar(2)) + ':00' as hour, binid as timestamp, salinity as salinity, fluorescence, transmission, [(O2/Ar)sat] as oxygen_sat, pop as seaflow_pop, conc as seaflow_conc, chl_big as seaflow_chl, fsc_big as seaflow_fsc, pe as seaflow_pe FROM [1314howe].[SDS and Seaflow Joined with Biological productivity] ORDER BY binid asc



________________________________________


SELECT cast(datepart(hour, binid) as varchar(2)) + ':00' as hour, binid as timestamp, fluorescence, transmission, [(O2/Ar)sat] as oxygen_sat, pop as seaflow_pop, conc as seaflow_conc, chl_big as seaflow_chl, fsc_big as seaflow_fsc, pe as seaflow_pe FROM [1314howe].[SDS and Seaflow Joined with Biological productivity] ORDER BY binid asc



________________________________________


SELECT * FROM [1307].[Flow Cytometry by Alicia]


________________________________________


SELECT * FROM [1307].[Flow Cytometry by Alicia]


________________________________________


SELECT * FROM [1307].[Seattle City Park Locations]


________________________________________


select * from [1307].[three periods of sine square and random]



________________________________________


select * from [1307].[three periods of sine, square, and random]



________________________________________


select * from [1307].[three NOISY periods of sine, square, and random]



________________________________________


SELECT * FROM [1307].[table_prodAndDevel_feature_dump_28oct2011_1428.csv] ORDER BY ui_score DESC


________________________________________


select * from [1307].[three periods of sine, square, and random]


________________________________________


SELECT s.TIGRFam, normalized_hit_count, m.day_or_night, m.Depth, m.Temperature, m.Salinity, m.Latitude, m.Longitude FROM [1352].[Amazon Sample Metadata] m, [1352].[Amazon: TIGRFam Hit Counts by Sample] s WHERE m.Sample = s.Sample


________________________________________


SELECT * FROM [1307].[Seattle City Park Locations]


________________________________________


SELECT * FROM [1314howe].[mhip_travel_distance_home_clinic]



________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]



________________________________________


WAITFOR DELAY '00:00:55' SELECT * FROM [1318].[table_United States Wind Energy Potential.csv]



________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv] where Country='Albania'


________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]



________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]



________________________________________


SELECT * FROM [1318].[table_United States Wind Energy Potential.csv]


________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


WAITFOR DELAY '00:03:55' SELECT * FROM [table_2010 Quality of Life Index.csv]



________________________________________


WAITFOR DELAY '00:00:15' SELECT * FROM [table_2010 Quality of Life Index.csv]



________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]


________________________________________


SELECT * FROM [1314howe].[UW highest paid employee by department]


________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
where last = 'peckol'


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
where last = 'sarkisian'


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
where last = 'willingham'


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
where title = 'senior fellow'


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
  where title in('senior fellow')


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
  where title in('coach')


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
  where title in('*coach')


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
  where title in('coach')


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
  where title in('*coach*')


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
  where title like 'coach'


________________________________________


SELECT * FROM [1314howe].[UW employees, salary and department]
  where title like '%coach%'


________________________________________


SELECT * FROM [807].[CSESalariesWithFalsePositives]


________________________________________


SELECT * FROM [807].[CSESalariesWithFalsePositives]


________________________________________


SELECT *
  FROM [1314howe].[UW employees, salary and department] s
 WHERE salary = (
   SELECT max(x.salary)
     FROM [1314howe].[UW employees, salary and department] x
    WHERE s.department = x.department
 )
  ORDER BY salary DESC 



________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


SELECT * FROM [1318].[table_Geo-tagged Wikipedia articles.csv]


________________________________________


SELECT * FROM [1318].[table_Coffee Production.csv]


________________________________________


SELECT * FROM [1318].[table_Geo-tagged Wikipedia articles.csv]


________________________________________


SELECT * FROM [1318].[Coffee Production Long.csv]
  where Country like('Angola')


________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


SELECT * FROM [1318].[table_Geo-tagged Wikipedia articles.csv]


________________________________________


SELECT * FROM [1318].[table_Geo-tagged Wikipedia articles.csv]


________________________________________


SELECT * FROM [1117].[Orca Sound Classifications- Resident ONLY]


________________________________________


SELECT * FROM [1117].[Orca Sound Classifications- Resident ONLY]


________________________________________


SELECT * FROM [1318].[table_Coffee Production Long.csv]
  where Country like('Angola')


________________________________________


WAITFOR DELAY '00:00:30' SELECT * FROM [1318].[table_Coffee Production Long.csv]
  where Country like('Angola')


________________________________________


WAITFOR DELAY '00:00:30' SELECT * FROM [1318].[table_Coffee Production Long.csv]
  where Country like('Angola')


________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


WAITFOR DELAY '00:00:30' SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


WAITFOR DELAY '00:00:15' SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


WAITFOR DELAY '00:00:10' SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


SELECT * FROM [1117].[Orca Sound Classifications- Resident ONLY]


________________________________________


SELECT * FROM [1117].[Orca Sound Classifications- Resident ONLY]


________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


SELECT * FROM [table_2010 Quality of Life Index.csv]


________________________________________


SELECT * FROM [1307].[10.7 cm Solar Flux]


________________________________________


SELECT * FROM [1318].[table_Coffee Production Long.csv]


________________________________________


SELECT * FROM [1307].[10.7 cm Solar Flux]


________________________________________


SELECT * FROM [1318].[table_Coffee Production Long.csv]


________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009] 
  where last like('biechel')


________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009] 
  where last like('biechele')


________________________________________


SELECT * FROM [1314howe].[UW Salaries 2009] 
  where last like('jones')


________________________________________


SELECT * FROM [1318].[United States Wind Energy Potential Test.csv]


________________________________________


SELECT * FROM [1318].[table_United States Wind Energy Potential.csv]


________________________________________


SELECT * FROM [1318].[table_United States Wind Energy Potential.csv]


________________________________________


SELECT * FROM [1318].[United States Wind Energy Potential Test.csv]


________________________________________


SELECT * FROM [1318].[Coffee Production Long.csv]


________________________________________


SELECT * FROM [1318].[Coffee Production Long.csv]




________________________________________


SELECT * FROM [1318].[Testing new row counts]


________________________________________


SELECT * FROM [1318].[Coffee Production Long.csv]




________________________________________


SELECT * FROM [1318].[Coffee Production Long.csv]




________________________________________


SELECT * FROM [1318].[Incidents between north and south Korea.csv]


________________________________________


SELECT * FROM [1318].[Coffee Production Long.csv]




________________________________________


SELECT * FROM [1318].[table_Incidents between north and south Korea.csv]


________________________________________


SELECT * FROM [1318].[table_Incidents between north and south Korea.csv]


________________________________________


SELECT * FROM [1318].[Incidents between north and south Korea.csv]


________________________________________


SELECT * FROM [1318].[Incidents between north and south Korea.csv]


________________________________________


SELECT * FROM [1318].[Incidents between north and south Korea.csv]


________________________________________


SELECT * FROM [95].[lifeExpectancyAtBirth.txt]


________________________________________


SELECT * FROM [1318].[Incidents between north and south Korea.csv]


________________________________________


SELECT * FROM [1318].[Testing new row counts]


________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , convert(varchar(max), lat) as LATITUDE
     , convert(varchar(max), long) as LONGITUDE
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]

 UNION

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family
  FROM [1231].[ArboretumData.csv]

  UNION

SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]

  UNION

SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed' OR QUESTION =
'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , convert(varchar(max), lat) as LATITUDE
     , convert(varchar(max), long) as LONGITUDE
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]

 UNION

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family
  FROM [1231].[ArboretumData.csv]

  UNION

SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]

  UNION

SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed' OR QUESTION =
'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT * FROM [1318].[table_Coffee Production.csv]


________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , convert(varchar(max), lat) as LATITUDE
     , convert(varchar(max), long) as LONGITUDE
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]

 UNION

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family
  FROM [1231].[ArboretumData.csv]

  UNION

SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]

  UNION

SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed' OR QUESTION =
'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT 'historic' as datasource
     , OBSERVER_ID
     , species_id as Species_code
     , NULL as common_name
     , NULL as scientific_name
     , question as questionable
     , state
     , county
     , NULL as date
     , year
     , month
     , NULL as day
     , convert(varchar(max), lat) as LATITUDE
     , convert(varchar(max), long) as LONGITUDE
     , source
     , quantity
     , estimate
     , habitat1 as habitat1
     , null as habitat2
     , comments
     , null as family
  FROM [1231].[NatureMapping_historic1.csv]

 UNION

SELECT 'arboretum' as datasource
     , Obs_id
     , NULL as species_code
     , species as common_name
     , NULL as scientific_name
     , q as questionable
     , st as state
     , cast(Co as varchar(max)) as county
     , convert(datetime, [date]) as date
     , datepart(year, convert(datetime, [date])) as year
     , datepart(month, convert(datetime, [date])) as month
     , datepart(day, convert(datetime, [date])) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , cast(source as varchar(max)) as source
     , qty as quantity
     , null as estimate
     , habitat as habitat1
     , null as habitat2
     , comment as comments
     , species_type as family
  FROM [1231].[ArboretumData.csv]

  UNION

SELECT 'online_export' as datasource
     , OBSERVER_ID
     , Species_id as species_code
     , SPECIES_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Sure' THEN 1 ELSE 0 END as questionable
     , STATE
     , COUNTY
     , convert(datetime, OBSERVATION_DATE) as date
     , datepart(year, convert(datetime, OBSERVATION_DATE)) as year
     , datepart(month, convert(datetime, OBSERVATION_DATE)) as month
     , datepart(day, convert(datetime, OBSERVATION_DATE)) as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , SOURCE
     , QUANTITY
     , ESTIMATE
     , HABITAT1
     , habitat2
     , COMMENTS
     , null as family
  FROM [1231].[online_export_080410_edit.csv]

  UNION

SELECT 'ebird' as datasource
     , NULL as OBSERVER_ID
     , convert(varchar(max), species_code) as species_code
     , common_NAME as common_name
     , null as scientific_name
     , case when QUESTION = 'Not valid and reviewed' OR QUESTION =
'Not valid but not reviewed' THEN 0 ELSE 1 END as questionable
     , STATE
     , COUNTY
     , date as date
     , years as year
     , months as month
     , days as day
     , convert(varchar(max), latitude) as latitude
     , convert(varchar(max), longitude) as longitude
     , NULL as SOURCE
     , QUANTITY
     , null as ESTIMATE
     , null as HABITAT1
     , null as habitat2
     , COMMENTS
     , null as family
  FROM [1231].[xls_ebird_WA_history.txt]



________________________________________


SELECT * FROM [1318].[Chars Query of Bill]


________________________________________


SELECT * FROM [1318].[table_United States Wind Energy Potential.csv]


________________________________________


SELECT * FROM [1318].[United States Wind Energy Potential Test.csv]


________________________________________


SELECT * FROM [1318].[Which dataset is this]


________________________________________


SELECT * FROM [1231].[Top_20_species]


________________________________________


SELECT * FROM [1231].[Top_20_species]
  where Column2 > 100



________________________________________


SELECT * FROM [1231].[Top_20_species]
  where Column2 > 30



________________________________________


SELECT * FROM [1231].[Top_20_species]
  where Column2 > 3



________________________________________


SELECT * FROM [1318].[Chars Query of Bill]


________________________________________


SELECT * FROM [1318].[Chars Query of Bill]
  where Species_code like 'COFA'



________________________________________


SELECT * FROM [1231].[Top_20_species]


________________________________________


select (12)



________________________________________


select * from sys.tables



________________________________________


select (1) WAITFOR DELAY '00:00:10'



________________________________________


select (1) WAITFOR DELAY '00:00:10'



________________________________________


select (1) WAITFOR DELAY '00:00:10'



________________________________________


select (1) WAITFOR DELAY '00:00:10'



________________________________________


SELECT *  FROM [1352].[all_MBARI_1358.sqltbl.clean.csv] c
  WHERE not exists (
 SELECT pp FROM [1352].[all_MBARI_1358.sqltbl.clean.csv] d
 WHERE c.gene = d.gene AND c.pp < d.pp
)  ORDER BY [database], gene



________________________________________


select * from sys.tables



________________________________________


select * from sys.tables



________________________________________


select *from sys.tables


________________________________________


select *from sys.tables


________________________________________


select *from sys.tables


________________________________________


select *from sys.tables


________________________________________


select *from sys.tables


________________________________________


select *from sys.tables


________________________________________


select *from sys.tables


________________________________________


select *from sys.tables


________________________________________


select *from sys.tables


________________________________________


select *from sys.tables


________________________________________


SELECT * FROM [957].[1358 w new]


________________________________________


select '<script>alert("This is not great");</script>OK'



________________________________________


select '<a onmouseover="j1313script:alert(\"Not too good\");" href="http://google.com/">Hover</a>'



________________________________________


SELECT * FROM [957].[new 1358]


________________________________________


SELECT * FROM [957].[aa_1358_file.csv]


________________________________________


select 1


________________________________________


select (1), (2)


________________________________________


select TOP 100 (1), (2)


________________________________________


SELECT (1), (2)


________________________________________


SELECT TOP 100 (1), (2)
  UNION SELECT (2), (3)


________________________________________


SELECT TOP 1 (1), (2)
  UNION SELECT (2), (3)


________________________________________


SELECT TOP 0 (1), (2)
  UNION SELECT (2), (3)


________________________________________


select (1) a, (2) b



________________________________________


select (1) a, (2) b order by b



________________________________________


select (1) as a order by a



________________________________________


select (1) as a order by a



________________________________________


select (1)



________________________________________


select (1)



________________________________________


select (1.1)



________________________________________


SELECT * FROM [957].[table_aa_1358_file_1.csv]


________________________________________


SELECT * FROM [957].[table_aa_1358_file_1.csv] 



________________________________________


SELECT * FROM [957].[table_aa_1358_file_1.csv] union select 10 as Django, 11 as Upload, 12 as Test, 13 as [File]



________________________________________


SELECT * FROM [957].[table_aa_1358_file_1.csv] 



________________________________________


SELECT * FROM [957].[table_aa_1358_file_1.csv] union select 10 as Django, 11 as Upload, 12 as Test, 13 as [File]


________________________________________


SELECT * FROM [1143].[publication]
  where title like 'explanation'



________________________________________


SELECT * FROM [1143].[publication]
  where title like '%explanation%'



________________________________________


SELECT * FROM [1143].[publication]
  where title like '%explanation%'
  order by year desc



________________________________________


SELECT X.title, X.year, X.venue, X.type
  FROM [1143].[publication] X
  where title like '%explanation%'
  
  order by year desc



________________________________________


SELECT X.title, X.year, X.venue, X.type
  FROM [1143].[publication] X
  where title like '%explanation%'
  and venue <> 'CoRR'
  order by year desc



________________________________________


SELECT X.title, X.year, X.venue, X.type
  FROM [1143].[publication] X
  where title like '%explanation%'
  and venue <> 'CoRR'
  and (venue like '%sigmod%' or venue like '%vldb%' or venue like '%icde%' or venue like '%pods%')
  order by year desc



________________________________________


SELECT X.title, X.year, X.venue, X.type
  FROM [1143].[publication] X
  where title like '%explanation%'
  and venue <> 'CoRR'
  and (venue like '%sigmod%' or venue like '%icdt%' or venue like '%vldb%' or venue like '%icde%' or venue like '%pods%')
  order by year desc



________________________________________


SELECT X.title, X.year, X.venue, X.type
  FROM [1143].[publication] X
  where title like '%explanation%'
  and venue <> 'CoRR'
  and (venue like '%kdd%' or venue like '%nips%' or venue like '%icdm%' or venue like '%ai%' or venue like '%nlp%')
  order by year desc



________________________________________


SELECT X.title, X.year, X.venue, X.type
  FROM [1143].[publication] X
  where title like '%explanation%'
  and venue <> 'CoRR'
  and (venue like '%kdd%' or venue like '%nips%' or venue like '%icdm%' or venue like '%ai %' or venue like '%nlp%')
  order by year desc



________________________________________


SELECT X.title, X.year, X.venue, X.type
  FROM [1143].[publication] X
  where title like '%caus%'
  and venue <> 'CoRR'
  and (venue like '%sigmod%' or venue like '%vldb%' or venue like '%icde%' or venue like '%pods%')
  order by year desc



________________________________________


select MothersAgeRecode9, MothersMaritalStatus, count(*)
  from [1144].[table_natality-20k.csv]
  group by MothersAgeRecode9, MothersMaritalStatus



________________________________________


select MothersAgeRecode9, MothersMaritalStatus, count(*)
  from [1144].[table_natality-20k.csv]
  group by MothersAgeRecode9, MothersMaritalStatus
  with cube



________________________________________


select MothersAgeRecode9, MothersMaritalStatus, count(*)
  from [1144].[table_natality-20k.csv]
  group by MothersAgeRecode9, MothersMaritalStatus
  --with cube



________________________________________


select MothersAgeRecode9, MothersMaritalStatus, count(*)
  from [1144].[table_natality-20k.csv]
  group by MothersAgeRecode9, MothersMaritalStatus
  --with cube



________________________________________


select MothersAgeRecode9, MothersMaritalStatus, count(*)
  from [1144].[table_natality-20k.csv]
  group by MothersAgeRecode9, MothersMaritalStatus
  with cube



________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='SIGCOMM'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='DEV'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='UBICOMP'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='DAC'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='ICCAD'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='ICTD'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='ACMDEV'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='ACM DEV'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='Pervasive'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='HotMobile'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='WMCSA'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 20 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='UBICOMP'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 50 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='UBICOMP'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


SELECT TOP 10 a.fullname, count(*) as c
FROM  [1143].[author] a,
      [1143].[authored] b,
      [1143].[inproceedings] p
WHERE a.fullname = b.fullname and b.pubID = p.id
  and p.booktitle='ACM DEV'
GROUP BY a.fullname
ORDER BY c DESC;


________________________________________


select (1)


________________________________________


select(1)


________________________________________


select (2)


________________________________________






________________________________________






________________________________________






________________________________________






________________________________________



select (1)


________________________________________






________________________________________






________________________________________






________________________________________






________________________________________






________________________________________



select (1)



________________________________________


select (1)



________________________________________



select (1)


________________________________________


WAITFOR DELAY '00:01'


________________________________________


WAITFOR DELAY '00:01'


________________________________________


SELECT * FROM [1227].[file0]


________________________________________


SELECT * FROM [1227].[table_basic_2.csv]


________________________________________


select (1)


________________________________________


SELECT * FROM [1227].[table_data_20.csv]


________________________________________


SELECT * FROM [1227].[table_data_20.csv]


________________________________________


select (1) 


________________________________________


select (66)


________________________________________


SELECT * FROM [1227].[table_aa_1358_file_3.csv]


________________________________________


SELECT * FROM [1314howe].[info_escience_senders_detail.txt] order by date desc



________________________________________


SELECT * FROM [1314howe].[info_escience_senders_detail.txt] 
  where date like '%2011%'
  order by date desc



________________________________________


SELECT cast(date as char(30)), * FROM [1314howe].[info_escience_senders_detail.txt] 
  where date like '%2011%'
  order by date desc



________________________________________


SELECT -- cast(date as date),
  CAST(date AS VARCHAR(4)),
  --+ '/' + CAST(MONTH(date) AS VARCHAR(2)) + '/' +        CAST(DAY(date) AS VARCHAR(2)) AS DATETIME)
  * FROM [1314howe].[info_escience_senders_detail.txt] 
  where date like '%2011%'
  order by date desc



________________________________________


SELECT -- cast(date as date),
  CAST(date AS VARCHAR(3)),
  --+ '/' + CAST(MONTH(date) AS VARCHAR(2)) + '/' +        CAST(DAY(date) AS VARCHAR(2)) AS DATETIME)
  * FROM [1314howe].[info_escience_senders_detail.txt] 
  where date like '%2011%'
  order by date desc



________________________________________


SELECT -- cast(date as date),
  CAST(date AS VARCHAR(3)),
  --+ '/' + CAST(MONTH(date) AS VARCHAR(2)) + '/' +        CAST(DAY(date) AS VARCHAR(2)) AS DATETIME)
  * FROM [1314howe].[info_escience_senders_detail.txt] 
  where date like '%2011%'
  order by date desc



________________________________________


select (1)


________________________________________


