0% found this document useful (0 votes)
10 views

SQL Test PaperJanuary

The document outlines a programming test for Giri’s Tech Hub Pvt. Ltd, scheduled for January 6, 2025. It includes instructions to solve 8 queries based on provided tables for courses, students, placements, and their relationships. Additionally, it lists specific SQL queries and procedures to be implemented on the database, focusing on course fees, student enrollment, and data integrity.

Uploaded by

tstudent437
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

SQL Test PaperJanuary

The document outlines a programming test for Giri’s Tech Hub Pvt. Ltd, scheduled for January 6, 2025. It includes instructions to solve 8 queries based on provided tables for courses, students, placements, and their relationships. Additionally, it lists specific SQL queries and procedures to be implemented on the database, focusing on course fees, student enrollment, and data integrity.

Uploaded by

tstudent437
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Giri’s Tech Hub Pvt.Ltd, Pune.

Programming (Machine) Test


Batch: May/June/July/Aug/Sep/Oct-23 Date: 06/01/2025
Time: 02:00 to 04:00 Pm

Instructions:
1. Solve any 8 query.
2. To take 10 record from each table.

1. Create Course Table :-

courseid name fees


1 Java Programming 15000
2 Web Development 20000
3 Data Science 25000
4 Cloud Computing 18000
5 Cyber Security 22000

2. Create Student Table :-

sid name email contact address


1 Alice [email protected] 1234567890 New York
2 Bob [email protected] 1234567891 Los Angeles
3 Charlie [email protected] 1234567892 Chicago
4 Diana [email protected] 1234567893 Houston
5 Ethan [email protected] 1234567894 Phoenix

3. Create Placement Table :-

pid comp_name package pdate


1 Google 1200000 01-01-2025
2 Microsoft 1000000 02-01-2025
3 Amazon 1100000 03-01-2025
4 Apple 1300000 04-01-2025
5 Facebook 1250000 05-01-2025

4. Create CSJoin Table :-

sid cid pid


1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
Write the Following SQL Queries on Above Database :-

Q1. Write SQL Query to display all courses whose fees are 15000, 22000 and 25000?

Q2. Write SQL query to display the course in which at least 3 character?

Q3. Write SQL Query to display the course wise student list?

Q4. Write SQL Query to show the Student count Course Wise?

Q5. Write SQL Query to show the course list who having more than 3 students?

Q6. Write SQL Query to show the all student list who having more than 3 lakh packages?

Q7. Create a stored procedure that inserts a new student into the Student table and calculates a discount
for the course fee based on the student’s enrollment. The discount should be 10% if the student’s contact
number starts with "123", otherwise no discount.

Q8. Write a stored procedure to update the fees of a student based on the course they are enrolled in.
The procedure should take the student ID and course ID as input, and the procedure should update the
fees of the student to the corresponding course fee.

Q9. Create a trigger that prevents the deletion of a student from the Student table if they are currently
enrolled in any course (i.e., they have an entry in the Csjoin table). If the student is enrolled in any course,
the deletion should be blocked and an error message should be raised.

Q10. Create a view that displays the names of students along with the courses they are enrolled in. The
view should join the Student, Course, and Csjoin tables.

-----ALL THE BEST-----

You might also like