Question: 1 . Create a schema employee 2 . Write a SQL statement to create a simple table countries including columns country _ id , country

1. Create a schema employee
2. Write a SQL statement to create a simple table countries including columns
country_id,country_name and region_id.
3. Write a SQL statement to create a table named jobs including columns
job_id, job_title, min_salary, max_salary and check whether the max_salary
amount exceeding the upper limit 25000.
4. Write a SQL statement to create a table job_history including columns
employee_id, start_date, end_date, job_id and department_id and make sure
that, the employee_id column does not contain any duplicate value at the time
of insertion and the foreign key column job_id contain only those values which
are exists in the jobs table.
Here is the structure of the table jobs;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| JOB_ID | varchar(10)| NO | PRI |||
| JOB_TITLE | varchar(35)| NO || NULL ||
| MIN_SALARY | decimal(6,0)| YES || NULL ||
| MAX_SALARY | decimal(6,0)| YES || NULL ||
+------------+--------------+------+-----+---------+-------+
5. Write a SQL statement to create a table departments
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+-------+
| DEPARTMENT_ID | decimal(4,0)| NO | PRI |0||
| DEPARTMENT_NAME | varchar(30)| NO || NULL ||
| MANAGER_ID | decimal(6,0)| NO | PRI |0||
| LOCATION_ID | decimal(4,0)| YES || NULL ||
+-----------------+--------------+------+-----+---------+-------+
6. Write a SQL statement to create a table employees including columns
employee_id, first_name, last_name, email, phone_number hire_date, job_id,
salary, commission, manager_id and department_id and make sure that, the
employee_id column does not contain any duplicate value
at the time of insertion and the foreign key columns combined by
department_id and manager_id columns contain only those unique
combination values, which combinations are exists in the departments
table.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!