Arun P Rangrej 4 Sem, Mca RIT Hive-Handout: Create The Following Tables and Answer The Queries
Arun P Rangrej 4 Sem, Mca RIT Hive-Handout: Create The Following Tables and Answer The Queries
HIVE-HANDOUT
Create the following tables and answer the queries.
ANS:
create database arun;
Insert values:
insert into arun.eat(id_e,eats) values (1,"grass")
insert into arun.eat(id_e,eats) values (3,"fish")
insert into arun.eat(id_e,eats) values (4,"meat")
insert into arun.eat(id_e,eats) values (6,"goldfish food")
insert into arun.eat(id_e,eats) values (7,"lettuce")
insert into arun.eat(id_e,eats) values (8,"flowers")
insert into arun.eat(id_e,eats) values (10,"anything")
ANS:
SELECT a.id_a, a.a_name, f.id_e, f.eats
FROM arun.animal a JOIN arun.eat f
ON (a.id_a = f.id_e);
ANS: