You say complex sql statement but above shared SQL looks straight forward.
About above query execution, you are creating a SP that holds a SELECT query. If you want to run that select query and get data, either execute SP or run the SQL directly.
i.e.:
SELECT sname from student
OR
exec test1;