You are on page 1of 2

SQL Questions

Answer the following

1. Consider the following table and answer the following

Student Faculty
Student_id Student_name Faculty_id Mark Faculty_Num Faculty_Name City
s
100 Arunkumar 10 80 10 Janaki 1
200 Chandra 20 85 20 Paul 2
300 Chithra 10 67 30 Irene 1
400 Muthu 10 56 40 Robin 3
500 Kumar 20 45 50 Anna 4

City Department
City_id City Name Depar_Id Depart_id Depart_name
1 Chennai 1000 1000 Computer Science
2 Bangalore 1000 1001 Mathematics
3 Delhi 1001 1002 Science
4 Kolkata 1002
5 Mumbai 1004

1. Write a query to display the Student id, Student Name, Faculty Id and Faculty name from Student and

faculty tables

2. Write a query to display the Student id, Student Name, Faculty name, City Name, Department Name from

the above mentioned tables

3. Write a query to find the maximum marks from student table

4. Find the students names starting with “C”

5. Write a query to find the top 3 marks from student table

6. Write a query to find out the number of student handled by a faculty

7. Write a query to find the faculty working in city – Chennai

8. Find the error in table City and Department

9. Relate the tables City and Department using Primary key and Foreign Key relationship
SQL Questions

10. Create table City and Department with Appropriate Constraints

You might also like