Q. What is the meaning of LIKE ‘%0%0%’?

  • (A) Feature has two 0’s in it, at any position
  • (B) Feature has more than two 0’s
  • (C) Feature ends with two 0’s
  • (D) Feature begins with two 0’s
πŸ’¬ Discuss
βœ… Correct Answer: (A) Feature has two 0’s in it, at any position

Q. 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’);
πŸ’¬ Discuss
βœ… Correct Answer: (A) SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)

Q. 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’ AND temperature > 70
  • (B) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
  • (C) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
  • (D) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
πŸ’¬ Discuss
βœ… Correct Answer: (B) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70

Q. Find all the tuples having a temperature greater than ‘Paris’.

  • (A) SELECT * FROM weather WHERE temperature > ‘Paris’ temperature
  • (B) SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = ‘Paris’)
  • (C) SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = ‘Paris’)
  • (D) SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’
πŸ’¬ Discuss
βœ… Correct Answer: (D) SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’

Q. 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 79
πŸ’¬ Discuss
βœ… Correct Answer: (C) SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79

Q. 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 WHERE
πŸ’¬ Discuss
βœ… Correct Answer: (D) DELETE FROM CUSTOMER WHERE

Q. The following SQL is which type of join:

Code:
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) Cartesian join
  • (B) Outer join
  • (C) Natural join
  • (D) Equi-join
πŸ’¬ Discuss
βœ… Correct Answer: (D) Equi-join

Q. The following SQL is which type of join:

Code:
SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T
  • (A) Cartesian join
  • (B) Outer join
  • (C) Natural join
  • (D) Equi-join
πŸ’¬ Discuss
βœ… Correct Answer: (A) Cartesian join

Q. Which is not a type of join in T-SQL?

  • (A) Cartesian join
  • (B) Outer join
  • (C) Natural join
  • (D) Equi-join
πŸ’¬ Discuss
βœ… Correct Answer: (C) Natural join

Q. Which of the following is not a limitation of view?

  • (A) Adding Column is Expensive by Joining Table Outside View
  • (B) Cross Database Queries Not Allowed in Indexed View
  • (C) Index Created on View Used Often
  • (D) ORDER BY Does Not Work
πŸ’¬ Discuss
βœ… Correct Answer: (C) Index Created on View Used Often