0% found this document useful (0 votes)
11 views12 pages

Write A Query To Access The Database and Create A Table Teacher Having The Following Specifications

Python programs

Uploaded by

luckydada1238
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)
11 views12 pages

Write A Query To Access The Database and Create A Table Teacher Having The Following Specifications

Python programs

Uploaded by

luckydada1238
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/ 12

23.

Write the SQL queries for the following on the


basis of the given table Teacher.
i. Write a query to access the database and create a
table Teacher having the
Attribute Datatype following specifications:
SNo integer
Name varchar(20)
Department varchar(25)
Date_of_Joining date
Salary integer
Gender char(3)

ii. Write a query to insert the data into the table Teacher.
iii. Write a query to display all the records from the table

Teacher.

iv. Write a query to display all the information of the


teacher of the computer department.
v. Write a query to give the alias name to Date_of_Joining

‘DOJ’.

24.Write the SQL queries for the following on the


basis of the given table Sports.

Table: SPORTS

i.Write a query to display the name of the students who


have ‘c’ grade.
ii. Write a query to view the structure of the table Sports.

iii. Write a query to display the name of students who


have opted for cricket.

iv. Write a query to display the details of the students


who have grades between ‘A’ to ‘B’.
v. Write a query to display the games taken up by the
students, whose name starts with ‘A’.

25. Write the SQL queries for the following on the


basis of the given table Subject.
Table: SUBJECT
i.Write a query to count the number of students.

ii. Write a query to count the students who have opted


for python as a subject in the Subject table.
iii. Write a query to display distinct subject options.

iv. Write a query to calculate the total fees of all the

students.

v. Write a query to display the records of students who


paid highest fees.
26.Write the output for the following SQL queries
on the basis of the given table Orders.
Table: ORDERS

i.SELECT item, SUM(qty) FROM ORDERS GROUP BY item;

ii. SELECT item, qty FROM ORDERS


WHERE orddate BETWEEN ‘2023-11-01’ AND ‘2023-12-
31’;

iii. SELECT orderno, orddate FROM ORDERS


WHERE item= ‘Wheat’ AND rate>=60;

iv. SELECT COUNT(DISTINCT item) FROM ORDERS;


27.Write the SQL queries for the following on the
basis of the given tables Admin and Transport.
Table: ADMIN

Table: TRANSPORT
i.Write a query to display the student name and their
stop name from the tables Admin and Transport.

ii. Write a query to display the number of students whose

s_type is not known.

iii. Write a query to display all the details of the students


whose name starts with ‘V’.
iv. Write a query to display student id and address in
alphabetical order of the student name from the table
Admin.

You might also like