My SQL Questions
My SQL Questions
Sr.No. Questions
Sname Varchar 20
Marks Integer -
ii) Insert the following details of the students in the above table.
(In copy write the query for inserting only first record but practically for further queries
insert all other queries in the table.)
Table : Students
Student_Id Sname Marks
1 Amit 72
2 Bharat 88
3 Chintan 68
4 Dinesh 54
5 Farahan 90
6 Hitesh 64
7 Jitesh 42
8 Ketan 59
iii) Get the details of the students with marks more than 80.
iv) Get the details of those students who have scored marks between 70 and 85 (both
values inclusive)
v) Get the details of those students whose name is “Hitesh”
vi) Get the details of those students whose name end with “esh”.
vii) Get the details of those students who marks are below 70 or above 80 using between in
the required manner.
x) Find the min, max, sum, and average of the marks from the above table.
xi) Display only student ID and marks table in descending order of the marks.
Q. 2 Consider the following tables Doctor. Write SQL commands for the statement
(i) to (vii)
Table: Doctor
ID Name Dept Gender Experience Basic
Q. 3 Consider the following table “SBOP” with details of account holders. Write commands of MySql
for (i) to (v) and output for (vi) to (viii).
Note: Output to be written after execution of queries on computer.
Table : SBOP
Accountno Name Balance Dateofopen Transaction
Q.4
Q.5
Q. 6 Consider the following tables Employee and Department. Write SQL commands for
the statement (i) to (vi)
Table: Employee
ENO ENAME JOB SAL COMM DEPTNO
5369 Sunita Clerk 2800 NULL 20
5499 Ashok Salesman 3600 300 30
5521 Rohit Salesman 5250 500 30
5566 Jyoti Manager 4975 NULL 20
5654 Martin Salesman 6250 1400 30
5698 Binod Manager 5850 NULL 30
5782 Anju Manager 2450 NULL 10
Table: Department
DEPTNO DNAME LOC
10 Accounting Delhi
20 Research Kolkata
30 Sales Mumbai
40 Operations Bangalore
Q,7
Q.8
Q. 9
Q. 10