Dbms Sql Exercise

Topics: Name, Family name, .jobs Pages: 4 (566 words) Published: November 15, 2012
Name:Jonathan Edward H. SilvosaYear: 3rd Year
Course: BSITSubject: IT 7

IT 7 – Exercise 01

Table

1. Select Statement Exercise
a. Display the first name and age for everyone that's in the table. select FName, Age from tbl_EmpInfo

b. Display the first name, last name, and city for everyone that's not from Payson. select FName, LName, City from tbl_EmpInfo where City <> 'Payson'

c. Display all columns for everyone that is over 40 years old. select * from tbl_EmpInfo where Age > 40

d. Display the first and last names for everyone whose last name ends in an "ay". select FName, LName from tbl_EmpInfo where LName LIKE '%ay'

e. Display all columns for everyone whose first name equals "Mary". select * from tbl_EmpInfo where FName = 'Mary'

f. Display all columns for everyone whose first name contains "Mary". select * from tbl_EmpInfo where FName LIKE '%Mary%'

2. Creating Table Exercise
create table tbl_Employee
(FName varchar(50),
LName varchar(50),
Title varchar(50),
Age int,
Salary decimal(18,2));

3. Inserting Statement Exercise
insert into tbl_Employee
(FName, LName, Title, Age, Salary)
values ('Dirk', 'Smith', 'Programmer II', 32, 75020);

a. Select all columns for everyone in your employee table. select * from tbl_Employee

b. Select all columns for everyone with a salary over 30000.
select * from tbl_Employee where Salary > 30000

c. Select first and last names for everyone that's under 30 years old.
select FName, LName from tbl_Employee where Age < 30

d. Select first name, last name, and salary for anyone with "Programmer" in their title.
select FName, LName, Salary from tbl_Employee where Title = 'Programmer'

e. Select all columns for everyone whose last name contains "ebe".
select * from tbl_Employee where LName LIKE '%ebe%'

f. Select the first name for everyone whose first name equals "Potsy"....
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Essay about DBMS
  • DBMS Essay
  • Dbms Essay
  • Dbms Essay
  • Dbms Essay
  • DBMS Essay
  • Essay about Dbms
  • Experiential Exercises Essay

Become a StudyMode Member

Sign Up - It's Free