Dinesh IT File
Dinesh IT File
- 1
i) Create a student table with the student id, name, and
marks as attributes where the student id is the primary key.
Solution:
Source
Code:
create table student
(
-> studid int primary key,
-> name varchar(30),
-> marks int -
>
);
Screenshot:
ii) In the table ‘student’ created in practical 26, insert the details of
new students.
Solution:
Source
Code:
insert into student values(1, 'sanjay', 67);
mysql> insert into student values(2, 'surendra', 88);
mysql> insert into studen values(3, 'Jamil', 74);
mysql> insert into t values(4, 'Rahul', 92)
studen
t
mysql> insert into student values(5, 'Prakash', 78);
Screenshot
1
iii) Write SQL command to get the details of the students with
marks more than 80.
Solution
: Source
Code:
select * from student where marks >=80;
Screenshot:
iv) Write SQL command to Find the min, max, sum, and average
of the marks in a student marks table..
Solution:
Source
Code:
select min(marks) as Min_marks, max(marks) as Max_Marks, sum(marks)
as Total_Marks, avg(marks) as Average_Marks from student;
Screenshot:
2
PRACTICAL No. -2
TABLE-INFO
Screenshot :
3
Screenshot :
Screensh
4
PRACTICAL No. -3
TABLE-STU
Solution :
Source Code :
Screenshot :
Solution :
Source Code :
5
Screenshot :
Solution :
Source Code :
Screenshot :
Solution :
Source Code :
6
SELECT SUBSTR(NAME,3,5) FROM STU;
Screenshot :
7
PRACTICAL No. - 4
TABLE-Nurse
Solution :
Source Code :
Screenshot :
Solution :
Source Code :
Screenshot :
8
iii) Get Distinct Nurse Positions
Solution :
Source Code :
Screenshot :
Solution :
Source Code :
Screenshot :
9
PRACTICAL No. - 5
TABLE- States
Solution :
Source Code :
Screenshot :
10
Solution :
Source Code :
Solution :
Source Code :
Solution :
Source Code :
11
PRACTICAL No. - 6
TABLE- Teacher
Solution :
Source Code :
Solution :
12
Source Code :
Solution :
Source Code :
Solution :
Source Code :
13
PRACTICAL No. - 7
TABLE- Students_2
Solution :
Source Code :
Screenshot:
Screenshot:
Solution :
Source Code :
15
PRACTICAL No. - 8
TABLE- Employee
Solution :
Source Code :
Screenshot
16
ii) to display ECODE, ENAME and GRADE of those
employees whose salary is between 40000 and 50000
Solution :
Source Code :
Screenshot
Screenshot
17
Solution :
Source Code :
PRACTICAL No. – 9
TABLE- STOCK
TABLE- DEALERS
Solution :
Source Code :
18
Screenshot
Solution :
Source Code :
Screenshot
Solution :
Source Code :
Screenshot
19
iv) To display the Pname and Dname from table stock and
dealers.
Solution :
Source Code :
Screenshot
20
PRACTICAL No. – 10
TABLE- CRICKET
Solution :
Source Code :
Screenshot
Solution :
Source Code :
21
Screenshot
Solution :
Source Code :
Screenshot
Solution :
Source Code :
Screenshot
22
PRACTICAL No. – 11
TABLE- SMARKS
Solution :
Source Code :
Screenshot
Solution :
Source Code :
23
Screenshot
Solution :
Source Code :
Solution :
Source Code :
24
PRACTICAL No. – 12
TABLE- Movies
Solution :
Source Code :
Screenshot
25
ii) Display movieid, moviename, total_eraning by showing
the business done by the movies. Claculate the
business done by movie using the sum of
productioncost and businesscost.
Solution :
Source Code :
Screenshot
Solution :
Source Code :
26
Screenshot
Solution :
Source Code :
Screenshot
27
PRACTICAL No. -13
TABLE- INFO
Refer to The Table of Practical no. – 2
Solution :
Source Code :
Screenshot
28
ii) Write a Query to delete the details of Employee Id 6.
Solution :
Source Code :
Screenshot
Solution :
Source Code :
Screenshot
Solution :
Source Code :
Screenshot
29
PRACTICAL No. – 14
TABLE-STU
Refer to The Table of Practical no. – 2
Solution :
Source Code :
Screenshot
30
ii) to display Remainder of column Percentage divide by 3.
Solution :
Source Code :
Screenshot
Solution :
Source Code :
Screenshot
31
Solution :
Source Code :
Screenshot
PRACTICAL No. – 15
TABLE-Phone
Solution :
Source Code :
32
UPDATE table_name SET price = '15000' WHERE name =
'POCO CE';
Screenshot
Solution :
Source Code :
Screenshot
Solution :
Source Code :
Screenshot
33
Solution :
Source Code :
Screenshot
PRACTICAL No. – 16
TABLE-SMARKS
Refer to The Table of Practical no. – 11
Solution :
Source Code :
Screenshot
34
ii) To display all the record of students except krishna
Solution :
Source Code :
Screenshot
Solution :
Source Code :
Screenshot
35
iv) To display the name of studemt obtaining rank = 1 in caps
Solution :
Source Code :
Screenshot
36