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

DBMS Assignment 3

The document outlines a lab assignment focused on database technology, specifically involving the creation of tables for students, applications, and colleges. It includes a series of practical questions that require combining tables and retrieving specific data related to student applications, as well as pre- and post-experiment questions discussing various types of joins. The assignment emphasizes the use of SQL joins to manipulate and query relational data effectively.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

DBMS Assignment 3

The document outlines a lab assignment focused on database technology, specifically involving the creation of tables for students, applications, and colleges. It includes a series of practical questions that require combining tables and retrieving specific data related to student applications, as well as pre- and post-experiment questions discussing various types of joins. The assignment emphasizes the use of SQL joins to manipulate and query relational data effectively.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

DATABASE TECHNOLOGY

LAB ASSIGNMENT 3

Create Table : Student

Create Table: Apply


Create Table: College

Practical Assignment 3

Q1. Produce a combined table in which each student is combined with every other application.
Q2. Give Student ID, name, GPA, and name of college and major each student applied to.

Q3. Find details of applications who applied to a college in California State.


Q4. IDs, name, GPA of students, and name of college with GPA > 3.7 applying to Stanford.

Q5. Find details of students who applied to the CS major and their application was rejected.
Q6. Find details of students and applications who applied to colleges in New York.

Q7. Find details of students who have not applied to any college.
Q8. Find colleges where no student has applied.

Q9. Find sID of students who have only one application.


Q10. Find name and GPA of applicants who applied to any college whose enrollment is not more
than 25,000.

Q11. Find pairs of students (sID) having the same GPA (each pair should occur just once in result).
Q12. Find various majors students applied for at a college in the state of MA.
PRE-EXPERIMENT QUESTIONS

1. When do we need to combine two tables?


 When we need to retrieve related data stored across
multiple tables, such as student applications to colleges.

2. Difference between Equi Join and Theta Join:


 Equi Join: Uses only equality (=) conditions for joining
tables.
 Theta Join: Uses other relational operators (<, >, !=, etc.)
in the join condition.

3. Difference between Natural Join and Inner Join:


 Natural Join: Automatically joins tables on columns with
the same name and type.
 Inner Join: Requires specifying the join condition
explicitly.
Q13. Find student and major he/she applied to.

Using CROSS JOIN:

Using NATURAL JOIN:


Using INNER JOIN:

Q14. Find details of students who came from a high school with size < 20000 and applied to CS at
Stanford.

Using CROSS JOIN:


Using NATURAL JOIN:

Using INNER JOIN:


Q15. Provide complete details of each student where they applied, what major they applied to,
what was the decision, and complete details of the college they applied to.

Using CROSS JOIN:

Using NATURAL JOIN:


Using INNER JOIN:

Q16. Names and GPAs of students with HS > 1000 who applied to CS and were rejected.

Using CROSS JOIN:


Using NATURAL JOIN:

Using INNER JOIN:


Q17. Names and GPAs of students with HS > 1000 who applied to CS at colleges with enrollment >
20,000 and were rejected.

Using CROSS JOIN:

Using NATURAL JOIN:


Using INNER JOIN:
POST-EXPERIMENT QUESTIONS

1. When can we use natural join?


o When two tables share columns with the same
name and we want to join them based on those
columns without specifying conditions.

2. When are we bound to use inner join?


o When we need to join tables using specific
conditions that are not based on column names
alone.

3. Can we implement all joins using cross join?


o Yes, by applying a WHERE condition after
performing a CROSS JOIN, we can simulate INNER
JOIN and NATURAL JOIN.

4. Where and in what kind of queries do we require outer


joins?
o When we want to retrieve records from one table
even if there is no corresponding match in another
table. Example: Retrieving students who have not
applied to any college (LEFT JOIN with NULL
checks).

You might also like