Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
DBMS ca2
Create table student(usn int primary key, sname varchar(10), address varchar(20),gender varchar(10),phone int); Create table semsec(ssid int primary key, sem int, sec varchar(10) not null); Create table class(usn int, ssid int, foreign key(usn) references student (usn) on delete cascade, foreign key (ssid) references semsec(ssid) on delete cascade); Create table subject(scode varchar(10), title varchar(10), sem int, creadits int not null, ssid int); Insert into semsec values(6, 3, 'a'); Insert into semsec values(7, 1, ' b'); Insert into semsec values(8, 4, 'e'); Insert into semsec values(9, 4, 'c'); Insert into semsec values(0, 6, 'd'); Select * from semsec; insert into student values(1,'hithesh', 'Banglore','male', 1234); select *from student ; insert into student values(2,'harikrish','hyderabad', 'male', 1245); insert into student values(3,'samantha','hyderabad', 'female', 4321); insert into student values(4,'yash','pune', 'female', 4561); insert into student values(5,'harika','rajankunte','female', 12678); select *from student ; insert into subject values('cse01','dbms',3,3,6); insert into subject values('cse02', 'mm',1,2,7); insert into subject values('cse03', 'm3',4,4,8); insert into subject values('cse04', 'ds',4,4,9); insert into subject values('cse05', 'mp',6,1,0); select *from subject; insert into class values(1,6); insert into class values(2,7); insert into class values(3,8); insert into class values(4,9); insert into class values(5,0) ; select *from class; select s. sname, s.address from student s, semsec se, class c where s.usn=c.usn and se. ssid=c. ssid and sem=4 and sec='c'; select ssid from subject where ssid not in(select ssid from subject where title='dbms') ; select s.sname from student s, semsec se,class c where s.usn=c.usn and c.ssid=se.ssid and sem=4 or sem=6;
run
|
edit
|
history
|
help
0
Movies
sql 7
omnichannel_example
Sum then delete one row - SQL Server 2008 R2
QUAN LY CHUYEN BAY
check constraint
hi
InsertData.sql
How to add namespace to sql generated XML output
aaa