Skip to Content
Oracle DBA teszt
1
CREATE TABLE t1 AS SELECT * FROM regions WHERE 1=2;
1
2
3
SELECT SUM(SALARY), DEPARTMENT_ID
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID;
1
2
3
4
5
6
7
CREATE OR REPLACE TRIGGER DELETE_TRIGGER
    BEFORE DELETE ON EMP
        BEGIN
            RAISE_APPLICATION_ERROR (
                num => -20000,
                msg => 'Cannot delete object';
        END;
1
2
3
4
CREATE TABLE STATE
(
    UPDATE_DT DATE
);
1
2
3
4
5
6
7
8
9
CREATE TABLE ADDRESSES
(
    NAME VARCHAR2(40) PRIMARY KEY,
    STREET VARCHAR2(40),
    CITY VARCHAR2(40),
    STATE CHAR(2) REFERENCES STATE (ST_CODE),
    ZIP NUMBER(5) NOT NULL,
    PHONE VARCHAR(12) UNIQUE
);
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
CREATE SEQUENCE S
START WITH 100
INCREMENT BY 10
NOCYCLE NOCACHE;

CREATE TABLE EXAMPLE
(
    EXAMPLE_ID NUMBER,
    NAME VARCHAR2(5)
);

INSERT INTO EXAMPLE(EXAMPLE_ID, NAME) VALUES (S.NEXTVAL, 'JOHN');
INSERT INTO EXAMPLE(EXAMPLE_ID, NAME) VALUES (S.NEXTVAL, 'GEORGE');