O’zbekiston Respublikasi va komunikatsiyalarni rivijlantirish vazirligi

Muhammad Al-Xorazmiy nomidagi Toshkent axborot texnologiyalari universiteti
Amaliy ishi №1
Bajardi:Abdutolipov Mahmud
Tekshirdi:Yuldashov Rahman
mysql-installer-community-8.0.28.0.msi dasturini o’rnatish.
2-AMALIY MASHG‘ULOT
Mavzu: Avto salon malumotlar bazasini yaratish
lavozimi
Ish tajribasi
Joy nomeri
Ish vaqti
Yoshi
F.I.SH
id
joyi
maydoni
Joy nomeri
Turi
Vaqti
BUGALTERIYASi
MASHINA
Sig’imi
XODIMLAR
nomi
id
AVTO PARK
Ma‘lumotlar bazasining Buhgalteriya jadvali
|
|
ID
|
FSHI
|
Xojayni
|
Joy nomeri
|
|
|
1
|
dilshod
|
Islom
|
2023
|
|
|
2
|
Doston
|
Bunyod
|
2024
|
|
|
3
|
Islom
|
Eshmat
|
2025
|
|
|
4
|
Nodir
|
G'ani
|
2026
|
|
|
5
|
Jambul
|
Tesha
|
2027
|
|
|
6
|
Jasur
|
Bolta
|
2028
|
|
|
7
|
Toshmat
|
Ali
|
2029
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ma‘lumotlar bazasining Xodimlar jadvali
|
|
ID
|
FISH
|
yoshi
|
lavozimi
|
tajribasi
|
|
1
|
Jonijon
|
19
|
qorovul
|
4
|
|
2
|
Elbek
|
18
|
boshliq
|
6
|
|
3
|
Jamshid
|
17
|
yuk toshuvchi
|
8
|
|
4
|
Shohjahon
|
16
|
qorovul
|
10
|
|
5
|
Nosirov
|
19
|
boshliq
|
12
|
|
6
|
Davron
|
14
|
yuk toshuvchi
|
14
|
|
7
|
Jasur
|
25
|
qorovul
|
16
|
|
|
|
|
|
|
|
|
|
|
|
|
Ma‘lumotlar bazasining mashina jadvali
|
|
|
|
|
|
ID
|
Brendi
|
Nomi
|
Soni
|
Firmasi
|
|
|
|
|
|
1
|
Apple
|
Gentra
|
10
|
MCHJ
|
|
|
|
|
|
2
|
BMW
|
Trakker
|
7
|
YTT
|
|
|
|
|
|
3
|
Bugatti
|
Cobalt
|
4
|
MCHJ
|
|
|
|
|
|
4
|
Nissan
|
malibu
|
1
|
YTT
|
|
|
|
|
|
5
|
Bugatti
|
Kaptiva
|
2
|
MCHJ
|
|
|
|
|
|
6
|
Nissan
|
Damas
|
5
|
YTT
|
|
|
|
|
|
7
|
Bugatti
|
tiko
|
8
|
MCHJ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3-AMALIY MASHG‘ULOT
Mavzu: SQL tilida jadvallar yaratish, o‘zgartirish va o‘chirish
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 24
Server version: 8.0.28 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| sys |
| testdb |
| world |
+--------------------+
7 rows in set (0.01 sec)
mysql> create database testdb;
ERROR 1007 (HY000): Can't create database 'testdb'; database exists
mysql> use testdb;
Database changed
mysql> create table talaba(id int, fish char(70),manzil char(30));
Query OK, 0 rows affected (0.13 sec)
mysql> insert into talaba values(1,"Qamariddinov Jonibek ","Qashqadaryo v");
Query OK, 1 row affected (0.02 sec)
mysql> insert into talaba values(2,"Nuraleyv Diyorbek ","Qashqadaryo v");
Query OK, 1 row affected (0.01 sec)
mysql> insert into talaba values(3,"Alimov Husniddin","Qashqadaryo v");
Query OK, 1 row affected (0.01 sec)
mysql> selict *from talaba;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'selict *from talaba' at line 1
mysql> select*from talaba;
+------+--------------------------------+---------------+
| id | fish | manzil |
+------+--------------------------------+---------------+
| 1 | Qamariddinov Dilshod|JIzzax v |
| 2 |Abdutolipov Mahmud |jizzax v |
| 3 | Alimov Husniddin | Jizzax v |
+------+--------------------------------+---------------+
3 rows in set (0.01 sec)
mysql>
mysql> alter talbe talaba add maosh varchar(20);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'talbe talaba add maosh varchar(20)' at line 1
mysql> alter table talaba add maosh varchar(20);
Query OK, 0 rows affected (0.07 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> update talaba set maosh='3000';
Query OK, 3 rows affected (0.01 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> select*from talaba;
+------+--------------------------------+---------------+-------+
| id | fish | manzil | maosh |
+------+--------------------------------+---------------+-------+
| 1 | Qamariddinov Dilshod | JIzzax v | 3000 |
| 2 | Abdutolipov Mahmud| Jizzax v | 3000 |
| 3 | Alimov Husniddin | Jizzax v | 3000 |
+------+--------------------------------+---------------+-------+
3 rows in set (0.00 sec)
mysql> update talaba set maosh ="40000" where id=1
-> select *from talaba;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select *from talaba' at line 2
mysql> update talaba set maosh ="40000" where id=1;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select *from talaba;
+------+--------------------------------+---------------+-------+
| id | fish | manzil | maosh |
+------+--------------------------------+---------------+-------+
| 1 Qamariddinov Dilshod|Jizzax v | 40000 |
| 2 | Abdutolipov Mahmud|Jizzax v | 3000 |
| 3 | Alimov Husniddin | Jizzax v | 3000 |
+------+--------------------------------+---------------+-------+
3 rows in set (0.00 sec)
mysql> select*from talaba where maosh>3000 and id in(1,2,3);
+------+--------------------------------+---------------+-------+
| id | fish | manzil | maosh |
+------+--------------------------------+---------------+-------+
| 1 | Qamariddinov Dilshod| Jizzaxv | 40000 |
+------+--------------------------------+---------------+-------+
1 row in set (0.01 sec)
mysql> insert into talaba values(4, "Hayotov Hasan","Toshkent v",3500);
Query OK, 1 row affected (0.05 sec)
mysql> insert into talaba values(5,"Bozorov Begali","Sirdaryo v",5000);
Query OK, 1 row affected (0.01 sec)
mysql> insert into talaba values(6,"Boyturaev Shodiyor","Sirdaryo v",10000);
Query OK, 1 row affected (0.01 sec)
mysql> select *from talaba;
+------+--------------------------------+---------------+-------+
| id | fish | manzil | maosh |
+------+--------------------------------+---------------+-------+
| 1 | Qamariddinov Dilshod | Jizzaxv | 40000 |
| 2 | Abdutolipov Mahmud| Jizzax v | 3000 |
| 3 | Alimov Husniddin | Jizzax v | 3000 |
| 4 | Hayotov Hasan | Toshkent v | 3500 |
| 5 | Bozorov Begali | Sirdaryo v | 5000 |
| 6 | Boyturaev Shodiyor | Sirdaryo v | 10000 |
+------+--------------------------------+---------------+-------+
6 rows in set (0.00 sec)
mysql> ^C
mysql>
|