CREATE DATABASE oquv_markaz
CREATE TABLE oqituvchilar(
id INT PRIMARY KEY AUTO_INCREMENT,
ismi VARCHAR(199),
familiya VARCHAR(100),
dars_beradigan_kuni VARCHAR(300)
)
CREATE TABLE oquvchilar(
id INT PRIMARY KEY AUTO_INCREMENT,
ism VARCHAR(200),
familiya VARCHAR(200)
)
CREATE TABLE darslar(
id INT PRIMARY KEY AUTO_INCREMENT,
kurs_nomi VARCHAR(100),
boshlanish_vaqti TIME,
dars_kuni VARCHAR(200),
oqituvchilar_id INT,
oquvchilar_id INT ,
FOREIGN KEY (oqituvchilar_id) REFERENCES oqituvchilar(id)
ON DELETE SET NULL ON UPDATE RESTRICT,
FOREIGN KEY (oquvchilar_id) REFERENCES oquvchilar(id)
ON DELETE SET NULL ON UPDATE RESTRICT
)
INSERT INTO oqituvchilar(ismi, familiya )
VALUES("Abdulloh","Abdurazzoqov"),
("Shohruz","Turg'unaliyev"),
("Qobiljon","Nomonjonov"),
("G'ofirjon", "Rahimov"),
("Burhon","Otabayev")
INSERT INTO oquvchilar(ism,familiya)
VALUES ("Samandar","Isroilov"),
("Abdulloh", "Abdurazzoqov"),
("Nodir","Homidov"),
("Xayrullo","Olimov")
INSERT INTO darslar(kurs_nomi, boshlanish_vaqti, dars_kuni)
VALUES ("Matematika", "16:00","Har kuni"),
("Malumotlar_bazasi","14:00","Se,Pay,Shan"),
("ingliz tili","16:00","Du,CHor,Jum"),
("Fizika","14:00","Du,CHor,Jum")
Dostları ilə paylaş: |