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.
Write a SQL statement to change the email column of employees table
with 'not available' for all employees.
Write a SQL statement to change the email and commission column of
employees table with 'not available' and for all employees.
Write a SQL statement to change the email column of employees table
with 'not available' for those employees whose departmentid is and
gets a commissionpct is less than
Write a SQL statement to change the email and commissionpct
column of employees table with 'not available' and for those
employees whose departmentid is
Write a SQL statement to change salary of employee to
whose ID is if the existing salary is less than
Write a SQL statement to add a primary key for the columns
locationid in the locations table.
Here is the sample table employees.
Sample table: locations
Here is the structure of the table locations.
mysql SHOW COLUMNS FROM locations;
Field Type Null Key Default Extra
LOCATIONID decimal YES NULL
STREETADDRESS varchar YES NULL
POSTALCODE varchar YES NULL
CITY varchar YES NULL
STATEPROVINCE varchar YES NULL
COUNTRYID varchar YES NULL
Write a SQL statement to rename the table countries to
countrynew.
Write a SQL statement to add a column regionid to the table
locations.
Write a SQL statement to add a columns ID as the first column of
the table locations.
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