Hello i study now database and i have a assignment : i have a table:
CREATE TABLE employees(
ID INTEGER NOT NULL,
FirstName VARCHAR (25) NOT NULL,
SecondName VARCHAR (25) NOT NULL,
CNMU VARCHAR (13) NOT NULL,
Adres VARCHAR (25) NOT NULL,
Home VARCHAR (25) NOT NULL,
DateOfBirth DATE,
PlaceOfBirght VARCHAR (50),
NrTelefon VARCHAR (20),
TrainingSchool VARCHAR (20),
CivilStatus VARCHAR (20),
Sex VARCHAR (10),
SalarMax NUMERIC (10),
SalarMediu NUMERIC (10));
Write the SQL query that will presents CivilStatus at least 4 employees.
i right:
select* from test. employees where civilstatus='married' or civilstatus ='notmarried' or civilstatus ='divorced' or civilstatus ='widow' group by civilstatus;
byt the answere was:
Unfortunately exercise is incorrect. Exercise can be achieved by grouping and aggregate function.
can you halp me how it should be????????
i tray : select id,firstname,civilstatus from test.employees group by civilstatus ;
and give me at lists 4 employees byt how can i coose to show me al the employees which are with civillstatus married??????(i have in my table 5 of them).i thinc it should be enought.
thank you very much.