MariaDB [(none)]> use toy ERROR 1049 (42000): Unknown database 'toy' MariaDB [(none)]> use toyu Database changed MariaDB [toyu]> SELECT stuIds, fname, lname -- columns in the table student -> FROM student; ERROR 1054 (42S22): Unknown column 'stuIds' in 'field list' MariaDB [toyu]> MariaDB [toyu]> SELECT stuId, fname, lname -- columns in the table student -> FROM student; +--------+-----------+----------+ | stuId | fname | lname | +--------+-----------+----------+ | 100000 | Tony | Hawk | | 100001 | Mary | Hawk | | 100002 | David | Hawk | | 100003 | Catherine | Lim | | 100004 | Larry | Johnson | | 100005 | Linda | Johnson | | 100006 | Lillian | Johnson | | 100007 | Ben | Zico | | 100008 | Bill | Ching | | 100009 | Linda | King | | 100111 | Cathy | Johanson | +--------+-----------+----------+ 11 rows in set (0.000 sec) MariaDB [toyu]> set @x = 1; Query OK, 0 rows affected (0.000 sec) MariaDB [toyu]> SELECT @x; +------+ | @x | +------+ | 1 | +------+ 1 row in set (0.000 sec) MariaDB [toyu]> source Createtoyu.sql Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 8 rows affected (0.123 sec) Query OK, 1 row affected (0.003 sec) Database changed Query OK, 0 rows affected, 1 warning (0.000 sec) Query OK, 0 rows affected, 1 warning (0.000 sec) Query OK, 0 rows affected, 1 warning (0.000 sec) Query OK, 0 rows affected, 1 warning (0.000 sec) Query OK, 0 rows affected, 1 warning (0.000 sec) Query OK, 0 rows affected, 1 warning (0.000 sec) Query OK, 0 rows affected, 1 warning (0.000 sec) Query OK, 0 rows affected, 1 warning (0.000 sec) Query OK, 0 rows affected, 1 warning (0.017 sec) Query OK, 0 rows affected, 1 warning (0.024 sec) Query OK, 0 rows affected, 1 warning (0.024 sec) Query OK, 0 rows affected, 1 warning (0.030 sec) Query OK, 0 rows affected, 1 warning (0.027 sec) Query OK, 0 rows affected, 1 warning (0.034 sec) Query OK, 0 rows affected, 1 warning (0.037 sec) Query OK, 0 rows affected, 1 warning (0.035 sec) Query OK, 0 rows affected (0.013 sec) Query OK, 0 rows affected (0.014 sec) Query OK, 0 rows affected (0.013 sec) Query OK, 0 rows affected (0.011 sec) Query OK, 0 rows affected (0.008 sec) Query OK, 15 rows affected (0.004 sec) Records: 15 Duplicates: 0 Warnings: 0 Query OK, 4 rows affected (0.010 sec) Records: 4 Duplicates: 0 Warnings: 0 Query OK, 7 rows affected (0.013 sec) Records: 7 Duplicates: 0 Warnings: 0 Query OK, 11 rows affected (0.005 sec) Records: 11 Duplicates: 0 Warnings: 0 Query OK, 11 rows affected (0.009 sec) Records: 11 Duplicates: 0 Warnings: 0 Query OK, 14 rows affected (0.012 sec) Records: 14 Duplicates: 0 Warnings: 0 Query OK, 11 rows affected (0.007 sec) Records: 11 Duplicates: 0 Warnings: 0 Query OK, 22 rows affected (0.013 sec) Records: 22 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) MariaDB [toyu]> SELECT DISTINCT s.stuId, s.name, s.major, s.minor -- Select clause: [3] -> FROM student AS s -- From clause: [1] -> WHERE s.major = 'CSCI' OR s.major = 'CINF' OR s.major = 'ITEC' -> ; -- Where clause: [2] ERROR 1054 (42S22): Unknown column 's.name' in 'field list' MariaDB [toyu]> SELECT DISTINCT s.stuId, -> CONCAT(s.fname, ' ', s.lname) AS name, -- value AS label/alias -> s.major, -> s.minor -- Select clause: [3] -> FROM student AS s -- From clause: [1] -> WHERE s.major = 'CSCI' OR s.major = 'CINF' OR s.major = 'ITEC' -> ; -- Where clause: [2] +--------+-----------------+-------+-------+ | stuId | name | major | minor | +--------+-----------------+-------+-------+ | 100000 | Tony Hawk | CSCI | CINF | | 100001 | Mary Hawk | CSCI | CINF | | 100002 | David Hawk | CSCI | ITEC | | 100003 | Catherine Lim | ITEC | CINF | | 100004 | Larry Johnson | ITEC | NULL | | 100005 | Linda Johnson | CINF | ENGL | | 100006 | Lillian Johnson | CINF | ITEC | +--------+-----------------+-------+-------+ 7 rows in set (0.001 sec) MariaDB [toyu]> SELECT DISTINCT s.stuId, -> CONCAT(s.fname, ' ', s.lname) AS name, -- value AS label/alias -> s.major -> s.minor -- Select clause: [3] -> FROM student AS s -- From clause: [1] -> WHERE s.major = 'CSCI' OR s.major = 'CINF' OR s.major = 'ITEC' -> ; -- Where clause: [2] ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.minor FROM student AS s WHERE s.major = 'CSCI' OR s.major = 'CINF' OR s.ma...' at line 4 MariaDB [toyu]> SELECT DISTINCT CONCAT(f.fname, ' ', f.lname) AS faculty, -> f.rank, -> d.deptName AS department -> FROM faculty AS f, -> department AS d, -> school AS s -> WHERE f.deptCode = d.deptCode -- join condition #1 -> AND d.schoolCode = s.scholCode -- join condition #2 -> AND s.schoolName = 'Science and Engineering'; ERROR 1054 (42S22): Unknown column 's.scholCode' in 'where clause' MariaDB [toyu]> SELECT DISTINCT CONCAT(f.fname, ' ', f.lname) AS faculty, -> f.rank, -> d.deptName AS department -> FROM faculty AS f, -> department AS d, -> school AS s -> WHERE f.deptCode = d.deptCodoe -- join condition #1 -> AND d.schoolCode = s.scholCode -- join condition #2 -> AND s.schoolName = 'Science and Engineering'; ERROR 1054 (42S22): Unknown column 'd.deptCodoe' in 'where clause' MariaDB [toyu]> SELECT DISTINCT CONCAT(f.fname, ' ', f.lname) AS faculty, -> f.rank, -> d.deptName AS department -> FROM faculty AS f, -> department AS d, -> school AS s -> WHERE f.deptCode = d.deptCode -- join condition #1 -> AND d.schoolCode = s.scholCode -- join condition #2 -> AND s.schoolName = 'Science and Engineering'; ERROR 1054 (42S22): Unknown column 's.scholCode' in 'where clause' MariaDB [toyu]> SELECT DISTINCT CONCAT(f.fname, ' ', f.lname) AS faculty, -> f.rank, -> d.deptName AS department -> FROM faculty AS f, -> department AS d, -> school AS s -> WHERE f.deptCode = d.deptCode -- join condition #1 -> AND d.schoolCode = s.schoolCode -- join condition #2 -> AND s.schoolName = 'Science and Engineering'; +---------------+---------------------+------------------------------+ | faculty | rank | department | +---------------+---------------------+------------------------------+ | Daniel Kim | Professor | Computer Information Systems | | Andrew Byre | Associate Professor | Computer Information Systems | | Paul Smith | Professor | Computer Science | | Mary Tran | Associate Professor | Computer Science | | David Love | NULL | Computer Science | | Sharon Mannes | Assistant Professor | Computer Science | | Deborah Gump | Professor | Information Technology | | Benjamin Yu | Lecturer | Information Technology | +---------------+---------------------+------------------------------+ 8 rows in set (0.002 sec) MariaDB [toyu]> SELECT DISTINCT CONCAT(f.fname, ' ', f.lname) AS faculty, -> f.rank, -> d.deptName AS department -> FROM faculty AS f INNER JOIN department AS d -> ON (f.deptCode = d.deptCode) -> JOIN school AS s ON (d.schoolCode = s.schoolCode ) -> WHERE s.schoolName = 'Science and Engineering'; +---------------+---------------------+------------------------------+ | faculty | rank | department | +---------------+---------------------+------------------------------+ | Daniel Kim | Professor | Computer Information Systems | | Andrew Byre | Associate Professor | Computer Information Systems | | Paul Smith | Professor | Computer Science | | Mary Tran | Associate Professor | Computer Science | | David Love | NULL | Computer Science | | Sharon Mannes | Assistant Professor | Computer Science | | Deborah Gump | Professor | Information Technology | | Benjamin Yu | Lecturer | Information Technology | +---------------+---------------------+------------------------------+ 8 rows in set (0.001 sec) MariaDB [toyu]> notee