logo

Crowdly

Browser

Add to Chrome

Questions Bank (1557147 total)

Digitaro adalah perusahaan fintech yang menerapkan sistem insentif otomatis berbasis jam kerja dan performa. Sistem mereka sangat tergantung pada trigger dan stored procedure yang kompleks, dengan skenario sebagai berikut:

  • Tabel employee memiliki kolom: ssn, name, salary, bonus, total_hours_project, dan performance_grade.
  • Tabel works_on memiliki kolom: essn, project_id, hours.
  • Setiap kali jam kerja dimasukkan, total_hours_project diperbarui otomatis.
  • Jika total_hours_project > 200, maka bonus otomatis diberikan sebesar 20% dari gaji pokok.
  • Jika performance_grade diubah menjadi "A", maka stored procedure akan memanggil prosedur pemberian bonus tambahan.
  • Terdapat trigger untuk menolak semua insert/update yang menyebabkan salary + bonus > 1.5 * (salary supervisor).

Jika terdapat tiga trigger:

  • Trigger X: AFTER INSERT ON works_on ➝ Update total_hours_project
  • Trigger Y: AFTER UPDATE ON employee.total_hours_project ➝ Jalankan give_bonus() jika jam > 200
  • Trigger Z: BEFORE INSERT ON works_on ➝ Cek apakah jam yang ditambahkan valid (jam ≤ 12), kalau tidak raise exception

Apa yang mungkin terjadi jika ada query:

INSERT INTO works_on VALUES ('123', 'P5', 15);
0%
0%
0%
0%
View this question
After surviving a particularly violent tornado, Dean experiences a selective memory loss for specific traumatic events that occurred just before and during the disaster. Other than these specific memory losses, Dean's personality and subjective sense of identity are essentially unchanged. Dean would most likely be diagnosed with:
0%
0%
0%
100%
View this question
According to data from epidemiological studies, the mean age of onset for schizophrenia is closest to
0%
100%
0%
0%
View this question
A woman wandered away from her hometown and was discovered five years later in a distant city under a different name and identity. She is probably suffering from
0%
0%
0%
0%
View this question
A war veteran who survived 5 tours of duty is functionally blind, even though there does not appear to be anything wrong with his eyes. He may be experiencing
0%
0%
100%
0%
View this question

Perhatikan trigger dan store procedure dibawah ini

Pilihlah pernyataan yang paling tepat untuk kode di atas!

I. Penggunaan OLD.Fname tidak tepat.

II. Jika ingin tetap mempertahankan penggunaan OLD.Fname, perlu dibuat kondisi baru, yaitu

IF (TG_OP = 'INSERT') THEN RAISE EXCEPTION '% salary cannot greater than his/her supervisor salary', NEW.Fname;

III. Jika ingin tetap mempertahankan penggunaan OLD.Fname, perlu dibuat kondisi baru, yaitu

IF (TG_OP = 'UPDATE') THEN RAISE EXCEPTION '% salary cannot greater than his/her supervisor salary', NEW.Fname;

IV. Penggunaan OLD.Fname sudah tepat.

100%
0%
0%
0%
View this question

Perhatikan definisi tabel berikut

CREATE TABLE EMPLOYEE (

Ssn VARCHAR PRIMARY KEY,

Fname VARCHAR,

Salary NUMERIC,

Super_ssn VARCHAR REFERENCES EMPLOYEE(Ssn),

Dno INT

);

Pilihlah trigger dan stored procedure yang paling tepat untuk memastikan bahwa tidak ada supervisor (Super_ssn) yang berbeda departemen dari pegawai yang dia supervisi.

0%
0%
0%
0%
View this question

Яку функцію виконує інструмент зображений на рисунку?

0%
0%
0%
0%
100%
View this question

Яку функцію виконує інструмент зображений на рисунку?

0%
0%
0%
100%
0%
View this question
A behaviour therapist spent months working with an autistic child who finally managed to say a few words. What is one reason that so much time and effort is needed to make such small changes in the behaviour of autistic children?
0%
100%
0%
0%
View this question