0
我有这三个表:涉及多个表之间关系的SQL查询。 SQLITE3
create table Nation ("nationkey" integer,
"name" text,
"regionkey" integer,
"comment" text,
"null" text,
foreign key (regionkey) references Region);
create table Supplier ("suppkey" integer,
"name" text,
"address" text,
"nationkey" integer,
"phone" text,
"acctbal" real,
"comment" text,
"null" text,
foreign key (nationkey) references Nation);
create table Customer ("custkey" integer,
"name" text,
"address" text,
"nationkey" integer,
"phone" text,
"acctbal" real,
"mktsegment" text,
"comment" text,
"null" text,
foreign key (nationkey) references Nation);
我必须写一个SQL查询返回比供应商更多的客户国家的名字。查询需要在Sqlite3中。我对sql很陌生,不确定如何去做这件事。
做一些调查研究,并给它一试。如果您遇到问题,请发布您的SQL,我们会尽力提供帮助。 http://stackoverflow.com/help/how-to-ask –
您将需要'JOIN','GROUP BY','COUNT'和'HAVING'。祝你好运! –
如果您有这些表格的测试数据和预期结果,请将此信息添加到您的帖子中。 –