MODEL PAPER 1

  • a) Find the Cartesian product of the given tables

ID / NAME
1 / Rajesh
2 / Anil
3 / Vishakha
E_ID / E_NAME
A1 / RKD
A2 / MMK

b) Create a TABLE student with following details
Stu_name VARCHAR2(25)

F_Name VARCHAR2(25)

Age NUMBER(3)

c) Write SQL commands:

No. / Name / Age / Department / City / Salary / Sex
1 / RAJAT AGGARWAL / 28 / SALES / DELHI / 25000 / M
2 / KESHAV GOYAL / 23 / MARKETING / DELHI / 28000 / M
3 / RAGHAV BANSAL / 26 / MARKETING / DELHI / 26500 / M
4 / NEETU GUPTA / 29 / IT / NOIDA / 24510 / F
5 / ROHINI GARG / 27 / IT / NOIDA / 26500 / F
6 / RICHA SINGHAL / 24 / HR / GHAZIABAD / 24530 / F
7 / AKASH GUPTA / 22 / SALES / GHAZIABAD / 27800 / M

i) To show all the Records from Sales Department

ii)To show the record of all employees getting salary more than 25000.

iii)To show All the records of Male Employees

iv)To show the records of employees living in Delhi and getting salary more than 26000.

v)To show the records of Male employees living in Ghaziabad

[2+1+5=8]

Marks:8

Answer:

a)

ID / Name / E_ID / E_NAME
1 / Rajesh / A1 / PKD
1 / Rajesh / A2 / MMK
2 / Anil / A1 / PKD
2 / Anil / A2 / MMK
3 / Vishakha / A1 / PKD
3 / Vishakha / A2 / MMK

b)
CREATE TABLE STUDENT

(Stu_name VARCHAR2(25),

F_Name VARCHAR2(25),

Age Number(3));

c)Queries:

i) SELECT * FROM EMPLOYEE

WHERE Department=’SALES’;

ii) SELECT * FROM EMPLOYEE

WHERE Salary>25000;

iii) SELECT * FROM EMPLOYEE

WHERE Sex=’M’;

iv) SELECT * FROM EMPLOYEE

WHERE City=’DELHI’ AND SALARY>26000;

v) SELECT * FROM EMPLOYEE

WHERE City=’GHAZIABAD' AND Sex=’M’;

Hide Answer

  • Q6

a) Explain Demorgan’sLaw.
b) Develop the Boolean expression for the circuit below.

c) Reduce the following Boolean expression using K-Map:

F(P,Q,R,S)=Σ(0,3,5,6,7,11,12,15)

d) Given the truth table of a function F(x, y, z). Write the s-o-p expression and canonical form from the following truth table:

x / y / z / F
0 / 0 / 0 / 0
0 / 0 / 1 / 1
0 / 1 / 0 / 1
0 / 1 / 1 / 1
1 / 0 / 0 / 0
1 / 0 / 1 / 0
1 / 1 / 0 / 0
1 / 1 / 1 / 0

[2+1+2+3=8]

Marks:8

Answer:

a)According to Demorgan’s law

1) The complement of the sum is equal to the product of the complement.

2) The complement of the product is equal to the sum of the complement.

(X+Y)’=X’.Y’

b) X= (((AB’C)’ + B)’’).B.(A+C’)’

c)

Thereare 1 quad, 2 pairs & 2 blocks
Quad(m3+m7+m15+m11) reduces to RS
Pair (m5+m7) reduces to P’QS
Pair (m7+m6) reduces to P’QR
Block m0=P’Q’R’S’
m12=PQR’S’
Hence the final expressions is F=RS + P’QS + P’QR + PQR’S’ + P’Q’R’S’

d) Canonical SOP Σ F(x,y,z) =x’y’z + x’yz’ + x’yz

=m1+ m2+ m3

=S(1,2,3)

Hide Answer

  • Q7

a) Extramarks has setup its new R&D centre in NOIDA. The company compound has 4 buildings:

Distance between different Blocks:

A-BLOCK TO B -BLOCK / 40 M
B-BLOCK TO C –BLOCK / 70 M
C-BLOCK TO D –BLOCK / 30 M
D-BLOCK TO A –BLOCK / 180 M
A-BLOCK TO C –BLOCK / 100 M
B-BLOCK TO D –BLOCK / 105 M

Number of computers in each block:

BLOCK-A / 20
BLOCK-B / 80
BLOCK-C / 12
BLOCK-D / 20

a1) Suggest a cable layout of connection between the blocks.
a2) Suggest the most suitable place to house the server of the organization with reason.

a3) Suggest the placement of the a) Internet connecting Devices 2) Switch

a4) Which types of network will be suitable if the BLOCKS are to be connected to extension offices in various parts of the city.

b) Write the full form of HTML and WWW.

c) Define the term Topology. Mention different types of topologies.
d) What is APRANET?

e) Define Web Browser.
[4+1+2+1+2=10]

Marks:10

Answer:

a)
a1)

a2) The most suitable block to house the server is B-BLOCK.

a3) 1) B-BLOCK 2) A switch would be needed in all the BLOCKS.

a4) MAN (Metropolitan Area Networks) is suitable.

b)HTML-Hyper Text Markup Language
WWW- World Wide Web

c)The structure or the layout of the networks in which the computer are connected refers to topology. In a topology the workstations are connected to the network. It provides interconnection communication in the network.
There are various types of topologies:

i)Star Topology
ii)Ring Topology
iii)Bus Topology
iv) Tree Topology
v) Mesh Topology

d)APRANET is a research based network. It is sponsored by Department of Defence.

e) A Web Browser is a program that computer runs to communicate with Web servers on the Internet, which enables it to download and display the Web pages that you request.

Model paper 2

  • a) What are SQL comments? How are they implemented?

b) Create a TABLE Employee with thefollowing details -
emp_name VARCHAR2(25)

emp_code NUMBER(5)

Department VARCHAR2(25)

c) Write SQL commands:

STUDENT

ID / NAME / STREAM / FEE / City / TEACHER / Sex
1 / VIBHA AGGARWAL / BIO / 2000 / DELHI / KPD / F
2 / VISHAL GOYAL / ECO / 2500 / DELHI / MMR / M
3 / PRANAV BANSAL / ECO / 1500 / DELHI / CPO / M
4 / MOHINI GUPTA / CS / 2000 / NOIDA / MMR / F
5 / ROHINI GARG / CS / 3000 / NOIDA / KPD / F
6 / RICHA SINGHAL / MAT / 2000 / GHAZIABAD / CPO / F
7 / VIKAS GUPTA / MAT / 3500 / GHAZIABAD / CPO / M
8 / MRIDUL BANSAL / CS / 4000 / NOIDA / CPO / M

i) To show all the records from CS stream.

ii) To show the record of all students residing in Delhi.

iii) To show all the records of Male students.

iv) To show the records of students paying fee more than 3500

v) To show the records of Male students from ECO stream

[2+1+5=8]

Marks:8

Answer:

a)SQL comments refer to the text within the SQL statements that do not affect the execution of SQL statement. A comment begins with /* and ends with */. It can also begin with two hyphen(--) sign

b)
CREATE TABLE EMPLOYEE

(emp_name VARCHAR2(25),

emp_code Number(5)

Department VARCHAR2(25));

c)Queries:

i) SELECT * FROM STUDENT

WHERE STREAM=’CS’;

ii) SELECT * FROM STUDENT

WHERE City=’DELHI’;

iii) SELECT * FROM STUDENT

WHERE Sex=’M’;

iv) SELECT * FROM STUDENT

WHERE FEE>3500;

v) SELECT * FROM STUDENT

WHERE Sex=’M’ AND STREAM=’ECO’;

Hide Answer

  • Q6

a) What is Associative property? Make the truth table.

b) Write the equivalent expression for the following logical circuit:

c) Convert the following three input function F denoted by the expression :

F(X,Y,Z) =(0,1,2,5) into its canonical Sum-of-Products form.

d) Given the truth table below

A / B / C / D / Z
0 / 0 / 0 / 0 / 0
0 / 0 / 0 / 1 / 0
0 / 0 / 1 / 0 / 0
0 / 0 / 1 / 1 / 0
0 / 1 / 0 / 0 / 0
0 / 1 / 0 / 1 / 1
0 / 1 / 1 / 0 / 1
0 / 1 / 1 / 1 / 1
1 / 0 / 0 / 0 / 0
1 / 0 / 0 / 1 / 1
1 / 0 / 1 / 0 / 0
1 / 0 / 1 / 1 / 0
1 / 1 / 0 / 0 / 0
1 / 1 / 0 / 1 / 1
1 / 1 / 1 / 0 / 1
1 / 1 / 1 / 1 / 1

