Ip Practical File Class 12
Ip Practical File Class 12
Program:
Output:
Program:
Output:
Program:
Output:
3. Factorial of a number.
Program:
Output:
Program:
Output:
Program:
Output:
Program:
Output:
7. Create a dictionary with 5 items and apply all methods learnt.
Program:
Program:
Output:
Program:
Output:
10. Create a list with n elements and find the sum of the elements.
Program:
Output:
Program:
Output:
Program:
Output:
Program:
Output:
14. 4 slicing questions.
Program:
Output:
Program:
Output:
16. WAP to display even numbers from 10 to 20.
Program:
Output:
Program:
Output:
Program:
Output:
19. WAP to display all numbers divisible by 13 and not by 3 between 100 and 500.
Program:
Output:
MYSQL
9) What will be the O/P for: select* from students where city is null;
10) What will be the output for: select*from students where id between 1 and 5;
2nd table:
However, since there is already a primary key an error will be displayed as below:
3rd table:
10) O/P for: SELECT * FROM employee WHERE last_name LIKE '%son';
4th table:
1) Display all the projects.
Select project_name from projects;
2) Display those projectids where the budget is more 70000.
Select project_id from projects where budget>70000;
3) Display the details of the projects starting after 2024.
Select*from projects where start_date>’2024-01-01’;
4) Display the projects managed by Jane.
Select *from projects where project_manager=’Jane Lead’;
5) Modify the budget of project a to 52500 aed.
UPDATE projects SET budget=52500.00 WHERE project_name=’project A’;
6) Delete those projects who ended before 2024-06-01.
DELETE from projects WHERE end_date<’2024-06-01’;
7) Display those project details whose names start with ‘project’.
Select*from projects where project_name like ‘project%’;
8) O/P for: SELECT project_name, start_date FROM projects WHERE department = 'HR';
9) O/P for: SELECT project_name, budget FROM projects WHERE budget BETWEEN 60000 AND
90000;
10) O/P for: SELECT * FROM projects WHERE end_date > '2024-07-01' AND project_manager =
'Sophia Lead';
5th table:
6th table:
9) O/P for: SELECT * FROM bookstore WHERE price BETWEEN 20.00 AND 30.00;
10) O/P for: SELECT * FROM bookstore WHERE publication_year > 2005 AND author IS
NULL;
7th table:
9) O/P for: SELECT * FROM vehicles WHERE price BETWEEN 25000.00 AND 35000.00;
10) O/P for: SELECT * FROM vehicles WHERE model IN ('Sorento', 'Outback');
8th table:
1) Display all the movies in the order of their descending release years.
Select*from movies order by release_year desc;
2) Display all action movies after 2010.
Select title from movies where genre=’action’ and release_year>2010;
3) Retrieve movies directed by Christopher Nolan.
Select*from movies where director=’Christopher Nolan’;
4) Display movies with their ratings if they are rated above 8 points.
Select title,rating from movies where rating>8.0;
5) Display the various directors.
Select DISTINCT directors from movies;
6) Delete records of movies with no genres.
DELETE from movies where genre IS NULL;
7) Find and display movies with titles which have the word ‘love’ in it.
Select*from movies where title like ‘%love%’;
8) O/P for: select*from movies;
9) O/P for: SELECT * FROM movies WHERE release_year BETWEEN 2010 AND 2019 AND rating
> 7.5;
9th table:
10) O/P for: SELECT country_name, population FROM countries ORDER BY population DESC;
10th table:
9) O/P for:SELECT name, nationality FROM celebrities WHERE nationality LIKE 'A%' OR nationality
LIKE 'S%';
10) O/P for: SELECT name, awards_won FROM celebrities WHERE awards_won IS NULL;