Register now or log in to join your professional community.
Come relations between at least two tables
It could be a single table in the event of self join
This is a poor sql statement. What kind of relational result is expected here? It just returns the entire table contents sorted by StudentId
The result will be a table.. Using the term relational here is pretty illogical brother. Coz result set cannot be relational as far as I know.
to solve this question we need to understand what is relation. SQL query based on relational model. Relational Model based on Set theory and Predicate logic. in Set there is no term "Sort", it means you can't sort a set. so relational model don't have any sort. in relational model relation express as table. so if we want to say a table is relational in sql means it is not sorted and also Set defination depend on distinct element in set. So in this given sentence it is not distint and we use order by clause so this is not a relational query. but if we write it like"Select distinct * from Student" then it become relational query and we get a relationl output.
There is a misconception about relational database, that relation between tables and primary key makes it relationl actually it's not. Because of Relational model it calls Relational database.so in this question it is not a poor sql, its is a perfect cursor but not relational query.