مدونة البرمجةمدونة أمن المعلوماتمدونة الأنترنتمدونة التقنية

حل المسائل البرمجية للغة SQL بموقع hackerrank والحصول على الشهادة

Solution for SQL Basic hackerrank

حل المسائل البرمجية للغة SQL بموقع hackerrank والحصول على شهادة الاساسيات للغة .

سنطرح لك جميع حلول المسائل البرمجية الاساسية الخاصة بلغة SQL بموقع هكررانك التي تمكنك بعد ذلك من الحصول على شهادة الاساسيات بلغة SQL من موقع hackerrank :


1 – Revising the Select Query I

Revising the Select Query I

الحل :


SELECT * FROM CITY
WHERE COUNTRYCODE = 'USA' AND POPULATION > 100000;


Revising the Select Query I1

2 – Revising the Select Query II

Revising the Select Query II

الحل :


SELECT NAME FROM CITY
WHERE COUNTRYCODE = 'USA' AND POPULATION > 120000;


Revising the Select Query II

3 – Select All

Select All

الحل :


SELECT * FROM CITY;


Select All

4 – Select By ID

Select By ID

الحل :


SELECT * FROM CITY
WHERE ID = 1661;


Select By ID

5 – Japanese Cities’ Attributes

Japanese Cities' Attributes
Japanese Cities’ Attributes

الحل :


SELECT * FROM CITY
WHERE COUNTRYCODE = 'JPN';


Japanese Cities' Attributes

6 – Japanese Cities’ Names

Japanese Cities' Names

الحل :


SELECT NAME FROM CITY
WHERE COUNTRYCODE = 'JPN';


Japanese Cities' Names

7 – Weather Observation Station 1

Weather Observation Station 1

الحل :


SELECT CITY, STATE FROM STATION;


Weather Observation Station 1

8 – Weather Observation Station 3

Weather Observation Station 3

الحل :


SELECT DISTINCT CITY FROM STATION
WHERE ID % 2 = 0;


Weather Observation Station 3

9 – Weather Observation Station 4

Weather Observation Station 4

الحل :


SELECT
COUNT(CITY) - COUNT(DISTINCT CITY)
FROM
STATION;


10 – Weather Observation Station 5

Weather Observation Station 5

الحل :


SELECT CITY, LENGTH(CITY) FROM STATION
ORDER BY LENGTH(CITY), CITY
LIMIT 1;
SELECT CITY, LENGTH(CITY) FROM STATION
ORDER BY LENGTH(CITY) DESC, CITY
LIMIT 1;


11 – Weather Observation Station 6

Weather Observation Station 6

الحل :


SELECT DISTINCT CITY FROM STATION
WHERE CITY REGEXP '^[aeiou]';


12 – Weather Observation Station 7

Weather Observation Station 7

الحل :


SELECT DISTINCT CITY FROM STATION
WHERE CITY REGEXP '[aeiou]$';


13 – Weather Observation Station 8

Weather Observation Station 8

الحل :


SELECT DISTINCT CITY FROM STATION
WHERE CITY REGEXP '^[aeiou].*[aeiou]$';


14 – Weather Observation Station 9

Weather Observation Station 9

الحل :


SELECT DISTINCT CITY FROM STATION
WHERE CITY REGEXP '^[^aeiou]';


15 – Weather Observation Station 10

Weather Observation Station 10

الحل :


SELECT DISTINCT CITY FROM STATION
WHERE CITY REGEXP '[^aeiou]$';


16 – Weather Observation Station 11

Weather Observation Station 11

الحل :


SELECT DISTINCT CITY FROM STATION
WHERE CITY REGEXP '^[^aeiou]|[^aeiou]$';


17 – Weather Observation Station 12

Weather Observation Station 12

الحل :


SELECT DISTINCT CITY FROM STATION
WHERE CITY REGEXP '^[^aeiou].*[^aeiou]$';


18 – Higher Than 75 Marks

Higher Than 75 Marks

الحل :


SELECT Name FROM STUDENTS
WHERE Marks > 75
ORDER BY RIGHT(Name, 3), ID;


19 – Employee Names

Employee Names

الحل :


SELECT name FROM Employee
ORDER BY name;


20 – Employee Salaries

Employee Salaries

الحل :


SELECT name FROM Employee
WHERE salary > 2000 AND months < 10
ORDER BY employee_id;



2121212122

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني.

هذا الموقع يستخدم Akismet للحدّ من التعليقات المزعجة والغير مرغوبة. تعرّف على كيفية معالجة بيانات تعليقك.

زر الذهاب إلى الأعلى