File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
data-platform/core-converged-db/hybrid-partitioned/scripts Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ REM Script: 1 - create- partitioned- table .sql
2
+ REM Use data from HR table EMPLOYEES
3
+
4
+ -- prereq EMPLOYEES table from HR schema
5
+ -- HR schema available in https://github.com/oracle-samples/db-sample-schemas/blob/main/human_resources/hr_create.sql
6
+
7
+
8
+ DROP TABLE hr .employees_hybrid ;
9
+
10
+ CREATE TABLE hr .employees_hybrid
11
+ ( EMPLOYEE_ID varchar2 (10 ),
12
+ SALARY number ,
13
+ JOB_TITLE varchar2 (35 ))
14
+ PARTITION BY RANGE (salary)
15
+ ( PARTITION salary_4000 VALUES less than (4000 ), -- internal partition
16
+ PARTITION salary_10000 VALUES less than (10000 ), -- internal partition
17
+ PARTITION salary_30000 VALUES less than (30000 ), -- intern partition
18
+ PARTITION salary_max values less than (MAXVALUE))
19
+ /
20
+
21
+ -- insert rows
22
+
23
+ INSERT INTO hr .employees_hybrid
24
+ SELECT e .employee_id , e .salary , j .job_title
25
+ FROM hr .employees e JOIN hr .jobs j ON e .job_id = j .job_id ;
26
+
27
+ COMMIT ;
You can’t perform that action at this time.
0 commit comments