Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views1 page

Worksheet2 MYSQL

The document outlines the creation and population of two tables: EXAM and PERSONS, with various attributes for each. It includes SQL commands for inserting data into these tables and retrieving specific information based on queries. The EXAM table focuses on student exam details, while the PERSONS table contains personal information and salary data.

Uploaded by

kabutazz3
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)
10 views1 page

Worksheet2 MYSQL

The document outlines the creation and population of two tables: EXAM and PERSONS, with various attributes for each. It includes SQL commands for inserting data into these tables and retrieving specific information based on queries. The EXAM table focuses on student exam details, while the PERSONS table contains personal information and salary data.

Uploaded by

kabutazz3
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/ 1

create table EXAM

(
No integer primary key,
Name varchar(30),
Stipend integer,
Subject varchar(30),
Average integer,
Division varchar(30));
insert into EXAM values ('1','Karan','400','English','68','FIRST');
insert into EXAM values ('2','Aman','680','Mathematics','72','FIRST');
insert into EXAM values ('3','Javed','500','Accounts','67','FIRST');
insert into EXAM values ('4','Bisakh','200','Informatics','55','SECOND');
insert into EXAM values ('5','Sugandha','400','History','35','THIRD');
insert into EXAM values ('6','Suparna','550','English','45','THIRD');
insert into EXAM values ('7','Mukul','750','Mathematics','83','FIRST');

Select * from EXAM;

-- cgenderreate
CREATE TABLE PERSONS (
PID integer primary key,
SurName varchar(100),
FirstName varchar(100),
Gender varchar(100),
City varchar(100),
Pincode integer,
BasicSalary integer
);

-- insert
insert into persons values
(1,'Sharma','Geeta','F','Udhamwara',182141,50000),
(2,'Singh','Surinder','M','Kupwara Nagar',193222,75000),
(3,'Jacob','Ryan','M','Bhawani',380025,50000),
(4,'Azmi','Simi','F','New Delhi',110021,40000),
(5,'Kaur','Manpreet','F','Udharmwara',182141,42000);
-- fetch
SELECT PID,City,Pincode FROM persons
order by Pincode desc;

SELECT FirstName, BasicSalary from persons


where Firstname like 'G%';

SELECT GENDER, min(basicsalary) from persons


group by

You might also like