Você está na página 1de 6

Electrical engineering department

DIS 2014 SESSION


EC601 DATABASE SYSTEMS
PRACTICAL WORK 2
Assessment Sheet

Practical Skill
Assessment

A. Use SQL command with comparison and logical operators.


( Activity 2a)

/ 80

B. Use SQL command to create column alias. (Activity 2b)

/ 10

C. Use SQL command to sort data. (Activity 2c)

/ 10
TOTAL

NAME :
REGISTRATION # :
PROGRAM:
PRACTICAL WORK :
DATE :

02DTK
DTK

/ 100

PRACTICAL WORK ASSESSMENT RUBRICS


Practical Skill Assessment (Assessment no. 1- no. 5)
Score

Description

10

Student can understand and follow all instruction and complete all tasks
assigned without error.

7-9

Student can understand and follow all instruction and complete all tasks
assigned with some error.

4-6

Student can understands and follow the instruction but completes only
some of the tasks.

1-3

Student can understand the instructions but unable to complete the tasks.

Student did not understand the instructions and unable to complete the
tasks.

Practical work 2 : Structured Query


Language
Duration: 2 Hours
Learning Outcomes:
This lab sheet encompasses activity 2A to 2C.
By the end of this laboratory session, you should be able to:
1. Use SQL command with comparison and logical operators.
2. Use SQL command to create column alias.
3. Use SQL command to sort data.
Hardware/Software: MySQL Server 5.2 OR above Client Interface

Activity 2a
Activity Outcome: Retrieve data from table by using comparison and logical
operator.
Procedures:
Step 1: Click button START window -> All Programs -> MySQL-> MySQL
server 5.5 -> MySQL Command Line Client Interface. Please ENTER
your password [root].

Step 2: Use your previous database. Write command SHOW DATABASES to


see all of your database.

Step 3: Type the following SQL command to retrieve all records from table
student. And Enter..
SELECT * FROM STUDENT;
Mark : 2

10

Step 4: Type the following SQL command to display subject names. And Enter.
SELECT SUBJECTNAME FROM SUBJECT;
Mark : 2

10

Step 5: Type the following SQL command to find students who live in Kuching
And Enter.
SELECT * FROM STUDENT
WHERE ADDRESS = 'KUCHING';
Mark : 2

10

Step 6: Type the following SQL command to find records with marks less than
70. And Enter.
SELECT * FROM RESULT
WHERE MARK < 70;
Mark : 2

10

Step 7: Type the following SQL command display records with marks between
80 and 70. And Enter.
SELECT * FROM RESULT
WHERE MARK BETWEEN 70 AND 80;
Mark : 2

10

Step 8: Type the following SQL command find students who live in Miri, Serian
or Bintulu And Enter.
SELECT * FROM STUDENT
WHERE ADDRESS IN ('MIRI', 'SERIAN', 'KUCHING');
Mark : 2

10

Step 9: Type the following SQL command to display students record whose
name start with S. And Enter.
SELECT * FROM STUDENT
WHERE STUNAME LIKE 'S%';
Mark : 2

10

Step 10: Type the following SQL command to display student no S01 result for
subject EC601. And Enter.
SELECT * FROM RESULT
WHERE STUNO = 'S01' AND SUBJECTCODE = 'EC601';
Mark : 2

10

Activity 2b
Activity Outcome: Create column alias.
Procedures:
Step 1: Type the following SQL command to create column alias. And Enter.
SELECT STUNAME AS NAME,
ADDRESS AS 'STUDENT ADDRESS'
FROM STUDENT;
Mark : 2

10

10

Activity 2c
Activity Outcome: Sort results.
Procedures:
Step 1: Type the following SQL command to display student marks in
descending order for subject ET102. And Enter.
SELECT STUNO, MARK
FROM RESULT
WHERE SUBJECTCODE = 'ET102'
ORDER BY MARK DESC;
Mark : 2

Você também pode gostar