Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Find five random employees from a random department

The image displays a table with three columns titled DEPTNO, DNAME, and LOC. Below is a transcription of the data presented in the table:

1. **DEPTNO: 10**
   - **DNAME: ACCOUNTING**
   - **LOC: NEW YORK**

2. **DEPTNO: 20**
   - **DNAME: RESEARCH**
   - **LOC: DALLAS**

3. **DEPTNO: 30**
   - **DNAME: SALES**
   - **LOC: CHICAGO**

4. **DEPTNO: 40**
   - **DNAME: OPERATIONS**
   - **LOC: BOSTON**

This table lists various departments identified by their department numbers, names, and locations.
expand button
Transcribed Image Text:The image displays a table with three columns titled DEPTNO, DNAME, and LOC. Below is a transcription of the data presented in the table: 1. **DEPTNO: 10** - **DNAME: ACCOUNTING** - **LOC: NEW YORK** 2. **DEPTNO: 20** - **DNAME: RESEARCH** - **LOC: DALLAS** 3. **DEPTNO: 30** - **DNAME: SALES** - **LOC: CHICAGO** 4. **DEPTNO: 40** - **DNAME: OPERATIONS** - **LOC: BOSTON** This table lists various departments identified by their department numbers, names, and locations.
The image shows a table with the following columns and data:

- **EMPNO (Employee Number):** 
  - 7839
  - 7566

- **ENAME (Employee Name):** 
  - KING
  - JONES

- **JOB (Job Title):** 
  - PRESIDENT
  - MANAGER

- **MGR (Manager Number):** 
  - (null) for KING
  - 7839 for JONES

- **HIREDATE (Hire Date):** 
  - 17-NOV-81 for KING
  - 02-APR-81 for JONES

- **SAL (Salary):**
  - 5000 for KING
  - 2975 for JONES

- **COMM (Commission):**
  - (null) for both KING and JONES

- **DEPTNO (Department Number):** 
  - 10 for KING
  - 20 for JONES

**Explanation:**

This table represents employee data, where each row corresponds to an individual employee's details. The columns include identifiers like employee number and name, job information, manager references, hire date, and financial details such as salary and commission. Null values indicate missing data in the manager and commission columns for some entries.
expand button
Transcribed Image Text:The image shows a table with the following columns and data: - **EMPNO (Employee Number):** - 7839 - 7566 - **ENAME (Employee Name):** - KING - JONES - **JOB (Job Title):** - PRESIDENT - MANAGER - **MGR (Manager Number):** - (null) for KING - 7839 for JONES - **HIREDATE (Hire Date):** - 17-NOV-81 for KING - 02-APR-81 for JONES - **SAL (Salary):** - 5000 for KING - 2975 for JONES - **COMM (Commission):** - (null) for both KING and JONES - **DEPTNO (Department Number):** - 10 for KING - 20 for JONES **Explanation:** This table represents employee data, where each row corresponds to an individual employee's details. The columns include identifiers like employee number and name, job information, manager references, hire date, and financial details such as salary and commission. Null values indicate missing data in the manager and commission columns for some entries.
Expert Solution
Check Mark
Step 1

 

  • Syntax to select a random record:

           SELECT column FROM  (SELECT column FROM table  ORDER BY dbms_random.value)  WHERE rownum =1  

By using the above syntax, Initially, a random department (DEPTNO) is retrieved from the DEPT table. Using DEPTNO, 5 random employee records are retrieved from the EMP table. 

NOTE: Sample Data is considered to implement query on EMP and DEPT table.

Step 2

Data in EMP Table:

Computer Science homework question answer, step 2, image 1

Data in DEPT table:

Computer Science homework question answer, step 2, image 2

bartleby

Step by stepSolved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education