Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
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 region_id. 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 job 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 job id 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 | DEPARTMENT_ID | decimal(4,0) | NO | PRIO DEPARTMENT_NAME | varchar(30) | NO | MANAGER_ID | decimal(6,0) | NO | LOCATION_ID | decimal(4,0) | YES 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago