Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 . Create a schema employee 2 . Write a SQL statement to create a simple table countries including columns country _ id , country
Create a schema employee
Write a SQL statement to create a simple table countries including columns
countryidcountryname and regionid
Write a SQL statement to create a table named jobs including columns
jobid jobtitle, minsalary, maxsalary and check whether the maxsalary
amount exceeding the upper limit
Write a SQL statement to create a table jobhistory including columns
employeeid startdate, enddate, jobid and departmentid and make sure
that, the employeeid column does not contain any duplicate value at the time
of insertion and the foreign key column jobid 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
JOBID varchar NO PRI
JOBTITLE varchar NO NULL
MINSALARY decimal YES NULL
MAXSALARY decimal YES NULL
Write a SQL statement to create a table departments
Field Type Null Key Default Extra
DEPARTMENTID decimal NO PRI
DEPARTMENTNAME varchar NO NULL
MANAGERID decimal NO PRI
LOCATIONID decimal YES NULL
Write a SQL statement to create a table employees including columns
employeeid firstname, lastname, email, phonenumber hiredate, jobid
salary, commission, managerid and departmentid and make sure that, the
employeeid column does not contain any duplicate value
at the time of insertion and the foreign key columns combined by
departmentid and managerid 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started