1. Ma’lumotlar bazasi dasturlarini o’rnatish va sozlash



Yüklə 96,58 Kb.
tarix07.01.2024
ölçüsü96,58 Kb.
#211042
1. Ma’lumotlar bazasi dasturlarini o’rnatish va sozlash


O’ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI
MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI

AMALIY ISH

Bajardi: DBM 005 guruh talabasi
Tuyqulov Asadbek
Tekshirdi: Djurayev Tulkinjon
Toshkent - 2023

1-Mustaqil ish


1.Ma’lumotlar bazasi dasturlarini o’rnatish va sozlash (MySql server, Oracle Server, Microsoft SQL Server).
Denwer programmasini o’rnatish:

Denwer programmasi ustiga ikki marta bosiladi


Da tugmasi bosiladi va bunday ochiladi



Va qora oydaga otib 2 marta enter tugmasi bosiladi

Va bunday buyruq chiqadi va o’rnatmoqchi bo’lsak “Y” tugmasi bosiladi va enter tugmasi bosiladi


Va bunday buyruq chiqadi va Z tugmasi bosiladi keyin C diskimiz o’xshagan yana bir disk chiqadi


Va qora oynaga o’tib enter tugmasi bosiladi


Keyin esa bizga Рабочем столе o’rnataymi deb soraydi va Y tugmasi bosiladi



Va brauzerga otib ketadi

Рабочем столе shunday 3ta programma chiqadi


Va mana bu programma ustiga bosiladi


Va Denwer dasturi ishlayot yoki ishlamayotganligini,

Bu yerdan bilib olamiz




  • bu belgi ishlayotganligini bildiradi.

Va brauzerga o’tib https://localhost/tools/phpmyadmin qidiriladi

Shunday qilib dasturimiz o’rnatilindi e’tiboringiz uchun rahmat.


2.Ma’lumotlar bazasini loyihalash, mohiyat – aloqa diagrammasini qurish. Relyatsion ma’lumotlar bazasini loyihalash.

-- Create Airport database
CREATE DATABASE Airport;
-- Use Airport database
USE Airport;
-- Create table for airports
CREATE TABLE Airports (
AirportID INT PRIMARY KEY,
AirportName VARCHAR(255) NOT NULL,
City VARCHAR(255) NOT NULL,
Country VARCHAR(255) NOT NULL);


-- Create table for airlines
CREATE TABLE Airlines (
AirlineID INT PRIMARY KEY,
AirlineName VARCHAR(255) NOT NULL,
ContactNumber VARCHAR(20) NOT NULL
);



-- Create table for flights
CREATE TABLE Flights (
FlightID INT PRIMARY KEY,
FlightNumber VARCHAR(20) NOT NULL,
DepartureAirportID INT,
ArrivalAirportID INT,
AirlineID INT,
FOREIGN KEY (DepartureAirportID) REFERENCES Airports(AirportID),
FOREIGN KEY (ArrivalAirportID) REFERENCES Airports(AirportID),
FOREIGN KEY (AirlineID) REFERENCES Airlines(AirlineID)
);


-- Create table for passengers
CREATE TABLE Passengers (
PassengerID INT PRIMARY KEY,
FirstName VARCHAR(255) NOT NULL,
LastName VARCHAR(255) NOT NULL,
Email VARCHAR(255) NOT NULL,
PhoneNumber VARCHAR(20) NOT NULL
);


-- Create table for bookings
CREATE TABLE Bookings (
BookingID INT PRIMARY KEY,
FlightID INT,
PassengerID INT,
SeatNumber VARCHAR(10),
FOREIGN KEY (FlightID) REFERENCES Flights(FlightID),
FOREIGN KEY (PassengerID) REFERENCES Passengers(PassengerID)
);


-- Create table for baggage
CREATE TABLE Baggage (
BaggageID INT PRIMARY KEY,
BookingID INT,
Weight DECIMAL(5,2),
FOREIGN KEY (BookingID) REFERENCES Bookings(BookingID)
);




-- Insert sample data into Airports table
INSERT INTO Airports (AirportID, AirportName, City, Country) VALUES
(1, 'John F. Kennedy International Airport', 'New York', 'USA'),
(2, 'Los Angeles International Airport', 'Los Angeles', 'USA'),
(3, 'Heathrow Airport', 'London', 'UK'),
(4, 'Charles de Gaulle Airport', 'Paris', 'France');



-- Insert sample data into Airlines table
INSERT INTO Airlines (AirlineID, AirlineName, ContactNumber) VALUES
(1, 'Delta Air Lines', '1-800-221-1212'),
(2, 'American Airlines', '1-800-433-7300'),
(3, 'United Airlines', '1-800-864-8331');


-- Insert sample data into Flights table
INSERT INTO Flights (FlightID, FlightNumber, DepartureAirportID, ArrivalAirportID, AirlineID) VALUES
(1, 'DL100', 1, 2, 1),
(2, 'AA200', 2, 3, 2),
(3, 'UA300', 1, 3, 3);


-- Insert sample data into Passengers table
INSERT INTO Passengers (PassengerID, FirstName, LastName, Email, PhoneNumber) VALUES
(1, 'John', 'Doe', 'johndoe@example.com', '123-456-7890'),
(2, 'Jane', 'Smith', 'janesmith@example.com', '987-654-3210');




-- Insert sample data into Bookings table
INSERT INTO Bookings (BookingID, FlightID, PassengerID, SeatNumber) VALUES
(1, 1, 1, 'A1'),
(2, 2, 2, 'B2');



-- Insert sample data into Baggage table
INSERT INTO Baggage (BaggageID, BookingID, Weight) VALUES
(1, 1, 25.5),
(2, 2, 32.0);


XULOSA:
Xulosa qilib aytadigan bo’lsak My Sql dasturida biz yangi jadval tuzimish ,unga satr va ustunlar qo’shishimiz, Bir atributni boshqasiga almashtirishimiz, malumotlar hajmini ozgartirishimiz, ba’zi ma’lumotlarni o’chirishimiz ham mumkin ekan va Relyatsion ma’lumotlar bazasini loyihalashni o’rgandim.
Yüklə 96,58 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin