Question: DDL STATEMENTS This lab is designed to practice the create command of DDL statement. 1. Write a SQL statement to create a simple table countries


DDL STATEMENTS This lab is designed to practice the create command of DDL statement. 1. Write a SQL statement to create a simple table countries including columns country.id, country.name and regionid, Specify the NOT NULL constraint on country.id and UNIQUE constraint on region id. 2. Write a SQL statement to create a table named selected 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. 3. Write a SQL statement to create a table named jobs including columns ieb.id, job_title, min salary, max salary and check whether the max salary amount exceeding the upper limit 25000.Also specify the jobid as the Primary key. 4. Write a SQL statement to create a table named new.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. 5. 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 iobuid contain only those values which are exists in the jobs table. 6. Create a table name Department with the following specification. | Field | Null key | Default | Extra | 1 | DEPARTMENT_ID | decimal(4,0) | NO | PRIO | DEPARTMENT_NAME varchar(30) NOI | MANAGER_ID | decimal(6,0) NOI | LOCATION_ID | decimal(4,0) YES 1 1 7. 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 column department id 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
Get step-by-step solutions from verified subject matter experts
