You are on page 1of 5

Republic of the Philippines

CAVITE STATE UNIVERSITY


Bacoor City Campus
SHIV, Molino VI, City of Bacoor

DEPARTMENT OF COMPUTER STUDIES


DCIT 55: ADVANCED DATABASE SYSTEMS
Activity Sheet
2nd Semester, A.Y. 2020-2021

INTENDED LEARNING OUTCOMES

After the completion of the unit, students will be able to:

1. create SQL commands; and


2. identify proper SQL commands for each given output.

Name: Delos Reyes, Franklin M. Date: April 24, 2020


Course/Yr&Section: BSIT1-1 Score:

ACTIVITY 04: DATA MANIPULATION ETTING UP THE DATABASE AND


BASIC DATA MANIPULATION

DIRECTION:

● Analyze the following. Write your answer on the space provided.

Table Name: tbl_employee

Emp_ID Name Sex Country Department Salary


101 Taylor Swift Female Germany Sales 5000.00
102 Selena Gomez Female New York Admin 3000.00
103 Chris Brown Male Mexico Marketing 3500.00
United Human
104 Ed Sheeran Male 4000.00
Kingdom Resource
105 Miley Cyrus Female Sweden Billing 3000.00
106 Justine Bieber Male Canada Production 2000.00
107 Adam Levine Male Germany Production 2500.00
108 Michael Jackson Male Canada Sales 3800.00
109 Ariana Grande Female Denmark Accounting 3200.00
Human
110 Demi Lovato Female Philippines 4000.00
Resource
A. ANALYZE THE GIVEN TABLE OUTPUT AND WRITE THE CORRECT SQL STATEMENT IN
SIMPLEST FORM. (5 POINTS EACH)

1. SELECT Name, Department, Salary FROM tbl_employee WHERE Sex=”Male”

Name Department
Salary
Chris Brown Marketing 3500.00
Ed Sheeran Human Resource 4000.00
Justine Bieber Production 2000.00
Adam Levine Production 2500.00
Michael Jackson Sales 3800.00

2. SELECT * FROM tbl_employee WHERE Emp_ID=”101”


Emp_ID Name Sex Country Department Salary
101 Taylor Swift Female Germany Sales 5000.00

3. SELECT * FROM tbl_employee WHERE Country=”Germany”


Emp_ID Name Sex Country Department Salary
107 Adam Levine Male Germany Production 2500.00
101 Taylor Swift Female Germany Sales 5000.00

4. SELECT Name, Sex, Country FROM tbl_employee WHERE Emp_ID=”101”

Name Sex
Country
Taylor Swift Female Germany

B. ANALYZE THE GIVEN TABLE ABOVE AND ILLUSTRATE THE TABLE OUTPUT OF EACH
STATEMENT BELOW BELOW.

1. SELECT DISTINCT Country FROM tblEmployee ORDER BY Country (5pts)


Country
Canada
Denmark
Germany
Mexico
New York
Philippines
Sweden
United Kingdom

2. SELECT * FROM tblEmployee WHERE Name LIKE '%A%' AND Country =


'CANADA' (5pts)

Emp_ID Name Sex Country Department Salary


101 Taylor Swift Female Germany Sales 5000.00
102 Selena Gomez Female New York Admin 3000.00
United Human
104 Ed Sheeran Male 4000.00
Kingdom Resource
106 Justine Bieber Male Canada Production 2000.00
107 Adam Levine Male Germany Production 2500.00
108 Michael Jackson Male Canada Sales 3800.00
109 Ariana Grande Female Denmark Accounting 3200.00
Human
110 Demi Lovato Female Philippines 4000.00
Resource

3. SELECT EmployeeID, Name FROM tblEmployee WHERE Name LIKE 'T%' OR


Country LIKE 'G%' (5pts)

Emp_ID Name Country


101 Taylor Swift Germany
107 Adam Levine Germany
4. SELECT Name,Salary FROM tblEmployee WHERE Name LIKE '%A%' ORDER BY
Department, Salary (5pts)

Name Department Salary


Ariana Grande Accounting 3200.00
Selena Gomez Admin 3000.00
Demi Lovato Human 4000.00
Resource
Human
Ed Sheeran 4000.00
Resource
Adam Levine Production 2500.00
Michael Jackson Sales 3800.00
Taylor Swift Sales 5000.00

5. SELECT * FROM tblEmployee WHERE Salary < 3000 AND Salary >= 2000 (5pts)

Emp_ID Name Sex Country Department Salary


106 Justine Bieber Male Canada Production 2000.00
107 Adam Levine Male Germany Production 2500.00

6. SELECT EmployeeID, Name, Department FROM tblEmployee WHERE


EmployeeID LIKE '[124]%' ORDER BY Name (5pts)
Emp_ID Name Department
107 Adam Levine Production
109 Ariana Grande Accounting
103 Chris Brown Marketing
Human
110 Demi Lovato
Resource
Human
104 Ed Sheeran
Resource
106 Justine Bieber Production
108 Michael Jackson Sales
105 Miley Cyrus Billing
102 Selena Gomez Admin
101 Taylor Swift Sales

You might also like