MariaDB [(none)]> use toyu Database changed MariaDB [toyu]> MariaDB [toyu]> SELECT * -- wild card match all columns -> FROM student; +--------+-----------+----------+-------+-------+------+---------+ | stuId | fname | lname | major | minor | ach | advisor | +--------+-----------+----------+-------+-------+------+---------+ | 100000 | Tony | Hawk | CSCI | CINF | 40 | 1011 | | 100001 | Mary | Hawk | CSCI | CINF | 35 | 1011 | | 100002 | David | Hawk | CSCI | ITEC | 66 | 1012 | | 100003 | Catherine | Lim | ITEC | CINF | 20 | NULL | | 100004 | Larry | Johnson | ITEC | NULL | 66 | 1017 | | 100005 | Linda | Johnson | CINF | ENGL | 13 | 1015 | | 100006 | Lillian | Johnson | CINF | ITEC | 18 | 1016 | | 100007 | Ben | Zico | NULL | NULL | 16 | NULL | | 100008 | Bill | Ching | ARTS | NULL | 90 | NULL | | 100009 | Linda | King | ARTS | CSCI | 125 | 1018 | | 100111 | Cathy | Johanson | NULL | NULL | 0 | 1018 | +--------+-----------+----------+-------+-------+------+---------+ 11 rows in set (0.001 sec) MariaDB [toyu]> SELECT * FROM student; +--------+-----------+----------+-------+-------+------+---------+ | stuId | fname | lname | major | minor | ach | advisor | +--------+-----------+----------+-------+-------+------+---------+ | 100000 | Tony | Hawk | CSCI | CINF | 40 | 1011 | | 100001 | Mary | Hawk | CSCI | CINF | 35 | 1011 | | 100002 | David | Hawk | CSCI | ITEC | 66 | 1012 | | 100003 | Catherine | Lim | ITEC | CINF | 20 | NULL | | 100004 | Larry | Johnson | ITEC | NULL | 66 | 1017 | | 100005 | Linda | Johnson | CINF | ENGL | 13 | 1015 | | 100006 | Lillian | Johnson | CINF | ITEC | 18 | 1016 | | 100007 | Ben | Zico | NULL | NULL | 16 | NULL | | 100008 | Bill | Ching | ARTS | NULL | 90 | NULL | | 100009 | Linda | King | ARTS | CSCI | 125 | 1018 | | 100111 | Cathy | Johanson | NULL | NULL | 0 | 1018 | +--------+-----------+----------+-------+-------+------+---------+ 11 rows in set (0.000 sec) MariaDB [toyu]> SELECT stuId, fname, lname -- wild card match all columns -> 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.001 sec) MariaDB [toyu]> SELECT DISTINCT s.stuId, -- select clause: [2] -> CONCAT(s.fname, ' ', s.lname) AS name, -- alias: label -> s.major, -> s.minor -> FROM student AS s -- from clause: [1] -> WHERE -- where clause: conditions -> s.major = 'CSCI' OR s.major = 'CINF' OR s.major = 'ITEC' -> ; +--------+-----------------+-------+-------+ | 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.002 sec) MariaDB [toyu]> MariaDB [toyu]> SELECT DISTINCT s.stuId, -- select clause: [2] -> CONCAT(s.fname, ' ', s.lname) AS name, -- alias: label -> s.major, -> s.minor -> FROM student AS s -- from clause: [1] -> WHER -- where clause: conditions -> s.major = 'CSCI' OR s.major = 'CINF' OR s.major = 'ITEC' -> ; 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 'WHER s.major = 'CSCI' OR s.major = 'CINF' OR s.major = 'ITEC'' at line 6 MariaDB [toyu]> SELECT DISTINCT s.stuId, -- select clause: [2] -> CONCAT(s.fname, ' ', s.lname) AS name, -- alias: label -> s.major, -> s.minor -> FROM student AS s -- from clause: [1] -> WHERE -- where clause: conditions -> s.major = 'CSCI' OR s.major = 'CINF' OR s.major = 'ITEC' -> ; +--------+-----------------+-------+-------+ | 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]> MariaDB [toyu]> SELECT DISTINCT s.stuId, -- select clause: [2] -> CONCAT(s.fname, ' ', s.lname) AS name -- alias: label -> s.major, -> s.minor -> FROM student AS s -- from clause: [1] -> WHERE -- where clause: conditions -> s.major = 'CSCI' OR s.major = 'CINF' OR s.major = 'ITEC' -> ; 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 's.major, s.minor FROM student AS s WHERE s.major = 'CSCI' OR s.major = '...' at line 3 MariaDB [toyu]> 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 -> d.schoolCode = s.schoolCode, -- join condition #2 -> s.schoolName = 'Science and Engineering' -- problem condition -> ; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 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 -> d.schoolCode = s.schoolCode, -> -- join condition #2 -> s.schoolName = 'Science and Engineering' -- problem condition -> ; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 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 -> d.schoolCode = s.schoolCode, -> -- join condition #2 -> s.schoolName = 'Science and Engineering' -- problem condition -> ; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 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 -> d.schoolCode = s.schoolCode, -> -- join condition #2 -> s.schoolName = 'Science and Engineering' -- problem condition -> ; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 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 -> d.schoolCode = s.schoolCode, -> -- join condition 2 -> s.schoolName = 'Science and Engineering' -- problem condition -> ; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 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 -> d.schoolCode = s.schoolCode, -> -- join condition 2 -> s.schoolName = 'Science and Engineering' -- problem condition -> ; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 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 -> d.schoolCode = s.schoolCode, -> -- join condition 2 -> s.schoolName = 'Science and Engineering' -- problem condition -> ; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 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, -> d.schoolCode = s.schoolCode, -> s.schoolName = 'Science and Engineering' -> ; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 MariaDB [toyu]> SELECT DISTINCT CONCAT(f.fname, ' ', f.lname) AS faculty, -> f.rank, -> d.deptName AS depart -> FROM faculty AS f, -> department AS d, -> school AS s -> WHERE f.deptCode = d.deptCode, -> d.schoolCode = s.schoolCode, -> s.schoolName = 'Science and Engineering' -> ; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 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, -> d.schoolCode = s.schoolCode, -> s.schoolName = 'Science and Engineering'; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 7 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, -> d.schoolCode = s.schoolCode, -> s.schoolName = 'Science and Engineering'; 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 ' d.schoolCode = s.schoolCode, s.schoolName = 'Science and Engineering'' at line 5 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, -> d.schoolCode = s.schoolCode -> s.schoolName = 'Science and Engineering'; 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 ' d.schoolCode = s.schoolCode s.schoolName = 'Science and Engineering'' at line 5 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, -> s.schoolName = 'Science and Engineering'; 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 ' s.schoolName = 'Science and Engineering'' at line 5 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) -> INNER JOIN school AS s (d.schoolCode = s.schoolCode) -> WHERE s.schoolName = 'Science and Engineering'; 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 '(d.schoolCode = s.schoolCode) WHERE s.schoolName = 'Science and Engineering'' at line 6 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) -> INNER 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]> 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 -> AND d.schoolCode = s.schoolCode -> 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.000 sec) MariaDB [toyu]> notee