SQL/Script-2.sql
2024-04-20 13:59:42 +08:00

30 lines
1.1 KiB
SQL

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 #