Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Simple query help

$
0
0
Hello, i am rather new to SQL and im having some struggles with queries. I have a general understanding of some statements. Like SELECT, COUNT, DISTINCT, and FROM. But i have the hardest time when it comes to grouping tables together or using sub queries i get highly confused and ends up leading to frustration and not figuring it out.
I have a database that has two tables both with the exact same columns and almost the same data. Its a database with geoip data.
Columns: visits id, ip, country_code, country_name, region_code, region_name, city, zip_code, time_zone, latitude, longitude, metro_code
So i just have a couple queries i would like help with.
This is what im trying to acheieve.

1.) How many rows/records ipv4 ips vs ipv6?
2.)List some non-US style zips (limit 10)
3.)Top 20 ip's with most visits.
4.)How many rows/records have NULLS/bad data?
5.)Counts of visits in Northern Hemisphere vs Southern Hemisphere

I really appreciate your time and help if there is any. Thanks

Viewing all articles
Browse latest Browse all 13329

Trending Articles