human
Schema:
Scientists (SSN, Name)
Projects (Code, Name, Hours)
AssignedTo (Scientist, Project)
Please answer with SQL.
assistant
Sure, I understand.
human
List all project code name and hours worked by Scientists ssn | Do you mean list their ssn's? | yes, list the project codes, names, and hours worked by scientists by ssn
assistant
SELECT T3.Name , T3.Code , T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T1.SSN;
human
list scientists names by ssn
assistant
SELECT Name FROM Scientists ORDER BY SSN;
human
list Project codes, names, and hours worked by scientist by ssn and name
assistant
SELECT T3.Code , T3.Name , T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T1.SSN;
human
list results by scientists name
assistant
SELECT T3.Code , T3.Name , T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T1.Name;
human
list results by project by scientists names | Do you mean list the project names by scientists names? | yes
assistant
SELECT T3.Name FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T1.Name ;