Maydon nomi
|
Tipi
|
Izoh
|
idemployee
|
int(6)
|
Kalit maydon
|
surname
|
varchar(50)
|
To’liq nomi
|
name
|
varchar(50)
|
Ismi
|
position
|
varchar(50)
|
Ishchi lavozimi
|
address
|
varchar(100)
|
Manzili
|
phone
|
varchar(20)
|
Telefon
|
email
|
varchar(50)
|
Elektron manzil
|
“sections” – bo'limlar haqida ma’lumotni saqlovchi jadval
Maydon nomi
|
Tipi
|
Izoh
|
idsection
|
int(5)
|
Kalit maydon
|
name
|
int(25)
|
Bo’lim nomi
|
address
|
varchar(50)
|
Bo’limning joylashish manzili
|
“leader” – boshliq haqida malumot saqlovchi jadval
Maydon nomi
|
Tipi
|
Izoh
|
idleader
|
int(5)
|
Kalit maydon
|
surname
|
varchar(50)
|
To’liq ismi
|
name
|
varchar(25)
|
Ismi
|
phone
|
varchar(20)
|
Telefon
|
email
|
varchar(30)
|
Kiritgan user
|
“ticket” – chipta haqidag ma’lumotni saqlovchi jadval
Maydon nomi
|
Tipi
|
Izoh
|
idticket
|
int(5)
|
Kalit maydon
|
price
|
int(20)
|
Chipta narxi
|
date
|
date(15)
|
Chipta sanasi
|
validity_period
|
varchar(20)
|
Amal qilish muddati
|
“advertising” – reklama malumotlarni saqlovchi jadval
Maydon nomi
|
Tipi
|
Izoh
|
idadvertising
|
int(4)
|
Kalit maydon
|
movie_title
|
varchar(40)
|
Film nomi
|
movie_date
|
date(20)
|
Film sanasi
|
“cash_register” – kalit maydon haqida ma’lumot saqlovchi jadval
Maydon nomi
|
Tipi
|
Izoh
|
idcash_register
|
int(5)
|
Kalit maydon
|
type_of_payment
|
varchar(20)
|
To’lov turi
|
“programm –film namoyishi haqida ma’lumot saqlovchi jadval
Maydon nomi
|
Tipi
|
Izoh
|
idprogramm
|
int(10)
|
Kalit maydon
|
programm_time
|
date(20)
|
Namoyish vaqti
|
seans
|
varchar(40)
|
Namoyish
|
“theater” – teatr haqidagi ma’lumotlarni saqlovchi jadval
Maydon nomi
|
Tipi
|
Izoh
|
Idtheater
|
int(5)
|
Kalit maydon
|
Name
|
varchar(50)
|
Teatr nomi
|
Address
|
varchar(50)
|
Teatr manzili
|
Email
|
varchar(50)
|
Electron manzili
|
Phone
|
varchar(20)
|
Telefon
|
JADVALLARNING O’ZARO BOG’LANISHI
Theater va Section jadvallar 1:N bog’lanish turini hosil qilgan.
Employee va Section jadvallar 1:N bog’lanish turini hosil qilgan.
Leader va Sections jadvallar 1:1 bog’lanish turini hosil qilgan.
Theater va Programm jadvallar 1:N bog’lanish turini hosil qilgan.
Theater va Ticket jadvallar M:N bog’lanish turini hosil qilgan.
Theater va Advertising jadvallar 1:N bog’lanish turini hosil qilgan.
2.4.SQL operatorlari yordamida jadvallarni hosil qilish
va jadvallarga ma’lumotlar kiritish
jadval. “CASH_REGISTER” jadvalini CREATE operatori yordamida hosil qilish
CREATE TABLE CASH_REGISTER ( idCASH_REGISTER INT NOT NULL , TYPE_OF_PAYMENT VARCHAR(45) NULL , PRIMARY KEY (idCASH_REGISTER) )
jadval. “THEATER” jadvalini CREATE operatori yordamida hosil qilish
CREATE TABLE THEATER ( idTHEATER INT NOT NULL ,
THEATER_NAME VARCHAR(50) NULL , THEATER_ADDREES VARCHAR(55) NULL , THEATER_GMAIL VARCHAR(45) NULL , THEATER_PHONE_NUMBER INT(25) NULL, THEATERcol VARCHAR(45) NULL , CASH_REGISTER_idCASH_REGISTER INT NOT NULL , PRIMARY KEY (idTHEATER) ,
INDEX fk_THEATER_CASH_REGISTER1_idx (CASH_REGISTER_idCASH_REGISTER ASC) ,
CONSTRAINT fk_THEATER_CASH_REGISTER1 FOREIGN KEY (CASH_REGISTER_idCASH_REGISTER)
REFERENCES mydb.CASH_REGISTER (idCASH_REGISTER))
jadval. “SECTIONS” jadvalini CREATE operatori yordamida hosil qilish
CREATE TABLE SECTIONS ( idSECTIONS INT NOT NULL ,
SECTIONS_NAME VARCHAR(45) NULL , SECTIONS_ADDRESS VARCHAR(45) NULL , THEATER_idTHEATER INT NOT NULL ,
PRIMARY KEY (idSECTIONS, THEATER_idTHEATER) ,
INDEX fk_SECTIONS_THEATER1_idx (THEATER_idTHEATER ASC)
CONSTRAINT fk_SECTIONS_THEATER1
FOREIGN KEY (THEATER_idTHEATER) REFERENCES THEATER (idTHEATER)
jadval. “LEADER” jadvalini CREATE operatori yordamida hosil qilish
CREATE TABLE LEADER ( id_LEADER INT NOT NULL ,
LEADER_SURNAME VARCHAR(45) NULL , LEADER_NAME VARCHAR(45) NULL , LEADER_PHONE NUMBER VARCHAR(45) NULL , lLEADER_GMAIL VARCHAR(45) NULL , SECTIONS_idSECTIONS INT NOT NULL , SECTIONS_THEATER_idTHEATER INT NOT NULL , PRIMARY KEY (id_LEADER) ,
INDEX fk_LEADER_SECTIONS1_idx (SECTIONS_idSECTIONS ASC, SECTIONS_THEATER_idTHEATER ASC) ,
CONSTRAINT fk_LEADER_SECTIONS1 FOREIGN KEY (SECTIONS_idSECTIONS ,
SECTIONS_THEATER_idTHEATER)
REFERENCES mydb.SECTIONS (idSECTIONS , THEATER_idTHEATER)
jadval. “EMPLOYEE” jadvalini CREATE operatori yordamida hosil qilish
CREATE TABLE EMPLOYEE ( idEMPLOYEE INT NOT NULL ,
EMPLOYEE_SURNAME VARCHAR(45) NULL , EMPLOYEE_NAME VARCHAR(45) NULL , EMPLOYEE_POSITION VARCHAR(45) NULL ,
EMPLOYEE_ADDRESS VARCHAR(45) NULL , EMPLOYEE_PHONE NUMBER VARCHAR(45) NULL , EMPLOYEE_GMAIL VARCHAR(45) NULL , THEATER_idTHEATER INT NOT NULL , SECTIONS_idSECTIONS INT NOT NULL ,
PRIMARY KEY (idEMPLOYEE, THEATER_idTHEATER, SECTIONS_idSECTIONS) ,
INDEX fk_EMPLOYEE_THEATER_idx (THEATER_idTHEATER ASC)
,
INDEX fk_EMPLOYEE_SECTIONS1_idx (SECTIONS_idSECTIONS
ASC) ,
CONSTRAINT fk_EMPLOYEE_THEATER FOREIGN KEY (THEATER_idTHEATER) REFERENCES mydb.THEATER (idTHEATER) ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_EMPLOYEE_SECTIONS1 FOREIGN KEY (SECTIONS_idSECTIONS) REFERENCES mydb.SECTIONS (idSECTIONS) ON DELETE NO ACTION
ON UPDATE NO ACTION)
jadval. “PROGRAMM” jadvalini CREATE operatori yordamida hosil qilish
CREATE TABLE PROGRAMM ( idPROGRAMM INT NOT NULL , PROGRAMM_TIME VARCHAR(45) NULL , SEANS VARCHAR(45) NULL ,
THEATER_idTHEATER INT NOT NULL ,
PRIMARY KEY (idPROGRAMM, THEATER_idTHEATER) ,
INDEX fk_PROGRAMM_THEATER1_idx (THEATER_idTHEATER ASC) ,
CONSTRAINT fk_PROGRAMM_THEATER1 FOREIGN KEY (THEATER_idTHEATER)
jadval. “TICKET” jadvalini CREATE operatori yordamida hosil qilish
CREATE TABLE TICKET ( idTICKET INT NOT NULL , TICKET_PRICE INT NULL ,
TICKET_DATE VARCHAR(45) NULL , TICKET_VALIDITY_PERIOD VARCHAR(45) NULL , CASH_REGISTER_idCASH_REGISTER INT NOT NULL ,
PRIMARY KEY (idTICKET, CASH_REGISTER_idCASH_REGISTER) ,
INDEX fk_TICKET_CASH_REGISTER1_idx (CASH_REGISTER_idCASH_REGISTER ASC) ,
CONSTRAINT fk_TICKET_CASH_REGISTER1
FOREIGN KEY (CASH_REGISTER_idCASH_REGISTER) REFERENCES mydb.CASH_REGISTER (idCASH_REGISTER) ON DELETE NO ACTION
ON UPDATE NO ACTION)
jadval. “ADVERTISING” jadvalini CREATE operatori yordamida hosil qilish
CREATE TABLE ADVERTISING ( idADVERTISING INT NOT NULL , MOVIE_TITLE VARCHAR(45) NULL , MOVIE_DATE VARCHAR(45) NULL , THEATER_idTHEATER INT NOT NULL ,
PRIMARY KEY (idADVERTISING, THEATER_idTHEATER) ,
INDEX fk_ADVERTISING_THEATER1_idx (THEATER_idTHEATER ASC) ,
CONSTRAINT fk_ADVERTISING_THEATER1 FOREIGN KEY (THEATER_idTHEATER) REFERENCES mydb.THEATER (idTHEATER) ON DELETE NO ACTION ON UPDATE NO )
SQL operatorlari yordamida jadvallarga yozuvlar qo’shish
1-jadval. “Theater” jadvaliga INSERT operatori yordamida yozuv qo’shish
INSERT INTO Theater VALUES ('Alisher Navoiy nomidagi kinoteatr', 'Samarqand shahar Mirzo Ulugbek 15', ALisherKinoter@mail.ru', 915846532);
1-jadval. “Employee” jadvaliga INSERT operatori yordamida yozuv qo’shish
INSERT INTO Employee VALUES ('Alisher Naymanov’,’Alisher’, ’buxgalter’, 'Samarqand shahar Mirzo Ulugbek 15', 996584565 ,’ ALisherKinote@mail.rur',5);
jadval. “Programm” jadvaliga INSERT operatori yordamida yozuv qo’shish
INSERT INTO Programm VALUES (‘2021-12-02’,’Yozgi’ ,5);
2-jadval. “Section” jadvaliga INSERT operatori yordamida yozuv qo’shish
INSERT INTO Section VALUES (‘Kinolar’,’Mirzo Ulugbek’ ,6);
jadval. “Advertising” jadvaliga INSERT operatori yordamida yozuv qo’shish
INSERT INTO Advertising VALUES (‘Millionlar,’2021-12-12’ ,2);
jadval. “Leader” jadvaliga INSERT operatori yordamida yozuv qo’shish INSERT INTO Leader VALUES ('Alisher Naymanov’,’Alisher’, 996584578, ’ALisherKinote@mail.rur',5);
jadval. “Ticket” jadvaliga INSERT operatori yordamida yozuv qo’shish INSERT INTO Ticket VALUES (12000,’2021-02-05’, ’2021-02-25’,
’ALisherKinote@mail.rur',5);
jadval. “Cash_Register” jadvaliga INSERT operatori yordamida yozuv qo’shish
INSERT INTO Cash_Register VALUES (‘Online Click’);
My SQL malumotlar bazasini Qt Creator bilan ulash kodlari
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QString"
#include
#include
#include
#include
#include
#include
#include
#include
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QSqlDatabase db;
QSqlQueryModel *m=new QSqlQueryModel();
db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=Teatr.mdb");
db.open();
if(!db.open())
{
QMessageBox::critical(this,tr("Ошибка"),db.lastError().text());
}
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
model = new QSqlTableModel(this);
model->setTable("teatr");
ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
ui->tableView->resizeColumnsToContents();
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
ui->tableView->horizontalHeader()->setStretchLastSection(true);
model->select();
ui->tableView->setModel(model);
ui->tableView->show();
}
void MainWindow::on_pushButton_5_clicked()
{
Model = new QSqlTableModel(this);
model->setTable(“spe");
ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
ui->tableView->resizeColumnsToContents();
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
ui->tableView->horizontalHeader()->setStretchLastSection(true);
model->select();
ui->tableView->setModel(model);
ui->tableView->show();
}
void MainWindow::on_pushButton_4_clicked()
{
model = new QSqlTableModel(this);
model->setTable("xodimlar");
ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
ui->tableView->resizeColumnsToContents();
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
ui->tableView->horizontalHeader()->setStretchLastSection(true);
model->select();
ui->tableView->setModel(model);
ui->tableView->show();
}
void MainWindow::on_pushButton_2_clicked()
{
model = new QSqlTableModel(this);
model->setTable("spektakllar)");
ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
ui->tableView->resizeColumnsToContents();
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
ui->tableView->horizontalHeader()->setStretchLastSection(true);
model->select();
ui->tableView->setModel(model);
ui->tableView->show();
}
void MainWindow::on_pushButton_3_clicked()
{
model = new QSqlTableModel(this);
model->setTable("Xodimlar");
ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
ui->tableView->resizeColumnsToContents();
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
ui->tableView->horizontalHeader()->setStretchLastSection(true);
model->select();
ui->tableView->setModel(model);
ui->tableView->show();
}
Xulosa
Xulosa qilib shuni ta’kidlash mumkin, xozirgi fan-texnika xamda informatsion texnologiyalarining jadal rivojlanayotgan vaqtida ATlarga bo`lgan talablar juda xam kuchli bo`lib, bu talablarni to`laqonli qondirish biz va bizga o`xshash yosh dasturchilarning oldida turgan ulkan vazifalardan biri bo`lib xisoblanadi. Menga berilgan loyiha <> loyihasi bunda <> haqida yo’nalishlar haqida ,talaba haqida malumotlarni chiqaruvchi dastur tuzdm bu dasturni tuzshim uchun birinchi navbatda MySQL malumotlar bazasini yaratib olamz va Qt Creatorga ulanish kodlarini terb ulab dsturni tuzdm.Bunda tugmalar va vedjetlardan foydalandm dizayn qismini qilsh uchun Background color bo’limidan foydalanib tuzdm.Bu kurs ishida asosan tableWidget fofdalaniladi.Bu dasturni ishlatishdan maqsad foydalanuchi ishini osonlashtiradi.talaba tugmasni bosak qaysi yo’nalishda o’qishi guruh raqami, guruh raxbari, ism,familyasi talaba haqida ma’lumot batafsil ekrang chiqadi.
Bu malumotlar bazasi bank tizimi uchun tuzildi. Bunda men unga kerakli jadvallarni tuzib o’zaro aloqalarni hosil qilib chiqdim. Darslar davomida men malumotlar mazasi bilan ishlashni kurib chiqdim. Shu jumladan jadvallarni yaratish, uchirish, tahrirlash kabi usullarni ham urganib chiqdim. Biz biror dastur tuzganimizda unda asosiy qismlaridan bir bu baza qismi hisoblanadi. Uni tug’ri loyihalash juda muhim hisoblanadi. Chunki u butun dasturni qanday ishlashini hal qilib beradi. Dastur shu asosida ishlaydi. Malumotlar bazasi bilan ishlashdi eng muhim ishlardan biri normallashtirish hisoblanadi. Normallashtirishlarni qilmasdan bu bazadan foydalanib bulmaydi chunki u baza bilan ishlash ancha murakkablashib ketadi va kompyuterdan kup joy ajratishi mumkin. Bu esa malumotlar tez suratda kupayib ketishi va malumotlar bilan ishlash jarayonini sekinlashtirishga olib keladi. Men bundan tashqari bu darslar davomida malumotlarni qidirish, uchirishlarni ham kurib chiqdim. Malumotlar bazasi uzi hayotimizda biror real sohaga tegishli malumotlarning tuliq ishlash strukturasi tuzilib uni relyatsion malumotlar bazasi orqali uzaro aloqalarni joylagan holda malumotlarini saqlash hisoblanadi. Bizda hayotimizda ham bunday kurinishlar juda kup uchraydi masalan: Oddiy sinf jurnalini oladigan bulsak unda uquvchilarning biror fandan olgan baholari saqlanadi.
Foydalanilgan adabiyotlar.
O‘zbekiston Respublikasining “Axborotlashtirish to‘g‘risida”gi Qonuni. (№563-11. № 560-II 11.12.2003 y.). 5. “Ma’lumotlar bazasini boshqarish tizimlar” fani bo’yicha elektron o’quv qo’llanma, TATU FF.
Зеленко Л. С. Программная.pdf
Липаев_Программная
Ayupov R.X., Ismoilov S.I., Azlarov A.X., “MS Access 2002 - ma’lumotlar majmuasini boshqarish tizimi”(o’quv qo’llanma) Toshkent.: Toshkent Moliya instituti, 2004.
Кодд Э.Ф., “Реляционная модель данных для больших совместно используемых банков данных”. СУБД. 1995 г.
Ma’ruzalardagi taqdimotlar to’plami
Internet saytlari
www.ictcouncil.gov.uz-Kompyuterlashtirishni rivojlantirish bo`yicha Vazirlar Maxkamasi muvofiqlashtiruvchi Kengashining sayti.
www.ecsoman.edu.ru–Rossiya Federatsiyasi Oliy o`quv yurtlarida o`qitilayotgan fanlar bo`yicha o`quv-uslubiy komplekslar.
ziyonet.uz–O`zbekistonning axborotlarni izlab topish tizimi.
http://ITPortal sayti.
https://www.qt.io
qt.com
Do'stlaringiz bilan baham: |