Write a sql query that returns the employee number

Assignment Help Database Management System
Reference no: EM132105106

Problem Set 10

1. Write a SQL query that returns the employee number, employee name, job, department number and location from the emp and dept tables.

Copy and paste your SQL code into this assignment.

2. Copy and modify the previous SQL query to use a right join to join the emp table to the dept table. What values appear in the result set now?

Copy and paste your SQL code along with your answer to the above question into this assignment.

3. Copy and paste the following SQL code into you ApEx SQL Command window:

insert into emp values(7935, 'EVE', 'MANAGER', 7839, SYSDATE, 2850, NULL, 40);

and click à Run

Re-run the SQL query created in part number 2 without making any changes to the query. How does the additional data in the table affect the result set of the query now?

Write your answer to the above question into this assignment.

4. Go to the SQL Scripts window in ApEx, which is under the SQL Workshop menu, and create a SQL file called "ps8a." Paste this SQL code into the code window and run it:

CREATE TABLE phone AS(select empno, deptno from emp);

ALTER table phone ADD(phoneNum NUMBER);

UPDATE phone set phoneNum = '8784444' where deptno = 10;

UPDATE phone set phoneNum = '8784445' where deptno = 20;

UPDATE phone set phoneNum = '8784446' where deptno = 30;

UPDATE phone set phoneNum = '8784447' where deptno = 40;

5. Create a SQL query in the SQL command window that will return the empno, enam, deptno and phone number from the emp and phone tables. You will have to join the two tables by first comparing them and decide which columns are in both tables. The phone table was created and populated with the commands above.

Copy and paste your SQL code along with your answer to the above question into this assignment.

Reference no: EM132105106

Questions Cloud

Develop a wbs and wbs dictionary : We have budgeted $150,000 for the project and have given 4 months to complete. How do I develop a WBS and WBS Dictionary for this?
Write the length of each cluster to a text file : Write the length of each cluster to a text file using the File class. Complete the analysis below two times.
Prepare advice for him citing full legal authority : Prepare advice for him citing full legal authority, as to what his legal position is - legal advice in relation to two transactions entered into by George
What is the executive summary for heinz : What is the executive summary for heinz and kraft within australia that includes success and failures
Write a sql query that returns the employee number : Write a SQL query that returns the employee number, employee name, job, department number and location from the emp and dept tables.
What is the uniform commercial code : What is the Uniform Commercial Code (UCC) responsibility concerning a contractual dispute?
Budget and get the project done with the cut specified : What if your boss says "just cut the budget and get the project done with the cut specified?" How would you handle this?
Advantages and disadvantages of practicing change control : What are some of the advantages and disadvantages of practicing Change Control?
Why do some organizations not practice change control : Why do some organizations not practice Change Control?

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd