Sat 20 April 2024
Baydari.com

Q1. SQL is

  • A. Procedural language
  • B. Non-procedural language
  • C. Not a data sublanguage
  • D. None
Click Here To View The Answer Answer: B. Non-procedural language

 SQL is non-procedural language. 


Q2. 2. To form a projection with SQL:

  • A. Name the relation to be projected and list the columns to be shown
  • B. The keywords SELECT and FROM are optional
  • C. The columns to be obtained arte listed before the keyword SELECT
  • A. The table to be used is listed before the keyword FROM
Click Here To View The Answer Answer: A. Name the relation to be projected and list the columns to be shown

 To form a projection with SQL Name the relation to be projected and list the columns to be shown.





Q3. 3. To remove duplicate rows, this qualifier must be specified:

  • A. ONLY
  • B. UNIQUE
  • C. DISTINCT
  • D. SINGLE
Click Here To View The Answer Answer:

 To remove duplicate rows, this qualifier must be specified DISTINCT.




Q4. To form a projection with SQL:

  • A. Name the relation to be projected and list the columns to be shown
  • B. The keywords SELECT and FROM are optional
  • C. The columns to be obtained arte listed before the keyword SELECT
  • A. The table to be used is listed before the keyword FROM
Click Here To View The Answer Answer: A. Name the relation to be projected and list the columns to be shown

 To form a projection with SQL Name the relation to be projected and list the columns to be shown.





Q5. Which SQL keyword is used to name a new table and describe the table's columns?

  • A. Set
  • B. create
  • C. Alter
  • D. Modify
Click Here To View The Answer Answer: B. create

Create SQL keyword is used to name a new table and describe the table's columns.




Q6. Which SQL keyword is used to change the structure, properties or constraints of a table?

  • A. Set
  • B .create
  • C. Alter
  • D. Modify
Click Here To View The Answer Answer: C. Alter

Alter SQL keyword is used to change the structure, properties or constraints of a table.




Q7. If table PRODUCT has a column PRICE with data type Numeric (8,2), it stores values as:

  • A. 8 digits, decimal point and 2 more digits
  • B. 6 digits, decimal point and 2 more digits
  • C. 10 digits with no stored decimal point
  • D. 8 digits with no stored decimal point
Click Here To View The Answer Answer: D. 8 digits with no stored decimal point

If table PRODUCT has a column PRICE with data type Numeric (8,2), it stores values as  8 digits with no stored decimal point



Q8. If the table PRODUCT has a column PRICE that has the data type Numeric (8,2), the value 12345 will be displayed by the DBMS as:

  • A. 123.45
  • B. 12345
  • C. 12345.00
  • D. 123450.00
Click Here To View The Answer Answer: A. 123.45

 If the table PRODUCT has a column PRICE that has the data type Numeric (8,2), the value 12345 will be displayed by the DBMS as 123.45




Q9. Which SQL keyword is used to delete a table's structure?

  • A. Delete
  • B. drop
  • C. update
  • D. Alter
Click Here To View The Answer Answer: B. drop

 Drop SQL keyword is used to delete a table's structure.




Q10. When the correct SQL command is used to delete a table's structure, what happens to the data in the table

  • A. If deleted table was a parent table, data is added to the appropriate rows of the child table.
  • B. If deleted table was a child table, data is added to the appropriate rows of the parent table.
  • C. The data in the table is also deleted.
  • D. Nothing because there was no data in the table - only an empty table can be deleted. b. drop
Click Here To View The Answer Answer: C. The data in the table is also deleted.

 The data in the table is also deleted  the correct SQL command is used to delete a table's structure, what happens to the data in the table.





Q11. In an SQL query, which SQL keyword is used to specify the table(s) to be used

  • A. EXISTS
  • B. Update
  • C. From
  • D. Set
Click Here To View The Answer Answer: C. From

In an SQL query,  SQL keyword  From is used to specify the table(s) .

Q12. The asterisk (*) means that:

  • A. All columns of table are to be obtained
  • B. All records meeting the criteria are returned
  • C. All records with partial criteria met are returned
  • D. None of the above
Click Here To View The Answer Answer: A. All columns of table are to be obtained

 The asterisk (*) means that  All columns of table are to be obtained




