0% found this document useful (0 votes)
2 views2 pages

Database

The document provides an overview of databases, specifically focusing on MySQL as a schema-based relational database management system. It includes examples of creating a 'StudentRecord' table, inserting records, and performing various SQL queries such as selecting, updating, and deleting data. Additionally, it demonstrates how to aggregate and manipulate data within the database.

Uploaded by

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

Database

The document provides an overview of databases, specifically focusing on MySQL as a schema-based relational database management system. It includes examples of creating a 'StudentRecord' table, inserting records, and performing various SQL queries such as selecting, updating, and deleting data. Additionally, it demonstrates how to aggregate and manipulate data within the database.

Uploaded by

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

Database:

It is collection of tables.
It is application level permanent storage which is capable to store data at
application level, this storage can be manually accessible and handled as per
requirement.
=====================
MYSQL:It is a schema based database management system used to manage and store data
in structured format.As it is structured database it manages big amount of data
using schema hence also considered as RDBMS(Relational Database Management System)
======================
CREATE TABLE StudentRecord (
Id int NOT NULL PRIMARY KEY,
Name varchar(255),
Email varchar(255),
Password varchar(255),
Gender varchar(255),
City varchar(255),
Info varchar(255),
Address varchar(255),
Mobile varchar(10)
);
==============
CREATE TABLE StudentRecord (
Id int NOT NULL PRIMARY KEY AUTO_INCREMENT ,
Name varchar(255),
Rollno varchar(255),
Course varchar(255),
Fee float(10),
Gender varchar(255),
Age int(2)
);
=================
insert query:-

INSERT INTO `StudentRecord` (`Name`, `Rollno`, `Course`, `Fee`, `Gender`, `Age`)


VALUES ('Rahul Sharma', 101, 'BCA', 34567.45, 'Male', 19);

===============
INSERT INTO `StudentRecord` (`Name`, `Rollno`, `Course`, `Fee`, `Gender`, `Age`)
VALUES ('Neha Sharma', 102, 'MCA', 44567.45, 'Female', 22),
('Priya Sharma', 103, 'B.Tech', 42567.45, 'Female', 21),
('Mukesh Sharma', 104, 'M.Tech', 55467.45, 'Male', 20),
('Rohit Sharma', 105, 'B.Tech', 44567.45, 'Male', 20);

==================
SELECT Name,Rollno FROM `StudentRecord`
=======================
SELECT * FROM `StudentRecord` WHERE Gender="Male"
SELECT * FROM `StudentRecord` WHERE Gender="Female"
SELECT * FROM `StudentRecord` WHERE Fee>35000.0
SELECT * FROM `StudentRecord` WHERE Age BETWEEN 20 and 30
SELECT * FROM `StudentRecord` WHERE Fee > 40000 AND Gender='Male'
SELECT * FROM `StudentRecord` WHERE Fee=35000.0 OR Fee>50000.0
SELECT * FROM `StudentRecord` ORDER BY Age
SELECT * FROM `StudentRecord` ORDER BY Age DESC
SELECT COUNT(*) FROM `StudentRecord`
SELECT max(age) FROM `StudentRecord`
SELECT min(age) FROM `StudentRecord`
SELECT avg(age) FROM `StudentRecord`
select Gender,COUNT(*) from StudentRecord group by Gender
select Course,COUNT(*) from StudentRecord group by Course
UPDATE StudentRecord SET Fee=25000.0 WHERE Rollno=102
UPDATE StudentRecord SET Fee=25000.0 , AGE=23 WHERE Rollno=102
UPDATE StudentRecord SET Fee=Fee+1000.0
DELETE FROM `StudentRecord` WHERE Rollno=2

You might also like