0% found this document useful (0 votes)
16 views23 pages

Informatics Practices Practical File For Class 12th

practical file subject ip (Informatics Practices ) on MYsql.

Uploaded by

msaadq87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views23 pages

Informatics Practices Practical File For Class 12th

practical file subject ip (Informatics Practices ) on MYsql.

Uploaded by

msaadq87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Informatics

Practices
Practical file
By
(your
name)
Academic year 20xx-xx
ACKNOWLED
GEMENT
I would like to extend my heartfelt
thanks to my teacher teacher name ,
for providing me with the opportunity
to undertake this project and for their
constant guidance and
expertise. Their valuable insights and
feedback have greatly enhanced the
quality of my work.
I would also like to thank our principal
for giving me this great opportunity to
do a project. Without their support
and suggestions, this project would
not have been completed.
CERTIFI
CATE
This is to certify that your name
of class your class has
completed his Informatics
Practices project under the
guidance of teacher name for
the academic year 2023-2024.
Teacher Signature
________________

Index
S.no Page.no
Topic
Create database
1
Use database
2
Create table
3 Describe table
4 Adding columns

5 Describe table
change call name
6
display table
7
drop column
8
insert data into table
9 displaying name with condition
10 find min Max,sum,and,average of the marks

11 Query to order
Delete the details of table
12
delete table
13
delete database
14

15

16

17
18
MySQL Queries
Create database -
>>Create database <database name> ;

Use database –
>>use <database name> ;
Create table :-
Creates a table named "Students" with columns for
student ID, name, marks, and class.
>> create table <table name>
Adding Columns:
Adds a new column named "new_column" to
the "Students" table.
>> ALTER TABLE table_name
ADD column_name datatype;
Change column name :-
Renames the "new_column" to "new_name" in
the "Students" table.
>>ALTER TABLE Students CHANGE COLUMN
new_column new_name VARCHAR(50);
Delete a column :-

Removes a specified column from the "Students" table.


>>ALTER TABLE Students DROP COLUMN column_to_drop;
Insert Data Into Table:
--Inserts a new row with data into the table
>>INSERT INTO Students VALUES (Values);
Change the mobile number of any one student
>>UPDATE Students
SET mobile_number = 'new_mobile_number'
WHERE student_id = 'student_id_to_update'
Display the details of those students which
name start with ‘A’
 To display the details of students whose names start
with 'A', you can use the SELECT statement with the
LIKE operator. Here's an example :

>>SELECT * FROM Students WHERE name LIKE 'A


%’;
Display
LENGTH
>>SELECT LENGTH(NAME), SUBSTR(NAME, 3,3) FROM STUDENT
Display DISTINCT

value
To display distinct values for a specific column, you can use the
DISTINCT keyword in a SELECT statement. If you want to display
distinct names from the "Students" table, for example, you
would do something like this:

>>SELECT COUNT (DISTINCT GENDER) FROM STUDENT;


Find the min, max, sum, and
average
To find the minimum, maximum, sum, and average of a numeric column
in a table, you can use the MIN, MAX, SUM, and AVG aggregate
functions.
SELECT
MIN(column_name) AS min_value,
MAX(column_name) AS max_value,
SUM(column_name) AS sum_value,
AVG(column_name) AS avg_value
FROM your_table;

Display the Gender, Minimum marks and


Maximum Marks Gender wise.
To display the gender along with the minimum and maximum marks
gender-wise, you can use the GROUP BY clause along with the MIN and
MAX aggregate functions. Here's an example assuming you have a
"Students" table with columns like gender and marks:

>>SELECT gender, MIN(marks) AS min_marks, MAX(marks) AS


max_marks FROM Students GROUP BY gender;
Write a SQL query to order the (student
ID, marks) table in descending order of
the marks
To order the "Students" table by both student ID and marks in
descending order of the marks, you can use the ORDER BY clause.
>>SELECT student_id, marks FROM Students ORDER BY marks DESC;

Delete the details of a student


in the above table
To delete the details of a student from the "Students" table based on a
specific condition (e.g., student ID), you can use the DELETE statement
with a WHERE clause. Here's an example query:
>>DELETE FROM Students WHERE student_id = 2;
Delete the table
Student
To delete a table in SQL, you use the DROP TABLE statement. If you want to delete
the "Students" table,

>> DROP TABLE Students;

Delete the Database


To delete a database in SQL, you use the DROP DATABASE
statement. If you want to delete the "School" database
>>DROP DATABASE <database name>;

You might also like