90 solutions available
Question 1Assertion. The ORDER BY clause of SELECT statement is carried out in the last after executing other clauses of the SELECT statement.Reason....
Question 2Assertion. MOD() and MIN() are numeric functions, yet they are different types of functions.Reason. MOD() is a single-row function and...
Question 3Assertion. The GROUP BY clause can use any type of function.Reason. The GROUP BY clause combines a number of rows in a group and applies...
Question 4Assertion. The GROUP BY clause yields summary results using group functions.Reason. The GROUP BY clause combines a number of rows in a...
Question 5Assertion. Both WHERE and HAVING clauses work with GROUP BY in a SELECT statement.Reason. The WHERE clause is applied before forming groups...
Question 6Assertion. Both WHERE and HAVING clauses are used for specifying conditions.Reason. WHERE and HAVING clauses of the SELECT query can be...
Question 7Assertion. Both WHERE and HAVING clauses are used for specifying conditions.Reason. The WHERE condition is applicable on individual rows...
Question 1Can you arrange the result set of an SQL query on multiple columns ?
Question 2What is the significance of "ORDER BY" in the given query?SELECT emp_id, fname, lname FROM person ORDER BY emp_id;(a) Data of table person...
Question 3What will be the order of sorting in the given query?SELECT emp_id, emp_name FROM person ORDER BY emp_id, emp_name;(a) Firstly on emp_id...
Question 4If column emp_id contains the following set {9, 7, 6, 4, 3, 1, 2}, what will be the output on execution of the given query?SELECT emp_id...
Question 5Which function can you use with ORDER BY clause to specify custom sort order ?(a) SORT()(b) CUSTOM()(c) FIELD()(d) All of these
Question 1To sort the rows of the result table, the ORDER BY clause is specified.
Question 2Columns can be sorted in descending sequence by using the SQL keyword DESC.
Question 3The SQL built-in function SUM totals values in numeric columns.
Question 4The SQL built-in function AVG computes the average of values in numeric columns.
Question 5The SQL built-in function MAX obtains the largest value in a numeric column.
Question 6The SQL built-in function MIN obtains the smallest value in a numeric column.
Question 7The SQL built-in function COUNT computes the number of rows in a table.
Question 8The SELECT clause GROUP BY is used to collect those rows that have the same value in a specified column.
Question 9With GROUP BY queries, aggregate functions are used.
Question 10To specify a condition on groups created by GROUP BY, HAVING clause is used.
Question 1By default, ORDER BY clause lists the results in ............... order.DescendingAnySameAscending
Question 2Which one of the following would arrange the rows in ascending order in SQL ?SORT BYALIGN BYGROUP BYORDER BY
Question 3To create summary results, ............... clause is used.SORT BYSUMMARY BYGROUP BYORDER BY
Question 4Consider the following querySELECT * FROM employee ORDER BY salary ............... , name ............... ;To display the salary from...
Question 5Select correct SQL query from below to find the temperature in increasing order of all cities.SELECT city FROM weather ORDER BY temperature...
Question 6Which SQL function is used to count the number of rows in a SQL query ?COUNT()NUMBER()SUM()COUNT(*)
Question 7Which SQL statement do we use to find out the total number of records present in the table ORDERS ?SELECT * FROM ORDERS;SELECT COUNT(*)...
Question 8With SQL, how can you return the number of not null records in the Project field of "Students" table ?SELECT COUNT(Project) FROM...
Question 9Which of the following is not an aggregate function ?AvgSumWithMin
Question 10All aggregate functions except ............... ignore null values in their input collection.Count(attribute)Count(*)AvgSum
Question 11Which of the following group functions ignore NULL values ?MAXCOUNTSUMAll of these
Question 12The HAVING clause does which of the following ?Acts EXACTLY like a WHERE clause.Acts like a WHERE clause but is used for columns rather...
Question 13Aggregate functions can be used in the select list or the ............... clause of a select statement. They cannot be used in a...
Question 14SQL applies conditions on the groups through ............... clause after groups have been formed.Group byWithWhereHaving
Question 15Which clause is used with "aggregate functions" ?GROUP BYSELECTWHEREBoth (a) and (c)
Question 16What is the meaning of "HAVING" clause in SELECT query ?To filter out the summary groupsTo filter out the column groupsTo filter out the...
Question 17Where and Having clauses can be used interchangeably in SELECT queries ?TrueFalseOnly in viewsWith order by
Question 18Raj, a Database Administrator, needs to display the average pay of workers from those departments which have more than five employees. He...
Question 1The rows of the result relation produced by a SELECT statement can be sorted, but only by one column.
Question 2The HAVING clause acts like a WHERE clause, but it identifies groups that meet a criterion, rather than rows.
Question 3The qualifier DISTINCT must be used in an SQL statement when we want to eliminate duplicate rows.
Question 4DISTINCT and its counterpart, ALL, can be used more than once in a SELECT statement.
Question 5DISTINCT and its counterpart, ALL, can be used together on single field in a SELECT statement.
Question 6COUNT(field_name) tallies only those rows that contain a value; it ignores all null values.
Question 7SUM, AVG, MIN, and MAX can only be used with numeric columns.
Question 8The SQL statement : SELECT Salary + Comm AS Total FROM Emp; adds two fields salary and comm from each row together and lists the results in...
Question 9ORDER BY can be combined with the SELECT statements.
Question 10The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the same value in a column.
Question 1Anjali writes the following commands with respect to a table employee having fields, empno, name, department, commission :Command1: Select...
Question 2What is the use of ORDER BY clause ?
Question 3What is the default sort order of ORDER BY clause ?
Question 4Write an example query that sorts on three columns.
Question 5Write a query that sorts the data of table student on the basis of Project-Group (in ascending order), section (in descending order), Marks...
Question 6What is the difference between HAVING and WHERE clause ?
Question 7What is the use of GROUP BY clause ?
Question 8What are aggregate functions? What is their use? Give some examples.
Question 9What type of functions can you use with GROUP BY and HAVING clauses ?
Question 10Harjat has created the table EMP in his database.Table :...
Question 1Table BOOK_INFORMATIONColumn NameBOOK_IDBOOK_TITLEPRICEWhich SQL statement allows you to find the highest price from the table...
Question 2Table SALESColumn NameSTORE_IDSALES_DATESALES_AMOUNTWhich SQL statement lets you find the sales amount for each store?SELECT STORE_ID,...
Question 3Table SALESColumn NameSTORE_IDSALES_DATESALES_AMOUNTWhich SQL statement lets you list all stores whose total sales amount is over 5000...
Question 4Table SALESColumn NameSTORE_IDSALES_DATESALES_AMOUNTWhich SQL statement lets you find the total number of stores in the SALES table?SELECT...
Question 5Table SALESColumn NameSTORE_IDSALES_DATESALES_AMOUNTWhich SQL statement allows you to find the total sales amount for Store ID 25 and the...
Question 6Table EXAM_RESULTSSTU IDFNAMELNAMEEXAM...
Question 7Table EXAM_RESULTSSTU IDFNAMELNAMEEXAM...
Question 8Table EXAM_RESULTSSTU IDFNAMELNAMEEXAM...
Question 9Table EXAM_RESULTSSTU IDFNAMELNAMEEXAM...
Question 10Given the following table :Table :...
Question 11Given the following table :Table :...
Question 12In a Database, there are two tables given below :Table : EMPLOYEEEMPLOYEEIDNAMESALESJOBIDE1SUMIT SINHA1100000102E2VIJAY SINGH...
Question 13Show the average salary for all departments with more than 3 people for a job.
Question 14Display only the jobs with maximum salary greater than or equal to 3000.
Question 15Find out number of employees having "Manager" as Job.
Question 16List the count of employees grouped by deptno. (table EMPL)
Question 17List the sum of employees' salaries grouped by department. (table EMPL)
Question 18List the maximum salary of employee grouped by their department number.
Question 19Below are the customer and order tables :Customerscustomer id (PK)first_namelast_nameemailaddresscitystatezipOrdersorder id...
Question 20Below are the customer and order tables :Customerscustomer id (PK)first_namelast_nameemailaddresscitystatezipOrdersorder id...
Question 21Below are the customer and order tables :Customerscustomer id (PK)first_namelast_nameemailaddresscitystatezipOrdersorder id...
Question 22Below are the customer and order tables :Customerscustomer id (PK)first_namelast_nameemailaddresscitystatezipOrdersorder id...
Question 23Below are the customer and order tables :Customerscustomer id (PK)first_namelast_nameemailaddresscitystatezipOrdersorder id...
Question 24Below are the customer and order tables :Customerscustomer id (PK)first_namelast_nameemailaddresscitystatezipOrdersorder id...
Question 25Schemas of tables EMPL, Dept, SalaryGrade are being shown below :EMPL (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) SALARYGRADE...
Question 26Schemas of tables EMPL, Dept, SalaryGrade are being shown below :EMPL (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) SALARYGRADE...
Question 27Give output for following SQL queries as per given table(s) :Table : GARMENTGCODEDescriptionPriceFCODEREADYDATE10023PENCIL...
Question 28Give output for following SQL queries as per given table(s) :Table : PRODUCTP_IDProductNameManufacturerPriceTPO1Talcom PowderLAK40FW05Face...
Question 29Give output for following SQL queries as per given table(s) :Table : ITEMI_IDItemNameManufacturerPricePC01Personal...
Question 30Give output for following SQL queries as per given table(s) :Table : SENDERSenderIDSenderNameSenderAddressSenderCityND01R Jain2, ABC...