Bozor nomli ma’lumotlar bazamizga customer nomli jadval yatatib olamiz: create table


Download 36.91 Kb.
Sana26.11.2020
Hajmi36.91 Kb.
#151896
Bog'liq
MB oraliq nazorat


3. Demak avval bozor nomli ma’lumotlar bazamizga customer nomli jadval yatatib olamiz:
CREATE TABLE customer (id INTEGER PRIMARY KEY AUTO_INCREMENT,

CustomerName VARCHAR(30), TelephoneNumber VARCHAR(15));




Endi esa uni ma’lumotlat bilan to’ldiramiz:



INSERT INTO customer (CustomerName, TelephoneNumber) VALUES ('Doston Urunov' , '+998942254555');

INSERT INTO customer (CustomerName, TelephoneNumber) VALUES ('Abbosbek Ibragimov' , '+998935221776');

INSERT INTO customer (CustomerName, TelephoneNumber) VALUES ('Shoxruz Yunusov' , '+998913314373');

INSERT INTO customer (CustomerName, TelephoneNumber) VALUES ('Halima Vahobova' , '+998904919964');

INSERT INTO customer (CustomerName, TelephoneNumber) VALUES ('Akmal Holiqov' , '+998935056776');

Demak biz bozor ma’lumotlar bazasida customer nomli jadval yaratib oldik. Endi esa bemalol yuqorida berilgan so’rovimizni amalga oshirsak bo’ladi:



WHERE customerName LIKE '%a'
va u bizga CustomerName ya’ni mijozlarning ismining oxirida “a” harfi bor yoki yo’qligini tekshiradi.

Biz bunga amin bo’lish uchun quyidagicha so’rov yuboramiz. Bunda biz so’rov yuborganimizda customer jadvalidagi mijozlarning CustomerName ya’ni ismining oxirida “a” harfi mavjud bo’lsa, bizga bu mijoz haqidagi barcha ma’lumotlarni chiqarsin:



SELECT * FROM customer WHERE customerName LIKE '%a'

Download 36.91 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling