Find the name and flag of ships that are not steered by any captain with Midshipman rank.
CREATE TABLE captain (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR); CREATE TABLE ship (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR)
SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE captain (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR); CREATE TABLE ship (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR) Question: Find the name and flag of ships that are not steered by any captain with Midshipman rank. [/INST] SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman') </s>