0% found this document useful (0 votes)
6 views2 pages

Question 1

The document outlines tasks related to SQL database management, including creating a Station table and querying city names with even ID numbers. It also involves creating Student and Advisor tables, querying advisor names with student counts, and handling cases where students lack advisors. Additionally, it specifies the need for a function to count students per advisor and a stored procedure for inserting and updating records in the tables.
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)
6 views2 pages

Question 1

The document outlines tasks related to SQL database management, including creating a Station table and querying city names with even ID numbers. It also involves creating Student and Advisor tables, querying advisor names with student counts, and handling cases where students lack advisors. Additionally, it specifies the need for a function to count students per advisor and a stored procedure for inserting and updating records in the tables.
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/ 2

Question 1:

Create a table Station and insert few records.

Write a Query a list of CITY names from STATION for cities that have an
even ID number. Print the results in any order, but exclude duplicates
from the answer.
Question 2 : Create two tables Student and Advisor.

i. Write a query to find out the advisor name and his student count.
ii. Write a query to get results that consists
student_id,student_name (it should be full name means firstname
+ lastname),advisor_name (it should be fullname).

NB : if a student not assigned with any advisor you should show


in “No Advisor Assigned” in the advisor_name column.

iii. Write a function which will return student count for an advisor, it
takes ‘advisor_id’ as argument and returns respective advisor
count.
iv. Write a stored procedure for insert,update the students and
advisor table. Define the required parameters for stored
procedure.

You might also like