All problems

Which Courses Carry Real Weight?

easySQLFiltering

A Fairhaven University student is picking electives and has been told to favour the ones that count for more towards the degree. Anything worth two credits or fewer is not worth a slot in her timetable this term, so she wants the titles of the courses above that bar and nothing else.

The bar is strict: a two-credit course is out, not in. Four courses is a short enough list to read by eye, but the catalogue grows every year and she would rather write something she can run again next term.

courses — one row per course on offer. credits is how much the course counts towards the degree.

id title credits
1 Intro to Databases 3
2 Machine Learning 4
3 Linear Algebra 3
4 Data Visualization 2

The table already exists in the database — there is nothing to create or load.

Task: Write a query returning a single column, title, for every course worth more than two credits. A course worth exactly two credits does not appear. List the titles in alphabetical sequence.

Example output — shape only, on an invented prospectus.

title
Cloud Systems
Discrete Maths
Ethics in Data

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…