Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
new
Create table student( sid int primary key,sname varchar (20), department varchar (20), dob date); Create table author ( authorname varchar (20) primary key,age int not null ,phoneno int); Create table books(bid int primary key, title varchar (20),price float,authorname varchar(20), FOREIGN KEY (authorname) REFERENCES author (authorname) ON DELETE CASCADE); Create table borrow (sid int,bid int , borroweddate date ,FOREIGN KEY (sid) REFERENCES student (sid) ON DELETE CASCADE,FOREIGN KEY (bid) REFERENCES books(bid) ON DELETE CASCADE); Insert into student values (101,'steve','ise','2-12-2001'); Insert into student values (102,'rogers','cse','3-12-2001'); Insert into student values (103,'chris','mech','4-12-2001'); Insert into student values (104,'pratt','cse','5-12-2001'); Insert into student values (105,'pine','ise','6-12-2001'); Select * from student; Insert into author values('milo',12,99009); Insert into author values('robert',42,9638); Insert into author values('scarlet',62,990349); Insert into author values('hemsworth',19,9049); Insert into author values('chad',92,9949); Select * from author; Insert into books values(201,'phoenix',100,'gaja'); Insert into books values(202,'groido',1000,'gsnapathi'); Insert into books values(203,'rory',200,'ganbhir'); Insert into books values(204,'megan',600,'goutha'); Insert into books values(205,'via',800,'kailadh'); Select * from books; Insert into borrow values(101,201,'12-2-2020'); Insert into borrow values(102,202,'10-3-2020'); Insert into borrow values(101,203,'9-2-2020'); Insert into borrow values(104,204,'7-8-2020'); Insert into borrow values(103,205,'6-9-2020'); Select * from borrow;
run
|
edit
|
history
|
help
0
customers
TRIGGERS
Basic Except
table emp
SQL for beginners( defined with errors while enforcing constraints)
Rextester.java
SQL Server - regex filtering using LIKE
Empleados
Insert multiple parent-child records
TEST