diff --git "a/36 \350\265\265\345\220\257\346\201\222/2023 2 24 .txt" "b/36 \350\265\265\345\220\257\346\201\222/2023 2 24 .txt" new file mode 100644 index 0000000000000000000000000000000000000000..5395dadf399e9626d4322b7f4707689dfeb511c7 --- /dev/null +++ "b/36 \350\265\265\345\220\257\346\201\222/2023 2 24 .txt" @@ -0,0 +1,47 @@ +(1)题目:查询年龄20岁及以上且23岁及以下用户的设备ID、性别、年龄 + +现在运营想要针对20岁及以上且23岁及以下的用户开展分析,请你取出满足条件的设备ID、性别、年龄。 +(2)题目:查询除复旦大学以外的所有用户的设备ID、性别、年龄、大学 + +现在运营想要查看除复旦大学以外的所有用户明细,请你取出相应数据 +select id,gender,age university from user_profile where university='复旦大学'; +2,male,复旦大学 +(3)题目:查询年龄不为空的用户的设备ID,性别,年龄,学校的信息 + +现在运营想要对用户的年龄分布开展分析,在分析时想要剔除没有获取到年龄的用户,请你取出所有年龄值不为空的用户的设备ID,性别,年龄,学校的信息。 +select id,gender,age university from user_profile where age != null; + +(4)题目:查询男性且GPA在3.5以上(不包括3.5)的用户的设备ID,性别、年龄、学校、gpa + +现在运营想要找到男性且GPA在3.5以上(不包括3.5)的用户进行调研,请你取出相关数据。 + +select id,gender,age,university ,gpa from user_profile where gpa>3.5; +2,male,,复旦大学,4 +4,female,23,浙江大学,3.6 +5,male,25,山东大学,3.8 + +(5)题目:查询学校为北大或GPA在3.7以上(不包括3.7)的用户的设备ID,性别、年龄、学校、gpa + +现在运营想要找到学校为北大或GPA在3.7以上(不包括3.7)的用户进行调研,请你取出相关数据(使用OR实现) +select id,gender,age,university ,gpa from user_profile where gpa>3.7; +2,male,,复旦大学,4 +5,male,25,山东大学,3.8 + +(6)题目:查询学校为北大、复旦和山大用户的设备ID,性别、年龄、学校、gpa + +现在运营想要找到学校为北大、复旦和山大的同学进行调研,请你取出相关数据。 +select id,gender,age,university ,gpa from user_profile where university='北京大须'and'复旦大学'and'山东大学'; + +(7)题目:查询gpa在3.5以上(不包括3.5)的山东大学用户 或 gpa在3.8以上(不包括3.8)的复旦大学同学 + +现在运营想要找到gpa在3.5以上(不包括3.5)的山东大学用户 或 gpa在3.8以上(不包括3.8)的复旦大学同学进行用户调研,请你取出相应数据。 + + + + + + +8)题目:所有大学中带有北京的用户信q息 + +现在运营想查看所有大学中带有北京的用户的信息,请你取出相应数据。 +select id,gender,age,university ,gpa from user_profile where university='北京' diff --git "a/36 \350\265\265\345\220\257\346\201\222/2023 2 24.txt" "b/36 \350\265\265\345\220\257\346\201\222/2023 2 24.txt" new file mode 100644 index 0000000000000000000000000000000000000000..a7cbf8c3a2b5fe1ad3196646646f024241593825 --- /dev/null +++ "b/36 \350\265\265\345\220\257\346\201\222/2023 2 24.txt" @@ -0,0 +1,98 @@ +1)题目:从用户信息表中取出学校的去重数据 + +现在运营需要查看用户来自于哪些学校,请从用户信息表中取出学校的去重数据。 +desc user_profile; +INSERT INTO user_profile VALUES(1,2138,'male',21,'北京大学','BeiJing'); +INSERT INTO user_profile VALUES(2,3214,'male',null,'复旦大学','Shanghai'); +INSERT INTO user_profile VALUES(3,6543,'female',20,'北京大学','BeiJing'); +INSERT INTO user_profile VALUES(4,2315,'female',23,'浙江大学','ZheJiang'); +INSERT INTO user_profile VALUES(5,5432,'male',25,'山东大学','Shandong'); +select * from user_profile ; + +1,2138,male,21,北京大学,BeiJing +2,3214,male,,复旦大学,Shanghai +3,6543,female,20,北京大学,BeiJing +4,2315,female,23,浙江大学,ZheJiang +5,5432,male,25,山东大学,Shandong + +select id,university from user_profile; +1,北京大学 +2,复旦大学 +3,北京大学 +4,浙江大学 +5,山东大学 + +(2)题目:查看用户明细设备ID数据,并将列名显示为 'user_infos_example' + +现在你需要查看用户明细设备ID数据,并将列名显示为 'user_infos_example',请你从用户信息表取出相应结果。 +select id,device_id from user_profile +1,2138 +2,3214 +3,6543 +4,2315 +5,5432 + +3)题目:查询university是北京大学的设备ID + +现在运营想要筛选出所有北京大学的学生进行用户调研,请你从用户信息表中取出满足条件的数据,结果返回设备id和学校。 + select id,university from user_profile where university='北京大学'; +1,北京大学 +3,北京大学 + + +## (4)题目:查询年龄大于24用户的设备ID、性别、年龄、学校 + +现在运营想要针对24岁以上的用户开展分析,请你取出满足条件的设备ID、性别、年龄、学校。 +select id,gender,age,university from user_profile where age>24; +5,male,25,山东大学 +(5)题目:查询所有用户的设备id、性别、年龄、学校 + +现在运营同学想要用户的设备id对应的性别、年龄和学校的数据,请你取出相应数据 +select id,gender,age,university from user_profile ; + +1,male,21,北京大学 +2,male,,复旦大学 +3,female,20,北京大学 +4,female,23,浙江大学 +5,male,25,山东大学 + +(6)题目:查询所有用户的数据 + +现在运营想要查看用户信息表中所有的数据,请你取出相应结果 +select * from user_profile ; +1,2138,male,21,北京大学,BeiJing +2,3214,male,,复旦大学,Shanghai +3,6543,female,20,北京大学,BeiJing +4,2315,female,23,浙江大学,ZheJiang +5,5432,male,25,山东大学,Shandong + +(7)题目:查询省份是"shanghai"的用户信息 + +现在运营想要查看上海市用户的信息,请你取出相应的结果。 + +根据示例,你的查询应返回以下结果: +select id,gender,age,university,province from user_profile where province='shanghai'; +2,male,,复旦大学,Shanghai + +(8)题目:查询所有男性用户的设备ID、年龄、学校 + +现在运营想要查看所有男性用户的设备ID、年龄、学校,便于后期做数据分析。 + +根据示例,你的查询应返回如下结果: +select id,age,university from user_profile where gender='male'; +1,21,北京大学 +2,,复旦大学 +5,25,山东大学 + +(9)题目:从用户信息表中取出省份的去重数据 + +现在运营想要查看所有用户的省份分布情况,请从用户信息表中取出省份的去重数据。 + +根据示例,你的查询应返回如下结果: +select province from user_profile; +BeiJing +Shanghai +BeiJing +ZheJiang +Shandong +