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
Afull journal bearing has a journal diameter of 27 mm, with a unilateral tolerance of -0.028 mm. the bushing bore has a diameter of 27.028 mm and a unilateral tolerance of 0.04 mm. the l/d ratio is 0.5. the load is 1.3 kn and the journal runs at 1200 rev/min. if the average viscosity is 50 mpa-s, find the minimum film thickness, the power loss, and the side flow for the minimum clearance assembly.
Answers: 1
question
Engineering, 04.07.2019 19:20
Afan that can provide air speeds up to 60 m/s is to be used in a low-speed wind tunnel with atmospheric air at 35 c. if one wishes to use the wind tunnel to study flat-plate boundary layer behavior up to reynolds numbes of re 10, what is the minimum plate length that should be used? at what distance from the leading edge would transition occur if the critical reynolds nurnber were rer,e = 5 × 105?
Answers: 2
question
Engineering, 06.07.2019 03:10
Two slings are used to lift a girder of length l and uniform weight per unit length. what is the best position for the slings if the bending moment due to the weight of the girder is to be kept to a minimum?
Answers: 2
question
Engineering, 06.07.2019 03:10
List and describe in sequence the operation process steps for boxf machine?
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
Arts, 10.12.2020 14:00
question
Mathematics, 10.12.2020 14:00
question
Law, 10.12.2020 14:00
Questions on the website: 13722360