Sql da masalalar
Download 32.11 Kb.
|
Sql da misollar
SQL DA Masalalar Oquvchilar jadvalidan Toshkent va Andijon Hudud table da joylashgan oquvchilarni jadvali chiqarilsin. SELECT * FROM Oquvchilar WHERE Hudud='Toshkent' AND Hudud='Andijon'; 2)MAKTAB jadvalidan 0 dan 20 gacha bolgan bolalar YOSHLARI table idan faqat 10 dan 15 gacha bolgan bolalar tanlab olinsin. SELECT * FROM Customers WHERE YOSHLARI 10 AND 15; 3)Oquvchilar jadvalidan Hudud table da Toshkent dan bolmagan oquvchilar royxati chiqarilsin SELECT * FROM Customers WHERE NOT Country='Germany'; 4) Migrant jadvalidan Country Ozbekiston dan va City Toshkent yoki Andijondan bolgan odamlar jadvali chiqarilsin SELECT * FROM MIigrant
SELECT * FROM Customers WHERE NOT Country='Germany' AND NOT Country='USA'; 6) Country jadvalini Alifbo boyicha tartiblang SELECT * FROM Customers ORDER BY Country; 7) Products table dan min narxni Smallestprice sifatida chiqarib bering SELECT MIN(Price) AS SmallestPrice FROM Products; 8) Products table dan max narxni Largestprice sifatida chiqarib bering SELECT MAX(Price) AS LargestPrice FROM Products; 9) Sotuvchilar jadvalidan Country table da UK USA va Germany dan bolgan sotuvchilar royxatini chiqarib bering SELECT * FROM Sotuvchilar WHERE Country IN ('Germany', 'France', 'UK'); 10) Kursdoshlar royxatidan Yosh table dan 15 dan 22 gacha bolmagan kursdoshlaringiz royxatini tuzing SELECT * FROM Kursdodhlar WHERE Yosh NOT BETWEEN 10 AND 20; 11) SHIfoxona jadvalidan 0 dan 100 gacha bolgan palatalarda yotgan bemorlarni 50 dan katta palatadagilarni 1 2 3 CategoryId dagilarni royxatini chiqaring SELECT * FROM SHifoxona WHERE Palata BETWEEN 50 AND 100 AND NOT CategoryID IN (1,2,3); 12) Student jadvalidan Toshtemirov va Qurashov familyasi orasidagi familiyalarni royxatini tuzing SELECT * FROM Student WHERE Familiya BETWEEN 'Toshtemirov' AND 'Qurshov' ORDER BY Familiya; 13) Student jadvalidan familiyasi Toshtemirov va Qurashov familiyalari orasodagilardan boshqa familiyadagilarni royxatini tuzib bering SELECT * FROM Products WHERE Familiya NOT BETWEEN 'Toshtemirov' AND 'Qurshov' ORDER BY Familiya; 14) Aholi jadvalidan orderdate table dan 1966 yilning iyul oyida tugilgan Aholi royxatini chiqrib bering. SELECT * FROM Aholi WHERE Orderdate BETWEEN #01/07/1996# AND #31/07/1996#; 15) Nurafshon filiali jadvalida nechta dona oquvchi elementi borligini sanab bering. SELECT COUNT(ProductID) FROM Products; Download 32.11 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling