SQL FOR BEGINNERS CHAPTER 1

in #sql6 years ago (edited)

Create Table Employee according to your self....and execute these Query..

  1. SELECT employee_id, last_name, job_id, hire_date FROM employees;

2.Create a query to display unique job codes from the EMPLOYEES table.

SELECT DISTINCT job_id FROM employees;

3.Name the column headings Emp #, Employee, Job, and Hire Date, respectively. Run your query again.

SELECT employee_id "Emp #", last_name "Employee", job_id "Job", hire_date "Hire Date" FROM employees;

4.Display the last name concatenated with the job ID, separated by a comma and space, and name the column Employee and Title.

SELECT last_name||’, ’||job_id "Employee and Title" FROM employees;

5.Create a query to display all the data from the EMPLOYEES table. Separate each column by a comma. Name the column THE_OUTPUT.

SELECT employee_id || ’,’ || first_name || ’,’ || last_name || ’,’ || email || ’,’ || phone_number || ’,’|| job_id || ’,’ || manager_id || ’,’ || hire_date || ’,’ ||
salary || ’,’ || commission_pct || ’,’ || department_id THE_OUTPUT
FROM employees;

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 57198.53
ETH 2362.64
USDT 1.00
SBD 2.40