Misolcha 5
SQL - 1
Quyidagi table lar berilgan. Table malumotlarini bazadan ko’rishingiz mumkin.
PERSON (Name, Gender, Age)
PARENT (ParentName, ChildName)
express the following queries in SQL language:
10 yoshdan kichik bo’lgan yolg’iz bolalarning ismini toping.
SQL - 2
Quyidagi table lar berilgan. Table malumotlarini bazadan ko’rishingiz mumkin.
SPECIALISTIC_VISIT (VCode, VType)
DOCTOR (DCode, DName)
PATIENT (SSN, PName, BirthDate)
VISIT_BOOKING (Date, Time, DCode, Room, VCode, SSN)
2005 yilda bitta do’ktorni oldiga eng kamida 3marta kelgan bemorning SSN ni, ismi, 2005 yildagi barcha tashriflarini sonini toping.
1960 yildan keyin tug’ilgan va birontaham cardiolog do’ktoriga ko’rinmagan bemorning ssn raqami va ismini ko’rsating. (Cardiologic)
SQL - 3
Given the following relations (primary keys are underlined):
CAR_RENTAL ( CRCode, CRName, Address, City, Country)
CAR (NumberPlate, Model, Maker, Category, NumPassengers)
CUSTOMER (SSN, Name, Surname, DrivingLicense, CreditCard)
RENTAL_RESERVATION (RCode, SSN, ReservationDate, CRCode, StartDate, EndDate, Price, NumberPlate)
Bir kunda ikkita Mercedes moshinasini zakaz qilmagan xaridorlar (customers) ning ismi va familiyasini ko’rsating. (bir kunda = StartDate treng bo’lgan.)
2006 yilning November oyidagi eng kamida 3 arenda shartnomasi qilgan ArendaDatel (car_rental) larning kodi, firmani nomi va 2006 yil davomida umumiy qilingan arendal shartnomalar sonini toping.
SQL – 4
Given the following relations (primary keys are underlined):
DRUG (DCode, Name, ActivePrinciple, Category, Maker)
PHARMACY (PCode, OwnerName, Address, City)
SALE (PCode, DCode, Date, Quantity)
Paracetamol dorisini bironmarta ham sotmagan Dorixonaning egasini nomi, adresi va city sini toping.
(activeprinciple = ‘Paracetamol’)
Barcha sotilgan dorilarning o’rtacha qiymatidan ko’p dori sotgan dorixonalarning kodi, egasini nomi va 2007 yilda Bayer dorisini sotilgan soni toping. (Maker = ’Bayer’)
Dostları ilə paylaş: |