Self Studies

Databases Test ...

TIME LEFT -
  • Question 1
    1 / -0

    In which case would you use a FULL OUTER JOIN?

  • Question 2
    1 / -0

    The number of rows returned by SQL query on the given EMP table is ________

    SELECT *

    FROM EMP

    WHERE eno NOT IN (

    SELECT manager FROM EMP);

    eno

    ename

    manager

    1

    a

    2

    2

    b

    3

    3

    c

    4

    4

    d

    NULL

  • Question 3
    1 / -0

    Given two tables EMPLOYEE (EID, ENAME, DEPTNO)

                DEPARTMENT (DEPTNO. DEPTNAME)

    Find the most appropriate statement of the given query:

                  Select count (*) total

                  from EMPLOYEE where DEPTNO IN (D1, D2)

                  group by DEPTNO

                  having count (*) >5 

  • Question 4
    1 / -0

    Consider a relation EdTech(Year, Famous, Popular) columns contain turnover in crores of Famous and Popular organization. If a cell contains null means turnover was not calculated for that particular year.

    EdTech

    Year

    Famous

    Popular

    1998

    10

    19

    1999

    15

    null

    2000

    null

    15

    2001

    21

    null

    2002

    16

    17

    2003

    23

    22

    2004

    13

    null

    2005null12
    20061918
    2007null16

     

    SQL query on the above relation is SELECT AVG(Popular)  FROM EdTech.

    What is the output of the given SQL query (answer upto 1 decimal place)?

  • Question 5
    1 / -0

    Given relations R(w, x) and S(y, z), the result of SELECT DISTINCT w, x from R, S is guaranteed to be same as R, provided.

  • Question 6
    1 / -0

    Consider a Student table, it has two attributes which are the student_name and student seat_no. The student seat number is not null and also it is unique.  

    The SQL statement is

    Select count(*) from Student

    where seat_no  ≤  All (Select seat_no from Student);

    What is the output of the above statement?

  • Question 7
    1 / -0

    A relational database contains two tables Traveler and Visited as shown below:

    Traveler

    ID

    Name

    E01

    Arya

    E02

    Shruti

    E03

    Zahida

    E04

    Madhu

    E05

    Hiteshri

    E06

    Archana

    E07

    Shradha

     

    Visited

    ID

    Month

    City

    Amount

    E02

    November

    Gangapur

    10K

    E01

    October

    Mumbai

    30K

    E02

    March

    Basti

    10K

    E01

    January

    Godda

    20K

    E06

    April

    Gorakhpur

    15K

    The primary key of the Traveler table is ID. For the Visited table, the columns

    ID and City together form the primary key. Consider the SQL query given

    below:

    SELECT T.Name, sum(V.Amount)

    FROM Traveler T, Visited V

    WHERE T.ID = V.ID OR V.Amount = 30 K

    GROUP BY T.Name;

    The number of rows returned by the above SQL query is ________.

  • Question 8
    1 / -0

    Consider the following relational schema:

    employee(empId,empName,empDept)

    customer(custId,custName,salesRepId,rating)

    salesRepId is a foreign key referring to empId of the employee relation. Assume that each

    employee makes a sale to at least one customer. What does the following query return?

    SELECT empName FROM employee E

    WHERE NOT EXISTS (SELECT custId FROM customer C WHERE C.salesRepId = E.empId

    AND C.rating <> ’GOOD’);

  • Question 9
    1 / -0

    Consider a database with the relation schema STUDENT(StId, StName, and CourseName). An instance of the schema STUDENT is given below 

    STUDENT

    StId

    StName

    CourseName

    1

    XYA

    AAA

    2

    XYB

    AAA

    3

    XYC

    AAA

    4

    XYD

    ABB

    5

    XYE

    ABB

    6

    XYF

    ABB

    7

    XYG

    ABB

    8

    XYH

    ACC

    9

    XYI

    ACC

    10

    SYJ

    ADD

    11

    XYK

    ADD

    12

    XYL

    ADD

    13

    XYM

    AEE

    14XYNAEE

    SQL query on the above instance is are given below.

    SELECT AVG(S.cnt

    FROM S

    WHERE(CourseName, cnt) IN

              (SELECTED CourseName, COUNT(StId) AS

                                                        CourseName, cnt)

               FROM STUDENT

               GROUP BY CourseName)

     

    The output of executing the SQL query is _________.

  • Question 10
    1 / -0

    Database table name Tuition_Records is given below

    Students

    Teachers

    Fees

    Aniket

    Uday

    10000

    Barbie

    Rishi

    7000

    Chandresh

    Uday

    12000

    Dharma

    Rishi

    9000

     

    SELECT count(*) FROM ((SELECT students, Teachers FROM Tuition_Records) AS A NATURAL JOIN (SELECT Teachers, Fees FROM Tuition_Records))

    What is the output of the following SQL query?

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 10

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
Submit Test
Selfstudy
Selfstudy
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now