SELECT firstname,lastname,IFNULL(city,null) city,IFNULL(state,null) state
FROM Person p
LEFTJOIN Address a
ON p.personid=a.personid;
1.3 运行截图
2 进店却未进行过交易的顾客
2.1 题目内容
2.1.1 基本题目信息
2.1.2 示例输入输出
2.2 示例sql语句
SELECT v.customer_id customer_id,count(*) count_no_trans
FROM Visits v
LEFTJOINTransactions t
ON v.visit_id=t.visit_id
WHERE t.transaction_id isnullGROUPBY v.customer_id
ORDERBY count_no_trans desc;
2.3 运行截图
3 文章浏览I
3.1 题目内容
3.1.1 基本题目信息
3.1.2 示例输入输出
3.2 示例sql语句
SELECTdistinct author_id id
FROM Views
WHERE author_id=viewer_id
ORDERBY id asc;