Q13. Which SQL keyword is used to state the condition to specifies the rows to be selected

  • A. EXISTS
  • B. Where
  • C. From
  • D. Select
Click Here To View The Answer Answer: B. Where

Where SQL keyword is used to state the condition to specifies the rows to be selected





Q14. In an SQL query, which SQL keyword is used to join two conditions that both must be true for the rows to be selected?

  • A. EXISTS
  • B. AND
  • C.IN
  • D. OR
Click Here To View The Answer Answer: B. AND

 In an SQL query,  SQL keyword is used to join  AND two conditions that both must be true for the rows to be selected



Q15. In an SQL query, which built-in function is used to compute the number of rows in a table?

  • A. AVG
  • B. Max
  • C. Min
  • D. Count
Click Here To View The Answer Answer: D. Count

In an SQL query, Count built  function is used to compute the number of rows in a table.





Q16. In an SQL query, which built-in function is used to total numeric columns?

  • A. AVG
  • B. SUM
  • C. Min
  • D. Count
Click Here To View The Answer Answer: B. SUM

 In an SQL query,  SUM built function is used to total numeric columns.





Q17. In SQL, which built-in function is used to compute the average value of numeric columns?

  • A. AVG
  • B. MEAN
  • C. Min
  • D. Count
Click Here To View The Answer Answer: A. AVG

 In SQL, AVG built-in function is used to compute the average value of numeric columns.





Q18. In an SQL, which built-in function is used to obtain largest value of numeric columns

  • A. AVG
  • B. MAX
  • C. Min
  • D. Count
Click Here To View The Answer Answer: B. MAX

 In an SQL,  MAX  built-in function is used to obtain largest value of numeric columns.




Q19. In SQL, which built-in function is used to obtain the smallest value of numeric columns

  • A. AVG
  • B. MIN
  • C. LOWEST
  • D. Count
Click Here To View The Answer Answer: B. MIN

 In SQL,  MIN built-in function is used to obtain the smallest value of numeric columns.




Q20. In an SQL query, which SQL keyword is used with built-in functions to group rows that have the same value in a specified column together

  • A. GROUP BY
  • B. ORDER BY
  • C. SELECT
  • D. SORT BY
Click Here To View The Answer Answer: A. GROUP BY

In an SQL query, GROUP BY SQL keyword is used with built-in functions to group rows that have the same value in a specified column together.




Q21. Which SQL keyword is used with GROUP BY to select groups meeting specified criteria?

  • A. AND
  • B. EXISTS
  • C. HAVING
  • D. IN
Click Here To View The Answer Answer: C. HAVING

 HAVING SQL keyword is used with GROUP BY to select groups meeting specified criteria




Q22. Given a table with the structure: EMPLOYEE (Exmp No, Name, Salary, Hire Date), which of the following is not a valid ANSI SQL command

  • A. SELECT * FROM EMPLOYEE WHERE Name LIKE 'Ja%';
  • B. SELECT COUNT(*) FROM EMPLOYEE WHERE Salary < 30000;
  • C. SELECT COUNT(EmpNo) FROM EMPLOYEE;
  • D. SELECT HireDate, COUNT(*) FROM EMPLOYEE WHERE Salary < 30000;
Click Here To View The Answer Answer: D. SELECT Hire Date, COUNT(*) FROM EMPLOYEE WHERE Salary < 30000;

 Given a table with the structure: EMPLOYEE (ExmpNo, Name, Salary, Hire Date),SELECT Hire Date, COUNT(*) FROM EMPLOYEE WHERE Salary < 30000;  not a valid ANSI SQL command.





Q23. In an SQL query, which SQL keyword is used to implement a subquery?

  • A. GROUP BY
  • B. HAVING
  • C. ORDER BY
  • D. Select
Click Here To View The Answer Answer: A. GROUP BY

In an SQL query, GROUP BYSQL keyword is used to implement a subquery.


 


Q24. When one SQL query is embedded in WHERE clause of another SQL query, it is called:

  • A. Subset
  • B. Joins
  • C. WHERE Query
  • D. Subquery
Click Here To View The Answer Answer: D. Subquery

 When one SQL query is embedded in WHERE clause of another SQL query, it is called: Subquery




Q25. In an SQL query, which SQL keyword is used to specify the names of tables to be joined?

  • A. FROM
  • B. HAVING
  • C. JOIN
  • D. Select
