79 solutions available
Question 1Assertion (A): COUNT() function ignores distinct values.Reasoning (R): Distinct clause ignores duplicate values.Both A and R are true and R...
Question 2Assertion (A): The HAVING clause is used with GROUP BY clause and aggregate functions.Reasoning (R): WHERE clause specifies the condition...
Question 3Assertion (A): SQL queries are performed on a table created under a database.Reasoning (R): The database is a folder created by the user in...
Question 4Assertion (A): Aggregate functions in SQL operate on multiple set of values and return a single value as the output.Reasoning (R): The...
Question 5Assertion (A): A Join is a query that combines rows from two or more tables.Reasoning (R): Equi-joins are joins based on equality...
Question 6Assertion (A): The INTERSECT operator returns all rows that are in both result sets.Reasoning (R): The UNION and INTERSECT yields same...
Question 7Assertion (A): GROUP BY clause is always preceded by ORDER BY clause in a SELECT statement.Reasoning (R): ORDER BY clause always follows...
Question 8Assertion (A): All aggregate functions except count(*) ignore null values in their input collection.Reasoning (R): SUM, AVG, MIN, and MAX...
Question 1ABC Associates has over 2000 employees on its roll and deals with customer support services. Help the company to perform associated...
Question 2Select all records where dept no of both emp and dept table matches.
Question 3If there are two tables emp and emp1, and both have common records, how can we fetch all the records but common records only once?
Question 4How can we fetch only common records from two tables emp and emp1?
Question 5How can we retrieve all records of emp that are not present in emp1?
Question 6Count the total salary deptno wise where more than 2 employees exist.
Question 7Suppose there is annual salary information provided by emp table. How can we fetch monthly salary of each and every employee?
Question 8Select all records from emp table where deptno = 10 or 40.
Question 9Select all records from emp table where deptno = 30 and sal > 1500.
Question 10Count number of managers (MGR column) and their salary in emp table.
Question 11How can we display all the employees grouped together on the basis of deptno and sal in descending order?
Question 1The Group/Aggregate function works with data of multiple rows at a time and returns aggregated value.
Question 2The ORDER BY clause lets you arrange the result set in ascending or descending order.
Question 3To specify filtering condition for groups, the HAVING clause is used in MySQL.
Question 4By default, the ORDER BY clause sorts the result-set in the Ascending order.
Question 5To sort the result set in descending order, DESC keyword is used with ORDER BY.
Question 6Two types of MySQL functions are single row functions and Multiple row functions.
Question 7The Count(*) function returns the total number of rows, including duplicates and NULL in a table.
Question 8Group functions are also known as Aggregate functions.
Question 9In MySQL, Distinct option causes a group function to consider only unique values of the argument expression.
Question 10The MIN() function returns the lowest value from the given column or expression.
Question 1What will be the order of the data being sorted after the execution of given SQL query?SELECT * FROM STUDENT ORDER BY ROLL_NO;Custom...
Question 2Which values will not be considered by SQL while executing the following statement?SELECT COUNT(column name) FROM DEPARTMENT;Numeric...
Question 3Which of the following clauses is used to sort the result set?SORT BYGROUP BYARRANGE BYORDER BY
Question 4Which clause is used in query to place the condition on groups in MySQL?WHEREHAVINGGROUP BYBoth (i) & (ii)
Question 5If column "Marks" contains the data set {25, 35, 25, 35, 38}, what will be the output after the execution of the given query?SELECT...
Question 6If column "Salary" contains the data set {10000,15000,25000,10000,15000}, what will be the output after the execution of the given...
Question 7What SQL statement do we use to find the total number of records present in the table Product?SELECT * FROM PRODUCT;SELECT COUNT(*) FROM...
Question 8What SQL statement do we use to display the record of all students whose last name contains 5 letters ending with "A"?SELECT * FROM...
Question 9Which of the following functions is not an aggregate function?ROUND()SUM()COUNT()AVG()
Question 10Which of the following functions is used to find the largest value from the given data in MySQL?MAX()MAXIMUM()LARGEST()BIG()
Question 11Consider a table named Employees with columns — EName, Age, Salary and Designation. Which SQL statement do we use to find out the total...
Question 12Which clause in SQL is used to apply a condition on a group?WhereHavingAsOn
Question 13In SQL, which function is used to extract a date from a date expression?Now()Curdate()Date()Day()
Question 1What are single row and multiple row functions?
Question 2What is the significance of GROUP BY clause in an SQL query?
Question 3What is the difference between WHERE and HAVING clause in SQL select command?
Question 4Write a query to find out the sum, average, lowest and highest marks in Student table.
Question 5Write a query to find out the sum, average, lowest and highest marks of the students in Student table grouped by STREAM.
Question 6Consider the table "Item" given below and give the outputs on the basis of it:Table: ITEMItemnoInamePrice...
Question 7Define a function. Why are they useful?
Question 8Write commands to display the system date.
Question 9Write a command to display the name of the current month.
Question 10Write a command to print the day of the week of your birthday in the year 1999.
Question 11What is the difference between SYSDATE() and NOW() function?
Question 12Consider two fields—B_date, which stores the birth date, and J_date, which stores the joining date of an employee. Write commands to find...
Question 13Write a query to find out the number of students in each Stream in STUDENT table.
Question 14Consider the given table Faculty and answer the questions that follow:Table:...
Question 15Consider the following EMP and DEPT tables:Table:...
Question 16Write a MySQL command for creating a table PAYMENT whose structure is given below:Table: PAYMENTField NameData...
Question 17Consider the table Product shown below:Table: PRODUCTP_IDProductNameManufacturerPriceP001MoisturizerXYZ40P002SanitizerLAC35P003Bath...
Question 18Consider the table RESULT given below. Write commands in MySQL for (a) to (d) and output for (e) to (g):Table:...
Question 19Write the SQL query commands based on the following table:Table:...
Question 20Consider the CUSTOMERS table having the following records:Table:...
Question 21Consider the following tables WORKER and PAYLEVEL and answer the questions:Table: WORKERECODENAMEDESIGPLEVELDOJDOB11Sachin...
Question 22Consider the tables given below and answer the questions that follow:Table:...
Question 23Consider the following structure of TEACHER and STUDENT table:Table: TEACHERTeacherIDTNameCitySubjectQualificationDesignationPayTable:...
Question 24Consider the following table and answer the questions that follow:Table: TEACHERIDNameDepartmentHiredateCategoryGenderSalary1Tanya...
Question 25Write SQL commands and the output for the following queries:Table:...
Question 26Consider the following table:Table: ITEMItemnoInamePriceQuantity101Soap50100102Powder10050103Facecream15025104Pen50200105Soapbox20100Write...
Question 27Write the output produced by the following SQL commands:(a) SELECT POW(2,3);(b) SELECT ROUND(123.2345, 2) ,ROUND(342.9234,-1);(c) SELECT...
Question 1The ORDER BY clause combines all those records that have identical values in a particular field or a group of fields.
Question 2The WHERE clause is used to specify filtering conditions for groups.
Question 3DISTINCT option causes a group function to consider only the unique values of the argument expression.
Question 4By default, ORDER BY clause sorts the result set in descending order.
Question 5COUNT() function ignores null values while counting the records.
Question 6The return value of MAX() function is a numeric value.
Question 7Multiple row function is also known as scalar function.
Question 8SUM() function is used to count the total number of records in a table.
Question 9Argument type of AVG() function can be numeric or string data type.
Question 10Group functions can be applied to any numeric values, some text types and DATE values.