0% found this document useful (0 votes)
3 views3 pages

Assignment 3.1

Uploaded by

myselfghoshayan
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 views3 pages

Assignment 3.1

Uploaded by

myselfghoshayan
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/ 3

Assignment - 3

1. SQL Queries to select based on


character placement. Name : Gourav Shaw
Roll no. : GCECTB-R22-3010

a. INPUT(forendingcharacters): SELECT * from STUDENT26 where FirstName LIKE '%t';


b. OUTPUT:

a.
INPUT (for starting characters) : SELECT * from STUDENT26 where FirstName LIKE 'S%';
b.
OUTPUT:

a.
INPUT (for middle characters) : SELECT * from STUDENT26 where FirstName LIKE '%eb%';
b.
OUTPUT:

a.
INPUT (for starting and ending characters) : SELECT * from STUDENT26 where FirstName LIKE 'S%n';
b.
OUTPUT:
a. INPUT (for '_<insert char>' characters) : SELECT * from STUDENT26 where FirstName LIKE '_o%';

b. OUTPUT:

2. SQL Query to select based on special characters.


a. INPUT (for 1 character) : SELECT * from STUDENT26 where REGEXP_LIKE (FirstName,'[@]', 'i');

b. OUTPUT:

a. INPUT (for multiple characters): SELECT * from STUDENT26 where REGEXP_LIKE (FirstName,'[@,#]', 'i');

b. OUTPUT:

3. SQL Query to show RANGE.


a. INPUT : SELECT * from STUDENT26 where marks BETWEEN 90 AND 100;

b. OUTPUT:

4. SQL Query to use LOGIC like NOT, AND, OR.


a. INPUT (using NOT) : SELECT * from STUDENT26 where NOT (Department = 'CSE');

b. OUTPUT:
a. INPUT (using AND) : SELECT * from STUDENT26 where FirstName LIKE 'D%' AND Marks < 100;

b. OUTPUT:

5. SQL Query to use MIN, MAX, AVG, SUM on the Table.


INPUT (using MIN) : SELECT MIN(marks) from STUDENT26;
INPUT (using MAX) : SELECT MAX(marks) from STUDENT26;
INPUT (using AVG) :
SELECT AVG(marks) from STUDENT26;
INPUT (using SUM) :
SELECT SUM(marks) from STUDENT26;

OUTPUT:

6. SQL Query to COUNT entities.


a. INPUT : SELECT COUNT(FirstName) from STUDENT26;
b. OUTPUT:

You might also like