Pages

Sunday, September 28, 2014

Database part 2

VIEW DATA

1. view data name and address, from table mahasiswa where sex = W
select name, addr, sex from mahasiswa where sex = 'W'

2. view data npm and name, from table mahasiswa where name initial 'a'
select npm, name from mahasiswa where name like 'a%'

3. view data name and birthday, from table mahasiswa where birthday between '1980-01-01' and '1982-12-12'
select name, birthday from mahasiswa where birthday >= '1980-01-01' and birthday <= '1982-12-12'
or
select name, birthday from mahasiswa where birthday between '1980-01-01' and '1982-12-12'

No comments:

Post a Comment