Database Management System (3330703) MCQs

MCQs of Relational Algebra and implementation using SQL

Showing 11 to 20 out of 60 Questions
11.

Choose the equery that matches the below image 

નીચે આપેલ image ને મેચ થતી હોય તે ક્વેરી સિલેક્ટ કરો

(a)

Select [List]  from [Table A] A inner join [Table B] B on A.value=B.value

(b)

Select [List]  from [Table A] A full outer join [Table B] B on A.value=B.value where A.value is null or B.value is null

(c)

Select [List] from [Table A] A right join [Table B] B on A.value=B.value where A.value is null

(d)

Select [List] from [Table A] A full outer join [Table B] B on A.value=B.value

Answer:

Option (b)

12.

If we want to retrieve only all employees, whether or not they have matching departments in the departments table. Then which query is right?

Employee

Name Department Salary
Aman 10 56000
Mukesh 14 35000
Kishan 12 48000
Hardik 13 25000
Ashok   12000

 Department

ID Department
10 HR
11 Admin
12 Technical
13 Marketing
14 Sales

જો આપણે ફક્ત બધા employees ને રીટ્રાઇવ કરવા હોય, તેમનું ડીપાર્ટમેન્ટ, ડીપાર્ટમેન્ટ ટેબલ માં હોય અથવા ના પણ હોય તો તેમના માટે નીચે ના માંથી કઈ ક્વેરી સાચી છે?

Employee

Name Department Salary
Aman 10 56000
Mukesh 14 35000
Kishan 12 48000
Hardik 13 25000
Ashok   12000

 Department

ID Department
10 HR
11 Admin
12 Technical
13 Marketing
14 Sales
(a)

select Name, Department from Employee left outer join Department on (Employee.Department = Department.ID);

(b)

select Name, Department from Employee right outer join Department on (Employee.Department = Department.ID);

(c)

select Name, Department from Employee full outer join Department on (Employee.Department = Department.ID);

(d)

select Name, Department from Employee outer join Department on (Employee.Department = Department.ID);

Answer:

Option (a)

13.

Following tables are available with following attributes, then write query to find out the name of students with their department name having backlog 0.

(નીચે ટેબલ ની સાથે તેમના એટ્રીબ્યુટ ની માહિતી આપેલ છે,હવે તેની મદદ થી તેવા સ્ટુડન્ટ નું નામ,ડીપાર્ટમેન્ટ નું નામ ડિસ્પ્લે કરવો જેમને 0 બેકલોગ હોય તો તેના માટેની ક્વેરી લખો)

(a)

select sname,dname,backlog from student,department,academic where department.did = academic.did and Department.rno=student.rno and academic.backlog=0;

(b)

select sname,dname,backlog from student,department,academic where department.dname = academic.did and academic.rno=student.rno and academic.backlog=0;

(c)

select sname,dname,backlog from student,department,academic where department.did = academic.did and academic.rno=student.rno and academic.backlog=0;

(d)

select sname,dname,backlog from student,department,academic where department.dname = academic.did and academic.rno=student.rno and academic.backlog<>0;

Answer:

Option (b)

14.

Choose the type of join that matches the below image 

Join

નીચે આપેલ image ને મેચ થતુ હોય તે જોઈન નું નામ આપો

Join

(a)

Natural Join

(b)

Left Outer Join

(c)

Right Outer Join

(d)

Equi Join

Answer:

Option (c)

15.

If we want to display name of staff with their manager name then which of the following query is true for it ?

Employee

E_ID Name M_ID
101 Mukesh 102
102 Amit 102
103 Piyush 105
104 Nitin 101
105 Arvind  

જો આપણે સ્ટાફ ના નામ ની સાથે તેમના મેનેજર નું નામ પણ ડિસ્પ્લે કરવું હોય તો નીચે ના માંથી કઈ ક્વેરી સાચી છે?

Employee

E_ID Name M_ID
101 Mukesh 102
102 Amit 102
103 Piyush 105
104 Nitin 101
105 Arvind  
(a)

select a.name as "Name", b.name as "Manager Name" from employee a,employee a where b.e_id=a.m_id;

(b)

select a.name as "Name", b.name as "Manager Name" from employee a,employee b where b.e_id=a.m_id;

(c)

select a.name as "Name", b.name as "Manager Name" from employee a,employee b where a.e_id=b.m_id;

(d)

select a.name as "Name", b.name as "Manager Name" from employee a,employees b where b.e_id=a.m_id;

Answer:

Option (b)

16.

Following query is know as ________ sub query 

select name,salary from faculty parent where sal > (select avg(salary) from faculty where parent.did = did);

નીચે આપેલ ક્વેરી ____ પ્રકારની સબ ક્વેરી છે

select name,salary from faculty parent where sal > (select avg(salary) from faculty where parent.did = did);

(a)

Single Row

(b)

Multiple Row

(c)

Correlated 

(d)

There is a error in query.

Answer:

Option (c)

17.

Total no. of columns in a table is refered as ________

(ટેબલ માં ટોટલ નંબર ઓફ કોલમ ને _____ તરીકે ઓળખવામાં આવે છે)

(a)

Cardinality

(કાર્ડીનલીટી)

(b)

Tuple

(ટપલ)

(c)

Arity

(એરિટી)

(d)

Domain

(ડોમેઈન)

Answer:

Option (c)

18.

Total no. of rows/records in a table is refered as ________

(ટેબલ માં ટોટલ નંબર ઓફ રો/રેકોર્ડ ને _____ તરીકે ઓળખવામાં આવે છે)

(a)

Cardinality

(કાર્ડીનલીટી)

(b)

Tuple

(ટપલ)

(c)

Arity

(એરિટી)

(d)

Domain

(ડોમેઈન)

Answer:

Option (a)

19.

How many attributes is/are required for super key ?

(સુપર કી કેટલા એટ્રીબ્યુટ ને આપી શકાય છે ?)

(a)

1

(b)

1 or more than 1

(1 અથવા 1 કરતા વધારે)

Answer:

Option (b)

20.

Consider attributes RollNo, Branch,Name,Semester,SPI  Which one of this can be considered as a super key?

(RollNo, Branch,Name,Semester,SPI જો એટ્રીબ્યુટ હોય તો નીચે આપેલ માંથી કયું ઓપ્શન સુપર કી માટે સાચું છે ?)

(a)

RollNo, Name

(b)

Branch, Name

(c)

RollNo, Branch, Name

(d)

RollNo, Name, Semester 

Answer:

Option (c)

Showing 11 to 20 out of 60 Questions