Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.51-community MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database Uni_talaba_ozlash;
Query OK, 1 row affected (0.06 sec)
mysql> show databases;
+-------------------------+
| Database |
+-------------------------+
| information_schema |
| 710_19 |
| agregat |
| dorixona |
| harbiy_okrug |
| imtihon |
| imtihon_2 |
| kutubxona |
| kutubxona_1 |
| kutubxona_2 |
| kutubxona_621 |
| kutubxona_fargona |
| kutubxona_mb |
| kutubxona_mb_642_20 |
| market |
| marko_supermarket |
| minimarket |
| mur_sorov |
| mysql |
| osiyo_supermarket |
| savdo_tashkilotii |
| sayyohlik_agentligi |
| shifoxona |
| talabalar_ozlashtirishi |
| tatu_ff |
| test |
| test1 |
| uni_talaba_ozlash |
+-------------------------+
28 rows in set (0.04 sec)
mysql> use uni_talaba_ozlash;
Database changed
mysql> create table Fakultet
-> (Nomi varchar(30) primary key,
-> Dekan_FIO varchar(50),
-> Xona_raqam int(5),
-> Bino_raqam int(5),
-> Tel varchar(15));
Query OK, 0 rows affected (0.19 sec)
mysql> show tables;
+-----------------------------+
| Tables_in_uni_talaba_ozlash |
+-----------------------------+
| fakultet |
+-----------------------------+
1 row in set (0.00 sec)
mysql> desc fakultet;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| Nomi | varchar(30) | NO | PRI | NULL | |
| Dekan_FIO | varchar(50) | YES | | NULL | |
| Xona_raqam | int(5) | YES | | NULL | |
| Bino_raqam | int(5) | YES | | NULL | |
| Tel | varchar(15) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
5 rows in set (0.12 sec)
mysql> Alter table fakultet RENAME FAKULTETLAR;
Query OK, 0 rows affected (0.10 sec)
mysql> show tables;
+-----------------------------+
| Tables_in_uni_talaba_ozlash |
+-----------------------------+
| fakultetlar |
+-----------------------------+
1 row in set (0.00 sec)
mysql> desc fakultet;
ERROR 1146 (42S02): Table 'uni_talaba_ozlash.fakultet' doesn't exist
mysql> desc fakultetLAR;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| Nomi | varchar(30) | NO | PRI | NULL | |
| Dekan_FIO | varchar(50) | YES | | NULL | |
| Xona_raqam | int(5) | YES | | NULL | |
| Bino_raqam | int(5) | YES | | NULL | |
| Tel | varchar(15) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
5 rows in set (0.10 sec)
mysql> ALTER TABLE FAKULTETLAR ADD IZOH TEXT;
Query OK, 0 rows affected (0.30 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc fakultetLAR;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| Nomi | varchar(30) | NO | PRI | NULL | |
| Dekan_FIO | varchar(50) | YES | | NULL | |
| Xona_raqam | int(5) | YES | | NULL | |
| Bino_raqam | int(5) | YES | | NULL | |
| Tel | varchar(15) | YES | | NULL | |
| IZOH | text | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
6 rows in set (0.04 sec)
mysql> ALTER TABLE FAKULTETLAR ADD IZOH2 TEXT FIRST;
Query OK, 0 rows affected (0.24 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc fakultetLAR;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| IZOH2 | text | YES | | NULL | |
| Nomi | varchar(30) | NO | PRI | NULL | |
| Dekan_FIO | varchar(50) | YES | | NULL | |
| Xona_raqam | int(5) | YES | | NULL | |
| Bino_raqam | int(5) | YES | | NULL | |
| Tel | varchar(15) | YES | | NULL | |
| IZOH | text | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
7 rows in set (0.09 sec)
mysql> ALTER TABLE FAKULTETLAR ADD IZOH3 TEXT AFTER NOMI;
Query OK, 0 rows affected (0.27 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc fakultetLAR;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| IZOH2 | text | YES | | NULL | |
| Nomi | varchar(30) | NO | PRI | NULL | |
| IZOH3 | text | YES | | NULL | |
| Dekan_FIO | varchar(50) | YES | | NULL | |
| Xona_raqam | int(5) | YES | | NULL | |
| Bino_raqam | int(5) | YES | | NULL | |
| Tel | varchar(15) | YES | | NULL | |
| IZOH | text | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
8 rows in set (0.10 sec)
mysql> ALTER TABLE FAKULTETLAR DROP IZOH2 ;
Query OK, 0 rows affected (0.23 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> ALTER TABLE FAKULTETLAR DROP IZOH3 ;
Query OK, 0 rows affected (0.28 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc fakultetLAR;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| Nomi | varchar(30) | NO | PRI | NULL | |
| Dekan_FIO | varchar(50) | YES | | NULL | |
| Xona_raqam | int(5) | YES | | NULL | |
| Bino_raqam | int(5) | YES | | NULL | |
| Tel | varchar(15) | YES | | NULL | |
| IZOH | text | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
6 rows in set (0.10 sec)
mysql> ALTER TABLE FAKULTETLAR MODIFY IZOH VARCHAR(50);
Query OK, 0 rows affected (0.27 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc fakultetLAR;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| Nomi | varchar(30) | NO | PRI | NULL | |
| Dekan_FIO | varchar(50) | YES | | NULL | |
| Xona_raqam | int(5) | YES | | NULL | |
| Bino_raqam | int(5) | YES | | NULL | |
| Tel | varchar(15) | YES | | NULL | |
| IZOH | varchar(50) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
6 rows in set (0.03 sec)
mysql> ALTER TABLE FAKULTETLAR CHANGE NOMI FAKULTET_NOMI VARCHAR(45);
Query OK, 0 rows affected (0.26 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc fakultetLAR;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| FAKULTET_NOMI | varchar(45) | NO | PRI | | |
| Dekan_FIO | varchar(50) | YES | | NULL | |
| Xona_raqam | int(5) | YES | | NULL | |
| Bino_raqam | int(5) | YES | | NULL | |
| Tel | varchar(15) | YES | | NULL | |
| IZOH | varchar(50) | YES | | NULL | |
+---------------+-------------+------+-----+---------+-------+
6 rows in set (0.03 sec)
mysql> SHOW TABLES;
+-----------------------------+
| Tables_in_uni_talaba_ozlash |
+-----------------------------+
| fakultetlar |
+-----------------------------+
1 row in set (0.00 sec)
mysql> DESC FAKULTETLAR;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| FAKULTET_NOMI | varchar(45) | NO | PRI | | |
| Dekan_FIO | varchar(50) | YES | | NULL | |
| Xona_raqam | int(5) | YES | | NULL | |
| Bino_raqam | int(5) | YES | | NULL | |
| Tel | varchar(15) | YES | | NULL | |
| IZOH | varchar(50) | YES | | NULL | |
+---------------+-------------+------+-----+---------+-------+
6 rows in set (0.10 sec)
mysql> INSERT INTO FAKULTETLAR VALUES
-> ('KIF','O.H.Otaqulov',321,1,'+9986352147','Kompyuter injiniringi fakulteti'),
-> ('TT va KT','F.Raimov',121,2,'+998665656','Telekomunikatsiya texnologiyalari ');
Query OK, 2 rows affected (0.07 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from fakultetlar;
+---------------+--------------+------------+------------+-------------+------------------------------------+
| FAKULTET_NOMI | Dekan_FIO | Xona_raqam | Bino_raqam | Tel | IZOH |
+---------------+--------------+------------+------------+-------------+------------------------------------+
| KIF | O.H.Otaqulov | 321 | 1 | +9986352147 | Kompyuter injiniringi fakulteti |
| TT va KT | F.Raimov | 121 | 2 | +998665656 | Telekomunikatsiya texnologiyalari |
+---------------+--------------+------------+------------+-------------+------------------------------------+
2 rows in set (0.00 sec)
mysql> select Fakultet_nomi, Dekan_fio from fakultetlar;
+---------------+--------------+
| Fakultet_nomi | Dekan_fio |
+---------------+--------------+
| KIF | O.H.Otaqulov |
| TT va KT | F.Raimov |
+---------------+--------------+
2 rows in set (0.00 sec)
mysql> select * from fakultetlar;
+---------------+--------------+------------+------------+-------------+------------------------------------+
| FAKULTET_NOMI | Dekan_FIO | Xona_raqam | Bino_raqam | Tel | IZOH |
+---------------+--------------+------------+------------+-------------+------------------------------------+
| KIF | O.H.Otaqulov | 321 | 1 | +9986352147 | Kompyuter injiniringi fakulteti |
| TT va KT | F.Raimov | 121 | 2 | +998665656 | Telekomunikatsiya texnologiyalari |
+---------------+--------------+------------+------------+-------------+------------------------------------+
2 rows in set (0.00 sec)
mysql> update fakultetlar set Dekan_fio='F.Rahimov' where fakultet_nomi='TT va KT';
Query OK, 1 row affected (0.04 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from fakultetlar;
+---------------+--------------+------------+------------+-------------+------------------------------------+
| FAKULTET_NOMI | Dekan_FIO | Xona_raqam | Bino_raqam | Tel | IZOH |
+---------------+--------------+------------+------------+-------------+------------------------------------+
| KIF | O.H.Otaqulov | 321 | 1 | +9986352147 | Kompyuter injiniringi fakulteti |
| TT va KT | F.Rahimov | 121 | 2 | +998665656 | Telekomunikatsiya texnologiyalari |
+---------------+--------------+------------+------------+-------------+------------------------------------+
2 rows in set (0.00 sec)
mysql> update fakultetlar set Dekan_fio='F.Qosimov' where dekan_fio='F.Rahimov'
-> ;
Query OK, 1 row affected (0.09 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from fakultetlar;
+---------------+--------------+------------+------------+-------------+------------------------------------+
| FAKULTET_NOMI | Dekan_FIO | Xona_raqam | Bino_raqam | Tel | IZOH |
+---------------+--------------+------------+------------+-------------+------------------------------------+
| KIF | O.H.Otaqulov | 321 | 1 | +9986352147 | Kompyuter injiniringi fakulteti |
| TT va KT | F.Qosimov | 121 | 2 | +998665656 | Telekomunikatsiya texnologiyalari |
+---------------+--------------+------------+------------+-------------+------------------------------------+
2 rows in set (0.00 sec)
mysql> select * from fakultetLAR;
+---------------+--------------+------------+------------+-------------+------------------------------------+
| FAKULTET_NOMI | Dekan_FIO | Xona_raqam | Bino_raqam | Tel | IZOH |
+---------------+--------------+------------+------------+-------------+------------------------------------+
| KIF | O.H.Otaqulov | 321 | 1 | +9986352147 | Kompyuter injiniringi fakulteti |
| TT va KT | F.Qosimov | 121 | 2 | +998665656 | Telekomunikatsiya texnologiyalari |
+---------------+--------------+------------+------------+-------------+------------------------------------+
2 rows in set (0.00 sec)
mysql> DELETE FROM FAKULTETLAR;
Query OK, 2 rows affected (0.04 sec)
mysql> select * from fakultetLAR;
Empty set (0.00 sec)
mysql> INSERT INTO FAKULTETLAR VALUES
-> ('KIF','O.H.Otaqulov',321,1,'+9986352147','Kompyuter injiniringi fakulteti'),
-> ('TT va KT','F.Raimov',121,2,'+998665656','Telekomunikatsiya texnologiyalari');
Query OK, 2 rows affected (0.08 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from fakultetLAR;
+---------------+--------------+------------+------------+-------------+-----------------------------------+
| FAKULTET_NOMI | Dekan_FIO | Xona_raqam | Bino_raqam | Tel | IZOH |
+---------------+--------------+------------+------------+-------------+-----------------------------------+
| KIF | O.H.Otaqulov | 321 | 1 | +9986352147 | Kompyuter injiniringi fakulteti |
| TT va KT | F.Raimov | 121 | 2 | +998665656 | Telekomunikatsiya texnologiyalari |
+---------------+--------------+------------+------------+-------------+-----------------------------------+
2 rows in set (0.00 sec)
mysql> DELETE FROM FAKULTETLAR WHERE FAKULTET_NOMI='TT va KT';
Query OK, 1 row affected (0.07 sec)
mysql> select * from fakultetLAR;
+---------------+--------------+------------+------------+-------------+---------------------------------+
| FAKULTET_NOMI | Dekan_FIO | Xona_raqam | Bino_raqam | Tel | IZOH |
+---------------+--------------+------------+------------+-------------+---------------------------------+
| KIF | O.H.Otaqulov | 321 | 1 | +9986352147 | Kompyuter injiniringi fakulteti |
+---------------+--------------+------------+------------+-------------+---------------------------------+
1 row in set (0.00 sec)
mysql>
Do'stlaringiz bilan baham: |