Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sql 7
Create table location ( location_id int , regional_group varchar(20)); insert into location( location_id , regional_group ) values ( 122, 'banglore'), (123 , 'delhi'), (124, 'noida'), (125, 'meerut'), (126, 'gzb'); select * from location; create table dept( dept_id int, name varchar(30), location_id int ); insert into dept( dept_id, name , location_id ) values( 10, 'tarun', 122), (20, 'harsh', 123), (30, 'popu', 124), (40, 'shubham', 125), (50, 'nitesh', 126); select * from dept; create table job (job_id int , post varchar(20)); insert into job values (666, 'clerk'), (667, 'hr'), (668, 'analyst'), (669, 'senior manager'), (670, ' associate analyst'), (671, 'senior hr'), (672, 'manager'); select * from job; CREATE TABLE EMP (EMPNO INT, EMPNAME CHAR(20), JOB CHAR(20), HIREDATE CHAR(20), SAL FLOAT, COMM FLOAT, DEPT_NO INT, job_id int ); INSERT INTO EMP (EMPNO,EMPNAME,JOB,HIREDATE,SAL,COMM,DEPT_NO, job_id) VALUES (320,'SUMIT KUMAR','ANALYST','14-MARCH-2019',50000,600,48, 666), (322,'GITESH KUMAR','ASSISTANT MANAGER','14-APRIL-2019',40000,400,45, 667), (305,'MUKESH KUMAR','PRESIDENT','10-MARCH-2010',100000,6008,01,668), (323,'HARSH','ANALYST','14-OCTOBER-2017',45000,1500,09,669), (329,'HARSHIT','ASSOCIATE ANALYST','14-MARCH-2019',40000,900,89,670), (31,'ARVIND','HR','14-JUNE-2010',49000,2000,51,671), (309,'SAJAL','SENIOR ANALYST','14-NOVEMBER-2009',40000,900,69,672); SELECT * FROM EMP;
run
|
edit
|
history
|
help
0
TESTE PLATAFORMA
Mala Studentska sve
Hierarchy table to exclude root
20181CSE0534
Table
Foreign keys
Tbl
tt
SQL for beginners( defined with errors while enforcing constraints)
test1