Skip to content

Tag: sql

How do I use one SQL statement to invalidate groups of records?

I’m working on an assignment for class. I need to write an SQL statement that returns every single country in the database where no single ethnic group makes up more than 25% of the population. This is the closest I can get: But, that only returns records where ethnic groups are over 25% population. It …

How to combine two tables to get singel table in Hive

I have following tables and need to combine them in hive Could any one please help me how can we achieve this. I tried date part with coalesce and it is fine. But fam part is not able to merge into single column. Really appreciate your help. Thanks, Babu Answer You can use full outer join. However, union with…

SQL: What are phone number formatting options?

SQL: What are phone number formatting options? I query my SQL Database for a phone number: 816-123-4567 I want to output it is as: 816 123-4567. What steps do I take to achieve this result in an SQL environment? Answer A standard SQL solution would be: There may be simpler solutions in other databases. For in…