Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10) Write a query to find the Colleges with fewer than 5 applications DROP DATABASE IF EXISTS college_application;CREATE DATABASE college_application;USE college_application;drop table if exists Student;drop

10) Write a query to find the Colleges with fewer than 5 applications

DROP DATABASE IF EXISTS college_application;CREATE DATABASE college_application;USE college_application;drop table if exists Student;drop table if exists College;drop table if exists Apply;/* Create the schema for our tables */create table College(cName text, state text, enrollment int);create table Student(sID int, sName text, GPA real, sizeHS int);create table Apply(sID int, cName text, major text, decision text);insert into Student values (123, 'Amy', 3.9, 1000);insert into Student values (234, 'Bob', 3.6, 1500);insert into Student values (345, 'Craig', 3.5, 500);insert into Student values (456, 'Doris', 3.9, 1000);insert into Student values (567, 'Edward', 2.9, 2000);insert into Student values (678, 'Fay', 3.8, 200);insert into Student values (789, 'Gary', 3.4, 800);insert into Student values (987, 'Helen', 3.7, 800);insert into Student values (876, 'Irene', 3.9, 400);insert into Student values (765, 'Jay', 2.9, 1500);insert into Student values (654, 'Amy', 3.9, 1000);insert into Student values (543, 'Craig', 3.4, 2000);insert into College values ('Stanford', 'CA', 15000);insert into College values ('Berkeley', 'CA', 36000);insert into College values ('MIT', 'MA', 10000);insert into College values ('Cornell', 'NY', 21000);insert into Apply values (123, 'Stanford', 'CS', 'Y');insert into Apply values (123, 'Stanford', 'EE', 'N');insert into Apply values (123, 'Berkeley', 'CS', 'Y');insert into Apply values (123, 'Cornell', 'EE', 'Y');insert into Apply values (234, 'Berkeley', 'biology', 'N');insert into Apply values (345, 'MIT', 'bioengineering', 'Y');insert into Apply values (345, 'Cornell', 'bioengineering', 'N');insert into Apply values (345, 'Cornell', 'CS', 'Y');insert into Apply values (345, 'Cornell', 'EE', 'N');insert into Apply values (678, 'Stanford', 'history', 'Y');insert into Apply values (987, 'Stanford', 'CS', 'Y');insert into Apply values (987, 'Berkeley', 'CS', 'Y');insert into Apply values (876, 'Stanford', 'CS', 'N');insert into Apply values (876, 'MIT', 'biology', 'Y');insert into Apply values (876, 'MIT', 'marine biology', 'N');insert into Apply values (765, 'Stanford', 'history', 'Y');insert into Apply values (765, 'Cornell', 'history', 'N');insert into Apply values (765, 'Cornell', 'psychology', 'Y');insert into Apply values (543, 'MIT', 'CS', 'N');

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago