'."\n"; ?> CS2310 Sample SQL Queries

IC Card Management System - Sample SQL Queries

-- select all fields for the IC card named "Hospital"
SELECT * FROM icCard WHERE icName = "Hospital"

-- select the Description from the IC card named "Hospital"
SELECT icDescription FROM icCard WHERE icName = "Hospital"

-- select all IC card ids that are part of a group
SELECT id FROM icCardEntry WHERE groupId > -1

-- select all IC card ids for cards that interact with card 1
SELECT id FROM icInteractions WHERE otherIcId = 1

-- select all IC card ids for cards that are direct sub-patterns of card 1
SELECT id FROM icInteractions WHERE parentId = 1

Click here to download the above sql file.