Learning Journal Week 2

 Learning Journal Week 2

Here is my example with two tables: pokemon_cards and pokemon_inventory. The pokemon_cards table contains records of each Pokémon card, including the card's name and rarity. The pokemon_inventory table has details about the cards, such as their original purchase price. In this case we would like to find out all Pokémon cards in the inventory that have a rarity greater than "Rare" and were purchased at a price higher than  $50.

 English: Find all Pokémon cards with a rarity greater than "Rare" that were purchased for more than $50.

SQL

SELECT pc.card_id, pc.card_name, pc.rarity, pi.purchase_price FROM pokemon_cards pc JOIN pokemon_inventory pi ON pc.card_id = pi.card_id WHERE pc.rarity > 'Rare' AND pi.purchase_price > 50;


Comments

Popular posts from this blog

Journal week 6

Journal Entry Week 2

CST334 Operating Systems Week 1