0% found this document useful (0 votes)
15 views11 pages

IP database assignment -2-subjective-MID ASSESS

The document is an academic assignment for Class XI students at G.D. Goenka Public School, focusing on Database Management Systems (DBMS) and SQL. It includes various questions related to database concepts, SQL queries, and operations involving tables such as LIST, MEMBER, WORKER, and others. The assignment aims to assess students' understanding of database structures, keys, and SQL commands.

Uploaded by

anjiniagarwal8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views11 pages

IP database assignment -2-subjective-MID ASSESS

The document is an academic assignment for Class XI students at G.D. Goenka Public School, focusing on Database Management Systems (DBMS) and SQL. It includes various questions related to database concepts, SQL queries, and operations involving tables such as LIST, MEMBER, WORKER, and others. The assignment aims to assess students' understanding of database structures, keys, and SQL commands.

Uploaded by

anjiniagarwal8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

G.D.

GOENKA PUBLIC SCHOOL


EAST DELHI

INFORMATICS PRACTICES
Class-XI
(Session: 2024-25)

UNIT-III: DBMS & SQL

Date of Submission: _____________

STUDENT’S NAME: __________________________


CLASS & SECTION: __________________________
ROLL NO. :__________________________

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

NO MNAME STREAM OPERATION PERORMED:


M001 JAYA SCIENCE
M002 ADITYA HUMANITIES
M003 HANSRAJ SCIENCE DEGREE:
M004 SHIVAK COMMERCE

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

Cod Item Qty Pric Transaction date


e e CANDIDATE KEY:
1001 Plastic folder 100 3400 2014-12-14
1004 Pen stand 200 4500 2015-01-31
PRIMARY KEY:
1005 Stapler mini 250 1200 2015-02-28
1009 Punching 200 1400 2015-03-12
machine ALTERNATE KEY:
1003 Stapler big 100 1500 2015-02-02

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

ECODE NAME DESIG PLEVEL DOJ DOB


11 RADHE SHYAM SUPERVISOR P001 13-SEP-2004 23-AUG-1981
12 CHANDER NATH OPERATOR P003 22-FEB-2010 12-JUL-1987
13 FIZZA OPERATOR P003 14-JUN-2009 14-OCT-1983

3
15 AMEEN AHMED MECHANIC P002 21-AUG-2006 13-MAR-1984
18 SANYA CLERK P002 19-DEC-2005 09-JUN-1983

PAYLEVEL

PLEVEL PAY ALLOWANCE


P001 26000 12000
P002 22000 10000
P003 12000 6000

(i) To display the details of all WORKER in descending order of DOB.

(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’.

(iv) To add a new row with the following:


( 19, ‘DAYA KISHORE’ , ‘OPERATOR’ , ‘P003’ , ’19-JUN-2008’ , ’11-JUL-1984’ )

(v) Give output: SELECT PLEVEL, PAY+ALLOWANCE FROM PAYLEVEL


WHERE PLEVEL=’P003’;

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

DCODE DTITLE DTYPE


F101 HENRY MARTIN FOLK
C102 DHRUPAD CLASSICAL
C101 THE PLANETS CLASSICAL
F102 UNIVERSAL SOLDIER FOLK
4
R102 A DAY IN LIFE ROCK

MEMBER

MID NAME DCODE ISSUED_YEAR


101 AGAM SINGH R102 2017
103 ARTH JOSPEH F102 2016
102 NISHA HANS C101 2017

(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.

(iv) Give output: SELECT DISTINCT DTYPE FROM DVD;

(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

WNO NAME DOJ DOB GENDER DCODE


1001 GEORGE K 2013-09-02 1991-09-01 MALE D01
1002 RYMA SEN 2012-12-11 1990-12-15 FEMALE D03
1003 MOHITESH 2013-02-03 1987-09-04 MALE D05
1007 ANIL JHA 2014-01-17 1984-10-19 MALE D04
1004 MANILA SAHAI 2012-12-09 1986-11-14 FEMALE D01
1005 R SAHAY 2013-11-18 1987-03-31 MALE D02
1006 JAYA PRIYA 2014-06-09 1985-06-23 FEMALE D05

(i) To display WNO, NAME, GENDER in descending order of WNO.

(ii) To display the NAME of all the FEMALE workers.

(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

INO INAME PRICE SNO SNO SNAME AREA


T01 Mother Board 12000 S01 S01 Abc Computronics Gk Ii
T02 Hard Disk 5000 S01 S02 All Infotech Media Cp
T03 Keyboard 500 S02 S03 Tech Shoppe Nehru
T04 Mouse 300 S01 Place
T05 Mother Board 13000 S02 S04 Geeks Techno Soft Nehru
T06 Keyboard 400 S03 Place
T07 Lcd 6000 S04 S05 Hitech Tech Store Cp
T08 Lcd 5500 S05
T09 Mouse 350 S05
T10 Hard Disk 4500 S03

6
(i) To display INAME and PRICE of all the items in ascending order of their PRICE.

(ii) To display SNO and SNAME of all store located in CP.

(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

SCODE NAME AGE STRCDE POINTS GRADE


101 AMIT 16 1 6 NULL
102 ARJUN 13 3 4 NULL
103 ZAHEER 14 2 1 NULL
105 GAGAN 15 5 2 NULL
108 KUMAR 13 6 8 NULL
109 RAJESH 17 5 8 NULL
110 NAVEEN 13 3 9 NULL
113 AJAY 16 2 3 NULL
115 KAPIL 14 3 2 NULL
120 GURDEEP 15 2 6 NULL

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

Write SQL commands to:

8
1. 1. a) Create the table Employee.

b) Create table Department

2. Insert one record in each of the table Employee and Department

3. Display the details of all the employees.

4. Display the Salary, Zone, and Grade of all the employees.

5. Display the details of all the employees who are below 30 years of age.

6. Display the names of all the employees working in North zone.

7. Display the salaries of all the employees of department 10.

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

You might also like