InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which of the following command is used to get child items in powershell?(a) Get-Child(b) Set-Alias(c) Get-Command(d) Get-ChildItemThe question was posed to me in an interview.My query is from Powershell in section Laying the Foundation of SQL Server |
|
Answer» The CORRECT answer is (d) Get-ChildItem |
|
| 2. |
We can test for the nonexistence of tuples in a subquery by using the __________ construct.(a) Not exist(b) Not exists(c) Exists(d) ExistThe question was asked by my school teacher while I was bunking the class.I want to ask this question from Aggregation of Data topic in section Laying the Foundation of SQL Server |
|
Answer» Correct option is (B) Not EXISTS |
|
| 3. |
Which of the following is not an aggregate function?(a) Avg(b) Sum(c) With(d) MinI got this question during an interview.My question is based upon Aggregation of Data in chapter Laying the Foundation of SQL Server |
|
Answer» Right option is (c) With |
|
| 4. |
The ________ keyword is used to access attributes of preceding tables or subqueries in the from clause.(a) In(b) Lateral(c) Having(d) WithThe question was posed to me in a job interview.Enquiry is from Aggregation of Data topic in division Laying the Foundation of SQL Server |
|
Answer» The correct option is (b) Lateral |
|
| 5. |
SQL applies predicates in the _______ clause after groups have been formed, so aggregate functions may be used.(a) Group by(b) With(c) Where(d) HavingI got this question in an online quiz.My doubt stems from Aggregation of Data topic in section Laying the Foundation of SQL Server |
|
Answer» Correct answer is (b) With |
|
| 6. |
Aggregate functions are functions that take a ___________ as input and return a single value.(a) Collection of values(b) Single value(c) Double value(d) All of the mentionedI had been asked this question by my school principal while I was bunking the class.My question is taken from Aggregation of Data topic in division Laying the Foundation of SQL Server |
|
Answer» Correct CHOICE is (a) Collection of values |
|
| 7. |
___________ isstored only in the Master database.(a) Database-scoped Dynamic Management View(b) Complex View(c) Catalog View(d) None of the mentionedThe question was posed to me in an interview.I need to ask this question from Views topic in division Laying the Foundation of SQL Server |
|
Answer» Correct ANSWER is (d) None of the mentioned |
|
| 8. |
Which of the following is not a SQL Server INFORMATION_SCHEMA view?(a) INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE(b) INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS(c) INFORMATION_SCHEMA.KEY_COLUMN_USAGE(d) sys.dm_exec_connectionsI had been asked this question in an internship interview.I'd like to ask this question from Views topic in portion Laying the Foundation of SQL Server |
|
Answer» Right option is (d) sys.dm_exec_connections |
|
| 9. |
What is SCHEMABINDING a VIEW?(a) Schema binding binds your views to the dependent physical columns of the accessed tables specified in the contents of the view(b) These are stored only in the Master database(c) These types of view are defined by users on a specified schema(d) These are used to show database self describing informationI got this question during an interview.Origin of the question is Views topic in section Laying the Foundation of SQL Server |
|
Answer» Right answer is (b) These are stored only in the Master database |
|
| 10. |
You can delete a view with ___________ command.(a) DROP VIEW(b) DELETE VIEW(c) REMOVE VIEW(d) TRUNCATE VIEWThis question was posed to me by my school principal while I was bunking the class.My question is based upon Views in division Laying the Foundation of SQL Server |
|
Answer» Right option is (a) DROP VIEW |
|
| 11. |
Dynamic Management View is a type of ___________(a) System Defined Views(b) User Defined View(c) Simple View(d) Complex ViewThis question was posed to me by my school principal while I was bunking the class.My question is taken from Views topic in portion Laying the Foundation of SQL Server |
|
Answer» The correct ANSWER is (a) System DEFINED VIEWS |
|
| 12. |
Syntax for creating views is __________(a) CREATE VIEW AS SELECT(b) CREATE VIEW AS UPDATE(c) DROP VIEW AS SELECT(d) CREATE VIEW AS UPDATEI got this question in an interview.My doubt is from Views in section Laying the Foundation of SQL Server |
|
Answer» The correct OPTION is (a) CREATE VIEW AS SELECT |
|
| 13. |
SQL Server has mainly how many types of views?(a) one(b) two(c) three(d) fourThis question was posed to me in a job interview.My enquiry is from Views topic in portion Laying the Foundation of SQL Server |
|
Answer» RIGHT OPTION is (b) two Easiest EXPLANATION: In SQL Server we have two types of views-System DEFINED Views and User Defined View. |
|
| 14. |
Which of the following statement is true?(a) Views could be looked as an additional layer on the table which enables us to protect intricate or sensitive data based upon our needs(b) Views are virtual tables that are compiled at run time(c) Creating views can improve query response time(d) All of the MentionedI had been asked this question during an internship interview.This intriguing question originated from Views in division Laying the Foundation of SQL Server |
|
Answer» Correct ANSWER is (d) All of the Mentioned |
|
| 15. |
What is a view?(a) A view is a special stored procedure executed when certain event occurs(b) A view is a virtual table which results of executing a pre-compiled query(c) A view is a database diagram(d) None of the MentionedThe question was posed to me during an interview for a job.I'm obligated to ask this question of Views in portion Laying the Foundation of SQL Server |
|
Answer» Correct answer is (B) A view is a virtual table which results of executing a pre-compiled query |
|
| 16. |
Which of the following is not a limitation of view?(a) ORDER BY Does Not Work(b) Index Created on View Used Often(c) Cross Database Queries Not Allowed in Indexed View(d) Adding Column is Expensive by Joining Table Outside ViewThe question was asked in an online interview.The origin of the question is Views in portion Laying the Foundation of SQL Server |
|
Answer» Right answer is (b) INDEX Created on View Used OFTEN |
|
| 17. |
The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T?(a) Equi-join(b) Natural join(c) Outer join(d) Cartesian joinI have been asked this question in an interview for job.My question is taken from Joins topic in chapter Laying the Foundation of SQL Server |
|
Answer» Right ANSWER is (d) CARTESIAN join |
|
| 18. |
Which is not a type of join in T-SQL?(a) Equi-join(b) Natural join(c) Outer join(d) Cartesian joinThe question was posed to me in an online quiz.My question is taken from Joins in section Laying the Foundation of SQL Server |
|
Answer» RIGHT answer is (b) Natural join The explanation is: A NATURAL JOIN is an INNER join where the RDBMS AUTOMATICALLY selects the join columns based on common columns names. Some RDBMS vendors, LIKE Oracle but not SQL Server, implement a NATURAL JOIN operator. |
|
| 19. |
How many tables may be included with a join?(a) One(b) Two(c) Three(d) All of the MentionedI had been asked this question in a job interview.I'd like to ask this question from Joins topic in division Laying the Foundation of SQL Server |
|
Answer» The correct option is (d) All of the Mentioned |
|
| 20. |
Which of the following is a correlated subquery?(a) Uses the result of an inner query to determine the processing of an outer query(b) Uses the result of an outer query to determine the processing of an inner query(c) Uses the result of an inner query to determine the processing of an inner query(d) Uses the result of an outer query to determine the processing of an outer queryThe question was posed to me in final exam.I would like to ask this question from Joins in portion Laying the Foundation of SQL Server |
|
Answer» The correct choice is (a) Uses the result of an inner QUERY to determine the processing of an outer query |
|
| 21. |
Which of the following statements is true concerning subqueries?(a) Involves the use of an inner and outer query(b) Cannot return the same result as a query that is not a subquery(c) Does not start with the word SELECT(d) All of the mentionedI had been asked this question in examination.Enquiry is from Joins topic in chapter Laying the Foundation of SQL Server |
|
Answer» Right option is (a) Involves the USE of an inner and outer query |
|
| 22. |
The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T WHERE CUSTOMER_T. CUSTOMER_ID = ORDER_T. CUSTOMER_ID?(a) Equi-join(b) Natural join(c) Outer join(d) Cartesian joinThis question was addressed to me in my homework.The question is from Joins in section Laying the Foundation of SQL Server |
|
Answer» The correct OPTION is (a) Equi-join |
|
| 23. |
A UNION query is which of the following?(a) Combines the output from no more than two queries and must include the same number of columns(b) Combines the output from no more than two queries and does not include the same number of columns(c) Combines the output from multiple queries and must include the same number of columns(d) Combines the output from multiple queries and does not include the same number of columnsThe question was posed to me in semester exam.This interesting question is from Joins topic in division Laying the Foundation of SQL Server |
|
Answer» CORRECT choice is (c) COMBINES the output from multiple QUERIES and must include the same number of columns Easiest explanation: A single UNION can COMBINE only 2 sql query at a time. |
|
| 24. |
Which of the following is one of the basic approaches for joining tables?(a) Subqueries(b) Union Join(c) Natural join(d) All of the MentionedThis question was addressed to me during an interview for a job.I would like to ask this question from Joins topic in chapter Laying the Foundation of SQL Server |
|
Answer» The CORRECT answer is (d) All of the Mentioned |
|
| 25. |
What type of join is needed when you wish to return rows that do have matching values?(a) Equi-join(b) Natural join(c) Outer join(d) All of the MentionedThe question was asked in a job interview.I need to ask this question from Joins in section Laying the Foundation of SQL Server |
|
Answer» The correct ANSWER is (d) All of the Mentioned |
|
| 26. |
What type of join is needed when you wish to include rows that do not have matching values?(a) Equi-join(b) Natural join(c) Outer join(d) All of the MentionedI have been asked this question in an international level competition.My question is based upon Joins topic in division Laying the Foundation of SQL Server |
|
Answer» RIGHT choice is (c) OUTER JOIN Easiest EXPLANATION: OUTER JOIN is the only join which shows the UNMATCHED rows. |
|
| 27. |
The command to remove rows from a table ‘CUSTOMER’ is __________________(a) DROP FROM CUSTOMER(b) UPDATE FROM CUSTOMER(c) REMOVE FROM CUSTOMER(d) DELETE FROM CUSTOMER WHEREThis question was posed to me in exam.The query is from Basic SQL in division Laying the Foundation of SQL Server |
|
Answer» CORRECT choice is (d) DELETE FROM CUSTOMER WHERE For explanation I would say: The SQL DELETE Query is used to delete the existing records from a table. You can USE WHERE CLAUSE with the DELETE query to delete SELECTED ROWS. |
|
| 28. |
Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79.(a) SELECT * FROM weather WHERE humidity IN (63 to 79)(b) SELECT * FROM weather WHERE humidity NOT IN (63 AND 79)(c) SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79(d) SELECT * FROM weather WHERE humidity NOT BETWEEN 63 AND 79The question was asked during an interview.I need to ask this question from Basic SQL topic in section Laying the Foundation of SQL Server |
|
Answer» Correct choice is (C) SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79 |
|
| 29. |
Find all the tuples having a temperature greater than ‘Paris’.(a) SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’(b) SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = ‘Paris’)(c) SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = ‘Paris’)(d) SELECT * FROM weather WHERE temperature > ‘Paris’ temperatureThe question was asked during an interview.My enquiry is from Basic SQL topic in division Laying the Foundation of SQL Server |
|
Answer» The correct answer is (a) SELECT * FROM WEATHER WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’ |
|
| 30. |
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.(a) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70(b) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70(c) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70(d) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70The question was asked in an online quiz.Origin of the question is Basic SQL topic in portion Laying the Foundation of SQL Server |
|
Answer» CORRECT answer is (c) SELECT city, temperature, CONDITION FROM WEATHER WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70 The EXPLANATION: The AND operator displays a record if both the first condition AND the second condition are true. The OR operator displays a record if either the first condition OR the second condition is true. |
|
| 31. |
Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.(a) SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)(b) SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)(c) SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)(d) SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);I have been asked this question during an interview for a job.Origin of the question is Basic SQL topic in portion Laying the Foundation of SQL Server |
|
Answer» The CORRECT ANSWER is (a) SELECT CITY, TEMPERATURE, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’) |
|
| 32. |
What is the meaning of LIKE ‘%0%0%’?(a) Feature begins with two 0’s(b) Feature ends with two 0’s(c) Feature has more than two 0’s(d) Feature has two 0’s in it, at any positionThis question was posed to me in an international level competition.Query is from Basic SQL in portion Laying the Foundation of SQL Server |
|
Answer» The correct OPTION is (d) Feature has two 0’s in it, at any position |
|
| 33. |
SQL query to find the temperature in increasing order of all cities.(a) SELECT city FROM weather ORDER BY temperature(b) SELECT city, temperature FROM weather(c) SELECT city, temperature FROM weather ORDER BY temperature(d) SELECT city, temperature FROM weather ORDER BY cityThe question was asked at a job interview.Query is from Basic SQL topic in chapter Laying the Foundation of SQL Server |
|
Answer» Right option is (d) SELECT CITY, temperature FROM WEATHER ORDER BY city |
|
| 34. |
SQL query to find all the cities whose humidity is 95.(a) SELECT city WHERE humidity = 95(b) SELECT city FROM weather WHERE humidity = 95(c) SELECT humidity = 89 FROM weather(d) SELECT city FROM weatherThe question was asked by my school principal while I was bunking the class.The doubt is from Basic SQL in chapter Laying the Foundation of SQL Server |
|
Answer» The correct CHOICE is (b) SELECT city FROM WEATHER WHERE humidity = 95 |
|
| 35. |
Which TCL command undo all the updates performed by the SQL in the transaction?(a) ROLLBACK(b) COMMIT(c) TRUNCATE(d) DELETEI got this question in an online quiz.This is a very interesting question from Basic SQL topic in division Laying the Foundation of SQL Server |
|
Answer» Right ANSWER is (b) COMMIT |
|
| 36. |
Which of the following command makes the updates performed by the transaction permanent in the database?(a) ROLLBACK(b) COMMIT(c) TRUNCATE(d) DELETEThis question was addressed to me by my school teacher while I was bunking the class.Asked question is from Basic SQL in chapter Laying the Foundation of SQL Server |
|
Answer» Correct answer is (b) COMMIT |
|
| 37. |
How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?(a) UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’(b) MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’(c) MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’(d) UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’The question was asked in class test.I need to ask this question from Basic SQL in portion Laying the Foundation of SQL Server |
|
Answer» Correct OPTION is (d) UPDATE Persons SET LASTNAME=’Nilsen’ WHERE LastName=’Hansen’ |
|
| 38. |
Which SQL keyword is used to sort the result-set?(a) ORDER BY(b) SORT(c) ORDER(d) SORT BYThe question was asked during an interview.My query is from Basic SQL in division Laying the Foundation of SQL Server |
|
Answer» The correct OPTION is (a) ORDER BY |
|
| 39. |
Which SQL statement is used to return only different values?(a) SELECT DIFFERENT(b) SELECT UNIQUE(c) SELECT DISTINCT(d) SELECT ALLI got this question in unit test.This is a very interesting question from Basic SQL in chapter Laying the Foundation of SQL Server |
|
Answer» Correct answer is (C) SELECT DISTINCT |
|
| 40. |
The UNION SQL clause can be used with _____________(a) SELECT clause only(b) DELETE and UPDATE clauses(c) UPDATE clause only(d) All of the mentionedI have been asked this question during an internship interview.My question is taken from Basic SQL in section Laying the Foundation of SQL Server |
|
Answer» The correct option is (a) SELECT CLAUSE only |
|
| 41. |
The UPDATE SQL clause can _____________(a) update only one row at a time(b) update more than one row at a time(c) delete more than one row at a time(d) delete only one row at a timeI had been asked this question in an online interview.This is a very interesting question from Basic SQL in chapter Laying the Foundation of SQL Server |
|
Answer» Correct choice is (b) update more than one row at a time |
|
| 42. |
What does the ALTER TABLE clause do?(a) The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints(b) The SQL ALTER TABLE clause is used to insert data into database table(c) THE SQL ALTER TABLE deletes data from database table(d) The SQL ALTER TABLE clause is used to delete a database tableThis question was posed to me during an interview for a job.My question comes from Basic SQL topic in chapter Laying the Foundation of SQL Server |
|
Answer» Right choice is (a) The SQL ALTER TABLE CLAUSE modifies a table definition by altering, adding, or deleting table COLUMNS and/or constraints |
|
| 43. |
With SQL, how can you return the number of not null records in the “Persons” table?(a) SELECT COUNT() FROM Persons(b) SELECT COLUMNS() FROM Persons(c) SELECT COLUMNS(*) FROM Persons(d) SELECT COUNT(*) FROM PersonsI have been asked this question in class test.I want to ask this question from Basic SQL in division Laying the Foundation of SQL Server |
|
Answer» The CORRECT choice is (a) SELECT COUNT() FROM Persons |
|
| 44. |
With SQL, how can you return all the records from a table named “Persons” sorted descending by “FirstName”?(a) SELECT * FROM Persons SORT BY ‘FirstName’ DESC(b) SELECT * FROM Persons ORDER FirstName DESC(c) SELECT * FROM Persons SORT ‘FirstName’ DESC(d) SELECT * FROM Persons ORDER BY FirstName DESCI have been asked this question during an online interview.My doubt stems from Basic SQL in division Laying the Foundation of SQL Server |
|
Answer» Correct choice is (d) SELECT * FROM Persons ORDER BY FirstName DESC |
|
| 45. |
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?(a) SELECT * FROM Persons WHERE FirstName=’a’(b) SELECT * FROM Persons WHERE FirstName LIKE ‘a%’(c) SELECT * FROM Persons WHERE FirstName LIKE ‘%a’(d) SELECT * FROM Persons WHERE FirstName=’%a%’This question was addressed to me in an internship interview.Enquiry is from Basic SQL topic in portion Laying the Foundation of SQL Server |
|
Answer» Right answer is (c) SELECT * FROM PERSONS WHERE FirstName LIKE ‘%a’ |
|
| 46. |
What does DML stand for?(a) Different Mode Level(b) Data Model Language(c) Data Mode Lane(d) Data Manipulation languageI have been asked this question in final exam.My question comes from Basic SQL in section Laying the Foundation of SQL Server |
|
Answer» The CORRECT OPTION is (d) Data Manipulation language |
|
| 47. |
What is the purpose of the SQL AS clause?(a) The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column(b) The AS clause is used with the JOIN clause only(c) The AS clause defines a search condition(d) All of the mentionedI have been asked this question during an interview.This intriguing question comes from Basic SQL in section Laying the Foundation of SQL Server |
|
Answer» Correct ANSWER is (a) The AS SQL clause is used to change the name of a COLUMN in the RESULT SET or to ASSIGN a name to a derived column |
|
| 48. |
Which of the following statement is true?(a) DELETE does not free the space containing the table and TRUNCATE free the space containing the table(b) Both DELETE and TRUNCATE free the space containing the table(c) Both DELETE and TRUNCATE does not free the space containing the table(d) DELETE free the space containing the table and TRUNCATE does not free the space containing the tableThis question was posed to me in an internship interview.The origin of the question is Basic SQL in division Laying the Foundation of SQL Server |
|
Answer» Correct CHOICE is (a) DELETE does not free the SPACE CONTAINING the table and TRUNCATE free the space containing the table |
|
| 49. |
If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default ______________(a) ASC(b) DESC(c) There is no default value(d) None of the mentionedI got this question by my school principal while I was bunking the class.Enquiry is from Basic SQL in chapter Laying the Foundation of SQL Server |
|
Answer» CORRECT answer is (a) ASC Easy explanation: ASC is the default sort ORDER. Null VALUES are treated as the lowest POSSIBLE values. |
|
| 50. |
________________ is not a category of SQL command.(a) TCL(b) SCL(c) DCL(d) DDLThe question was posed to me during an interview.Query is from Basic SQL in division Laying the Foundation of SQL Server |
|
Answer» RIGHT answer is (b) SCL The explanation is: SQL commands can be used not only for searching the database but also to PERFORM VARIOUS other functions.They are DDL,DML,TCL and DCL. |
|