Find a Boolean algebra expression using a Karnaugh map.[2+1+2+3=8]

Marks:8

Answer:

According to Associative Property:

Associative property of addition: X+(Y+Z)=(X+Y)+Z

Associative property of multiplication: X.(Y.Z)=(X.Y).Z

X / Y / Z / Y+Z / X+Y / X+(Y+Z) / (X+Y)+Z
0 / 0 / 0 / 0 / 0 / 0 / 0
0 / 0 / 1 / 1 / 0 / 1 / 1
0 / 1 / 0 / 1 / 1 / 1 / 1
0 / 1 / 1 / 1 / 1 / 1 / 1
1 / 0 / 0 / 0 / 1 / 1 / 1
1 / 0 / 1 / 1 / 1 / 1 / 1
1 / 1 / 0 / 1 / 1 / 1 / 1
1 / 1 / 1 / 1 / 1 / 1 / 1
X / Y / Z / Y.Z / X.Y / X.(Y.Z) / (X.Y).Z
0 / 0 / 0 / 0 / 0 / 0 / 0
0 / 0 / 1 / 0 / 0 / 0 / 0
0 / 1 / 0 / 0 / 0 / 0 / 0
0 / 1 / 1 / 1 / 0 / 0 / 0
1 / 0 / 0 / 0 / 1 / 0 / 0
1 / 0 / 1 / 0 / 0 / 0 / 0
1 / 1 / 0 / 0 / 1 / 0 / 0
1 / 1 / 1 / 1 / 1 / 1 / 1

b)

WX’+Y’Z

c) If three inputs we take as X, Y and Z then

F = m0 + m1 + m2 + m5

m0 = 000 = X'Y'Z'

m1 = 001 = X'Y'Z

m2 = 010 = X'YZ'

m5 = 101 = XY'Z

Canonical S-O-P form of the expression is -

X'Y'Z' + X'Y'Z + X'YZ' + XY'Z

d)

Canonical SOP

Z= AC’D + BD + BC

AB
CD / A’B’ / A’B / AB / AB’
C’D’ / 0 / 0 / 0 / 0
C’D / 0 / 1 / 1 / 1
CD / 0 / 1 / 1 / 1
CD’ / 0 / 1 / 0 / 0

=

Hide Answer

  • Q7

a) CDMA and GSM stands for?

b) New Era School has set up a new communication system network. It has 4 blocks as shown below :

Distance between different Blocks:

A-BLOCK TO B-BLOCK / 60 M
B-BLOCK TO C–BLOCK / 160 M
C-BLOCK TO D–BLOCK / 30 M
A-BLOCK TO D–BLOCK / 180 M
B-BLOCK TO D–BLOCK / 130 M
A-BLOCK TO C–BLOCK / 100 M

Number of computers in each block:

BLOCK-A / 30
BLOCK-B / 60
BLOCK-C / 135
BLOCK-D / 15

b1) Suggest a cable layout of connection between the blocks.
b2) Suggest the most suitable place to house the server of the organization with reason.
b3) Suggest the placement of the 1) Repeater 2) Switch
b4) The school is planning to link its system to the school campus situated in a hilly area where cable connection is not possible. Suggest an economic way to connect it.

c) What is baud rate?

d) What is an e-mail address? Explain.

e) (i) What do you understand by uploading a file? Name the software used for it.

(ii) What is world wide web ?

[1+4+1+2+2=10]

Marks:10

Answer:

a)i) CDMA-Code Division Multiple Access ii) Global System for Mobile Communication

b)

b1)
b2) Since Block-C contains maximum numbers of computers so the most suitable place to house the server would be C-Block.
b3)
1) The cable distance between A and C blocks and that between B and C is quite large thus the repeaters should be needed along their path to avoid the loss of signals.

2) A hub is needed in all the blocks.
b4) The most economic way is to use the Radio Waves Transmission.
c) Baud rate is used to measure the modulation rate i.e. the number of discrete signaling events per second.

d)E-mail stands for Electronic Mail. It is a network address provided by a portal offering e-mail services. This address is same as our postal address. E-mail address is used to send or receive the mails. The format of an e-mail address is “username@hostname”
Example:

