Posts

Showing posts from November, 2022

I PU Computer Science Text Book

  Prescribed Text Book for I PU Computer Science: I PU Computer Science

SQL: Employee Salary

/* Exercise NO 21 Generate the employee details and compute the salary based on the department.*/ -- creating database employee and opening it for use. create database employee ; use employee ; -- create employee table in employee database create table emp_table ( emp_id int ( 4 ), Dpt_id int ( 4 ), emp_name varchar ( 20 ), salary decimal ( 7 , 2 ) ); -- create department table create table dpt_table ( dpt_id int ( 5 ), dpt_name varchar ( 20 ), supervisor varchar ( 20 ) ); -- Insert record into the employee table. INSERT INTO EMP_table ( emp_id , Dpt_id , emp_name , salary ) VALUES ( 101 , 01 , 'ARUN' , 15000 ); INSERT INTO EMP_table ( emp_id , Dpt_id , emp_name , salary ) VALUES ( 102 , 02 , 'ARUNachalam' , 25000 ); INSERT INTO EMP_table ( emp_id , Dpt_id , emp_name , salary ) VALUES ( 103 , 03 , 'Blesson' , 15000 ); INSERT INTO EMP_table ( emp_id , Dpt_id , emp_name , salary ) VALUES ( 104 , 04 , ...

SQL: Bank Transaction

/*Exercise No:22 create bank transaction File*/ --create database with name bank and use it with its name create database bank ; use bank ; --create table with the following fields create table bank_table ( ac_number int ( 15 ), c_name varchar ( 20 ), ac_type char ( 2 ), balance int ( 15 ), dot date , t_amount int ( 15 ), t_type char ( 1 )); --inserting all the records ito the table bank_table insert into bank_table ( ac_number , c_name , ac_type , balance , dot , t_amount , t_type ) values ( 123456 , 'swati' , 'sb' , 9000 , '2022-12-19' , 100 , 'W' ); insert into bank_table ( ac_number , c_name , ac_type , balance , dot , t_amount , t_type ) values ( 123457 , 'chran' , 'sb' , 9000 , '2022-11-19' , 500 , 'D' ); insert into bank_table ( ac_number , c_name , ac_type , balance , dot , t_amount , t_type ) values ( 123459 , 'raju' , 'ca' , 5000 , '2022-09-19' ...