kemenyston
2007-06-01 15:33:49 UTC
create a table that will contain the following information about your new employees:
employee_id, firstname, lastname, title, age, and salary.
A. create table MYEMPLOYEES having fields :
employee_id 3 character size,
firstname 30 characters max size,
lastname 30 characters max size,
title 30 characters max size,
age numeric value,
salary capability to store six-figure salary
with 2 decimal places.
It is time to insert data into your new employee table.
Your first three employees are the following:
234, Jonie, Weber, Secretary, 28, 19500.00
456, Potsy, Weber, Programmer, 32, 45300.00
789, Dirk, Smith, Programmer II, 45, 75020.00
Write appropriate sql statements to insert the above data.
B. Now add additional 12 Employees to this table.
(Add your own 'dummy' data keeping in mind the table structure)
Now, answer the following questions using SQL statements:
1) List all the employees (all fileds).
2) List of employee names (first and last) making more than $30000.
3) List of employees names (first and last) less than 30 yrs old.
4) Select first name, last name, and salary for anyone with "Programmer" in their title.
5) Show employee data (all fields) for employees whose last name contains "ebe".
6) Jonie Weber just got married to Dirk Smith. She has requested that her last name be
updated to 'Weber-Williams'. Make this change using SQL statement.
7) Bonus time ! Everyone that's making under $30000 are to receive a 3500 a year raise.
Make this change using SQL statement.
8) Jonie Weber-Williams just quit, remove her record from the table.
Make this change using SQL statement.
9) It's time for budget cuts. Remove all employees who are making over 70000 dollars.
Make this change using SQL statement.
10) Add the 'Hire_date' column to the MYEMPLOYEES table.