Do’kon ijara Dokon ijarada biz 5 da jadval yaratdik
Download 1.03 Mb.
|
1 2
Bog'liqSaidmurodov Sulaymon 941 21-guruh
- Bu sahifa navigatsiya:
- Maishiy texnikani tamirlash
- Dorixona sistemasi
Do’kon ijara Dokon ijarada biz 5 da jadval yaratdik. 1-jadvalim do’konlar do’konlarni idsi nomi narxi status nomli ustinlarga ega. 2-jadval haridorlar haridorlarni idsi nomi tel_raqami va pochta nomli ustunlarga ega. 3-jadval omborxona nomli jadvalimda id va nomga ega. 4-jadval mahsulotlar nomli jadvalimni idsi va nomi bor. 5-jadvalimni mahsulot_turi unda id nomi narxi sifati miqdor va muddat degan ustunlarga ega. CREATE DATABASE dokon_ijara; CREATE TABLE dokonlar( id int PRIMARY KEY AUTO_INCREMENT, name varchar(50), narxi int, status varchar(20) ); CREATE TABLE haridorlar( id int PRIMARY KEY AUTO_INCREMENT, name varchar(50), tel_raqam int, pochta varchar(50) ); CREATE TABLE omborxona( id int PRIMARY KEY AUTO_INCREMENT, name varchar(50) ); CREATE TABLE mahsulotlar( id int PRIMARY KEY AUTO_INCREMENT, name varchar(50) ); CREATE TABLE mahsulot_turi( id int PRIMARY KEY AUTO_INCREMENT, name varchar(50), narxi int, sifati varchar(50), miqdori varchar(50), muddati varchar(50) ); Maishiy texnikani tamirlash Maishiy texnikani tamirlashdabiz 5 ta jadval yaratdik 1-jadvalim Appliance repair jihozni ta’mirlash id repair_id name tavsifi narx degan ustunlarga egadir. 2-jadvalim appliances bu jadvalimda hairdo idsi uni tipi brandi model va boshqa ustunlarga ega. 3-jadval technicians texnik hodimlarning idsi ism familiyasi tel raqami email joylashgan orni berilgan. 4-jadval repairs asboblarni idsi tamirlash vaqti holati nomli ustunlar berilgan 5-jadval repair_parts ta'mirlash qismlarida tamirlash idsi nomi narxi va ularning holati berilgan. CREATE DATABASE Appliance_repair; CREATE TABLE customers ( id INT PRIMARY KEY AUTO_INCREMENT, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL ); CREATE TABLE appliances ( id INT PRIMARY KEY AUTO_INCREMENT, customer_id INT NOT NULL, type VARCHAR(255) NOT NULL, brand VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, serial_number VARCHAR(255) NOT NULL, purchase_date DATE NOT NULL, FOREIGN KEY (customer_id) REFERENCES customers(id) ); CREATE TABLE technicians ( id INT PRIMARY KEY AUTO_INCREMENT, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, dob DATE NOT NULL, gender CHAR(1) NOT NULL, phone VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, position VARCHAR(255) NOT NULL ); CREATE TABLE repairs ( id INT PRIMARY KEY AUTO_INCREMENT, appliance_id INT NOT NULL, technician_id INT NOT NULL, description TEXT NOT NULL, repair_date DATE NOT NULL, status VARCHAR(255) NOT NULL, FOREIGN KEY (appliance_id) REFERENCES appliances(id), FOREIGN KEY (technician_id) REFERENCES technicians(id) ); CREATE TABLE repair_parts ( id INT PRIMARY KEY AUTO_INCREMENT, repair_id INT NOT NULL, name VARCHAR(255) NOT NULL, description TEXT NOT NULL, price FLOAT NOT NULL, FOREIGN KEY (repair_id) REFERENCES repairs(id) ); Dorixona sistemasi Dorixona sistemasida biz 6 ta jadvalyaratdik 1- customers xaridorlar jadvalida ism familiyasi va ularning idsi email manzil va tel raqami keltirilgan. 2- medications dorilar jadvalimizda esa dorilar nomi ularning idsi va narxi keltirilgan. 3- Orders buyurtmalar jadvalida haridorlar idsi jami haridlar va haridlar vaqti berilgan ustunlar mavjud. 4- order_items buyumlarga buyurtma berish bu jadvalda buyurtmalar idsi dori idsi va ularning miqdori keltirilgan. 5-jadvalda esa warehouses omborlar idsi nomi va joylashuvi keltirilgan. 6- warehouse_inventory ombor inventarizatsiyasida ombor idsi dori idsi va miqdori keltirilgan. CREATE DATABASE Pharmacy_warehouse; CREATE TABLE customers ( id INT PRIMARY KEY AUTO_INCREMENT, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL ); CREATE TABLE medications ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255) NOT NULL, description TEXT NOT NULL, price FLOAT NOT NULL, quantity INT NOT NULL ); CREATE TABLE orders ( id INT PRIMARY KEY AUTO_INCREMENT, customer_id INT NOT NULL, order_total FLOAT NOT NULL, order_date DATE NOT NULL, FOREIGN KEY (customer_id) REFERENCES customers(id) ); CREATE TABLE order_items ( id INT PRIMARY KEY AUTO_INCREMENT, order_id INT NOT NULL, medication_id INT NOT NULL, quantity INT NOT NULL, FOREIGN KEY (order_id) REFERENCES orders(id), FOREIGN KEY (medication_id) REFERENCES medications(id) ); CREATE TABLE warehouses ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255) NOT NULL, location VARCHAR(255) NOT NULL ); CREATE TABLE warehouse_inventory ( id INT PRIMARY KEY AUTO_INCREMENT, warehouse_id INT NOT NULL, medication_id INT NOT NULL, quantity INT NOT NULL, FOREIGN KEY (warehouse_id) REFERENCES warehouses(id), FOREIGN KEY (medication_id) REFERENCES medications(id) ); Download 1.03 Mb. Do'stlaringiz bilan baham: |
1 2
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling