tee 2025_10_1_sql_log.txt DROP SCHEMA IF EXISTS tinker; CREATE SCHEMA tinker; USE tinker; CREATE TABLE s2 SELECT * FROM toyu.student; SELECT * FROM s2; CREATE TEMPORARY TABLE s3 SELECT * FROM toyu.student; SELECT * FROM s3; CREATE TABLE s4 LIKE toyu.student; SELECT * FROM s4; INSERT INTO s4 SELECT * FROM toyu.student; SELECT * FROM s4; SHOW TABLES; -- Note that keys and constraints of student are missing in s2 and S3. DESC student; DESC s2; DESC s3; DESC s4; DROP TABLE s2; DROP TABLE s3; DROP TABLE s4; SHOW TABLES; DROP SCHEMA IF EXISTS tinker; INSERT INTO student VALUES (100010,'Bun','Yue',null,null,50,null), (100011,'Paul','Harris','CSCI','ITEC',23,1015); SELECT * FROM student; INSERT INTO student VALUES (100010,'Bun','Yue',null,null,50,null), (100011,'Paul','Harris','CSCI','ITEC',23,1015); INSERT INTO student VALUES (100020,'Bunno','Yue','GEOG',null,50,null); INSERT INTO student VALUES (100021,'Bunna','Yue',null,'GEOG',50,null); INSERT INTO student VALUES (100022,'Bunno','Yue',null,null,50,8888); -- Remove the two new rows. DELETE FROM Student WHERE stuId = 100010 OR stuId = 100011; SELECT * FROM student; UPDATE student SET major = 'CINF' WHERE stuId = 100009; UPDATE student SET major = 'CINF'; DELETE FROM Student; SELECT COUNT(*) FROM student; SELECT COUNT(*) INTO @count FROM student; SELECT * FROM student; SELECT * INTO @s FROM student; SELECT stuId INTO @s FROM student; -- operators: -- student with credits in a range: including the lower and upper limits. SELECT DISTINCT * FROM Student WHERE ach BETWEEN 30 AND 70; SELECT DISTINCT * FROM Student WHERE 30 < ach AND ach < 70; SELECT DISTINCT * FROM Student WHERE ach BETWEEN 20 AND 40; SELECT DISTINCT * -- not the same FROM Student WHERE 20 < ach AND ach < 40; SELECT DISTINCT * FROM Student WHERE 20 <= ach AND ach <= 40;