You are on page 1of 3

TOPC ;SQL

SUBMITTED TO Ma’am Kiran Amjad

SUBMITTED By Noor Qammar


Roll on 248

Create Database student

create table department

Dep_ID int identity(1,1)primary key,

Dep_Name varchar(25) not null,

);

create table course

courseid int identity(1,1) primary key,

coursename varchar(25)not null,

Dep_ID int foreign key references department(Dep_ID) not null,

);

create table student

Student_Rno int identity(1,1) primary key,

Name varchar(25)not null,

SGPA float not null,

CGPA float not null,

Adress varchar(max) not null,

P_no varchar(max)not null,

departement int foreign key references department(Dep_ID),

courseid int foreign key references course(courseid)not null,

);
create table teacher

Teacher_ID int identity(0,1)primary key,

Name varchar(25),

Salary int not null,

courseid int foreign key references course(courseid)not null,

departement int foreign key references department(Dep_ID)not null,

);

select *

from course

select *

from course where coursename!='algebra'

select *

from department

select *

from student

select *

from student where CGPA>=3

select *

from student where CGPA<3

select *

from teacher

select *

from teacher where Salary>10000


select *

from teacher where Salary<20000

select *

from teacher where Salary !=10000

You might also like