Computer
Computer
SQL
1. Write SQL command
(a) To define the table EMPLOYEE and insert following data to the table.
CODE NAME DEG SALARY
M12 Ranjan Executive 18000
B11 Manas Officer 12000
M13 Naveen Executive 16500
A01 Smita Trainee 10000
A02 Akash Trainee 9500
(b) To display all records those have designation ‘Executive’ or salary more then 11500.
(c) To count all records for salary <= 15000.
(d) To display all records those have name start with ‘M’.
(e) To arrange all the records of employee table according to ascending order of name.
2. Write SQL command
(a) To define the table STUDENT and insert following data to the table.
Sl No Name Stream Fees Age Sex
1 Pankaj Gupta Mechanical 450000 17 M
2 Shalini Panda Computer Sc. 350000 17 F
3 Binod Sahu Electrical 400000 17 M
4 Sushant Agrawal Mechanical 420000 17 M
5 Vikash Sharma Computer Sc. 380000 18 M
(b) To display the Name, Stream and fees of students who have taken stream as Computer Sc.
(c) To display the number of students stream wise.
(d) To display all details of students whose age is 17 in the ascending order of name.
(e) To display Name, Stream and fees of male students.