-
Revising the Select Query I Solution
SELECT *
FROM CITY
WHERE COUNTRYCODE='USA'
AND POPULATION>100000;
-
Revising the Select Query II Solution
SELECT NAME
FROM CITY
WHERE COUNTRYCODE='USA'
AND POPULATION>120000;
-
Select All Solution
SELECT *
FROM CITY;
-
Select By ID Solution
SELECT *
FROM CITY
WHERE ID=1661;
-
Japanese Cities Attribute Solution
SELECT *
FROM CITY
WHERE COUNTRYCODE='JPN';
-
Japanese Cities Name Solution
SELECT NAME
FROM CITY
WHERE COUNTRYCODE='JPN';
-
Weather Observation Station 1 Solution
SELECT CITY,STATE
FROM STATION;
-
Weather Observation Station 3 Solution
SELECT DISTINCT CITY
FROM STATION
WHERE ID % 2 =0;
-
Weather Observation Station 4 Solution
SELECT COUNT(CITY) - COUNT(DISTINCT CITY)
FROM STATION;
-
Weather Observation Station 5 Solution
select city,length(city) from station order by length(city) asc,city asc limit 1;
select city,length(city) from station order by length(city) desc,city asc limit 1;
-
Weather Observation Station 6 Solution
select city
from station
where city REGEXP '^(A|E|I|O|U)';
-
Weather Observation Station 7 Solution
select distinct city
from station
where city REGEXP '(A|E|I|O|U|a|e|i|o|u)$';
-
Weather Observation Station 8 Solution
select distinct city
from station
where city REGEXP '^[AEIOUaeiou].*[AEIOUaeiou]$';
-
Weather Observation Station 9 Solution
select distinct city
from station
where city REGEXP '^[^AEIOUaeiou]';
-
Weather Observation Station 10 Solution
select distinct city
from station
where city REGEXP '[^AEIOUaeiou]$';
-
Weather Observation Station 11 Solution
SELECT distinct city FROM station WHERE lower(city) not REGEXP '[aeiou]$' or
city not REGEXP '^[aeiou]' order by city;
-
Weather Observation Station 12 Solution
SELECT distinct city FROM station WHERE lower(city) not REGEXP '[aeiou]$'
AND city not REGEXP '^[aeiou]' order by city;
-
Higher than 75 marks Solution
select Name
from students
Where Marks>75
order by
right(name,3),
id;
-
Employee Names Solution
select name
from Employee
order by name;
-
Employee salaries Solution
select name
from Employee
where salary > 2000 AND months<10
order by employee_id;
No comments:
Post a Comment