DS26
Q. 1) Create employee table as follows EMP (eno, ename, designation, salary). Write Ajax program to
select the employees name and print the selected employee’s details. [Marks 15]
CREATE TABLE EMP (
eno INT PRIMARY KEY,
ename VARCHAR(255),
designation VARCHAR(255),
salary DECIMAL(10, 2)
);
INSERT INTO EMP (eno, ename, designation, salary) VALUES
(1, 'John Doe', 'Manager', 50000.00),
(2, 'Jane Smith', 'Developer', 40000.00),
(3, 'Alice Johnson', 'Designer', 45000.00),
(4, 'Bob Williams', 'Tester', 38000.00),
(5, 'Eve Brown', 'Analyst', 48000.00);
// Fetch employee details from the database
conn) {
ename'";
conn, result) > 0) {
result);
echo "<h2>Employee Details:</h2>";
echo "<p><strong>Employee Number:</strong> {row['eno']}</p>";
echo "<p><strong>Name:</strong> {row['ename']}</p>";
echo "<p><strong>Designation:</strong> {row['designation']}</p>";
echo "<p><strong>Salary:</strong> {row['salary']}</p>";
} else {
echo "No employee found with the selected name.";
}
mysqli_close($conn);
}
?>
Q. 2 )Consider text paragraph. """Hello all, Welcome to Python Programming Academy. Python
Programming Academy is a nice platform to learn new programming skills. It is difficult to get enrolled
in this Academy.""" Preprocess the text to remove any special characters and digits. Generate the
summary using extractive summarization process
import re
from gensim.summarization import summarize
Text paragraph
text = "Hello all, Welcome to Python Programming Academy. Python Programming Academy is a nice platform to learn new programming skills. It is difficult to get enrolled in this Academy."
Preprocess the text to remove special characters and digits
clean_text = re.sub(r'[^a-zA-Z\s]', '', text)
Generate summary using extractive summarization
summary = summarize(clean_text)
print("Original Text:")
print(text)
print("\nPreprocessed Text:")
print(clean_text)
print("\nSummary:")
print(summary)