NOT Like: Check Whether The Max - Salary Amount Exceeding The Upper Limit 25000
NOT Like: Check Whether The Max - Salary Amount Exceeding The Upper Limit 25000
3. Write a SQL statement to create the structure of a table dup_countries similar to countries.
4. Write a SQL statement to create a duplicate copy of countries table including structure and data by name dup_countries.
6. 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.
7. Write a SQL statement to create a table named countries including columns country_id, country_name and region_id
and make sure that no countries except Italy, India and China will be entered in the table.
8. Write a SQL statement to create a table named job_histry including columns employee_id, start_date, end_date, job_id
and department_id
9. Write a SQL statement to create a table named countries including columns country_id,country_name and region_id
and make sure that no duplicate data against column country_id will be allowed at the time of insertion.
10. Write a SQL statement to create a table named jobs including columns job_id, job_title, min_salary and max_salary,
and make sure that, the default value for job_title is blank and min_salary is 8000 and max_salary is NULL will be entered
automatically at the time of insertion if no value assigned for the specified columns.
11. Write a SQL statement to create a table named countries including columns country_id, country_name and region_id
and make sure that the country_id column will be a key field which will not contain any duplicate data at the time of
insertion.
12. Write a SQL statement to create a table countries including columns country_id, country_name and region_id and
make sure that the column country_id will be unique and store an auto incremented value.
13. Write a SQL statement to create a table countries including columns country_id, country_name and region_id and
make sure that the combination of columns country_id and region_id will be unique.
+------------+--------------+------+-----+---------+-------+
| 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 | |
+------------+--------------+------+-----+---------+-------+
15. 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.
+-----------------+--------------+------+-----+---------+-------+
| 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 | |
+-----------------+--------------+------+-----+---------+-------+