SQL Practice: Introduction To Structured Query Language (SQL)
SQL Practice: Introduction To Structured Query Language (SQL)
Create
You have just started a new company. It is time to hire some employees. You will need to create a table that will contain the following information about your new employees: first name, last name, title, age, and salary .
01.12.2010
Create
create table EMPLOYEE ( first varchar(15), last varchar(20), title varchar (30) age number(3), salary number (5) );
01.12.2010 Sarajevo School of Science and Technology 3
Insert
It is time to insert data into your new employee table. Your first three employees are the following:
Jonie Weber, Secretary, 28, 19500 Potsy Weber, Programmer, 32, 45300 Dirk Smith, Programmer II, 45, 75020
01.12.2010
Insert
insert into EMPLOYEES (first, last, title, age, salary) values ('Jonie', 'Weber', 'Secretary', 28, 19500);
01.12.2010
Select
Select all columns for everyone whose last name ends in "ith".
01.12.2010
Select
Select * from Employees where last LIKE %ith
01.12.2010
Update
Jonie Weber just got married to Bob Williams. She has requested that her last name be updated to WeberWilliams.
01.12.2010
Update
Update Employee set last=Weber-Williams where first=Jonie and last=Weber
01.12.2010
Select
Select the first name, last name, salary from the employee table for all of the rows that have a salary value ranging from 40000 to 80000.
01.12.2010
10
Select
Select first, last, salary from Employee where salary between 40000 and 80000
01.12.2010
11