CREATE TABLE student (
  sid INTEGER PRIMARY KEY,
  name VARCHAR(30) NOT NULL,
  gender CHAR(1) NOT NULL,
  deptid INTEGER NOT null,
  salary INTEGER NOT null,
  joindate DATE  
);
-- create a department table
create table department(
deptid INTEGER PRIMARY key,
deptname VARCHAR(10) NOT null,
commision float(10)
);
-- insert some student values
INSERT INTO student VALUES
(1, 'adnan', 'M',1,5000,'2020-04-27'),
(2, 'turjoy', 'F',2,6000,'2015-04-27'),
(3, 'helal', 'F',1,5000,'2017-04-27'),
(4, 'shovon', 'F',1,9000,now()),
(5, 'rajib', 'M',3,8000,'2012-04-27'),
(6, 'rinku', 'M',3,15000,'2011-04-27'),
(7, 'alif', 'F',3,17000,'2017-04-27');
-- insert some student values
insert into department values(1,"CSE",.23),(2,"EEE",.10),(3,"CIVIL",.49);

select * from student 
where deptid in (
select deptid from department
where commision*100 > 12
);
select * from student
where deptid in (select deptid from student
group by deptid
having count(deptid) >2
)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: