Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a query to show only the classes that have no students signed up. - Include the classes.class_id, classes.code, number_of_students and the maximum_students - Do

image text in transcribed

image text in transcribed

Write a query to show only the classes that have no students signed up. - Include the classes.class_id, classes.code, number_of_students and the maximum_students - Do not use a subquery - Do not hardcode a specific class (i.e. WHERE classes.code = 'MA030') This query should work for new classes that get added. CREATE TABLE Classes( class_Id INT AUTO_INCREMENT, name VARCHAR(50) NOT NULL, description VARCHAR(200), code VARCHAR(10) UNIQUE, maximum_students INT DEFAULT 10, PRIMARY KEY(class_1d) ); CREATE TABLE students( student_Id INT AUTO_INCREMENT, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(50) NOT NULL, birthdate DATE, PRIMARY KEY(student_id) ); CREATE TABLE registered_students ( id INT AUTO_INCREMENT, class_id INT NOT NULL, student_Id INT NOT NULL, PRIMARY KEY(id)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Window Functions For Data Analysis And Beyond

Authors: Itzik Ben Gan

2nd Edition

0135861446, 978-0135861448

More Books

Students also viewed these Databases questions

Question

Writing a Strong Introduction

Answered: 1 week ago