Prince A
Prince A
class Vehicle:
self.brand = brand
self.model = model
def display_info(self):
class Car(Vehicle):
super().__init__(brand, model)
self.doors = doors
def display_details(self):
self.display_info()
my_car.display_details()
(b) Self Join: A self join joins a table with itself, typically using aliases.
Q4. Write a Nested Query with the Use of EXISTS and NOT EXISTS
• enrollments — containing student IDs and course IDs, showing which students are enrolled
in which courses.
Table Structures:
Using NOT EXISTS: Find students who are not enrolled in any course.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<h2>Login Form</h2>
</form>
<script>
function validateForm() {
if (!userIdPattern.test(userId)) {
alert("User ID must be 5 to 12 characters long and can only contain letters and numbers.");
return false;
if (!passwordPattern.test(password)) {
return false;
alert("Validation successful!");
return true;
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<h2>Form Validation</h2>
<p>Gender:</p>
<br><br>
<p>Interests:</p>
<br><br>
</form>
<script>
function validateForm() {
const genderSelected = document.querySelector('input[name="gender"]:checked');
if (!genderSelected) {
return false;
if (interestSelected.length === 0) {
return false;
alert("Validation successful!");
return true;
</script>
</body>
</html>
ON Employees
AFTER UPDATE
AS
BEGIN
@OldSalary = DELETED.Salary,
@NewSalary = INSERTED.Salary
FROM INSERTED
INNER JOIN DELETED ON INSERTED.EmpID = DELETED.EmpID;
BEGIN
END
END;
const person = {
name: "John",
age: 30,
};
const employee = {
position: "Developer",
salary: 80000
};
Object.assign(employee, person);
console.log(employee);
return x + y
def subtract(x, y):
return x - y
return x * y
if y != 0:
return x / y
else:
print("Select an operation:")
if choice == '1':
Q10. what is diff between map and set illustrate with program.
Map:
A Map stores key-value pairs, where both keys and values can be of any data type. It is similar to an
object but more versatile because keys can be objects, functions, or any primitive type.
Set:
A Set stores a collection of unique values. It automatically removes duplicate values and does not
have key-value pairs. It is similar to an array but guarantees uniqueness.
set.add("Apple");
set.add(42);