tee 2025_10_1_sql_log.txt -- A Schema is a DB in MySQL DROP SCHEMA IF EXISTS tinker; CREATE SCHEMA tinker; USE tinker; -- create the table schema + populate the table with the query. CREATE TABLE s2 SELECT * FROM toyu.student; SELECT * FROM s2; -- a temporary table: stores in primary memory of the session. CREATE TEMPORARY TABLE s3 SELECT * FROM toyu.student; SELECT * FROM s3; -- only create the relation schema CREATE TABLE s4 LIKE toyu.student; -- populate SELECT * FROM s4; INSERT INTO s4 SELECT * FROM toyu.student; SELECT * FROM s4; SHOW TABLES; UPDATE Student SET major = 'ITEC', minor = 'CSCI' WHERE StuId = 100000; UPDATE Student SET major = 'ITEC'; SELECT COUNT(*) FROM faculty; SELECT COUNT(*) INTO @c FROM faculty; SELECT * INTO @c FROM faculty; SELECT * INTO @c FROM faculty WHERE facId = 1011; SELECT facId INTO @c FROM faculty; -- BETWEE ... AND: ternary operations. 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 90; SELECT DISTINCT * FROM Student WHERE 20 < ach AND ach < 90; SELECT DISTINCT * FROM Student WHERE 20 <= ach AND ach <= 90;