題目:
給一個world table,用兩個條件,篩選area 跟 population。
There is a table World
World
+-----------------+------------+------------+--------------+---------------+| name | continent | area |…
給一個courses的table,找出哪個科目學生人數大於5人。
SQL Schema
There is a table courses with columns: student and class
courses
倆倆交換座位。
Mary is a teacher in a middle school and she has a table seat storing students' names and their corresponding seat ids.
seat
給一個TABLE Stadium,找出至少連續三天,人數大於100的天數。
Write an SQL query to display the records with three or more rows with consecutive id's, and the number of people is greater than or equal to 100 for each.
id
用python寫一個開根號之後的數字取整數部分。
Example 1:
Input: x = 4Output: 2
Example 2:
Input: x = 8Output: 2Explanation: The square root of 8 is 2.82842..., and since the…
找出奇數ID 描述不是"BORING”的名單。
X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and descriptions.
題目: 找出有重複的email。
Write a SQL query to find all duplicate emails in a table named Person.
Person
+----+---------+| Id | Email |+----+---------+| 1 | a@b.com || 2 | c@d.com || 3 | a@b.com |+----+---------+
利用UPDATE 與 SET 將SEX的m與f互換。
Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice versa)…
salary
n=1:1 (一個一)
n=2:2 (一個二、兩個一)
n=3:3 (一個三、一個二 一個一、三個一)
依此類推
n=4:5
n=5:8