Create an oracle exercise table

Source: Internet
Author: User

CREATE an oracle exercise TABLE SQL code CREATE TABLE DEPT (DEPTNO NUMBER (2) CONSTRAINT PK_DEPT PRIMARY KEY, DNAME VARCHAR2 (14), LOC VARCHAR2 (13 )); create table emp (empno number (4) CONSTRAINT PK_EMP primary key, ENAME VARCHAR2 (10), JOB VARCHAR2 (9), mgr number (4), hiredate date, sal number (), comm number (), deptno number (2) CONSTRAINT FK_DEPTNO references dept); insert into dept values (10, 'accounting', 'New YORK '); insert into dept values (20, 'Research ', 'Dallas'); insert into dept values (30, 'sales', 'Chicago '); insert into dept values (40, 'operation', 'boston '); insert into emp values (7369, 'Smith', 'cler', 7902, to_date ('17-12-1980 ', 'dd-mm-yyyy'), 800, NULL, 20); insert into emp values (7499, 'allen', 'salesman', 7698, to_date ('20-2-1981 ', 'dd-mm-yyyy'), 1600,300, 30); insert into emp values (7521, 'ward ', 'salesman', 7698, to_date ('22-2-1981 ', 'dd-mm-yyyy'), 1250,500, 30); insert into emp values (7566, 'Jones ', 'manager', 7839, to_date ('2-4-1981 ', 'dd-mm-yyyy'), 2975, NULL, 20); insert into emp values (7654, 'martin ', 'salesman ', 7698, to_date ('28-9-1981 ', 'dd-mm-yyyy'), 7698, 30); insert into emp values (, 'bucke', 'manager ', 7839, to_date ('1-5-1981 ', 'dd-mm-yyyy'), 2850, NULL, 30); insert into emp values (7782, 'clark ', 'manager', 7839, to_date ('9-6-1981 ', 'dd-mm-yyyy'), 2450, NULL, 10); insert into emp values (7788, 'Scott ', 'analyst', 7566, to_date ('13-7-87', 'dd-mm-rr ')-, NULL, 20 ); insert into emp values (7839, 'King', 'President ', NULL, to_date ('17-11-1981', 'dd-mm-yyyy'), 5000, NULL, 10); insert into emp values (7844, 'turner ', 'salesman', 7698, to_date ('8-9-1981', 'dd-mm-yyyy'), 0, 30); insert into emp values (7876, 'adams', 'lock', 7788, to_date ('13-8-87 ', 'dd-mm-rr, NULL, 20); insert into emp values (7900, 'James ', 'cler', 7698, to_date ('3-12-1981', 'dd-mm-yyyy '), 950, NULL, 30); insert into emp values (7902, 'Ford ', 'analyst', 7566, to_date ('3-12-1981 ', 'dd-mm-yyyy'), 3000, NULL, 20); insert into emp values (7934, 'miller ', 'cler', 7782, to_date ('23-1-1982 ', 'dd-mm-yyyy'), 1300, NULL, 10); create table bonus (ENAME VARCHAR2 (10), JOB VARCHAR2 (9 ), sal number, comm number); create table salgrade (grade number, losal number, hisal number); insert into salgrade values (1,700,120 0); insert into salgrade values (1400 ); insert into salgrade values (2000, 3000); insert into salgrade values (9999,); insert into salgrade values (,); COMMIT;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.