Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
food_plan
create table our_kitchen1(food_name char(13), food_type char(13), nutrient_fibre int, nutrient_protien int, nutrient_vitamins int, nutrient_flavonoids int, nutrient_carotene int, frequency int, primary key(food_name)); insert into our_kitchen1 values('carrots', 'veggies', 3, 1, 3, 2, 3, 3), ('potatoes', 'veggies', 2, 1, 1, 1, 1, 19), ('sweetpotatoes', 'veggies', 3, 2, 3, 3, 3, 1),('onions', 'veggies', 2, 1, 3, 3, 2, 20), ('gourds', 'veggies', 2, 2, 2, 1, 1, 3), ('spinach', 'veggies', 3, 3, 3, 1, 1, 1), ('broccolli', 'veggies', 3, 3, 3, 3, 3, 2), ('garlic', 'veggies', 1, 1, 3, 3, 1, 7), ('ginger', 'veggies', 3, 1, 1, 2, 1, 14), ('papaya', 'veggies', 3, 2, 3, 3, 3, 8); insert into our_kitchen1 values('raw_banana', 'veggies', 2, 2, 2, 1, 1, 2), ('lemon', 'veggies', 1, 1, 3, 1, 1, 14), ('oats', 'staples', 3, 2, 2, 1, 1,3), ('beans', 'pluses', 3, 3, 3, 2, 2, 3), ('raw_papaya', 'fruits', 2,2, 2, 3, 3, 2), ('plums', 'fruits', 3, 2, 3, 2, 2, 2), ('coconuts' , 'fruits', 2,2,2,2,2,1),('dry_fruits', 'fruits', 3,3,3,2,2,7), ('avocados', 'fruits', 3,3,3,3,3,1), ('arvi', 'veggies', 3, 3, 3, 3, 2, 6), ('dal', 'pulses', 3,3,3,1,1,10), ('yoghurt', 'sides', 2, 1, 3, 3, 1,7), ('eggs', 'poultry', 1,2,3,2,2,3); select * from our_kitchen1 select food_name, food_type, nutrient_fibre from our_kitchen1 order by food_type, nutrient_fibre desc; select food_name, food_type, nutrient_fibre, nutrient_protien from our_kitchen1 where food_type = 'fruits' order by nutrient_fibre, nutrient_protien desc; select food_name, food_type, nutrient_fibre, nutrient_protien from our_kitchen1 where nutrient_fibre > 3;
run
|
edit
|
history
|
help
0
SQL
Preppin Data Challenge - Week 7
Alquileres
Q2_30min
M0413045.sql
FirstTable
Count by days
sql to search database objects' definitions for text
№1
Comercio