student_id first_name last_name date_of_birth gender email phone_number address enrollment_year major status gpa
1 Nathan Washington 2007-02-01 M gonzalezpamela@hotmail.com 001-431-730-5499x87628 2406 Jessica Forges Suite 152, Michaelton, ID 31645 2018 Business Administration Dropped 3.0
2 Aaron Moore 2000-09-21 F anthony30@rose.org (937)140-9873x91529 86480 Stewart Estates Apt. 175, Port Connor, KY 95874 2021 Civil Engineering Graduated 2.91
3 Jose Robbins 2000-11-14 Other travis89@lawrence.com 001-285-702-4923 PSC 8905, Box 0748, APO AE 57911 2022 Civil Engineering Dropped 3.93
4 Valerie Ferguson 2003-07-23 Other ryan49@thompson.com 4908148273 9291 Sherry Rapids Suite 891, Evanston, DC 09540 2019 Biology Graduated 3.05
5 Chelsea Thomas 2002-10-02 F jessica02@bray-norton.com 253-887-7752x89629 3916 Jose Roads, Johnsonmouth, HI 16080 2019 Psychology Graduated 3.88
6 Jennifer Sandoval 2005-05-16 F harrisonangela@shannon.com +1-479-842-9458 5939 Megan Ridges, Knightborough, CT 63160 2022 Mechanical Engineering Active 3.97
7 Richard Roth 1999-05-11 F ramirezjessica@mann.com (545)545-4368x73355 61646 Graham Fords, South Gilberttown, OK 51861 2021 Physics Active 2.6
8 Scott Collier 1999-11-28 M qcohen@yahoo.com 895-226-1457 06440 Robertson Circles Apt. 189, East Savannahfort, NY 71038 2019 Biology Dropped 3.76
9 Tracy Johnson 2003-03-13 Other jimmy50@gmail.com 001-626-858-8020x4622 06745 Turner Court Suite 047, Lloydton, NE 52896 2021 Electrical Engineering Leave 2.48
10 Anita Richards 2002-05-19 F tlopez@hunt-ross.com 396-283-9243 636 Malone Lodge, Lake Rickybury, NC 48299 2023 Mathematics Dropped 3.13
11 Richard Pena 2001-03-28 F breynolds@yahoo.com 168.070.5572 4427 Evan Heights Apt. 209, Morrisview, SD 44997 2019 Computer Science Dropped 2.49
12 Dana Cox 2006-10-13 M carolyn49@gmail.com +1-430-674-3008x126 37604 Kimberly Meadows, South Luisview, NM 38667 2023 Mathematics Dropped 2.78
13 Susan Lopez 2000-12-26 F johnherrera@anderson-smith.com 060.713.1055x71157 335 Regina Ridge Suite 175, Brandonview, AZ 02756 2021 Civil Engineering Leave 3.03
14 Amanda Carson 1999-11-20 F ashleythomas@stone.com +1-166-660-7566 87291 Jennifer Lock, Pearsonton, AZ 85887 2019 Electrical Engineering Active 2.16
15 Sierra Thompson 1999-08-08 F wlewis@gmail.com 907-525-1009 905 Velez Avenue, Scottshire, OK 25630 2023 Civil Engineering Dropped 2.97
16 Kimberly Cook 2006-10-15 M kellyshawn@smith.com 960-540-0559 833 Simmons Place, Wheelerchester, OH 67543 2019 Information Management Graduated 3.49
17 Michael Rodriguez 2002-08-21 F joshua19@gmail.com 956-372-1672x036 91452 Carlson Camp Apt. 313, New Emily, NM 37174 2018 Computer Science Dropped 3.58
18 Deborah Vance 2005-10-16 Other brendangutierrez@hotmail.com +1-293-685-6416x5839 2767 Anderson Pass Suite 529, Randystad, UT 32408 2018 Mathematics Leave 3.79
19 Phillip Smith 2002-02-17 Other daniel76@stein-patterson.com 001-018-853-8720x195 350 Schwartz Inlet, Smithmouth, NV 21598 2021 Civil Engineering Dropped 3.75
20 Sara Edwards 2000-10-17 M nryan@yahoo.com 070.249.5387x37041 92721 Saunders Gateway Apt. 330, Gardnermouth, ID 13492 2019 Civil Engineering Dropped 2.02
  1. Insert a student with minimal data (skip optional fields like address and phone), named Emily Clark, born on 2002-05-10, female, majoring in Psychology, enrolled in 2022, GPA 3.8.
  2. Find all students currently marked as "Active".
  3. List students majoring in "Computer Science" with a GPA above 3.5.
  4. Update the status of a student with student_id = 5 to 'Graduated'.
  5. Change the major of all students who enrolled in 2019 from "Business Administration" to "Information Management".
  6. Remove all students who dropped out (status = 'Dropped') and have GPA lower than 2.5.
  7. Show the full names and GPA of all students with a GPA greater than 3.0.

中文

  1. 插入一筆最基本資料的學生(略過像地址和電話等選填欄位),名為 Emily Clark,出生於 2002-05-10,女性,主修心理學,2022 年入學,GPA 為 8。
  2. 查詢目前標示為「在學」的所有學生。
  3. 列出主修「電腦科學」且 GPA 高於 5 的學生。
  4. 將 student_id 為 5 的學生狀態更新為「已畢業」。
  5. 將所有 2019 年入學且主修「企業管理」的學生主修改為「資訊管理」。
  6. 移除所有中途退學(狀態為「已退學」)且 GPA 低於 5 的學生。
  7. 顯示 GPA 高於 0 的所有學生之全名與 GPA。

SELECT column1, column2 FROM table_nameWHERE [Condition];

Insert into demo (name) values ('Brian')

UPDATE table_nameSET column1=value1, column2=value2WHERE [condition]

DELETE FROM table_name WHERE [Condition]