Loading...

SQL Server

Which of the following command makes the updates performed by the transaction permanent in the database ?
  1. ROLLBACK
  2. COMMIT
  3. TRUNCATE
  4. DELETE
Which TCL command undo all the updates performed by the SQL in the transaction ?
  1. ROLLBACK
  2. COMMIT
  3. TRUNCATE
  4. DELETE
SQL query to find all the cities whose humidity is 95
  1. SELECT city WHERE humidity = 95
  2. SELECT city FROM weather WHERE humidity = 95
  3. SELECT humidity = 89 FROM weather
  4. SELECT city FROM weather
SQL query to find the temperature in increasing order of all cities.
  1. SELECT city FROM weather ORDER BY temperature
  2. SELECT city, temperature FROM weather
  3. SELECT city, temperature FROM weather ORDER BY temperature
  4. SELECT city, temperature FROM weather ORDER BY city
What is the meaning of LIKE ‘%0%0%’ ?
  1. Feature begins with two 0’s
  2. Feature ends with two 0’s
  3. Feature has more than two 0’s
  4. Feature has two 0’s in it, at any position
Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
  1. SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
  2. SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)
  3. SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)
  4. SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’)
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
  1. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
  2. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
  3. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
  4. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70
Find all the tuples having temperature greater than ‘Paris’.
  1. SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’
  2. SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = ‘Paris’)
  3. SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = ‘Paris’)
  4. SELECT * FROM weather WHERE temperature > ‘Paris’ temperature
Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79.
  1. SELECT * FROM weather WHERE humidity IN (63 to 79)
  2. SELECT * FROM weather WHERE humidity NOT IN (63 AND 79)
  3. SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
  4. SELECT * FROM weather WHERE humidity NOT BETWEEN 63 AND 79
The command to remove rows from a table ‘CUSTOMER’ is
  1. DROP FROM CUSTOMER
  2. UPDATE FROM CUSTOMER
  3. REMOVE FROM CUSTOMER
  4. DELETE FROM CUSTOMER WHERE