The document provides SQL queries related to a table named 'Class' that includes student information such as Rollno, Name, Stipend, Subject, Avgmark, and Grade. It includes tasks such as displaying non-medical students, listing names with grade 'A', arranging records by average marks, and inserting a new student record. The document serves as a practical guide for performing basic SQL operations on the specified table.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views
SIMPLE WORKSHEET (4)
The document provides SQL queries related to a table named 'Class' that includes student information such as Rollno, Name, Stipend, Subject, Avgmark, and Grade. It includes tasks such as displaying non-medical students, listing names with grade 'A', arranging records by average marks, and inserting a new student record. The document serves as a practical guide for performing basic SQL operations on the specified table.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
Downloaded from www.studiestoday.
com
Simple Queries in SQL
Q1. Create a Table “Class” with the following constraints
(Rollno(2), Name Varchar(30), Stipend number(5), Subject Char(25), Avgmark decimal(6,2),Grade char(1));
ROLLNO NAME STIPEND SUBJECT AVGMARK GRADE
1 VIKAS 1200 MEDICAL 67 B 2 BOBY 1400 HUMANITIES 78.8 B 3 TARUN 1000 MEDICAL 64.8 C 4 VARUN 1600 NON-MEDICAL 84 A 5 ATUL 1800 NON-MEDICAL 90 A Q3. Write the following SQL commands on the basis of above table “CLASS” a) Display all the Non Medical stream students Name from the table Class.
b) List the Names that have grade “A” sorted by stipend in the ascending order.
c) Arrange the records Average marks wise .
d) List the records where grade is B or C.
e) Display the records where Name ends with N.
f) Display those records whose average mark in between 70 to 90.
g) Display the different Subjects in the table.
h) Display students Name where Avergemarks is more than 75.
i) Display all records in Descending order (Name) wise.
j) Insert a new row with the following data (06, ‘MITHUN’, 1300, ‘HUMANITIES’, ‘98’,’A’).
Data Definition Language (DDL) Data Manipulation Language (DML) Data Retrieval Language (DRL) Transaction Control Language (TCL) Data Control Language (DCL)