CREATE TABLEEmployees_demo (employee_id Number(6), first_nameVARCHAR2( -), last_nameVARCHAR2( -)CONSTRAINTEmp_last_name_nn_demo not NULL, emailVARCHAR2( -)CONSTRAINTEmp_email_nn_demo not NULL, Phone_numberVARCHAR2( -), hire_date dateDEFAULTsysdateCONSTRAINTEmp_hire_date_nn_demo not NULL, job_idVARCHAR2(Ten)CONSTRAINTEmp_job_nn_demo not NULL, Salary Number(8,2)CONSTRAINTEmp_salary_nn_demo not NULL, commission_pct Number(2,2), manager_id Number(6), department_id Number(4), DNVARCHAR2( -), CONSTRAINTEmp_salary_min_demoCHECK(Salary> 0), CONSTRAINTEmp_email_uk_demoUNIQUE(email)) Tablespace examplestorage (INITIAL6144NEXT 6144minextents1MAXEXTENTS5);
This example shows that there are some differences compared to SQL Server, such as
1) Whether NULL is allowed to become contraint under Oracle
2) Then a named contraint can be implemented in the code block of the CREATE table
3) getdate () under SQL Server becomes sysdate under Oracle
4) The FILEGROUP option under SQL Server becomes tablespace under Oracle, and of course the two are quite large.
Oracle Demo->> CREATE TABLE