1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SQL

Discussion in 'SQL Exams' started by zxspectrum, Nov 9, 2008.

  1. zxspectrum

    zxspectrum Gigabyte Poster Premium Member

    1,666
    54
    139
    Right im getting wound up as ive come up with several answers or this question but not the one that is meant to be right so if i post this link would someone help me out and tell me where im going wrong, slightly embarrassed as its only the second question, but i need to take a breather before i throw this laptop out of the window.

    http://sqlzoo.net/1.htm

    That is the link and the question number is 2, cant understand why i get loads of different answers that to me seem to be right, but then they are wrong

    Thanks in advance for whoever helps me stop being thick
    Ed
     
    Certifications: BSc computing and information systems
    WIP: 70-680
  2. Sparky
    Highly Decorated Member Award

    Sparky Zettabyte Poster Moderator

    10,190
    296
    319
    2a)
    Code:
    Select Name from bbc 
    WHERE population > 200000000
    2b)
    Code:
    Select name, gdp/population FROM bbc
    WHERE population > 200000000 
    Been a while since I have done SQL, good site that btw!
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) Security+ Network+ A+
    WIP: Exchange 2007\2010
  3. zxspectrum

    zxspectrum Gigabyte Poster Premium Member

    1,666
    54
    139
    ARGHhhhhhhhhhhhhhhhhh

    I cant believe i was being sooooo stupid

    i put this

    SELECT name from bbc WHERE population < 200000000

    and when that returned a message that it wasnt right i started changing everything else but not wat i needed to change

    Thanks for that Sparky

    Ed
     
    Certifications: BSc computing and information systems
    WIP: 70-680
  4. Sparky
    Highly Decorated Member Award

    Sparky Zettabyte Poster Moderator

    10,190
    296
    319
    No probs mate 8)
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) Security+ Network+ A+
    WIP: Exchange 2007\2010
  5. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,623
    115
    224
    Being pedantic I'd say
    Code:
    select name, gdp/population as 'GDP' from bbc where population >= 200000000
    
    for 2b

    For 2c:
    Code:
    select name, round(population/1000000, 0) as 'population in millions' from bbc where region = 'Asia';
    
    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+

Share This Page

Loading...