This commit is contained in:
威勝 張 2024-04-20 13:59:42 +08:00
parent d3b0cda8a3
commit d31735b912

30
Script-2.sql Normal file
View File

@ -0,0 +1,30 @@
INSERT INTO teaching_sql_2 (student_id,person_id,student_birthday)
Values("M11112030","A123456789","890808")
INSERT INTO teaching_sql_2 (student_id,person_id,student_birthday) # 選擇好資料表及覽未明成
Values("M11112029","C123456789","900801") #將參數按照順序放入
UPDATE teaching_sql_2 SET student_birthday='890801' # 將變動的資料設置好
WHERE student_id='M11112030'; #尋找student id 為M11112030的參數
DELETE FROM teaching_sql_2 # 選擇要刪除的table表
WHERE student_id='M11112029' #山處studen_id為M1112029
select * FROM teaching_sql_1
select student_name,student_id FROM teaching_sql_1
select * FROM teaching_sql_1 WHERE student_id='M11112030'
select * FROM teaching_sql_1 WHERE student_id='M11112030' AND student_class='EL125'
select * FROM teaching_sql_1 WHERE student_id='M11112030' or student_class='EL124'
SELECT teaching_sql_1.student_id, # 找尋teaching_sql_1的 student_id
teaching_sql_1.student_class, # 找尋teaching_sql_1的 student_class
teaching_sql_2.person_id # 找尋teaching_sql_2的 person_id
from teaching_sql_1 join teaching_sql_2 # 將teaching_sql_2加入
WHERE teaching_sql_1.student_id = teaching_sql_2.student_id # 指定條件