example: DATADDH_C is the sample comments table for hourly data. Daily detail audit trail is stored in the DataDDx_AT table where x is the VarType. For example: DATADDF_AT is the audit trail table for 15 Minute data. Daily detail additional info is stored in the DataDDx_I table where x is the VarType. For example: DATADDF_I is the additional info table for 15 Minute data. FILES Simulates a file system for WIMS clients. Files are stored as Binary Objects. – LOCATION Contains the list of Locations/sampling points. Used to populate the VarDesc.LocId field. – VarDesc.LOCID = Location.LOCID See for a complete list Basic SQL Queries A query retrieves records from Tables. SELECT : The SELECT clause specifies the table columns that are retrieved. FROM : The FROM clause specifies the tables accessed. WHERE : The WHERE clause specifies which table rows are used. The WHERE clause is optional; if missing, all table rows are used. ORDER BY: Sets the sort order of the returned records. Optional Example 1: List all variables in my database SELECT * FROM VARDESC Example 2: List all variables with units of MGD Example 3: List all variables with units of MGD or mg/L SQL is not case sensitive Example 4: Show me variables that do not have SCADATAGS
example: DATADDH_C is the sample comments table for hourly data. Daily detail audit trail is stored in the DataDDx_AT table where x is the VarType. For example: DATADDF_AT is the audit trail table for 15 Minute data. Daily detail additional info is stored in the DataDDx_I table where x is the VarType. For example: DATADDF_I is the additional info table for 15 Minute data. FILES – Simulates a file system for WIMS clients. Files are stored as Binary Objects. LOCATION – Contains the list of Locations/sampling points. Used to populate the VarDesc.LocId field. VarDesc.LOCID = Location.LOCID See for a complete list Basic SQL Queries A query retrieves records from Tables. SELECT : The SELECT clause specifies the table columns that are retrieved. FROM : The FROM clause specifies the tables accessed. WHERE : The WHERE clause specifies which table rows are used. The WHERE clause is optional; if missing, all table rows are used. ORDER BY: Sets the sort order of the returned records. Optional Example 1: List all variables in my database SELECT * FROM VARDESC Example 2: List all variables with units of MGD Example 3: List all variables with units of MGD or mg/L SQL is not case sensitive Example 4: Show me variables that do not have SCADATAGS
SQLBasicTraining.Docx