Data definition language) Ma`lumotlarni manipulyatsiya qilish tili


Simple integrity constraint types


Download 303.9 Kb.
bet6/6
Sana23.04.2023
Hajmi303.9 Kb.
#1387249
1   2   3   4   5   6
Bog'liq
11-lecture

Simple integrity constraint types

Integrity constraint can be divided into the following types:

  • PRIMARY KEY
  • UNIQUE
  • NULL/NOT NULL
  • FOREIGN KEY/REFERENCE
  • CHECK

Masalalar

  • Imtihon jadvalidan baholar sonini aniqlang.
  • Fanlar jadvalidan fanlar sonini aniqlang.
  • Imtihon jadvalidan eng yuqori baho olgan talaba va 34 soatga teng bo’lgan fanlarni guruhlang.
  • Mahsulot jadvalidan mahsulot narxi 500 va 2000 oralig’idagi narxlarni chiqaring.
  • Mahsulot jadvalidan eng qimmat mahsulotni aniqlang.
  • Mahsulotlar jadvalidan mahsulot narxini o’rtacha qiymatini toping.
  • Mahsulot jadvalidan yo’nalishi go’shtga tenglarini aniqlang.
  • Mahsulot jadvalidan id si 2 ga teng bo’lmagan va narxi 500 va 2000 oralig’idagi mahsulotlarni aniqlang.

Masalalar

  • Select count(*) from EXAMS_MARKS ;
  • Select count(subj_ID) from SUBJECT;
  • Select student_ID, Max(mark) from EXAM_MARKS Group by Subj_name Having max (Hour)>= 34;
  • select * from Mahsulotlar where [mahsulot narxi] BETWEEN 500 AND 2000);
  • select Max([Mahsulot narxi]) AS [eng qimmat mahsulot narxi] from Mahsulotlar;
  • select AVG([Mahsulot narxi]) from mahsulotlar;
  • select * from Mahsulotlar where Yunalishlar IN (Gusht);
  • select * from Mahsulotlar where [mahsulot narxi] BETWEEN 500 AND 2000) AND NOT Mahsulot_t_id IN (2);

Download 303.9 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6




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