0% found this document useful (0 votes)
3 views

mysql

The document outlines SQL commands for creating a database named 'namit' and a table called 'student' with various attributes. It includes commands for inserting student records, querying data, and applying filters based on conditions. Additionally, it provides examples of inserting new student records for the next year.

Uploaded by

neerajseervi161
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)
3 views

mysql

The document outlines SQL commands for creating a database named 'namit' and a table called 'student' with various attributes. It includes commands for inserting student records, querying data, and applying filters based on conditions. Additionally, it provides examples of inserting new student records for the next year.

Uploaded by

neerajseervi161
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/ 8

1.

create database namit ;

2.

show databases ;

3.

Use namit;

create table student

(rollno integer primary key,

name char(30) NOT NULL,

DOB date,

city varchar(30),

english integer default 0,

IP float(5,2),

check(english<=100),

check(IP<=100)

);

4.

Use namit

desc student; / describe student;

5. show tables;
6.

insert into student values(1101,'abhishek','1997-11-23','jaipur',91,89.95);

insert into student values(1102,'bhanu','1998-12-24','jodhpur',81,60.50);

OTHER WAY TO INPUT

insert into student(IP,english,NAME,ROLLNO,dob,city) values(95.2,90,'KAPIL',1103,'1999-07-09','KOTA');

insert into student(rollno,name,dob,english,ip) values(1104,'neeraj','2008-02-28',80,70.2);

Insert into student values(1105,'namit','2008-01-05','amritsar',79,75.9);

insert into student values(1106,’kavita’,2009-05-05,’jodhpur’,77,39.00);

insert into student values(1107,’krishna’,2005-09-06,’jodhpur’,89,92.0);

insertinto studentvalues(1108,’vidhi’,2007-11-25,’jodhpur’,77,80.50);

insert into student values(1109,’pradeep’,2008-01-25,’jodhpur’,97,72.50);

insert into student values(1110,’pranav’,2008-08-04,’jodhpur’,75,60.23);

insert into student values(1111,’rahul’,2007-01-25,’jodhpur’,67,76.50);

insert into student values(1112,’karan’,2008-07-15,’jaipur’,77,89.40);

insert into student values(1113,’gopal’,2007-08-23,’jodhpur’,67,30.05);

insert into student values(1114,’praveen’,2007-08-23,’kota’,23,23.30);

insert into student values(1115,'ram','2007-08-23','ahemdabad',30,30.05);

7.

select * from student;

8.

select name from student;


9.

Select rollno from student;

10.

Select rollno,name from student;

11.

select rollno,name,ip from student;

12.

select distinct (city) from student;

13.select * from student

where IP>80;

14.

15.
se

16.

17.

18.

19.

20.

21.

22.
select * from student
where city='jodhpur' and dob>2005-12-31;

23.

select * from student


order by ip;

(;

24.

25.

26.

27.

28.

29.

30.

31.
32.

33.

34.

35.

Insert into quaterlyexam values( );

ERROR –

36.

37.
38.

Next year program-

class 12 statements
INSERT INTO student (rollno, name, DOB, city, english, IP)
VALUES
(1, 'Alice', '2005-04-12', 'New York', 85, 91.5),
(2, 'Bob', '2004-11-30', 'Los Angeles', 78, 88.0),
(3, 'Charlie', '2005-01-25', 'Chicago', 92, 95.2),
(4, 'Diana', '2003-09-10', 'Houston', 67, 74.0),
(5, 'Ethan', '2004-07-20', 'Phoenix', 88, 82.7);

INSERT INTO student


VALUES
(101, 'Riya', '2006-03-15', 'Delhi', 90, 89.5),
(102, 'Aman', '2005-12-05', 'Mumbai', 85, 78.0),
(103, 'Neha', '2006-07-21', 'Kolkata', 88, 91.2),
(104, 'Karan', '2004-10-10', 'Chennai', 76, 80.0),
(105, 'Sneha', '2005-05-25', 'Bangalore', 95, 99.9);

You might also like