VIEW yaratish va o‟chirishning so‟rovi sintaksisi
CREATE VIEW tasavvur_nomi AS SELECT ustun1, ustun2, ...
FROM jadval_nomi
WHERE shartli_tenglik; DROP VIEW tasavvur_nomi; Masalan:
CREATE VIEW Braziliya_xaridorlari AS SELECT xaridor_familiyasi, xaridor_ismi FROM xaridorlar
WHERE mamlakat = "Braziliya"; DROP VIEW Braziliya;
Ishni bajarish tartibi
Maxsulot jadvalidan 4000 dan ko‘p maxsulotlarni aks ettiruvchi Viewni yaratamiz:
So`rov: Create view 4000_kg_kop_maxsulotlar as select maxsulot_nomi, ogirligi_kg, from maxsulot where ogirligi_kg>4000;
Natija:
– rasm. View yaratilishi.
Tasavvur (view)ni ko‘ramiz:
So`rov: Select * from 4000_kg_dan_kop_maxsulotlar; Natija:
– rasm. Yaratilgan Viewdagi ma‘lumotlarni ko‘rish.
Tasavvurni o‘chirish:
Do'stlaringiz bilan baham: |