N
N
n_a_m_e2018-05-30 14:51:18
SQL
n_a_m_e, 2018-05-30 14:51:18

How to select correctly?

There was a question at the interview that I'm trying to clarify. I do not understand what kind of comments in the request. More details https://sql-language.ru/query-select.html
Example No. 5.
Calculate the number of students enrolled in each faculty. Display the name of the faculty in the query, the comment - "training", the number of students, the comment "person".
sql server management studio 17 swears when I try to do this with my table. I can not understand why why and how to write a request so that it works correctly.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2018-05-30
@n_a_m_e

select fac, concat('learning ', quo, 'person') as info
from(
select fac, count(*) as quo
from student
group by fac
)q

N
n_a_m_e, 2018-05-30
@n_a_m_e

||' learns '||
This part is not clear to me how it works

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question