Uploaded by Abdul MAalik

CODE

advertisement
CODE:
create database student;
use student;
create table student_info(
Name varchar(30),
Semester int,
Birth_date date,
Age int,
Department varchar(10),
Min_Marks int,
Max_Marks int);
alter table student_info add sno int first;
alter table student_info add guardian_name varchar(30) after Name;
insert into student_info values('1','ali','hassan','4','2000-03-22','19','cs','70','88');
insert into student_info values('2','waqar','hussain','4','2001-12-02','20','cs','60','85');
insert into student_info values('3','alyan','ahmed','5','2002-05-10','19','cs','75','90');
insert into student_info values('4','daniyal','ahmed','5','2001-03-25','21','cs','85','95');
select UPPER (Name) from student_info;
select concat(Name,',',guardian_name) from student_info;
select concat(Name,' ',guardian_name,',',department) from student_info;
select Name, replace(department,"cs","CSE") as Instance_Of_Department from student_info;
select * from student_info;
select abs(-273.5);
select pi() * 180/pi();
select radians(120);
select round(exp(5),4);
select truncate(exp(5),4);
select sqrt(pow((2 - (-1)),2) + pow((-7 - (-3)),2));
select Name, guardian_name, concat(Min_Marks , '-', Max_Marks) as Ranges_Of_Percentage from student_info;
select timestampdiff(month,curdate(),'2022-08-27') AS NumberOfMonths;
select year(Birth_date) as Student_BirthDate, Age as Student_Age from student_info;
Download