0% found this document useful (0 votes)
2 views24 pages

SQL K

The document provides SQL commands and queries related to various tables including CLUB, STUDENT, FACULTY, FLIGHTS, and FARES. It includes tasks such as displaying information about coaches, students, and faculty members, as well as performing calculations and aggregations. Additionally, it outlines commands for inserting values and showing table data.

Uploaded by

kirtikamanoth
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)
2 views24 pages

SQL K

The document provides SQL commands and queries related to various tables including CLUB, STUDENT, FACULTY, FLIGHTS, and FARES. It includes tasks such as displaying information about coaches, students, and faculty members, as well as performing calculations and aggregations. Additionally, it outlines commands for inserting values and showing table data.

Uploaded by

kirtikamanoth
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/ 24

SQL

(STRUCTUR
ED
QUERY
LANGUAGE)
FUNCTION
S
TABLE 1: CLUB

INSERTING VALUES IN THE TABLE:-

SHOWING TABLE ITEM:-


Q1) Write SQL commands for the
following on the basis of the given
table club.
a) To show all information about
the swimming coaches in the
club.

b) To list names of all coaches with


their date of appointment
(DATE_OF_APP) in decreasing
order.
c) To display a report showing
coach name,pay,age and bonus
(15% of pay)for all coaches.

d) Give output of the following:


1. Select lcase(sports) from club;

2. Select mod(age,5) from club


where sex=”f”;

3. Select pow(3,2) from club where


sports=”karate”;
Q2) Write the output of the following
SQL commands:-
a) Select pow(2,3);

b) Select round (123.2345,2),


round (342.9234,-1);
c) Select length (“Informatics
Practices”);

d) Select year (“1979-11-


26”),month(“1979-11-26”);

e) Select left (“INDIA”,3),


right(“computer science”,4);
f) Select mid
(“informatics”,3,4), substr
(“practices”,3);

g) Select concat(“you scored”,


length (“123”),”rank”);

h) Select abs(-67.89);
i) Select
sqrt(625)+round(1234.89,-3);

j) Select mod(56,8);
TABLE 2: STUDENT

INSERTING VALUES IN THE TABLE:


SHOWING THE TABLE:

Q3) Consider the given student table


and write output of the following
commands:-
a) To display name like “% i %”.
b) To display month name where
class=3.

c) To display voc_subj and count


them.

d) To display adm_no in order.

e) Display the name and age of every


student (age=current year- year of
birth)
TABLE 3: FACULTY

INSERTING VALUES IN THE TABLE:-


SHOWING THE TABLE:-

Q4) Consider the given table


FACULTY and answer the following
questions:-
a) To display details of those
faculty members whose salary is
higher than 12000.

b) To display details of faculty


members whose salary is in the
range of 8000 to 12000.
c) Count number of different IDs
from FACULTY.

d) Count the number of faculty


members getting salary as 10000.

e) Display names of faculty


members whose name starts with
“s”.
f) Display all records in
descending order of hire data.

g) Find maximum and minimum


salary.
h) SELECT concat (F_Name,
L_Name ) from faculty;

i)Select Month (Hire_ date) from


faculty;
TABLE 4: FLIGHTS

INSERTING VALUES IN THE


TABLE:-

SHOWING THE TABLE:-


TABLE 6: FARES

INSERTING VALUES IN THE TABLE:-

SHOWING THE TABLE:-


Q5) Write SQL commands for the
following:
a) Display FL_NO AND NO_FLIGHTS
from Kanpur to Bengaluru from the
table.

b) Display the minimum fare offered by


Indian airlines from the table fare.
c) Display total number of flights in
each starting location.

You might also like