0 0 votes From the following statements which of them is/are true about SQL a) All attributes used in the group by clause must appear in the select clause b) An SQL query can contain a having clause only if it has a group by clause c) An SQL query can contain a having clause even if it does not have a group by clause d) Not all attributes used in the group by clause need to appear in the select clause Databases sql + – Manas Mishra 3.4k views answer comment Share Follow Print See all 4 Comments 4 4 Comments reply daksirp commented Oct 14, 2018 reply Follow flag b and d 0 0 replyShare Deepanshu commented Oct 14, 2018 reply Follow flag it depends on sql standard nowa days sqls are more advanced than previous ones. so if i go with gate exam means previous ones sqls like 1990s sql then option a and b correct 0 0 replyShare daksirp commented Oct 14, 2018 reply Follow flag i think for gate, we need to follow sql-93 standard. acc to sql-93, option a & option b are correct. 1 1 replyShare Sukanya Das commented Oct 14, 2018 reply Follow flag b) An SQL query can contain a having clause only if it has a group by clause d) Not all attributes used in the group by clause need to appear in the select clause is correct. 0 0 replyShare Please log in or register to add a comment.
0 0 votes Option A : A group by command need to be applied to some attribute. So minimum of one attribute must be selected using select command. Option B: Having command is used to qualify the group by command. So having depends on group by. Option A and B are true! sarathijayaraman answered Oct 14, 2018 sarathijayaraman comment Share Follow See 1 comment 1 1 comment reply Manas Mishra commented Oct 14, 2018 reply Follow flag Bt according to the recent sql version , An SQL query can contain a having clause even if it does not have a group by clause and Not all attributes used in the group by clause need to appear in the select clause 2 2 replyShare Please log in or register to add a comment.