Click Here To View The Answer Answer: A. FROM

In an SQL query, FROM SQL keyword is used to specify the names of tables to be joined.




Q26. In SQL, which SQL keyword is used to specify the condition(s) for a join operation?

  • A. FROM
  • b. HAVING
  • C. Where
  • D. Select
Click Here To View The Answer Answer: C. Where

 In SQL, Select SQL keyword is used to specify the condition(s) for a join operation.





Q27. Regarding the interchangeability of subqueries and joins

  • A. Join can always be used as an alternative to a subquery, and a subquery can always be used as an alternative to a join.
  • B. A join can sometimes be used as an alternative to a subquery, and a subquery can sometimes be used as an alternative to a join.
  • C. A join can always be used as an alternative to a subquery, and a subquery can sometimes be used as an alternative to a join.
  • D. A join can sometimes be used as an alternative to a subquery, and subquery can always be used as an alternative to a join.
Click Here To View The Answer Answer: B. A join can sometimes be used as an alternative to a subquery, and a subquery can sometimes be used as an alternative to a join.

 Regarding the interchangeability of subqueries and joins  a join can sometimes be used as an alternative to a subquery, and a subquery can  sometimes be used as an alternative to a join.




Q28. Which SQL keyword is used to add one or more rows to a table?

  • A. MODIFY
  • B. INSERT
  • C. SELECT
  • D. INSERT
Click Here To View The Answer Answer: D. INSERT


Q29. Which SQL keyword is used to change one or more rows in a table

  • A. MODIFY
  • B. INSERT
  • C. SELECT
  • D. UPDATE
Click Here To View The Answer Answer: D. UPDATE

UPDATE SQL keyword is used to change one or more rows in a table.





Q30. Which SQL keyword is used to change a column value?

  • A. CHANGE
  • B. INSERT
  • C. SELECT
  • D. Set
Click Here To View The Answer Answer: D. Set

 Set SQL keyword is used to change a column value.




Q31. Which keyword is used to remove one or more rows from a table?

  • A. CHANGE
  • B. Delete
  • C. SELECT
  • D. Erase
Click Here To View The Answer Answer: B. Delete

 Delete keyword is used to remove one or more rows from a table.




Q32. WHERE clauses cannot refer to ranges and to partial values when:

  • A. The keyword LIKE is used
  • B. Keyword BETWEEN is used
  • C. The keyword IS NULL is used
  • D. The keyword ALSO is used
Click Here To View The Answer Answer: D. The keyword ALSO is used

 WHERE clauses cannot refer to ranges and to partial values when: The keyword ALSO is used





Q33. Which of the following are the five built-in functions provided by SQL?

  • A. COUNT, SUM, AVG, MAX, MIN
  • B. SUM, AVG, MIN, MAX, MULT
  • C. SUM, AVG, MULT, DIV. MIN)
  • D. SUM, AVG, MIN, MAX, NAME
Click Here To View The Answer Answer: A. COUNT, SUM, AVG, MAX, MIN

 COUNT, SUM, AVG, MAX, MIN the following are the five built-in functions provided by SQL.





Q34. The SQL keyword GROUP BY instructs the DBMS:

  • A. To physically group together rows meeting the specified criteria
  • B. To group together those rows that have the same value of a column
  • C. Both A and B
  • D. Neither A nor B
Click Here To View The Answer Answer: B. To group together those rows that have the same value of a column

 The SQL keyword GROUP BY instructs the DBMS To group together those rows that have the same value of a column.





Q35. A subquery must be:

  • A. In bold
  • B. In capital letters
  • C. In parentheses
  • D. In italics
Click Here To View The Answer Answer: C. In parentheses

 A subquery must be In parentheses



Q36. Which is true about a "join"?

  • A. A join is the combination of the WHERE and SELECT clauses
  • B. A join is the combination of a product operation, followed by a selection, followed (usually) by a projection
  • C. A join is the product of the SELECT FROM WHERE clauses
  • D. A join can only be used for two tables
Click Here To View The Answer Answer: B. A join is the combination of a product operation, followed by a selection, followed (usually) by a projection

A join is the combination of a product operation, followed by a selection, followed (usually)  by a projection true about a "join".