Here the username is amit and the host name is extramarks.com.

e) (i) To transfer a file from your computer to your home directory on the host system is called uploading a file. FTP software is used for it.

(ii) The WWW(world wide web) is a set of protocols that allow you to access any document on the internet througj a naming system based on the WWW.

Hide Answer

MODEL PAPER 3

  • a) What is UPDATE command? Explain.

b) Expand DDL and DML.

c) Write SQL commands:

DOCTOR

ID / NAME / DEPT / SEX / SHIFT / EXPERIENCE
1 / VIBHA AGGARWAL / GYN / F / MOR / 12
2 / VISHAL GOYAL / ENT / M / MOR / 10
3 / PRANAV BANSAL / ENT / M / EVE / 09
4 / MOHINI GUPTA / ORT / F / EVE / 09
5 / ROHINI GARG / ORT / F / EVE / 12
6 / ASTHA SINGHAL / ENT / F / MOR / 14
7 / RICHA GUPTA / GYN / F / EVE / 10
8 / MRIDUL BANSAL / SKIN / M / MOR / 05

i)To show all the records from GYN DEPT.

ii) To show the record of all doctors visiting in morning shift.

iii) To show all the records of male doctors.

iv) To show the records of female gynaecologists.

v) To show the records of doctors having more than 12 years of

experience.

[2+1+5 = 8]

Marks:8

Answer:

a)UPDATE command is used to change a value in the table. It is used to update the rows in a table. We can also use ‘where’ clause with UPDATE command.

Syntax:

UPDATE table_name

SET column=value1

[WHERE column=value]

Example:

UPDATE EMPLOYEE

SET BASIC= BASIC +1200

WHERE DEPT=’SALES’

b)
DDL- Data Definition Language.

DML- Data Manipulation Language.

c)Queries:

i) SELECT * FROM DOCTOR

WHERE DEPT=’GYN’;

ii) SELECT * FROM DOCTOR

WHERE SHIFT=’MOR’;

iii) SELECT * FROM DOCTOR

WHERE SEX=’M’;

iv) SELECT * FROM DOCTOR

WHERE DEPT=’GYN’ AND SEX=’F’;

v) SELECT * FROM DOCTOR

WHERE EXPERIENCE>12;

Hide Answer

  • Q5

a)State and algebraically verify Absorption Laws.
b) Write the equivalent Boolean Expression for the following Logic Circuit.

c) Minimise AB + (AC)' + AB'C(AB + C)

d) Write the Product of Sum form of the function H(U,V,W), truth table representation of H is as follows:

U V W H

0 0 0 1

0 0 1 0

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 0

1 1 1 1
[2+2+3+1=8]

Marks:8

Answer:

a) According to Absorption Law: (i) X+(X.Y)= X and (ii) X(X+Y)=X

Proof of X.(X+Y) = X

The truth table for X+(X.Y)= X as given below:

X / Y / (X+Y) / X(X+Y)
0 / 0 / 0 / 0
0 / 1 / 1 / 0
1 / 0 / 1 / 1
1 / 1 / 1 / 1

Column X and X+(X.Y) are identical

X+X.Y = X

L.H.S = X+X.Y

= X.1+X.Y

= X.(1+Y)

= X.1

= X

= R.H.S

X+X’.Y = X+Y

L.H.S. = X+X’.Y

= (X+X’).(X+Y)

= 1.(X+Y)

= X+Y

= R.H.S

b) F(U,V)=U’.V+U.V’

c)AB + (AC)' + AB'C(AB + C) = AB + (AC)' + AB'CAB + AB'CC

= AB + (AC)' + AABB'C + AB'CC

= AB + (AC)' + 0 + AB'CC

= AB + (AC)' + AB'.C

= AB + A' + C' + AB'C

= A' + AB + C' + AB'C

= A' + B + C' + AB'C

=A’+B+ ( C’+ C) (C’+AC)

= A’+B+C’+AC

=A’+B+(C’+C)(C’+A)

=A’+B+C’+A

= B+C’

d)The POS of the function H(U,V,W)

H (U, V, W) = (U+V+W’). (U+ V’+ W’). (U’+V+W). (U’+V’+W)

Hide Answer

  • Q6

a) Expand WWW and TCP/IP

