diff --git a/4_Queries_SQL/Specific_Instance_ Implementations.sql b/4_Queries_SQL/Specific_Instance_ Implementations.sql new file mode 100644 index 0000000..6e08067 --- /dev/null +++ b/4_Queries_SQL/Specific_Instance_ Implementations.sql @@ -0,0 +1,37 @@ +-- Show how Hyrum Reservoir node instance has seven different implementations +-- where ObjectTypeCV and InstanceNameCV make all of them related. + +SELECT DISTINCT ResourceTypeAcronym,MasterNetworkName, ScenarioName,ObjectTypeCV,ObjectType,InstanceNameCV,InstanceName + +FROM ResourceTypes + +Left JOIN "ObjectTypes" +ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID" + +LEFT JOIN "Attributes" +ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" + +LEFT JOIN "Mappings" +ON "Mappings"."AttributeID"= "Attributes"."AttributeID" + +LEFT JOIN "Instances" +ON "Instances"."InstanceID"="Mappings"."InstanceID" + +LEFT JOIN "ValuesMapper" +ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID" + +LEFT JOIN "ScenarioMappings" +ON "ScenarioMappings"."MappingID"="Mappings"."MappingID" + +LEFT JOIN "Scenarios" +ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID" + +LEFT JOIN "MasterNetworks" +ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID" + + + +-- Specifiy controlled Object Type, instance name, and an attribute of interest +WHERE ObjectTypeCV='Reservoir' and InstanceNameCV='Hyrum Reservoir' + +