#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Location
    NewYork
    Posts
    3
    Rep Power
    0

    basic Query help


    Hello everyone

    I am doing some coursework and need to complete some queries.

    I'm sure even the best of the best can't quite make queries without knowing the tables so I have:

    site_details:site_name
    site_reference:site_grid_reference,site_name*
    site_boundaries:site_name*,boundary1, boundary2, boundary3, boundary4
    site_record:site_record_number,site_name*, site_record_date
    recorder_details:recorder_id,(more fields like recorder_name, recorder_addres, etc )
    surveyour_log:site_record_number*, recorder_id
    species_details:species_id, (more fields like name, etc)
    species_record:species_id*,site_record_number

    The queries I have to complete are:
    a. A list of Species (no duplicates).
    b. A list of records for a site after a specific date.
    c. The number of species found at each site.
    d. Sites and dates where a particular species was recorded by a specific surveyor.
    e. List of species that have less than a given number of records within some mapping area (site).

    I have done the 1st one and the 2nd I'm not sure why it isn't working.

    For the 2nd query I have:
    SELECT *
    FROM site_record
    WHERE site_record_date>01/01/2003
    ORDER BY site_record_date

    Any help will be much appreciated, I will be working on these all day so I will keep everyone posted as to my progess.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Location
    NewYork
    Posts
    3
    Rep Power
    0
    Ok, compelted query 3.

    Did:
    SELECT site_name, COUNT(*)
    FROM site_record
    GROUP BY site_name

    Queries left:
    2,4,5
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Location
    NewYork
    Posts
    3
    Rep Power
    0
    Ok, completed 1,2 and 3.

    The only thing wrong with it was I hadn't put single quotes around the date ..

    oh well nevermind

    still doing 4 and 5

IMN logo majestic logo threadwatch logo seochat tools logo