SQL query for querying counts from a table

SQL query for querying counts from a table

The prompt is to form a SQL query.

The prompt is to form a SQL query.

  • That finds the students name and ID who attend all lectures having ects more than 4.

The tables are

CREATE TABLE CLASS (
    STUDENT_ID INT NOT NULL,
    LECTURE_ID INT NOT NULL
   );


CREATE TABLE STUDENT ( STUDENT_ID INT NOT NULL, STUDENT_NAME VARCHAR(255), PRIMARY KEY (STUDENT_ID) )

CREATE TABLE LECTURE ( LECTURE_ID INT NOT NULL, LECTURE_NAME VARCHAR(255), ECTS INT, PRIMARY KEY (LECTURE_ID) )

I came up with this query but this didn't seem to work on SQLFIDDLE. I'm new to SQL and this query has been a little troublesome for me. How would you query this?

SELECT STUD.STUDENT_NAME FROM STUDENT STUD
INNER JOIN CLASS CLS AND LECTURE LEC ON
CLS.STUDENT_ID = STUD.STUDENT_ID
WHERE LEC.CTS > 4

How do I fix this query?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Learn to Build SQL Query| Ultimate SQL and DataBase Concepts|Simpliv

Learn to Build SQL Query| Ultimate SQL and DataBase Concepts

An Introduction to Oracle SQL

An Introduction to Oracle SQL: A quick tour of the six principal clauses of the SELECT statement.

Real time Oracle database administration interview questions | Simpliv

Real time Oracle database administration interview questions