Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 help with this assignment

Author  Topic 

egipto
Starting Member

1 Post

Posted - 2013-01-09 : 10:59:56
Data provided are:
We have a schema named Student Data that contains 3 tables: Municipality, student and student location The tables are described as follows:

There is a table with 3 columns named Municipality:

id, integer, identifier number of the municipality
name, character varying (32), Name of municipality
geom, geometry (polygon, 32,161), geometry of the municipality

Each student has a unique record in the student table that has four columns:

code, character(2), student identifier code
name, character varying (32), Name of student
lastname, character varying (64), Last name of student
municipality, character varying (32), Student municipality name

Each student has located his position and entered the student identifier code in the student_ location table, which has two columns:

code, character (2), student identifier code
geom, geometry (point, 32,161), student point location

Students table has filled all columns except for the municipality column whose value is null.

task:
1 - Write an instruction in structured query language (SQL) to update the name field of the municipality in the students table, where the point the student is placed within the polygon corresponding to the municipality that contains the point placed.

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2013-01-09 : 11:25:01
What have you tried?
Do you know how to handle geometry datatypes? - have a look at STIntersects

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

sportsguy
Starting Member

39 Posts

Posted - 2013-01-09 : 17:54:03
who gets the grade if we do your homework?

MS Access 20 years, SQL hack
Go to Top of Page
   

- Advertisement -