Original atributes in table boat(bID, name, legth, colour)
Then i create a new atribute called relLength ant i need to to write sentences, where I will update my column (which set to 0 nowstrong text) with this formula:
relLength = Length/AVERAGE length.
I have this atributes in this table called boat: bID, name, length, colour, relLength (this was created)
This Is what I wrote, but is not working
UPDATE boat
SET relLength = length/ (SELECT AVG(length) FROM boat)
(the average is 38.75)
The other exercises is about to create view. I need to take original table (without relLengt inside) and create view where i create this (relLength) atribute and fill with previous formula only in view table and not into table.
Thanks for your help. :)