- #1
mathmari
Gold Member
MHB
- 5,049
- 7
Hey! :giggle:
The following relations of a project administration of a company are given, where the primary key of the respective relations are underlined.
An employee can be assigned to several projects. Furthermore, an employee can have different competencies, which are billed at different daily rates. Each employee can do a task only on a daily basis. The assignment of employees to projects is contained in the relationship projektzuord. The relations mitarb und projekte contain the master data for the existing employees and projects.
In order to solve the tasks in the following, enter general SQL statements. The commands of the task should be as generally as possible, i.e. they should also be applicable to other data of the same form. Hint: You can calculate with the data type DATE like with an INTEGER
1) Which different employees (first name and last name) are assigned to the project with the name Lagerreorganisation ?
2) Which different employees (first name and last name) generate the most sales? Give a sorted list. The turnover is calculated from the number of planned days multiplied by the daily rate.
3) Which competencies (designation of competency) will be needed at least twice in the planned projects ?
4) How many employees with which skills are available in the period from 03/15/2022 to 04/09/2022, that is, not assigned to other projects?
5) There is a new project p42 called Datenreorganisation of customer kn99 and a Volume of 12000 euros. The employee Maier will be responsible for this new project from 01/03/2022 to 31/05/2022. Give SQL commands to update the database.
I have done the following :1)
SELECT DISTINCT m.vorname, m.name
FROM mitarb m, projektzuord z
WHERE m.mnr = z.mitarbnr AND z.projnr = 'p17'Is that correct ? :unsure:2)
SELECT m.vorname, m.name, MAX(DATEDIFF(day, z.datumbis, z.datumvon) * m.tagesastz)
FROM mitarb m, projektzuord z
WHERE m.mnr = z.mitarbnr AND m.kompetenz = z.kompetenzIs that the correct way to check the employees with the most sales? :unsure:
The following relations of a project administration of a company are given, where the primary key of the respective relations are underlined.
An employee can be assigned to several projects. Furthermore, an employee can have different competencies, which are billed at different daily rates. Each employee can do a task only on a daily basis. The assignment of employees to projects is contained in the relationship projektzuord. The relations mitarb und projekte contain the master data for the existing employees and projects.
In order to solve the tasks in the following, enter general SQL statements. The commands of the task should be as generally as possible, i.e. they should also be applicable to other data of the same form. Hint: You can calculate with the data type DATE like with an INTEGER
1) Which different employees (first name and last name) are assigned to the project with the name Lagerreorganisation ?
2) Which different employees (first name and last name) generate the most sales? Give a sorted list. The turnover is calculated from the number of planned days multiplied by the daily rate.
3) Which competencies (designation of competency) will be needed at least twice in the planned projects ?
4) How many employees with which skills are available in the period from 03/15/2022 to 04/09/2022, that is, not assigned to other projects?
5) There is a new project p42 called Datenreorganisation of customer kn99 and a Volume of 12000 euros. The employee Maier will be responsible for this new project from 01/03/2022 to 31/05/2022. Give SQL commands to update the database.
I have done the following :1)
SELECT DISTINCT m.vorname, m.name
FROM mitarb m, projektzuord z
WHERE m.mnr = z.mitarbnr AND z.projnr = 'p17'Is that correct ? :unsure:2)
SELECT m.vorname, m.name, MAX(DATEDIFF(day, z.datumbis, z.datumvon) * m.tagesastz)
FROM mitarb m, projektzuord z
WHERE m.mnr = z.mitarbnr AND m.kompetenz = z.kompetenzIs that the correct way to check the employees with the most sales? :unsure:
Last edited by a moderator: