Sunteți pe pagina 1din 7

TASK REPORT DATABASE

Arranged By
Nur Rizal (4101418097)
Chapter I
In this section the command is using the table that we created last week, then:
1. Show students whose names begin with the letter "a"
2. Show students whose names end with the letter "i"
3. Show students whose names contain the character "ar"
4. Show all students whose names begin and end with vowels use Regular
expression
Chapter II
Firstly, we start with launch XAMPP Control Panel v3.2.4. After we
launch this program, choose start on Apache and MySQL options. Then open
Command Prompt and start our querry here. Start with CD and our file directory
of bin in mysql folder. In here my file directory is C:\xampp\mysql\bin. After that
mysql -u root -p and we will get command to enter the password, just type Enter
or empty our password. The next querry is using my database that we made
before by USE dbpert2_4101418132. The screenshot will not attach because we
have use in before practice.
Firstly, we use querry SELECT *from mhs_tb; to show all the data in our
table before.

The, use the querry SELECT *from mhs_tb WHERE nama_mhs LIKE 'a%';
to show students whose names begin with the letter "a" only.

Then, use querry SELECT *from mhs_tb WHERE nama_mhs LIKE '%i'; to
show students whose names end with the letter "i".

Next, use SELECT *from mhs_tb WHERE nama_mhs LIKE '%ar%'; to Show
students whose names contain the character "ar"
Then, SELECT *from mhs_tb WHERE nama_mhs REGEXP
'^[aiueo].*[aiueo]$'; to Show all students whose names begin and end with
vowels.
Chapter III
CD C:\xampp\mysql\bin
mysql -u root -p

USE dbpert2_4101418097;
SHOW TABLES;
SELECT *from mhs_tb;
SELECT *from mhs_tb WHERE nama_mhs LIKE 'a%';
SELECT *from mhs_tb WHERE nama_mhs LIKE '%i';
SELECT *from mhs_tb WHERE nama_mhs LIKE '%ar%';
SELECT *from mhs_tb WHERE nama_mhs REGEXP '^[aiueo].*[aiueo]$';
Chapter IV
This is the result of this section.
Chapter V
The conclusion of this practice is like practice before. the more querry to
display our table. We can also filter it, show some conditions like the data with
the data such that begin, end, or contain the character that we choose before,
or combine some conditions too.
Querry SELECT.LIKE is more sustainable if we search data with simple
filter like find all name of students with first character is a,b,c, and other. If we
want filter the data with complex filter we better use regular expression.

S-ar putea să vă placă și