Академический Документы
Профессиональный Документы
Культура Документы
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.1.30-MariaDB Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [almacen]> select * from articulos where precio between 200 and 350;
+-------------+-------------+--------+---------------+
| id_articulo | nombre | precio | id_fabricante |
+-------------+-------------+--------+---------------+
| 5 | memoria ram | 290 | 1|
| 7 | memoria usb | 279 | 1|
| 9 | cd rom | 200 | 2|
+-------------+-------------+--------+---------------+
3 rows in set (0.00 sec)
MariaDB [almacen]> select * from articulos where nombre = 'memoria ram'or nombre'memoria
usb';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds
to your MariaDB server version for the right syntax to use near ''memoria usb'' at line 1
MariaDB [almacen]> select * from articulos where nombre ='memoria ram'or nombre='memoria
usb';
+-------------+-------------+--------+---------------+
| id_articulo | nombre | precio | id_fabricante |
+-------------+-------------+--------+---------------+
| 4 | memoria usb | 140 | 4|
| 5 | memoria ram | 290 | 1|
| 7 | memoria usb | 279 | 1|
+-------------+-------------+--------+---------------+
3 rows in set (0.00 sec)
MariaDB [almacen]> select nombre,precio from articulos where precio>=250 order by precio
desc,nombre;
+----------------------------+--------+
| nombre | precio |
+----------------------------+--------+
| disco duro extraible 250gb | 650 |
| disco duro300 gb | 500 |
| dvd rom | 450 |
| memoria ram | 290 |
| memoria usb | 279 |
+----------------------------+--------+
5 rows in set (0.00 sec)
MariaDB [almacen]> select nombre,precio from articulos where precio>=250 order by precio
desc,nombre;
+----------------------------+--------+
| nombre | precio |
+----------------------------+--------+
| disco duro extraible 250gb | 650 |
| disco duro300 gb | 500 |
| dvd rom | 450 |
| memoria ram | 290 |
| memoria usb | 279 |
+----------------------------+--------+
5 rows in set (0.00 sec)
MariaDB [almacen]> select*from articulos where precio>=250 order by precio desc, nombre asc;
+-------------+----------------------------+--------+---------------+
| id_articulo | nombre | precio | id_fabricante |
+-------------+----------------------------+--------+---------------+
| 6 | disco duro extraible 250gb | 650 | 5|
| 2 | disco duro300 gb | 500 | 5|
| 8 | dvd rom | 450 | 2|
| 5 | memoria ram | 290 | 1|
| 7 | memoria usb | 279 | 1|
+-------------+----------------------------+--------+---------------+
5 rows in set (0.00 sec)