Enter password: Welcome to the Mysql monitor. Commands end with; or \g



Download 16,6 Kb.
Sana16.01.2022
Hajmi16,6 Kb.
#374165
Bog'liq
lobaratoriya
Axborot texnologiyalari va tizimlari ularning jamiyatdagi o’rni~, 10 Genlar o-zaro t, Мурод акага, 2 5197478510599340700, Internet Explorer - bu nima Rivojlanish va funktsiyalar, rvot mi, EN va MS dan 1-modul boyicha mustaqil ish, Электрон тўлов ЙЎРИҚНОМА 250420091135, 7- семинар материали, Ўрнатилган операцион тизимга кириш, pronoun and preposition, ekologik talim-tarbiya, 1- ma'ruza , 1-amaliy , 1-amaliy

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

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> show databases;

+--------------------------------------+

| Database |

+--------------------------------------+

| information_schema |

| kafedra |

| kafedra_talabalarining_ozlashtirishi |

| mysql |

| ozlashtirish_korsatgichi |

| talaba_ozlashtirish |

| talabalar_ozlash |

| talabalar_ozlashtirish |

| temiryol_stansiyasi |

| test |


+--------------------------------------+

11 rows in set (0.04 sec)

mysql> use ozlashtirish_korsatgichi;

Database changed

mysql> show tables;

+------------------------------------+

| Tables_in_ozlashtirish_korsatgichi |

+------------------------------------+

| fanlar |

| kafedralar |

| o_k |

| oqituvchilar |

| talabalar |

+------------------------------------+

5 rows in set (0.03 sec)

mysql> select hello world();

+--------------+

| Helloworld() |

+--------------+

| HELLO WORLD |

+--------------+

1 row in set (0.07 sec)

mysql> CREATE FUNCTION plus(a int,b int) RETURNS int DETERMINISTIC BEGIN DECLARE result INT; SET result = a+b; RETURN (result); END//

mysql> CREATE FUNCTION plus(a int,b int) RETURNS int DETERMINISTIC BEGIN DECLARE result INT; SET result = a+b; RETURN (result); END//

ERROR 1304 (42000): FUNCTION plus already exists

mysql> select plus(20,65);

-> //

+-------------+



| plus(20,65) |

+-------------+

| 85 |

+-------------+



1 row in set (0.07 sec)

\d// CREATE FUNCTION minus(a int,b int) RETURNS int DETERMINISTIC BEGIN DECLARE result INT; SET result = a-b; RETURN (result); END//

Query OK, 0 rows affected (0.06 sec)

mysql> select minus(50, 36);

-> //

+---------------+



| minus(50, 36) |

+---------------+

| 14 |

+---------------+



1 row in set (0.00 sec)

/ CREATE FUNCTION bolish(a int,b int) RETURNS int DETERMINISTIC BEGIN DECLARE result INT; SET result = a/b; RETURN (result); END//

Query OK, 0 rows affected (0.00 sec)

mysql> select bolish(100, 4);//

+----------------+

| bolish(100, 4) |

+----------------+

| 25 |


+----------------+

1 row in set (0.00 sec)

\d// CREATE FUNCTION ildizz(a int,b int) RETURNS int DETERMINISTIC BEGIN DECLARE result INT; SET result = sqrt(a*b); RETURN (result); END//

Query OK, 0 rows affected (0.05 sec)

mysql> select ildizz(6,6);//

+-------------+

| ildizz(6,6) |

+-------------+

| 6 |

+-------------+



1 row in set (0.00 sec)

\d// CREATE FUNCTION modul(a int) RETURNS int DETERMINISTIC BEGIN DECLARE result INT; SET result = abs(a); RETURN (result); END//

Query OK, 0 rows affected (0.00 sec)

mysql> select modul(-10);//

+------------+

| modul(-10) |

+------------+

| 10 |


+------------+

1 row in set (0.00 sec)

mysql> select modul(22);//

+-----------+

| modul(22) |

+-----------+

| 22 |

+-----------+



1 row in set (0.00 sec)

mysql> create database triger;

-> ?

Query OK, 1 row affected (0.00 sec)



mysql> use triger?

Database changed

mysql> create table bemorlar

-> (id int auto_increment primery key,

-> Nomi varchar(25),

-> Ketgan_sana date,

-> Kelgan_sana date)?

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 'primery key,

Nomi varchar(25),

Ketgan_sana date,

Kelgan_sana date)' at line 2

mysql> create table Poyezdlar

-> (id int(10),

-> Nomi varchar(25),

-> Ketgan_sana date,

-> Kelgan_sana date)?

Query OK, 0 rows affected (0.01 sec)

mysql> desc loyixalar;?

+-------------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------------+-------------+------+-----+---------+-------+

| id | int(10) | YES | | NULL | |

| Nomi | varchar(25) | YES | | NULL | |

| Ketgan_sana | date | YES | | NULL | |

| Kelgan_sana | date | YES | | NULL | |

+-------------+-------------+------+-----+---------+-------+

4 rows in set (0.02 sec)

mysql> create trigger bemorlar before insert

-> on shifoxona

-> for each row begin

-> set new.kergan_sana = now();

-> end?


ERROR 1054 (42S22): Unknown column ‘Shifoxona in 'NEW'

mysql> create trigger bemorlar before insert

-> on shifoxona

-> for each row begin

-> set new.ketgan_sana = now();

-> end?


Query OK, 0 rows affected (0.01 sec)

mysql> insert into bemorlar (nomi) values

-> ('sodiqov'),

-> ('axrorov'),

-> ('azizov')?

Query OK, 3 rows affected, 3 warnings (0.01 sec)

Records: 3 Duplicates: 0 Warnings: 3

mysql> select * from bemorlar;

-> ?

+------+-----------+-------------+-------------+



| id | Nomi | Ketgan_sana | Kelgan_sana |

+------+-----------+-------------+-------------+

| NULL | azizov | 2021-12-16 | NULL |

| NULL | axrorov | 2021-12-16 | NULL |

| NULL | sodiqov | 2021-12-16 | NULL |

+------+-----------+-------------+-------------+



3 rows in set (0.00 sec)

mysql>
Download 16,6 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2022
ma'muriyatiga murojaat qiling

    Bosh sahifa
davlat universiteti
ta’lim vazirligi
axborot texnologiyalari
maxsus ta’lim
zbekiston respublikasi
guruh talabasi
O’zbekiston respublikasi
nomidagi toshkent
o’rta maxsus
davlat pedagogika
texnologiyalari universiteti
toshkent axborot
xorazmiy nomidagi
rivojlantirish vazirligi
pedagogika instituti
Ўзбекистон республикаси
tashkil etish
haqida tushuncha
таълим вазирлиги
vazirligi muhammad
O'zbekiston respublikasi
toshkent davlat
махсус таълим
respublikasi axborot
kommunikatsiyalarini rivojlantirish
vazirligi toshkent
saqlash vazirligi
fanidan tayyorlagan
bilan ishlash
Toshkent davlat
sog'liqni saqlash
uzbekistan coronavirus
respublikasi sog'liqni
coronavirus covid
koronavirus covid
vazirligi koronavirus
qarshi emlanganlik
risida sertifikat
covid vaccination
sertifikat ministry
vaccination certificate
Ishdan maqsad
fanidan mustaqil
matematika fakulteti
o’rta ta’lim
haqida umumiy
fanlar fakulteti
pedagogika universiteti
ishlab chiqarish
moliya instituti
fanining predmeti