Skip to content

feat: adds josephcaballero.sql inside queries dir. lesson_28 -JosephCaballero" #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lesson_28/db/db_app/src/main/resources/queries/josephcaballero.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--gets all the types and their occurences
SELECT type, COUNT(*)
FROM media_items
GROUP BY type;

--gets the pages that were checked-out
SELECT pages
FROM media_items
WHERE id
IN (SELECT item_id FROM checked_out_items);

--returns the info of an email
SELECT *
FROM checked_out_items c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected a select from guests joined with checked_out_items

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will review this, thank you.

WHERE c.email IN (SELECT email FROM guests);