MCQ Questions - Python, SQL , ML, R

 

Multiple Choice Questions for Data Science Practice Exams

MCQ Questions - Python, SQL , ML, R

All MCQ Questionshttps://www.algaestudy.com/search/label/MCQ

1. Which data type can be used to represent position in a hierarchy?

  • Hierarchy
  • Hierarchyid (correct)
  • Nhierarchyid
  • None of the above


2. How is Column wise insertion of data different from simply passing values to a table?

  • Column wise data leads in populating data on optional basis i.e. whether user wanted to insert data in a column or not. (correct)
  • We can’t pass value to a table without mentioning column names in an insert statement.
  • Passing values to a table without column names is always safe
  • None of the above.


3. Can insert be used in place of update?

  • TRUE
  • FALSE (correct)
  • It is replacement of update
  • None of the above



4. What will be the output of the below code? x=1,2

  • List
  • Error (correct)
  • Dictionary
  • Tuple



5. Out of the below data types which can be used for Date & time type?

  • Date
  • Datetimeoffset
  • Time
  • All (correct)


6. Which category Delete query exits?

  • BPL
  • DDL
  • TCL
  • DML (correct)



7. Suppose x = (1,2,3,4), Which code below is incorrect?

  • max(x)
  • min(x)
  • x[2] = 5 (correct)
  • x[1]


8. What is the purpose of Order By Clause in SQL server?

  • It is used to change sequence order of columns
  • It is used to sort the result. (correct)


9. Is TOP used in Delete Query?

  • TRUE
  • FALSE (correct)


10. A loop becomes infinite loop if a condition never becomes TRUE

  • No (correct)
  • Yes


11. Suppose your data is the heights of 50 males and you want to arrange it in decreasing order. Which of the following functions will you use?
  • arrange()
  • sort() (correct)
  • descending()

12. Tuples are mutable
  • False (correct)
  • TRUE

13. The second part of if, that is executed when the condition is false
  • if
  • else (correct)
  • for
  • input

14. What does the term 'debug' mean?
  • Identify errors and fix them. (correct)
  • Making a calculation
  • A set of instructions
  • Looking at code

15. Which of the following is a correctly-formatted comment in Python?
  • #Comment (correct)
  • Comment
  • &Comment
  • !Comment

16. To solve a problem that requires the user to enter 10 numbers would use what type of iteration (preffered)?
  • While loop
  • For loop (correct)
  • Variable
  • Selection

17. What will be the output of the code  X=1,2 ?
  • Dictionary
  • Error (correct)
  • Tuple
  • List

18. What syntax can you use to insert a line break between strings so that they appear over multiple lines?
  • /
  • \n (correct)
  • \l
  • n

19. What will be the consequence of omitting ‘Where’ clause in Update Statement?
  • No effect on the query as well as on table.
  • All records present in the table will be updated (correct)
  • Only one record will be updated
  • None of the above

20. Which data type is used to store binary data up to the limit of 2,147,483,647?
  • Image (correct)
  • Text
  • Ntext
  • None of the above

21. Which one is correct syntax for Insert Statement?
  • Insert table_name Columns(Col1, Col2,Col3);
  • Insert into table_name (Col1, Col2,Col3) VALUES (Val1,Val2,Val3); (correct)
  • Insert Columns(Col1, Col2,Col3) VALUE (Val1, Val2,Val3) Into table_name
  • None of the above

22. If a command is not complete at the end of a line, R will give a different prompt, by default it is ____.
  • *
  • ?
  • + (correct)


23. Which one is correct from the following statements Statement
1: list and tuples can contain any type of objects Statement
2: list and tuples can contain only characters Statement
3: Lists and tuples are like arrays Statement
4: Lists and tuples are like non-array objects
  • 1 &4
  • 1 & 4
  • 1 &3 (correct)
  • 2 &4

24. Out of the below data types which can be used for Date & time type?
  • Date
  • Date time offset
  • Time
  • All (correct)

25. What is the purpose of Order By Clause in SQL server?
  • It is used to change sequence order of columns
  • It is used to sort the result. (correct)

26. What would be the output of the following?
"Length(seq(1,30,5))"
  • 1 6 11 16 21 26
  • 5 (correct)
  • 5 10 15 20 25 30
  • 6

27. Can insert be used in place of update?
  • TRUE
  • FALSE (correct)
  • It is replacement of update
  • None of the above

28. How is Column wise insertion of data different from simply passing values to a table
  • Column wise data leads in populating data on optional basis i.e. whether user wanted to insert data in a column or not. (correct)
  • We can’t pass value to a table without mentioning column names in an insert statement.
  • Passing values to a table without column names is always safe.
  • None of the above.

29. Which one is not a part of Control Statements?
  • Pass statement
  • Break statement
  • While statement (correct)
  • Continue statement

30. What is the purpose of CAST function in SQL server?
  • It converts or casts an expression of 1 data type to another. (correct)
  • It cannot be in SQL Server
  • Add description to statement
  • None of the above

31. Is there any function in SQL server which can be used to check whether value can be Casted or not? If yes, name it.
  • No there is no method (correct)
  • Try_Cast
  • CAST
  • None of the above


32. What is the default size of n in a column which is defined as VARCHAR?
  • NULL
  • 0 (correct)
  • 1
  • None of the above

33. Which of the following is used for generating sequences?
  • seq()
  • c()
  • sequence() (correct)
  • All of the above

34. The JOIN which returns all the records from the right table in conjunction with the matching records from the left table and if there are no matching values in the left table, it returns NULL. Which is this JOIN?
  • CROSS JOIN
  • Right JOIN (correct)
  • Full OUTER JOIN
  • LEFT Join

35. What are the basic data types in the python
  • Int
  • Float
  • String
  • All the above (correct)


36. The JOIN which does Cartesian Product is called?
  • Left Outer Join
  • Left Join
  • Cross Join (correct)
  • Right Outer Join

37. Is there any function in SQL server which can be used to check whether value can be Casted or not? If yes, name it.
  • No there is no method
  • Try_Cast
  • CAST
  • None of the above (correct)

38. Can we use UNION operator in SELECT statement which contains TABLE collection expressions?
  • False
  • TRUE (correct)

39. Which function in SQL server is used to insert a string into another string?
  • FILL
  • STUFF
  • MERGE (correct)
  • None of the above

40. We cannot write single if statements without else statement
  • False
  • TRUE (correct)

No comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services