You are on page 1of 14

1.

2.
3.
4.

5.

6.

7.
8.

9.

10.
11.

12.

13.

14.
15.

16.

17.

18
19

20

21
22

23

24
25

26

27.
28.
29.

30.
create database 01DTK22F1048EXP444;

use 01DTK22F1048EXP444;

create table STUDENT11 (P_ID Int, Name varchar(10),


Dept varchar(10),Age Int, Address varchar(20),
City varchar(20), CGPA decimal(3,2));

describe STUDENT11;

insert into STUDENT11(P_ID,Name,Dept,Age,Address,City,CGPA)


VALUES(1,'HARUN','JKE',20,'KG BINJUL','IPOH',3.01);

insert into STUDENT11(P_ID,Name,Dept,Age,Address,City,CGPA)


VALUES(2,'AHMAD','JKA',21,'KG JONG','KUANTAN',3.19);

insert into STUDENT11(P_ID,Name,Dept,Age,Address,City,CGPA)


VALUES(3,'KUMAR','JKA',22,'KG RIMAU','ALOR SETAR',3.67);

insert into STUDENT11(P_ID,Name,Dept,Age,Address,City,CGPA)


VALUES(4,'AMIRUL','JKM',22,'KG KECIL','TAIPING',3.17);

insert into STUDENT11(P_ID,Name,Dept,Age,Address,City,CGPA)


VALUES(5,'ADILAH','JP',21,'KG BANGGOL','BALING',2.82);
insert into STUDENT11(P_ID,Name,Dept,Age,Address,City,CGPA)
VALUES(6,'MAZWIN','JP',25,'KG SEMPENEH','TAIPING',2.71);
select*from STUDENT11;

Select Name,Dept From STUDENT11;

Select Name,CGPA,Dept From STUDENT11;

select Name,Dept From STUDENT11 where City='TAIPING';

select Name,Dept From STUDENT11 where Dept='JKA';

select Name,Dept,CGPA From STUDENT11 where CGPA>3.00 OR Age<22;

select Name,Dept,Age From STUDENT11 where CGPA BETWEEN 3.50 AND 4.00;

select*from STUDENT11 Where CGPA BETWEEN 3.50 AND 4.00;

select*from STUDENT11 Where Dept<>JKE;

select*from STUDENT11 Where Name Like ‘%M%’;

You might also like