Explore topic-wise InterviewSolutions in .

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

To explain I WOULD say: Get-ChildItem is USED to get the contents of a folder or REGISTRY KEY.

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

The EXPLANATION: Exists is used to check for the EXISTENCE of tuples.

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

For explanation: With is USED to CREATE temporary relation and its not an AGGREGATE FUNCTION.

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

The explanation: Select name, salary, avg salary from INSTRUCTOR I1, lateral (select avg(salary) as avg salary from instructor I2 where I2.dept name= I1.dept name);

WITHOUT the lateral CLAUSE, the SUBQUERY cannot access the correlation variable I1 from the outer query.

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

To EXPLAIN I would say: The with clause PROVIDES a WAY of defining a temporary relation whose definition is available only to the QUERY in which the with clause OCCURS.

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

For explanation: Aggregate FUNCTIONS PERFORM a calculation on a set 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

Explanation: Server-scoped DYNAMIC MANAGEMENT VIEW is stored only in the Master DATABASE.

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

Explanation: The INFORMATION_SCHEMA views allow you to retrieve METADATA about the objects WITHIN a database.These views can be found in the master database under Views / System Views and be called from any database in your SQL SERVER instance.

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

The explanation is: SCHEMABINDING binds the view to the schema of the underlying table or TABLES. When SCHEMABINDING is SPECIFIED, the base table or tables cannot be modified in a WAY that would affect the view definition.

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

To ELABORATE: DROP VIEW REMOVES one or more views from the CURRENT database.

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

To explain: Dynamic Management Views were introduced in SQL Server 2005. These Views give the administrator information of the DATABASE about the current STATE of the SQL Server machine.

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

Explanation: SQL CREATE VIEW Syntax:CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition.

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

The explanation is: Views are a valuable tool for the SQL Server DEVELOPER because they hide COMPLEXITY and allow for a readable style of SQL EXPRESSION.

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

The best explanation: VIEW is a virtual table, through which a selective PORTION of the DATA from one or more tables can be SEEN. A view do not contain data of their own.

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

Best explanation: VIEWS created on indexed Columns are often used because of performance optimization PROBLEMS.

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

For explanation I would SAY: Cartesian Join is simply the JOINING of one or more table which returns the product of all the ROWS in these tables.

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

The explanation is: JOIN can be used for more than ONE table. For ‘N’ tables the no of join conditions REQUIRED are ‘n-1’.

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

For explanation: A ‘CORRELATED subquery’ is a term USED for SPECIFIC types of queries in SQL in computer databases. It is a subquery (a query nested inside another query) that uses values from the outer query in its WHERE clause.

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

To explain I would say: Subquery—also referred to as an inner query or inner select—is a SELECT STATEMENT embedded within a data MANIPULATION LANGUAGE (DML) statement or nested within another subquery.

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

The explanation: Equi-join JOINS only same data entry field. For example, one table contains department ID and another table should contain department id.

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

To explain I would say: The SQL SUBQUERY is a SELECT query that is embedded in the main SELECT statement. In many CASES, a subquery can be used instead of a JOIN.

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

To EXPLAIN I would say: Outer JOIN RETURNS the row having matching as well as NON matching values.

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

The explanation: The BETWEEN OPERATOR is used to select values WITHIN a RANGE.

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’

To elaborate: Subquery—also REFERRED to as an inner query or inner select—is a SELECT STATEMENT embedded within a DATA manipulation LANGUAGE (DML) statement or nested within another subquery.

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’)

The best explanation: The IN operator allows you to specify multiple VALUES in a WHERE clause.

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

Easiest EXPLANATION: The LIKE operator is used in a WHERE CLAUSE to search for a specified PATTERN in a column.

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

Explanation: The ORDER BY keyword SORTS the RECORDS in ascending order by default.

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

For EXPLANATION: The SQL WHERE clause is USED to filter the results and apply conditions in a SELECT, INSERT, UPDATE, or DELETE statement.

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

The explanation is: Rollback is USED for undoing the work DONE in the current transaction. This command also releases the locks if any hold by the current transaction.

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

To explain: Commit command is used to permanently SAVE any TRANSACTION into the DATABASE.

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’

To elaborate: In its simplest form, the syntax for the UPDATE statement when UPDATING one table is:UPDATE table SET column1 = expression1,column2 = EXPRESSION2,… WHERE conditions.

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

Easy EXPLANATION: The ORDER BY keyword SORTS the records in ascending order by default.

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

The explanation is: The SELECT DISTINCT statement is USED to return only distinct (DIFFERENT) VALUES.

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

The explanation is: The SQL UNION operator is used to combine the RESULT sets of 2 or more SELECT STATEMENTS. It removes duplicate ROWS between the various SELECT statements.

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

Best EXPLANATION: The SQL UPDATE Query is used to modify the existing records in a table. You can use WHERE CLAUSE with UPDATE query to update SELECTED rows otherwise all the rows WOULD be affected.

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

Easiest EXPLANATION: The ALTER TABLE statement is used to add, DELETE, or modify columns.

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

For explanation: COUNT(column_name) is used to count the NUMBER of rows of a table where column name is a column that does not allow NULL values.

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

Explanation: The SQL SELECT statement queries DATA from TABLES in the database.

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’

Explanation: The SQL LIKE clause is used to compare a VALUE to SIMILAR values using wildcard OPERATORS.

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

For explanation I WOULD say: Data Manipulation Language is used to MODIFY the records in the database.

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

Easiest explanation: SQL Aliases are defined for columns and tables. Basically aliases are created to make the column selected more readable.

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

The explanation: The SQL TRUNCATE COMMAND is used to delete all the ROWS from the table and 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.