Q37. Which is true of a "join"?

  • A. A join can be used as an alternative way of expressing many subqueries-
  • B. A join expression can be substituted for all subquery expressions
  • C. A join expression can be substituted for EXISTS and NOT EXISTS
  • D. Subqueries can be substituted for all joins
Click Here To View The Answer Answer: A. A join can be used as an alternative way of expressing many subqueries-

 A join can be used as an alternative way of expressing many subqueries- true of a "join".





Q38. An outer join:

  • A. Is not supported by ANSI standard SQL
  • B. Is supported by many DBMS products
  • C. Both A and B
  • D. Neither Anor B
Click Here To View The Answer Answer: C. Both A and B

 An outer join: Both A and B




Q39. EXISTS and NOT EXISTS:

  • A. Are logical operators whose value is either true or false depending on the presence or absence of rows that fit the qualifying conditions
  • B. Only work with one or two tables
  • C. Can return values other than true or false if rows meet the qualifying conditions
  • D. None of the above
Click Here To View The Answer Answer: A. Are logical operators whose value is either true or false depending on the presence or absence of rows that fit the qualifying conditions

EXISTS and NOT EXISTS Are logical operators whose value is either true or false depending on the presence or  absence of rows that fit the qualifying conditions





Q40. When using INSERT:

  • A. Rows can be modified according to criteria
  • B. Rows cannot be copied in mass from one table to another
  • C. Rows cannot be copied in mass from one table to another
  • D. Rows can be inserted into a table one at a time or in groups
Click Here To View The Answer Answer: D. Rows can be inserted into a table one at a time or in groups

When using INSERT Rows can be inserted into a table one at a time or in groups.





Q41. When using DELETE:

  • A. Rows can be deleted one at a time or in groups
  • B. It will not cause integrity problems
  • C. Rows can be deleted only one at a time
  • D. Order of operations is not important
Click Here To View The Answer Answer: A. Rows can be deleted one at a time or in groups

When using DELETE Rows can be deleted one at a time or in groups. 





Q42. Which is not true about modifying data?

  • A. Rows can be modified one at a time or in groups
  • B. The keyword SET is used to change a column value
  • C. After SET, the name of the column to be changed and then the new value or way of computing the new value is specified
  • D. Mass updates are fast, easy, and cause few problems
Click Here To View The Answer Answer: D. Mass updates are fast, easy, and cause few problems

Mass updates are fast, easy, and cause few problems is not true about modifying data.





Q43. Which of the following is not an SQL statement used on a single table.

  • A. SELECT with WHERE
  • B. SELECT with GROUP BY
  • C. SELECT with GROUP BY and HAVING
  • D. SELECTION
Click Here To View The Answer Answer: D. SELECTION

SELECTION of the following is not an SQL statement used on a single table.




Q44. Which of the following is not an operation used on two or more tables?

  • A. Subqueries
  • B. Joins
  • C. EXISTS
  • D. SELECT with GROUP BY & HAVING
Click Here To View The Answer Answer: D. SELECT with GROUP BY & HAVING

 SELECT with GROUP BY & HAVING of the following is not an operation used on two or more tables.



 

Q45. SQL commands can be classified into three types. Which is NOT an SQL command type?

  • A. DDL
  • B. DML
  • C.DGL
  • D. DCL
Click Here To View The Answer Answer: C.DGL

 SQL commands can be classified into three types. C.DGL is NOT an SQL command type.



Q46. Three SQL DDL CREATE commands are

  • A. Schema, Base, and Table
  • B. Base, Table, and Schema
  • C. Key, Base, and Table
  • D. Schema, Table, and View.
Click Here To View The Answer Answer: C. Key, Base, and Table

 Three SQL DDL CREATE commands are Key, Base, and Table





Q47. Which is NOT an advantage of using a view?

  • A. Simplify query commands
  • D. Provide data security
  • C. Enhance programming productivity
  • D. Decrease system overhead
Click Here To View The Answer Answer: D. Decrease system overhead

Decrease system overhead is NOT an advantage of using a view.




Q48. Which keyword is NOT included in most data retrieval statements?

  • A. Select
  • B. As
  • C. From
  • D. Where
Click Here To View The Answer Answer: B. As

 As keyword is NOT included in most data retrieval statements.





Share