Here we have  Creating table code according to syntax in Oracle APEX.         CREATE TABLE DEPT ( DEPTNO NUMBER(10) NOT NULL, DNAME VARCHAR2(50) NOT NULL, LOC VARCHAR2(50) , CONSTRAINT DEPT_PK PRIMARY KEY (DEPTNO) );       Step 2: Emp table CREATE TABLE EMP( EMPNO NUMBER(10) NOT NULL, ENAME  VARCHAR2(50) NOT NULL, JOB  VARCHAR2(50) , MGR  VARCHAR2(50) , HIREDATE  DATE,  SAL  NUMBER(5) ,  COMM  VARCHAR2(50) ,  DEPTNO  NUMBER(10) NOT NULL, CONSTRAINT EMP_PK PRIMARY KEY (EMPNO), CONSTRAINT EMP_FK  FOREIGN KEY ( DEPTNO ) REFERENCES DEPT  (DEPTNO ) );       Step 3 CREATE TABLE SALGRADE  ( GRADE NUMBER(10) NOT NULL,  LOSAL NUMBER(10) ,   HISAL NUMBER(10) , CONSTRAINT SALGRADE_PK PRIMARY KEY (GRADE) ); Question: Give all employees records who have salaries in between 1000 and 2000 (both included) Get all employee names whose name the second letter is ‘A’. Retrieve all employees records who don’t take a commission. Get all employee's records who work as ‘CLERK’.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter6: Additional Database Objects
Section: Chapter Questions
Problem 6RQ
icon
Related questions
icon
Concept explainers
Question

 

Here we have  Creating table code according to syntax in Oracle APEX.

 

 

 

 

CREATE TABLE DEPT (

DEPTNO NUMBER(10) NOT NULL,

DNAME VARCHAR2(50) NOT NULL,

LOC VARCHAR2(50) ,

CONSTRAINT DEPT_PK PRIMARY KEY (DEPTNO)

);

 

 

 

Step 2: Emp table

CREATE TABLE EMP(

EMPNO NUMBER(10) NOT NULL,

ENAME  VARCHAR2(50) NOT NULL,

JOB  VARCHAR2(50) ,

MGR  VARCHAR2(50) ,

HIREDATE  DATE,

 SAL  NUMBER(5) ,

 COMM  VARCHAR2(50) ,

 DEPTNO  NUMBER(10) NOT NULL,

CONSTRAINT EMP_PK PRIMARY KEY (EMPNO),

CONSTRAINT EMP_FK  FOREIGN KEY ( DEPTNO ) REFERENCES DEPT  (DEPTNO )

);

 

 

 

Step 3

CREATE TABLE SALGRADE  (

GRADE NUMBER(10) NOT NULL,

 LOSAL NUMBER(10) , 

 HISAL NUMBER(10) ,

CONSTRAINT SALGRADE_PK PRIMARY KEY (GRADE)

);

Question:

Give all employees records who have salaries in between 1000 and 2000 (both included)
Get all employee names whose name the second letter is ‘A’.
Retrieve all employees records who don’t take a commission.
Get all employee's records who work as ‘CLERK’.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning