Question: 1 . Write a SQL statement to create a table named hr _ projects to store the information about the projects being run in the
Write a SQL statement to create a table named hrprojects to store the information about the projects being run in the company. Identify to the best of your knowledge proper keys primary and foreign the best data types, and any other constraint that should be considered. The table must comprise the following attributes:
projectnumber: number of the project, it must allow to identify each project uniquely by using this identifier.
projectname: name of the project, it cannot be null.
projectmanager: identifies the project manager, it must be one of the existing employees.
projectdepartment: identifies the project department, it must be one of the existing departments.
projectbudget: budget of the project USD currency format
Write a SQL statement to:
Insert yourself as a new employee in the Employees table. Include only your employeeid lastname your lastname email your email hiredate now as in the systems date and jobid ITPROG Do not include any other information nor NULL values in the insert statement.
Update your salary and set it to
Delete yourself from the Employees table youre fired!
Write a query to show the distinct last names of the employees and how many of them have such same last name, sort the results according to the count first bigger count first and in case of equal count then sort according to the alphabetical order A first, Z last
Write a query to show the full name of the employees in a single column eg John Doe the department name, and the location city for all employees whose job title contains Manager and does not contain Sales.
Write a query to show the department name, the departments manager full name in a single column eg John Doe the average salary of all employees working for the department, and the number of employees of the department. Show only the departments whose managers salary is more than
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