b) Extramarks.com is setting up the network between its different departments. There are 4 departments SOFTWARE, HARDWARE, DEVELOPMENT, VIRTUAL_TEACHING. Distance between different departments is as follows: 4 blocks

Distance between different Blocks:

HARDWARE TO SOFTWARE / 60 M
SOFTWARE TO DEVELOPMENT / 150 M
DEVELOPMENT TO VIRTUEL-TEACHING / 40 M
HARDWARE TO VIRTUAL TEACHING / 190 M
SOFTWARE TO VIRTUAL TEACHING / 125 M
HARDWARE TO DEVELOPMENT / 105 M

Number of computers in each block:

BLOCK-SOFTWARE / 30
BLOCK-HARDWARE / 60
BLOCK-DEVELOPMENT / 135
BLOCK-VIRTUAL TEACHING / 15

b1) Suggest a cable layout of connection between the blocks.
b2) Suggest the most suitable place to house the server of the organization with reason.

b3) Suggest the placement of the 1) Repeater 2) Switch

b4) Extramarks is is planning to link its system to its University Campus situated in a hilly area where cable connection is not possible. Suggest an economic way to connect it.

c) What is a Hub?

d)What is firewall?
e) What is the purpose of MODEM?

f) How does a web browser work?

[1+4+1+1+1+2 = 10]

Marks:10

Answer:

a)i) WWW-World Wide Web

ii) TCP/IP- Transfer Control Protocol/ Internet Protocol

b1)
b2) Since DEVELOPMENT CENTER contains maximum numbers of computers so the most suitable place to house the server would be DEVELOPMENT CENTER.

b3)

1) The repeaters should be needed between HARDWARE CENTER and DEVELOPMENT CENTER and between SOFTWARE CENTER and DEVELOPMENT CENTER to avoid the loss of signals.

2) A hub is needed in all the CENTERS.

b4) The most economic way is to use the Radio Waves Transmission.

c)A Hub is a physical device that connects multiple user stations. A hub establishes a network while maintaining the logical bus or ring configuration of the LAN.

d)A firewall is a computer system or group of system that is designed to prevent unauthorized access to or from a private network Firewalls can be implemented in both hardware and software, or a combination of both.

e)MODEM stands for Modulation-Demodulation. It converts digital signals into analog signals and vice versa.

f) A web browser works by using a protocol called HTTP (Hypertext Transfer Protocol) to request a specially encoded text document from a web server. This text document contains special markup written in HTML (Hypertext Markup Language), which is interpreted by the web browser.

The web browser then renders the documents content in an appropriate manner for user’s convenience.

Hide Answer

MODEL PAPER 4

  • a) Explain WHERE clause.

b) Write SQL commands:

EMPLOYEE

ID / NAME / DEPT / SEX / SHIFT / EXPERIENCE / SALARY
1 / RICHA AGGARWAL / SALES / F / MOR / 12 / 150000
2 / DEEPAK GOYAL / IT / M / MOR / 10 / 140000
3 / AJAY BANSAL / IT / M / EVE / 09 / 120000
4 / RENU GUPTA / MRKTG / F / EVE / 09 / 125000
5 / SHRISTI GARG / MRKTG / F / EVE / 12 / 154000
6 / ASTHA SINGHAL / PROD / F / MOR / 14 / 160000
7 / RACHNA GUPTA / IT / F / EVE / 10 / 150000
8 / MRIDUL BANSAL / SALES / M / MOR / 05 / 100000
9 / PRATEEK GOYAL / SALES / M / MOR / 10 / 123000

i) To show all the records from SALES DEPT.

ii) To show the record of all employees coming in morning shift.

iii) To show All the records of Female Employees.

iv) To show the records of female employees getting salary more than 150000.

v) To show the records of employees having more than 12 years of experience.

vi) To find the number of employees getting salary more than 130000

[2+6=8]

Marks:8

Answer:

a)The WHERE clause is an optional clause. It is followed by the FROM clause. WHERE clause filters rows and specifies the query. WHERE clause helps to make a query only for the selected rows.

Example:SELECT * FROM EMPLOYEE

WHERE DEPT=’SALES’

In the example the result will display all the records from employee table where Department is sales.

b)Queries:

i) SELECT * FROM EMPLOYEE

WHERE DEPT=’SALES’;

ii) SELECT * FROM EMPLOYEE

