subject
Engineering, 12.03.2022 14:00 JamierW2005

* Ocelot exercise database presented in SQL basics 1 will be used in this exercise * Return exercise in .txt format and use formatting presented below (question always followed be the query)
-- Select all employees from table
SELECT * FROM EMPS;
* In this exercise you will add a new table to Ocelot training database, which will be used to describe the history of employee salary.
Create tables
1. Create a new table called salarydata with the following columns:
* salarydataID (primary key)
* salary (the amount of salary described with two decimals)
2. Create a connection between salarydata and emps tables (Tip: First think what column you should bring from emps table and then create a new column for it). Use the following options in foreign key definition:
* UPDATE CASCADE
* DELETE NO ACTION
Editing table properties
* Important: Do not include the following tasks with the CREATE TABLE statement used in the first exercise but rather add them using a separate query!
3. Add a new column called last_update. The current date should be added automatically for this column when new data is inserted.
4. Add automatic counter for salarydataID column so that this field value will be automatically generated each time a new data is inserted.
Input validation
5. Create input validation check with TRIGGER. The following checks has to be made:
* Salary cannot be under 1000 and cannot exceed 12000 euros.
* Salary value must be even (salary % 2 = 0). For example, only salary values 1000, 1002, 1004 etc. are accepted.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Machinery that is a key part of the process and without which the plant or process cannot function is classifed as: (clo4) a)-critical machinery b)-essential machinery c)-general purpose machinery d)-none of the specified options.
Answers: 1
question
Engineering, 04.07.2019 18:20
Asolid cylinder is concentric with a straight pipe. the cylinder is 0.5 m long and has an outside diameter of 8 cm. the pipe has an inside diameter of 8.5 cm. the annulus between the cylinder ad the pipe contains stationary oil. the oil has a specific gravity of 0.92 and a kinematic viscosity of 5.57 x 10-4 m2/s. most nearly, what is the force needed to move the cylinder along the pipe at a constant velocity of 1 m/s?
Answers: 3
question
Engineering, 04.07.2019 19:20
Acarnot refrigerator operates in a room in which the temperature is 21°c and of power when operating. if the food compartment of the refrigerator is consumes 3 kw to be maintained at 2°c, determine (a) the coefficient of performance of the cycle and (b) the rate of heat removal from the food compartment. refrigerator cycle that has a higher coefficient of performance than that of the discussed (e) is it possible to develop a carn ot refrigerator, operating between the same temperature limits? explain
Answers: 2
question
Engineering, 06.07.2019 03:10
Different between boring and turning?
Answers: 1
You know the right answer?
* Ocelot exercise database presented in SQL basics 1 will be used in this exercise * Return exerci...
Questions
question
Mathematics, 16.02.2021 19:40
question
History, 16.02.2021 19:40
question
Mathematics, 16.02.2021 19:40
Questions on the website: 13722360