Database Reference
In-Depth Information
Table 4.
( Continued )
Individual
Query (IQ)
Query Details
(200001) and table_column_id in (55,61) ORDER BY tr.table_row_id,
tr.serial_id LIMIT 2 OFFSET 0;
IQ15
SELECT c.COLUMN_NAME FROM INFORMATION_SCHEMA.
TABLE_CONSTRAINTS pk,INFORMATION_SCHEMA.
KEY_COLUMN_USAGE c WHERE pk.TABLE_NAME = ' product '
and CONSTRAINT_TYPE =
'
PRIMARY KEY
'
and c.
TABLE_NAME = pk.TABLE_NAME and c.
CONSTRAINT_NAME = pk.CONSTRAINT_NAME;
IQ16
SELECT c.COLUMN_NAME FROM INFORMATION_SCHEMA.
TABLE_CONSTRAINTS pk,INFORMATION_SCHEMA.
KEY_COLUMN_USAGE c WHERE pk.
TABLE_NAME = ' sales_fact ' and
CONSTRAINT_TYPE = ' PRIMARY KEY ' and c.
TABLE_NAME = pk.TABLE_NAME and c.
CONSTRAINT_NAME = pk.CONSTRAINT_NAME;
IQ17
SELECT * FROM product lt LEFT JOIN sales_fact rt ON lt.
product_id = rt.product_id LIMIT 1 OFFSET 0;
IQ18
SELECT trs.table_column_id FROM table_relationship trs WHERE trs.
tenant_id = 1000 and trs.db_table_id = 17 and trs.table_type = 2 and
trs.target_table_id = ' 16 ' and (trs.table_column_id = 47 or trs.
target_column_id = 47) ORDER BY 1 ASC;
IQ19
SELECT trl.table_row_id, trr.table_row_id FROM table_index trl,
table_index trr WHERE trl.tenant_id = 1000 and trr.tenant_id = 1000
and(((trl.db_table_id = 16 and trl.table_column_id = 47) and(trr.
db_table_id = 17 and trr.table_column_id = 58) and trl.value = trr.
value)) LIMIT 1 OFFSET 0;
IQ20
SELECT cttl.product_id, trr.table_row_id as right_row_id FROM
product cttl, table_index trr WHERE cttl.tenant_id = 1000 and trr.
tenant_id = 1000 and((trr.db_table_id = 17 and trr.
table_column_id = 58 and trr.value = CAST(cttl.product_id AS
TEXT))) LIMIT 1 OFFSET 0;
IQ21
SELECT tr.table_column_id, tr.value, tr.table_row_id, tr.serial_id FROM
table_row tr WHERE tr.tenant_id = 1000 and tr.db_table_id = 17 and
tr.table_row_id IN (200001) ORDER BY 3,4 LIMIT 11 OFFSET 0;
IQ22
SELECT sf.sales_fact_id FROM sales_fact sf WHERE sf.
tenant_id = 1000 and sf.quantity > = 9000 and product_id = 100
ORDER BY sf.sales_fact_id;
IQ23
SELECT * FROM sales_details sd WHERE sd.tenant_id = 1000 and sd.
discount > = 30 and (sales_fact_id in (9, 12, 16, and other IDs))
ORDER BY sd.sales_details_id LIMIT 1;
IQ24
SELECT * FROM table_relationship trs WHERE trs.tenant_id = 1000
and trs.db_table_id = 16 or trs.target_table_id = 16 ORDER BY trs.
table_relationship_id;
( Continued )
Search WWH ::




Custom Search