Jadval yaratish
CREATE TABLE uquvchilar (
id SERIAL PRIMARY KEY,
ism VARCHAR(50) NOT NULL,
familiya VARCHAR(50) NOT NULL,
yosh INT,
grux VARCHAR(10) NOT NULL
);
Jadvalni conslga chiqarish SELECT * FROM UQUCHILAR;
Jadvalni malumotlar bilan tuldirish
INSERT INTO uquvchilar (ism, familiya, yosh, grux)
VALUES ('Ali', 'Valiyev', 18, '572-21'),
('Vali', 'Aliyev', 18, '571-21'),
('Halil', 'Sobirov', 19, '572-22'),
('Sobit', 'Zokirov', 23, '572-23'),
('Tulqin', 'Valiyev', 32, '522-22'),
('Baxodr', 'Vahidov', 21, '575-71');
Quantity bo’yicha so’rtlash
SELECT * FROM uquvchilar ORDER BY yosh;
Jadvalni Yangilash:
UPDATE uquvchilar SET yosh = 12 WHERE ism = 'Baxodr';
Jadvaldan o’chirish;
DELETE FROM uquvchilar WHERE ism = 'Tulqin';
Dostları ilə paylaş: |