-- DBMS: bigquery
CREATE TABLE `bigquery-public-data.ebi_chembl.activities_30`
(
  activity_id INT64 NOT NULL OPTIONS(description="Unique ID for the activity row"),
  assay_id INT64 NOT NULL OPTIONS(description="Foreign key to the assays table (containing the assay description)"),
  doc_id INT64 OPTIONS(description="Foreign key to documents table (for quick lookup of publication details - can also link to documents through compound_records or assays table)"),
  record_id INT64 NOT NULL OPTIONS(description="Foreign key to the compound_records table (containing information on the compound tested)"),
  molregno INT64 OPTIONS(description="Foreign key to compounds table (for quick lookup of compound structure - can also link to compounds through compound_records table)"),
  standard_relation STRING OPTIONS(description="Symbol constraining the activity value (e.g. >, <, =)"),
  standard_value FLOAT64 OPTIONS(description="Same as PUBLISHED_VALUE but transformed to common units: e.g. mM concentrations converted to nM."),
  standard_units STRING OPTIONS(description=" Selected 'Standard' units for data type: e.g. concentrations are in nM."),
  standard_flag INT64 OPTIONS(description="Shows whether the standardised columns have been curated/set (1) or just default to the published data (0)."),
  standard_type STRING OPTIONS(description=" Standardised version of the published_activity_type (e.g. IC50 rather than Ic-50/Ic50/ic50/ic-50)"),
  activity_comment STRING OPTIONS(description="Previously used to report non-numeric activities i.e. 'Slighty active', 'Not determined'. STANDARD_TEXT_VALUE will be used for this in future, and this will be just for additional comments."),
  data_validity_comment STRING OPTIONS(description="Comment reflecting whether the values for this activity measurement are likely to be correct - one of 'Manually validated' (checked original paper and value is correct), 'Potential author error' (value looks incorrect but is as reported in the original paper), 'Outside typical range' (value seems too high/low to be correct e.g., negative IC50 value), 'Non standard unit type' (units look incorrect for this activity type)."),
  potential_duplicate INT64 OPTIONS(description="When set to 1, indicates that the value is likely to be a repeat citation of a value reported in a previous ChEMBL paper, rather than a new, independent measurement. Note: value of zero does not guarantee that the measurement is novel/independent though"),
  pchembl_value FLOAT64 OPTIONS(description="Negative log of selected concentration-response activity values (IC50/EC50/XC50/AC50/Ki/Kd/Potency)"),
  bao_endpoint STRING OPTIONS(description="ID for the corresponding result type in BioAssay Ontology (based on standard_type)"),
  uo_units STRING OPTIONS(description="ID for the corresponding unit in Unit Ontology (based on standard_units)"),
  qudt_units STRING OPTIONS(description="ID for the corresponding unit in QUDT Ontology (based on standard_units)"),
  toid INT64 OPTIONS(description=" The Test Occasion Identifier, used to group together related activity measurements"),
  upper_value FLOAT64 OPTIONS(description="Where the activity is a range, this represents the highest value of the range (numerically), while the PUBLISHED_VALUE column represents the lower value"),
  standard_upper_value INT64 OPTIONS(description="Where the activity is a range, this represents the standardised version of the highest value of the range (with the lower value represented by STANDARD_VALUE)"),
  src_id INT64 OPTIONS(description="Foreign key to source table, indicating the source of the activity value"),
  type STRING NOT NULL OPTIONS(description="Type of end-point measurement: e.g. IC50, LD50, %inhibition etc, as it appears in the original dataset"),
  relation STRING OPTIONS(description="Symbol constraining the activity value (e.g. >, <, =), as it appears in the original dataset"),
  value FLOAT64 OPTIONS(description="Datapoint value as it appears in the original dataset."),
  units STRING OPTIONS(description=" Units of measurement as they appear in the original dataset"),
  text_value STRING OPTIONS(description="Non-numeric value for measurement as in original dataset"),
  standard_text_value STRING OPTIONS(description="Standardized version of non-numeric measurement")
);

INSERT INTO `bigquery-public-data.ebi_chembl.activities_30` (activity_id, assay_id, doc_id, record_id, molregno, standard_relation, standard_value, standard_units, standard_flag, standard_type, activity_comment, data_validity_comment, potential_duplicate, pchembl_value, bao_endpoint, uo_units, qudt_units, toid, upper_value, standard_upper_value, src_id, type, relation, value, units, text_value, standard_text_value) VALUES (14533479, 1327810, 81810, 2072947, 1724870, '=', 14.9, 'ucm/s', 0, 'permeability', NULL, NULL, 0, nan, 'BAO_0002808', NULL, NULL, NULL, nan, NULL, 1, 'permeability', '=', 14.9, 'ucm/s', NULL, NULL), (14552144, 1328175, 82051, 2076992, 1727934, '=', 30.0, 'mL.min-1.kg-1', 1, 'CL', NULL, NULL, 0, nan, 'BAO_0002759', NULL, NULL, NULL, nan, NULL, 1, 'CL', '=', 30.0, 'ml/min.kg', NULL, NULL), (14584908, 1336038, 82217, 2087119, 1736260, '=', 2.0, 'mL.min-1.kg-1', 1, 'CL', NULL, NULL, 0, nan, 'BAO_0002759', NULL, NULL, NULL, nan, NULL, 1, 'CL', '=', 0.12, 'L/hr/kg', NULL, NULL), (14615592, 1341036, 82819, 2089490, 1738203, '>', 1000.0, 'mg.kg-1', 1, 'LD50', NULL, NULL, 0, nan, 'BAO_0002117', 'UO_0000308', NULL, NULL, nan, NULL, 1, 'LD50', '>', 1000.0, 'mg kg-1', NULL, NULL), (14633014, 1345169, 82761, 2089307, 1738035, '=', 0.037, '10''6L/mol', 0, 'KA', NULL, NULL, 0, nan, 'BAO_0002809', NULL, NULL, NULL, nan, NULL, 1, 'KA', '=', 0.037, '10''6L/mol', NULL, NULL);