BIG Beginner SQL

ghz 8months ago ⋅ 56 views

Should I make for '이홍근's student sno count

[Search for the number of courses registered by '이홍근]

This is my own

SELECT COUNT (*) AS Number of courses
FROM STUDENT AS S, ENROL AS E
WHERE S.SNO = E. SNO
 AND S.NAME = '이홍근';

Is this right?

I just asked SQL and just need an answer.

enter image description here

Answers

Your SQL query looks mostly correct for counting the number of courses registered by a student named '이홍근'. However, there is a small typo in your query. The dot "." between "E." and "SNO" should not have a space. Here's the corrected version of your query:

SELECT COUNT(*) AS "Number of courses"
FROM STUDENT AS S
JOIN ENROL AS E ON S.SNO = E.SNO
WHERE S.NAME = '이홍근';

This query will count the number of courses registered by the student named '이홍근'.