SHARE
TWEET

Untitled

a guest Sep 16th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create database alpha;
  2. use alpha;
  3. create table EMPLOYEE
  4. (
  5. id int primary key,
  6. department_id int,
  7. chief_id int,
  8. e_name varchar(20),
  9. e_position  varchar(20),
  10. salary int
  11. );
  12.  
  13. insert into EMPLOYEE values
  14. (1,1,null,'A','chief',1100),
  15. (2,1,1,'B','prog',500),
  16. (3,1,1,'C','qa',500),
  17. (4,1,1,'D','analyst',500),
  18. (5,2,null,'E','chief',600),
  19. (6,2,5,'F','prog',500),
  20. (7,2,5,'G','prog',500);
  21.  
  22. select * from EMPLOYEE;
  23.  
  24. DELIMITER //
  25. CREATE procedure ex1(in dep int)
  26. begin
  27.     select e_name,e_position from EMPLOYEE where department_id = dep;
  28. end//
  29. DELIMITER ;
  30.  
  31. call ex1(2);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top