Question

Write a T-SQL query to display the emp code, emp lname, employee job code, from the...

Write a T-SQL query to display the emp code, emp lname, employee job code, from the employee table joining the job table where the employee job code equals the job table job code. Order the output by employee job code. Copy and paste the query and the output into your assignment document. (hint: use table aliases).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Since you have not provided the table and column names, I am guessing them and providing you the query. You might need to change them accordingly. Feel free to reach out to me via the comments section in case you have any doubts.

Please find the SQL query below.

Query:

SELECT e.EmpCode, e.Lname, e.JobCode FROM EMPLOYEE e JOIN JOB j ON e.JobCode = j.JobCode ORDER BY e.JobCode;

Add a comment
Know the answer?
Add Answer to:
Write a T-SQL query to display the emp code, emp lname, employee job code, from the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need this written in SQL Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP...

    I need this written in SQL Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP CITY EMP STATE EMP ZIP EMP START DATE Table TABLE ID AREA IDTABLE SEATS Area AREA ID AREA NAME AREA SUPERVISOR EMPLOYEE ID Customer CUST ID CUST LAST NAME CUST NUMBER OF GUESTS Assignment EMPID TABLE ID Seating CUST IDTABLE ID SEATING COST SEATING DATE SEATING TIP Question 29 (10 points) Write an SQL query to list the employee ID and first and last...

  • DROP TABLE EMPLOYEE; DROP TABLE JOB; DROP TABLE EMP; DROP TABLE EMP_1; DROP TABLE EMP_2; CREATE...

    DROP TABLE EMPLOYEE; DROP TABLE JOB; DROP TABLE EMP; DROP TABLE EMP_1; DROP TABLE EMP_2; CREATE TABLE JOB(JOB_CODE CHAR (3) PRIMARY KEY, JOB_DESCRIPTION VARCHAR (20) NOT NULL,JOB_CHG_HOUR NUMBER (5,2) NOT NULL,JOB_LAST_UPDATE DATE NOT NULL); INSERT INTO JOB VALUES('500','Programmer','35.75','20-Nov-2017'); INSERT INTO JOB VALUES('501','System Analyst','96.75','20-Nov-2017'); INSERT INTO JOB VALUES('502','Database Designer','125.00','24-Mar-2018'); CREATE TABLE EMPLOYEE(EMP_NUM CHAR (3) PRIMARY KEY,EMP_LNAME VARCHAR (15) NOT NULL,EMP_FNAME VARCHAR (15) NOT NULL, EMP_INITIAL CHAR (1),EMP_HIREDATE DATE NOT NULL,JOB_CODE CHAR (3), EMP_YEARS NUMBER (2),FOREIGN KEY (JOB_CODE) REFERENCES JOB (JOB_CODE)); INSERT...

  • CIS 411w spring 2017 Problem Set 11    1 Log in to your Oracle ApEx account....

    CIS 411w spring 2017 Problem Set 11    1 Log in to your Oracle ApEx account. 2. Create a new table called email with this command: CREATE table email as (SELECT empno, ename||'.'||SUBSTR(JOB,1,2)||'@apex.com' as "EMAIL" from emp); Click à Run to create this table 3. Write a SQL query that JOINS the three tables emp,dept and email. This SQL query will return the empno, ename, job, sal, loc and email for each employee. Use the newer ANSI JOIN syntax rather...

  • SQL query: Write an SQL query that will output the last name, employee id, hire date and department from the employee table. Pick only those employees whose department ID is specified in the employee...

    SQL query: Write an SQL query that will output the last name, employee id, hire date and department from the employee table. Pick only those employees whose department ID is specified in the employee table. If the employee id is 777, name is ABC and hire date is 01-JAN-2016, the output should look as follows - 'Stephen (Employee ID - 777) was hired on the 1st of January, 2016 – Department: 90'. Note - The date should not have preceding...

  • emp table in bellow: 5. Query data from emp table for each non-deptno 20 employees to...

    emp table in bellow: 5. Query data from emp table for each non-deptno 20 employees to display the ename and calculate the number of months between today and the date the employee was hired. Label the column heading to Ename and Months_Worked. Order your results by the number of months employed. Round the number of months to a whole number. Months _Worked - - - - - - - - Ename MILLER KING JAMES MARTIN TURNER CLARK BLAKE WARD ALLEN...

  • How would I write the SQL statement SELECT fname AS First_Name, lname AS Last_Name FROM employee...

    How would I write the SQL statement SELECT fname AS First_Name, lname AS Last_Name FROM employee WHERE salary BETWEEN 10000 AND 30000; in relational algebraic syntax?

  • Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display...

    Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the employee number, last name, email address, title, and department name of each employee whose job title ends in the word “ASSOCIATE.” Sort the output by department name and employee title Problem 36, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the number of products within each base and type combination, sorted by base and then by type...

  • SQL query: Write a SQL statement using the employees table and retrieve employees whose monthly salary...

    SQL query: Write a SQL statement using the employees table and retrieve employees whose monthly salary (including their commission) is greater or equal to 5,000 but less than or equal to 17,000 (we are assuming the salary on the table is monthly). In other words, if their monthly salary was 1000 and their commission was .2, their total monthly salary would be 1200 and given the criteria above this instance would not be selected. Please display the full name of...

  • SQL query QUESTION 34 Write a SQL statement that shows the months between orderdate and pubdate...

    SQL query QUESTION 34 Write a SQL statement that shows the months between orderdate and pubdate for order# 1004. Make sure to truncate any decimal points using the trunc function - hint: see page 373 of the book. T T Dararanh Enter SQL Statement Statement SELECT title, TRUNC (MONTHS_BETWEEN (orderdate, pubdate),0) ATHS FROM books JOIN orderitems USING (isbn) JOIN orders USING (order#) WHERE orderi = 1004; | DeMS Output QONA Output Results Script Output Explain 9 Autotrace Results: 3 TITLE...

  • Write a SQL query that outputs the grade level from the job grades table for which...

    Write a SQL query that outputs the grade level from the job grades table for which the inputted salary is between the lowest salary and the highest salary column values. The salary value will be inputted by the user after the query is run. This should be done with a substitution variable. Keep the column names as - Job's Grade.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT