The document contains several SQL queries related to a 'teacher' database, including selecting specific data based on conditions, aggregating counts and sums, and ordering results. It shows examples of retrieving names, salaries, and filtering by date of joining. Additionally, it includes results from executed queries, such as the first two letters of names and salaries ordered by age.
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 ratings0% found this document useful (0 votes)
4 views1 page
Set 2 - SQL - Ip
The document contains several SQL queries related to a 'teacher' database, including selecting specific data based on conditions, aggregating counts and sums, and ordering results. It shows examples of retrieving names, salaries, and filtering by date of joining. Additionally, it includes results from executed queries, such as the first two letters of names and salaries ordered by age.
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
select month (doj) from teacher where name = "Arun"
select count(*), Department
from teacher group by Department;
select SUM (salary) from teacher where Gender = 'F';
select upper(Name) from teacher;
select * from teacher where DOJ < '2019-01-01'
mysql> SELECT left(Name,2) FROM teacher;
+------------------+ | left(Name,2) | +------------------+ | Ra | | Sa | | Ar | | Sh | | Sh | | Sh | | Sa | | Ra | +------------------+ 8 rows in set (0.02 sec)
mysql> SELECT name, salary FROM teacher order by Age DESC;