SQL Practical que
SQL Practical que
Write Query for creating a table of students in SQL having roll no field is primary key and fees is not
null, father name,fees,class,contact.
Q3. Write Query to select roll no, name, DOB from student table.
Q4. Write Query to select all the data from student table in ascending order of their name.
Q5. Write Query to select all the data from student table in descending order of their class.
Q6. Write Query to select class, name and yearly fees of the student whose roll number is 5.
Q7. Write query to show pf and net salary of employee with a new column name of employee table. (Pf=
annual salary*10%, net salary = annual salary – PF)
Q8. Write query to show record of all students other than 10th class.
Q9. Write query to change the data type of dob in student table.
Q10. Write query to show record of employees having max salary in each department. (2 tables –
employee, department).
Q11. Write query to show names of all students of 10th class in lowercase letters.
Q12. Write Query to show the name of all students who are in class 10th and their fees is more than
1000.
Q13. Write query to show records of students whose name contain 5 letters and first letter should be
‘A’.
Q14. Write query to show records of students whose last letter of their father’s name should be ‘H’.
Q15. Write query to show records of students who has not given their DOB.
Q17. Write a list of queries to add a new column named “city” and make “ajmer” its default value. Then
create query to delete this column.
Q18. Write query to show the count of all students and sum fee of each class.
Q19. Write query to show the count of all girls and all boys.
Q20. Write query to display name, father’s name , class and annual fees of those students who pay
annual fees more than 12000 and show this column as “Annual Fees”.
Q21. Write query to change all the manager to executive and decrease their salary by 10%.
Q22. Write query to give commission 500 to all the clerks who are not getting commission.
Q24. Write query to change the name of student table to “student data”.
Q25. Write query to display total number of students.
Q26. Write query to create an employee table with empid, name, fname, joining_date, salary, contact
field.
Q27. Write sub query from employee table to select all employees whose salary is minimum.
Q28. Write subquery to select all employees whose salary is more than ‘jones’ s salary.
Q29. Write query to display name,class of all the students of class 10. Their name must be in initial
capital. (Use initcap())