WHERE SHIFT=’MOR’;

iii) SELECT * FROM EMPLOYEES

WHERE SEX=’F’;

iv) SELECT * FROM EMPLOYEE

WHERE SALARY>150000 AND SEX=’F’;

v) SELECT * FROM EMPLOYEE

WHERE EXPERIENCE>12;

vi) SELECT COUNT (*) FROM EMPLOYEE

WHERE SALARY>130000;

Hide Answer

  • Q6

a) What is a truth table? Make a truth table for (A’+B)’.
b) Write the equivalent boolean expression for the following Logic Circuit :

c) Reduce the expression (XY)' + X' + XY
d) Write the POS form of a Boolean Function F, which is represented by the followingtruth table:

X / Y / Z / F
0 / 0 / 0 / 1
0 / 0 / 1 / 1
0 / 1 / 0 / 0
0 / 1 / 1 / 1
1 / 0 / 0 / 0
1 / 0 / 1 / 1
1 / 1 / 0 / 0
1 / 1 / 1 / 0

[2+2+2+2=8]

Marks:8

Answer:

a)A Truth Table is a table that represents the logical operation of the logical variable. Since a variable can have the value either 0 or 1, the truth table is used to contain all possible inputs.

The Truth Table for (A’+B)’

A / B / A’ / (A’+B) / (A’+B)’
0 / 0 / 1 / 1 / 0
0 / 1 / 1 / 1 / 0
1 / 0 / 0 / 0 / 1
1 / 1 / 0 / 1 / 0

b) (X+Y'). (X'+Y'). (X'+Y')

c) (XY)' + X' + XY

= (X' + Y') + X' + XY

= X' + X' + Y' + XY

= X' + XY + Y'

= (X' + (X')'Y) + Y' = (X' + XY) + Y'

= X' + Y + Y'

= X' + 1

= 1

d)

POS of function F(X,Y,Z) = (X+Y’+Z).(X’+Y+Z).(X’+Y’+Z).(X’+Y’+Z’)

Hide Answer

  • Q7

a) Expand HTTP and TCP/IP

b) University of Extramarks is setting up the network among its different wings. There are 4 wings:

Wing A : JOURNALISM

Wing B : DRAMATICS

Wing C : MULTIMEDIA

Wing D : SCIENCE

Distance between various wings:

A to B / 50 M
B to C / 130 M
C to D / 65 M
A to D / 180 M
B to D / 155 M
A to C / 80 M

Number of computers in each block:

WING A / 30
WING B / 60
WING C / 135
WING D / 15

b1) Suggest a cable layout of connection between the WINGS.
b2) Suggest the most suitable place to house the server of the organization with reason.

b3) Suggest the placement of the 1) Repeater 2) Hub/Switch

b4) Extramarks is planning to link its wings (in Mumbai) to the Development Center located in DELHI. Suggest an economic way to connect it.

c) Give the full form of CDMA.

e) Name the device used to convert digital signals into analog signals and vice versa.

f) What is the difference between web browser and web server ?

[1+4+1+1+1+2 =10]

Marks:8

Answer:

a) i) HTTP-Hyper Text Transfer Protocol

ii) TCP/IP- Transfer Control Protocol/ Internet Protocol
b1)

b2) Since MULTIMEDIA i.e Wing C has the maximum numbers of computers so the most suitable place to house the server would be MULTIMEDIA Wing.

b3)
1) The repeaters should be needed between Wing A & Wing C and between Wing B & Wing C to avoid the loss of signals.

2) A hub is needed in all the Wings.
b4) The most economic way is to use the Radio Waves Transmission.
c) CDMA stands for Code Division Multiple Access.
d) A computer virus as the name suggests is not a virus but a small program that implants itself into other programs. It is termed as virus as it spread in a manner similar to a biological virus.
e) MODEM is used to convert digital signals into analog signals and vice versa.

f) Web browser: A software application for retrieving, presenting and traversing information resources on the World Wide Web.
Example: Internet Explorer, Mozilla Firefox, Google Chrome

Web server: A program on a server computer, somewhere out on the internet, that delivers web pages to web browser.

MODEL PAPER 5

a) (i) Differentiate between Candidate Key and Alternate Key in context of RDBMS.

(ii) Discuss INSERT statement.
b) Create a TABLE Worker with following details
worker_name VARCHAR2(25)

