Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create database alpha;
- use alpha;
- create table EMPLOYEE
- (
- id int primary key,
- department_id int,
- chief_id int,
- e_name varchar(20),
- e_position varchar(20),
- salary int
- );
- insert into EMPLOYEE values
- (1,1,null,'A','chief',1100),
- (2,1,1,'B','prog',500),
- (3,1,1,'C','qa',500),
- (4,1,1,'D','analyst',500),
- (5,2,null,'E','chief',600),
- (6,2,5,'F','prog',500),
- (7,2,5,'G','prog',500);
- select * from EMPLOYEE;
- DELIMITER //
- CREATE procedure ex1(in dep int)
- begin
- select e_name,e_position from EMPLOYEE where department_id = dep;
- end//
- DELIMITER ;
- call ex1(2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement