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?

sql database oracle

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Introduction to Structured Query Language SQL pdf

SQL stands for Structured Query Language. SQL is a scripting language expected to store, control, and inquiry information put away in social databases. The main manifestation of SQL showed up in 1974, when a gathering in IBM built up the principal model of a social database. The primary business social database was discharged by Relational Software later turning out to be Oracle.

Introduction to Structured Query Language SQL pdf

SQL stands for Structured Query Language. SQL is a scripting language expected to store, control, and inquiry information put away in social databases. The main manifestation of SQL showed up in 1974, when a gathering in IBM built up the principal model of a social database. The primary business social database was discharged by Relational Software later turning out to be Oracle.

Exploring PL/SQL Nested Tables in Oracle

In this tutorial, you will learn how to declare and initialize Oracle PL/SQL collections (Nested Tables). Nested tables are very similar to the PL/SQL tables, which are known in Oracle as index-by tables.

AlaSQL in Action: The JavaScript SQL Database

Overview on AlaSQL, the popular lightweight client-side in memory SQL database, including a real life example of AlaSQL in action. I was surprised to see that there aren’t more posts about this popular lightweight client-side in-memory SQL database online apart from this awesome article I found.

Backup Database using T-SQL Statements

Introduction In this article, We will discuss how to backup our database in MS-SQL Server using T-SQL Statements. We need to use BACKUP DATABASE statement to create full database backup, along with…