Hi guys someone could please help me? I really can’t understand “join”‘s… Given the database defined by the following relational schema:
Employee (id_code, Name, Surname, Serial Number, Unit, Prog) Project (ProjectCode, Name) Unit (UnitCode, Name, Headquarters)
Where the underlined attribute represents the primary key, the Unit attribute is the foreign key of the Unit and the Prog attribute is the foreign key of the Project.
express the following questions:
- Select employees with surname ‘Bianchi’
- Select the list of employee surnames in alphabetical order and without duplicates
- Select the locations of the units of employees who are assigned to the project with code ‘4’
- Count the employees assigned to each project for each unit
Those are the first two that I’ve done.
1)
SELECT *
FROM Employee
WHERE Surname= ‘Bianchi’;
SELECT DISTINCT Surname
FROM Employee
ORDER BY Surname ASC;
Hope those two are at least correct