worker_code NUMBER(5)

wages_rate NUMBER(2)

c) Write SQL commands:

TEACHER

ID / NAME / SUBJECT / SALARY / DESIG / DEPt / Sex
1 / REKHA AGGARWAL / BIO / 22500 / PGT / SCIENCE / F
2 / RACHIT GOYAL / ECO / 25500 / PGT / COMMERCE / M
3 / ARUN BANSAL / ECO / 15800 / TGT / COMMERCE / M
4 / MEETA GUPTA / PHYSICS / 20000 / PGT / SCIENCE / F
5 / ROHINI GARG / CHEMISTRY / 25000 / PGT / SCIENCE / F
6 / ARSHI SINGHAL / MATH / 22500 / PGT / SCIENCE / F
7 / AKASH GUPTA / MATH / 17500 / TGT / COMMERCE / M
8 / MRIDUL BANSAL / BUSINESS / 24000 / PGT / COMMERCE / M

i) To show the records of Math teachers.

ii) To show the records of all teachers from SCIENCE department.

iii)To show the records of Male teachers getting salary more than 22000.

iv) To show the details of all the teacher whose designation is PGT.

[2+2+4 = 8]

Marks:8

Answer:

a)(i) Any attribute that uniquely identify a row in a table is candidate key for the table. We select one of the candidate key as Primary key. All candidate keys which are not chosen as primary key are Alternate keys.

(ii) The INSERT Statement is used to add one or more rows to a table. It has two formats to add the rows to the table:

1) Rows can be inserted specifying the values.

2) Rows can also be inserted using the query specification.

Format:

1)INSERT INTO table-1 [(column-list)] VALUES (value-list)2) INSERT INTO table-1 [(column-list)] (query-specification)

b)
CREATE TABLE WORKER

(worker_name VARCHAR2(25),

worker_code Number(5)

wages_rate NUMBER(2));

c)Queries:

i) SELECT * FROM TEACHER

WHERE SUBJECT=’MATH’;

ii) SELECT * FROM TEACHER

WHERE DEPT=’SCIENCE’;

iii) SELECT * FROM TEACHER

WHERE SEX=’M’ AND SALARY>22000;

iv) SELECT * FROM TEACHER

WHERE DESIG=’PGT’;

Hide Answer

  • Q4

a) What is Associative property? Make the truth table.

b)Write the dual of the (x+y).(y+z’)

c) Define Minterm and Maxterm

d) Prove that X.(X + Y) = X by algebraic method.

e) (i) Express P + Q'R in POS form.

(ii) Make a truth table for: X+X’.Y’

[2+1+2+1+2=8]

Marks:8

Answer:

a)

According to Associative Property:

Associative property of addition: X+(Y+Z)=(X+Y)+Z

Associative property of multiplication: X.(Y.Z)=(X.Y).Z

X / Y / Z / Y+Z / X+Y / X+(Y+Z) / (X+Y)+Z
0 / 0 / 0 / 0 / 0 / 0 / 0
0 / 0 / 1 / 1 / 0 / 1 / 1
0 / 1 / 0 / 1 / 1 / 1 / 1
0 / 1 / 1 / 1 / 1 / 1 / 1
1 / 0 / 0 / 0 / 1 / 1 / 1
1 / 0 / 1 / 1 / 1 / 1 / 1
1 / 1 / 0 / 1 / 1 / 1 / 1
1 / 1 / 1 / 1 / 1 / 1 / 1
X / Y / Z / Y.Z / X.Y / X.(Y.Z) / (X.Y).Z
0 / 0 / 0 / 0 / 0 / 0 / 0
0 / 0 / 1 / 0 / 0 / 0 / 0
0 / 1 / 0 / 0 / 0 / 0 / 0
0 / 1 / 1 / 1 / 0 / 0 / 0
1 / 0 / 0 / 0 / 1 / 0 / 0
1 / 0 / 1 / 0 / 0 / 0 / 0
1 / 1 / 0 / 0 / 1 / 0 / 0
1 / 1 / 1 / 1 / 1 / 1 / 1

b)(x' . y') + ( y' . z)

c)Minterm is the product (using AND operator) of n variables in a series x1,x2,x3,x4----xn Whereas Maxterm is the sum (using OR operator) of n variables in a series x1,x2,x3,x4----xn