QC資料庫表結構
有時候QC的報表不能滿足我們的要求,需要自己從QC的資料庫中查詢資料,放到Excel中進行統計並生成圖表,因此有必要熟悉一下QC的表結構:
Requirement (REQ)
- Req ID (RQ_REQ_ID)
- Name (RQ_REQ_NAME)
- Description (RQ_REQ_COMMENT)
- Requirement Type (RQ_TYPE_ID)
- Is Folder (RQ_IS_FOLDER) – beware. This contains incorrect data (folders with value “N”)
- Req Father ID (RQ_FATHER_ID) e.g. the folder id that the requirement is in.
- Risk (RQ_USER_03)
Requirement Types (REQ_TYPE)
- Requirement Type ID (TPR_TYPE_ID) – is foreign key for REQ.RQ_TYPE_ID
- Requirement Type Name (TPR_NAME) – e.g. “Folder”, “Business”, “Functional” etc
Requirement Coverage (REQ_COVER) – maps requirements to test cases
- Requirement (RC_REQ_ID)
- Covering Entity ID (RC_ENTITY_ID)
- Coverage Type (RC_ENTITY_TYPE) – always seems to be “TEST”. Do not put this in a WHERE clause or you will filter out requirements that do not have an associated test case.
Test (TEST) – contains test cases
- Test ID (TS_TEST_ID)
- Test Name (TS_NAME)
- Execution Status (TS_EXEC_STATUS)
下面SQL指令碼查出所有需求項:
-- This query shows all requirements in all folders.
SELECT
REQ.RQ_REQ_ID AS 'Requirement ID',
REQ.RQ_USER_01 AS 'Req ID Project', -- this has the original REQ ID from project doco
REQ.RQ_REQ_NAME AS 'Requirement Name',
REQ.RQ_REQ_COMMENT AS 'Requirement Description',
REQ_TYPE.TPR_NAME AS 'Requirement Type',
REQ.RQ_USER_03 AS 'Risk'
FROM
REQ
JOIN REQ_TYPE
ON REQ.RQ_TYPE_ID = REQ_TYPE.TPR_TYPE_ID -- join to get the name of the requirement type e.g "Folder"
WHERE
TPR_NAME != 'Folder' -- Only retrieve requirements of type "Business" or "Functional"
ORDER BY
RQ_REQ_ID
下面SQL指令碼查出所有測試用例:
-- This query shows all test cases in all folders.
SELECT
TEST.TS_TEST_ID AS 'Test ID',
TEST.TS_NAME AS 'Test Name',
TEST.TS_EXEC_STATUS AS 'Execution Status'
FROM
TEST
ORDER BY
TEST.TS_TEST_ID
下面SQL指令碼查出哪些有測試用例覆蓋的需求項:
-- This query shows all requirements with any test cases that are mapped to the requirement.
-- If there are 2 test cases mapped to a requirement, then both will be included.
SELECT
REQ.RQ_REQ_ID AS 'Requirement ID',
REQ.RQ_USER_01 AS 'Req ID Project', -- this has the original REQ ID from project doco
REQ.RQ_REQ_NAME AS 'Requirement Name',
REQ.RQ_REQ_COMMENT AS 'Requirement Description',
REQ_TYPE.TPR_NAME AS 'Requirement Type',
REQ.RQ_USER_03 AS 'Risk',
TEST.TS_TEST_ID AS 'Test Case ID',
TEST.TS_NAME AS 'Test Case Name',
TEST.TS_EXEC_STATUS AS 'Execution Status'
FROM
REQ
LEFT JOIN
REQ_COVER ON REQ.RQ_REQ_ID = REQ_COVER.RC_REQ_ID -- join requirements to test cases (REQ to REQ_COVER)
LEFT JOIN
TEST ON REQ_COVER.RC_ENTITY_ID = TEST.TS_TEST_ID -- join requirements to test cases (REQ_COVER to TEST)
JOIN
REQ_TYPE ON REQ.RQ_TYPE_ID = REQ_TYPE.TPR_TYPE_ID -- join to get the name of the requirement type e.g "Folder"
WHERE
REQ_TYPE.TPR_NAME != 'Folder' -- Only retrieve requirements of type "Business" or "Functional"
ORDER BY
REQ.RQ_REQ_ID
參考:
http://www.jds.net.au/tech-tips/quality-center-database-queries/
相關文章
- Activiti資料庫表結構資料庫
- MySQL 對比資料庫表結構MySql資料庫
- Agile PLM資料庫表結構(Oracle)資料庫Oracle
- 資料庫-單表結構-建表語句資料庫
- ECshop 每個資料庫表結構說明資料庫
- 織夢資料庫表結構_Dedecms資料庫表和欄位詳細介紹資料庫
- mysql資料庫-資料結構MySql資料庫資料結構
- DBus資料庫表結構變更處理方案資料庫
- 資料庫崩潰恢復表結構的方法資料庫
- 利用AUDIT檢視資料庫表結構變化資料庫
- 超給力,一鍵生成資料庫文件-資料庫表結構逆向工程資料庫
- Oracle 資料庫 結構Oracle資料庫
- SQL Server 批量生成資料庫內多個表的表結構SQLServer資料庫
- DB2資料庫匯出表結構與匯入、匯出表資料DB2資料庫
- Mysql匯出表結構、表資料MySql
- 資料結構——雜湊表資料結構
- [資料結構] - 線性表資料結構
- 資料結構 | 線性表資料結構
- 資料結構——線性表資料結構
- 資料結構-線性表資料結構
- 資料結構—線性表資料結構
- database資料庫的資料結構Database資料庫資料結構
- 如何用PLSQL匯出資料庫存表結構資訊SQL資料庫
- 如何比較兩個資料庫表結構的不同資料庫
- 【01】把 Elasticsearch 當資料庫使:表結構定義Elasticsearch資料庫
- 修改SQL-SERVER資料庫表結構的SQL命令SQLServer資料庫
- Oracle資料庫表結構匯出器-work/excel版本Oracle資料庫Excel
- Dedecms 資料庫 結構分析資料庫
- IMDB的資料庫結構資料庫
- 資料庫結構操作 (轉)資料庫
- 資料結構 - 線性表 - 順序表資料結構
- 資料結構進階:ST表資料結構
- 資料結構之「雜湊表」資料結構
- 資料結構(一)--- 跳躍表資料結構
- Redis資料結構—跳躍表Redis資料結構
- jdbcTemplate 獲取資料表結構JDBC
- 資料結構 - 雜湊表,初探資料結構
- 【資料結構之線性表總結】資料結構