Batch 1 - Theory Internal Quiz

10 Questions

SettingsSettingsSettings
Please wait...
Batch 1 - Theory Internal Quiz

.


Questions and Answers
  • 1. 
    If a sorted set(emp) in REDIS has the following values {satish:50, tom:30,ram:20,sam:90} The output of the command zrevrange emp 0 1 will be
    • A. 

      Ram,tom

    • B. 

      Satish,sam

    • C. 

      Sam,satish

    • D. 

      Tom,sam

  • 2. 
    The number of bits required to store the word "NoSQL" in ASCII is
    • A. 

      40

    • B. 

      30

    • C. 

      5

    • D. 

      36

  • 3. 
    Late materialization is the process of
    • A. 

      First building rows from columns before applying conditions

    • B. 

      First applying conditions on specific columns and building rows

    • C. 

      Retrieving specific rows from the disc

    • D. 

      Retrieving all rows from the disc

  • 4. 
    The command zcard students on a sorted set by name students containing {sam 20, ram 50, jeff 30,chris 80} will return
    • A. 

      Sam , ram, jeff, chris

    • B. 

      80,30,50,20

    • C. 

      20 ,50, 30, 80

    • D. 

      4

  • 5. 
    Consider the document in a student collection { "name" : "", "marks" : [ 25, 35, 45, 12, 9 ] } The query db.student.find({},{marks:{$slice:-1},_id:0,name:0}) will display
    • A. 

      25,35

    • B. 

      Error Message

    • C. 

      9

    • D. 

      9,12

  • 6. 
    The query to write the first two documents of employee collection to another collection by name testcollection is
    • A. 

      Db.employee.aggregate({$skip:2},{$out:"testcollection"})

    • B. 

      Db.employee.aggregate({$limit:2},{$out:"testcollection"})

    • C. 

      Db.employee.aggregate({$out:"testcollection", $limit:2})

    • D. 

      Db.employee.aggregate({$out:"testcollection",$skip:2})

  • 7. 
    Consider a employee collection as given { "name" : "sam", "address" : vellore, " gender" : " male" } { "name" : " harini", "address" : "mumbai ", " gender " : " female " } { "name" : " Tina", "address" : "goa ", gender: " female " } { "name" : " ram", "address" : " pune ", gender: " " male " } The query to display the count of employees gender wise is
    • A. 

      Db.employee.aggregate({$group:{_id:"$male",total_count:{$sum:1}}})

    • B. 

      Db.employee.aggregate({$group:{_id:"$female",total_count:{$sum:1}}})

    • C. 

      Db.student.find({$group:{_id:"$gender",total_count:{$sum:1}}})

    • D. 

      Db.student.aggregate({$group:{_id:"$gender",total_count:{$sum:1}}})

  • 8. 
    Consider a employee collection as given { "name" : "sam", "address" : vellore, " gender" : " male" } { "name" : " harini", "address" : "goa ", " gender " : " female " } { "name" : " Tina", "address" : "goa ", gender: " female " } { "name" : " ram", "address" : " vellore ", gender: " " male " } The output of the following query will be db.employee.find({$nor:[{"address":{$eq:goa}},{"gender":{$eq:"female"}}]})
    • A. 

      Documents of sam and harini will be displayed

    • B. 

      Documents of tina and ram will be displayed

    • C. 

      Documents of harini and tina will be displayed

    • D. 

      Documents of ram and sam will be displayed

  • 9. 
    Consider a student collection as given { "name" : "sam", "marks" :10,"city" : "mumbai " } { "name" : " harini", "marks" :20,"city" : "goa "} { "name" : " Tina", "marks" :30,"city" : "mumbai "} { "name" : " ram", "marks" :40,"city" : "goa" } The query to display sum of marks for all students for each city is
    • A. 

      Db.student.aggregate({$group:{_id:"$city",total:{$sum:"1"}}})

    • B. 

      Db.student.aggregate({$group:{_id:"$city",total:{$sum:"marks"}}})

    • C. 

      Db.student.find({$group:{_id:"$city",total:{$sum:"$salary"}}})

    • D. 

      Db.student.aggregate({$group:{_id:"$city",total:{$sum:"$salary"}}})

  • 10. 
    If a sorted set(emp) in REDIS has the following values {satish:50, tom:30,ram:20,sam:90} The output of the command zrank emp satish  will be
    • A. 

      50

    • B. 

      0

    • C. 

      30

    • D. 

      2

Back to Top Back to top