67

join challenges

 4 years ago
source link: https://joins-238123.netlify.com/join-challenges/?fbclid=IwAR0Hnr93L-hBibTfHGZvcmF1Wuj_706OqGbW9aSxWaahC2d9mAUWPA4uvBM
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
★ sql exercises ★

Joins!

Clicking "Run query" will run the query with SQLite.

★★★ challenges ★★★

How many cats does each owner have?

Make a query that outputs, for each owner in the cat_owners table:
  • the owner name
  • how many cats they have
  • the total number of activities their cats have done
Sort by number of activities descending.

tables

Which activity do cats like the best?

Make a query that outputs, for every activity, how many cats have done that activity

Sort the activities alphabetically.

tables

Find cats with no owners

For every cat with no owners, find the number of times they did the 'sleep' activity.

Order the cats alphabetically by name.

tables


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK