IP database assignment -2-subjective-MID ASSESS
IP database assignment -2-subjective-MID ASSESS
INFORMATICS PRACTICES
Class-XI
(Session: 2024-25)
1
UNIT-III
Database & SQL
Q1. Observe the following table LIST and find its Degree and Cardinality
LIST
DEGREE:
NO NAME EVENTCODE EVENTNAME
1 Tara Mani 1001 Programming
1 Tara Mani 1002 IT Quiz
CARDINALITY:
2 Jaya Sarkar 1001 Programming
2 Jaya Sarkar 1002 IT Quiz
3 Tarini Trikha 1001 Programming
3 Tarini Trikha 1002 IT Quiz
Q2. Observe the following table MEMBER and write the name of the RDBMS operation which
has been used to produce the output as shown in RESULT. Also, find the Degree and
Cardinality of the RESULT.
MEMBER
RESULT CARDINALITY:
NO MNAM STREAM
E
M00 ADITYA HUMANITIE
2 S
Q3. Observe the following table and write the names of the most appropriate columns, which can
be considered as (i) Candidate Keys (ii) Primary Key (iii) Alternate Key
2
Q4. Write any three advantages and disadvantages of DBMS.
Q5. Differentiate between Hierarchical Data Model and Relational Data Model.
Q6. Differentiate between Primary Key, Candidate Key, Alternate Key and foreign Key with the
help of an example.
Q7. What are DML and DDL statements in SQL? Explain with one example command for each.
(Also give the syntax)
Q8. Write the SQL Queries for (i) to (iv) and find the outputs for SQL Queries (v) to (viii) which
are based on the tables.
WORKER
3
15 AMEEN AHMED MECHANIC P002 21-AUG-2006 13-MAR-1984
18 SANYA CLERK P002 19-DEC-2005 09-JUN-1983
PAYLEVEL
(ii) To display the NAME and DESIG of those WORKER whose PLEVEL is either P001 or
P002.
(iii) To display the content of all the WORKER table whose DOB is in between ’19-JAN-1984’
and ’18-JAN-1987’.
Q9. Write the SQL Queries for (i) to (iv) and find the outputs for SQL Queries (v) to (viii) which
are based on the tables.
DVD
MEMBER
(i) To display all details from the table MEMBER in descending order of MID.
(ii) To display the DTYPE and DTITLE of all FOLK type DVDs
(iii) To display all NAME and DCODE of those members from the table MEMBER who have
DVDs issued in the year 2017.
(v) Give output: Select Dcode,Name,Issued_Year From Member Where Name Like “%A
%”;
(vi) Give output: Select Dtitle From Dvd Where Dtype Not In(“Folk” , “Classical”);
5
Q10. Write the SQL Queries for (i) to (iv) and find the outputs for SQL Queries (v) to (viii)
which are based on the tables.
WORKER
(iii) To display the WNO and NAME of those workers from the table WORKER, who are born
between ‘1987-01-01 ‘and ‘1991-12-01’.
Q12. Write the SQL Queries for (i) to (iv) and find the outputs for SQL Queries (v) to (viii)
which are based on the tables.
ITEM STORE
6
(i) To display INAME and PRICE of all the items in ascending order of their PRICE.
(iii) Give output: Select Distinct Iname From Item Where Price>=5000;
(iv) Give output: Select Iname, Price*0.05 From Item Where Sno In (‘S02’, ‘S03’);
Q13. Write the SQL Queries for (i) to (iv) and find the outputs for SQL Queries (v) to (viii)
which are based on the tables.
STUDENT
STREAM
STRCDE STRNAME
1 SCIENCE+COMP
2 SCIENCE+BIO
3 SCIENCE+ECO
4 COMMERCE+MATHS
5 COMMERCE+SOCIO
6 ARTS+MATHS
7
7 ARTS+SOCIO
(i) To display the name of streams in alphabetical order from table STREAM.
(ii) To display the number of students whose POINTS are more than 5.
(iii) To update GRADE to ‘A’ for all those students who are getting more than 8 as POINTS.
(iv) ARTS+MATHS stream is no more available. Make necessary change in table STREAM.
Q14. Consider the tables given below and answer the questions that follow:
Table: Employee
No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10
2 Kritika 35000 Centre 30 A 10
3 Naveen 32000 West 40 NULL 20
4 Uday 38000 North 38 C 30
5 Nupur 32000 East 26 NULL 20
6 Moksh 37000 South 28 B 10
7 Shelly 36000 North 26 A 30
Table: Department
Dept DName MinSal MaxSal HOD
10 Sales 25000 32000 1
20 Finance 30000 50000 5
30 Admin 25000 40000 7
8
1. 1. a) Create the table Employee.
5. Display the details of all the employees who are below 30 years of age.
8. Display the details of all the employees whose Grade is not NULL.
9
9. Display the details of all the employees of department 10 who are above 30 years of age.
10. Display the details of all the employees who are getting a salary of more than 35000 in
the department 30.
11. Display the names and salaries of those employees who are not working in department 20.
12. Display the names and salaries of those employees who are not working in West or
Centre zone.
13. Display the names of all the employees who are working in department 20 or 30.
14. Display the details of all the employees whose salary is between 32000 and 38000.
15. Display the details of all the employees whose grade is between ‘A’ and ‘C’.
16. Display the name, salary, and age of all the employees whose names start with ‘M’.
17. Display the name, salary, and age of all the employees whose names end with ‘a’.
18. Display the name, salary, and age of all the employees whose names contain ‘a’.
10
19. Display the name, salary, and age of all the employees whose names do not contain ‘a’
20. Display the details of all the employees in the ascending order of their salaries.
21. Display the details of all the employees in the descending order of their names.
22. Put the grade B for all those whose grade is NULL.
23. Increase the salary of all the employees above 30 years of age by 10%.
24. Delete the records of all the employees whose grade is C and salary is below 30000.
25. Delete the records of all the employees of department 10 who are above 40 years of age.
11