TÓM TẮT
departments /insert 4
name /nn
location
country
employees /insert 14
name /nn vc50
email /lower
cost center num
date hired
job vc255
view emp_v departments employees
CHI TIẾT
-- create tables
create table departments (
department_id number constraint department_fk primary key,
name varchar2(255) not null,
location varchar2(4000),
country varchar2(4000)
)
;
create table employees (
department_id number
constraint employees_department_id_fk
references departments on delete cascade,
name varchar2(50) not null,
email varchar2(255),
cost_center number,
date_hired date,
job varchar2(255)
)
;
-- triggers
create or replace trigger departments_biu
before insert or update
on departments
for each row
begin
null;
end departments_biu;
/
create or replace trigger employees_biu
before insert or update
on employees
for each row
begin
:new.email := lower(:new.email);
end employees_biu;
/
-- indexes
create index employees_i1 on employees (department_id);
-- create views
create or replace view emp_v as
select
departments.name department_name,
departments.location location,
departments.country country,
employees.name employee_name,
employees.email email,
employees.cost_center cost_center,
employees.date_hired date_hired,
employees.job job
from
departments,
employees
where
employees.department_id(+) = departments.id
/
-- load data
insert into departments (
department_id,
name,
location,
country
) values (
1,
'Customer Satisfaction',
'Tanquecitos',
'United States'
);
insert into departments values (2,
'Facilities',
'Sugarloaf',
'United States'
);
insert into departments values (3,
'Product Support',
'Dale City',
'United States'
);
insert into departments values (4,
'Internal Systems',
'Grosvenor',
'United States'
);
commit;
commit;
-- load data
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Gricelda Luebbers',
'gricelda.luebbers@aaab.com',
28,
sysdate - 64,
'Customer Advocate'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Dean Bollich',
'dean.bollich@aaac.com',
57,
sysdate - 95,
'President'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Milo Manoni',
'milo.manoni@aaad.com',
33,
sysdate - 87,
'Systems Designer'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Laurice Karl',
'laurice.karl@aaae.com',
63,
sysdate - 80,
'System Operations'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'August Rupel',
'august.rupel@aaaf.com',
77,
sysdate - 54,
'Security Specialist'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Salome Guisti',
'salome.guisti@aaag.com',
77,
sysdate - 88,
'President'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Lovie Ritacco',
'lovie.ritacco@aaah.com',
74,
sysdate - 56,
'Solustions Specialist'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Chaya Greczkowski',
'chaya.greczkowski@aaai.com',
77,
sysdate - 76,
'Web Developer'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Twila Coolbeth',
'twila.coolbeth@aaaj.com',
87,
sysdate - 66,
'Business Applications'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Carlotta Achenbach',
'carlotta.achenbach@aaak.com',
49,
sysdate - 91,
'Webmaster'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Jeraldine Audet',
'jeraldine.audet@aaal.com',
57,
sysdate - 27,
'Programmer Analyst'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'August Arouri',
'august.arouri@aaam.com',
5,
sysdate - 62,
'Executive Engineer'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Ward Stepney',
'ward.stepney@aaan.com',
24,
sysdate - 13,
'Accounting Analyst'
);
insert into employees (
department_id,
name,
email,
cost_center,
date_hired,
job
) values (
1,
'Ayana Barkhurst',
'ayana.barkhurst@aaao.com',
5,
sysdate - 36,
'Programmer Analyst'
);
commit;
* KHOÁ HỌC ORACLE DATABASE A-Z ENTERPRISE trực tiếp từ tôi giúp bạn bước đầu trở thành những chuyên gia DBA, đủ kinh nghiệm đi thi chứng chỉ OA/OCP, đặc biệt là rất nhiều kinh nghiệm, bí kíp thực chiến trên các hệ thống Core tại VN chỉ sau 1 khoá học.
* CÁCH ĐĂNG KÝ: Gõ (.) hoặc để lại số điện thoại hoặc inbox https://m.me/tranvanbinh.vn hoặc Hotline/Zalo 090.29.12.888
* Chi tiết tham khảo:
https://bit.ly/oaz_w
hoặc
https://bit.ly/oaz_fp
=============================
KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH:
📧 Mail: binhoracle@gmail.com
☎️ Mobile: 0902912888
⚡️ Skype: tranbinh48ca
👨 Facebook: https://www.facebook.com/BinhOracleMaster
👨 Inbox Messenger: https://m.me/101036604657441 (profile)
👨 Fanpage: https://www.facebook.com/tranvanbinh.vn
👨 Inbox Fanpage: https://m.me/tranvanbinh.vn
👨👩 Group FB: https://www.facebook.com/groups/DBAVietNam
👨 Website: https://www.tranvanbinh.vn
👨 Blogger: https://tranvanbinhmaster.blogspot.com
🎬 Youtube: http://bit.ly/ytb_binhoraclemaster
👨 Tiktok: https://www.tiktok.com/@binhoraclemaster?lang=vi
👨 Linkin: https://www.linkedin.com/in/binhoracle
👨 Twitter: https://twitter.com/binhoracle
👨 Địa chỉ: Tòa nhà Sun Square - 21 Lê Đức Thọ - Phường Mỹ Đình 1 - Quận Nam Từ Liêm - TP.Hà Nội
=============================
học oracle database
Các tìm kiếm liên quan đến học oracle
database
Tự học Oracle
Tài liệu Oracle 12c tiếng Việt
Hướng dẫn sử dụng Oracle Database
Oracle SQL cơ bản
Oracle SQL là gì
Khóa học Oracle Hà Nội
Học chứng chỉ Oracle ở đầu
Khóa học Oracle online
khóa học pl/sql
học dba
học dba ở việt nam
khóa học dba
khóa học dba sql
tài liệu học dba oracle
Khóa học Oracle online
học oracle sql
học oracle ở đâu tphcm
học oracle bắt đầu từ đâu
học oracle ở hà nội
oracle database tutorial
oracle database 12c
oracle database là gì
oracle database 11g
oracle download
oracle database 19c
oracle dba tutorial
oracle tunning
sql tunning
oracle 12c
oracle dataguard
oracle goldengate
oracle weblogic
oracle exadata
hoc solaris
hoc linux
hoc aix