Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started