- •Лабораторная работа №2 по курсу субд oracle Введение
- •Задание
- •Составить и выполнить команды select
- •Примеры
- •13 Rows selected.
- •13 Rows selected.
- •13 Rows selected.
- •3.5" Floppy Disk 10
- •13 Rows selected.
- •3.5" Floppy Disk 10
- •12 Rows selected.
- •2 Where (price between 10 and 60) and (price not in (10,60));
- •3.5" Floppy Disk 10 30
- •11 Rows selected.
- •3.5" Floppy Disk
- •11 Rows selected.
- •3.5" Floppy Disk 10
- •14 Rows selected.
- •14 Rows selected.
3.5" Floppy Disk
DVD-R Disk
DVD+R Disk
DVD-RW Disk
DVD+RW Disk
Red Ink Marker
Green Ink Marker
Blue Ink Marker
Milk 3 lt.
11 Rows selected.
SQL>
SQL> -- использование оператора LIKE для выборки по символьным шаблонам
SQL> SELECT name, price FROM product WHERE name LIKE 'CD%';
NAME PRICE
------------------------- ----------
CD-RW Disk 20
CD-R Disk 15
SQL> SELECT name, price FROM product WHERE name LIKE '%Disk';
NAME PRICE
------------------------- ----------
CD-RW Disk 20
CD-R Disk 15
3.5" Floppy Disk 10
DVD-R Disk 80
DVD+R Disk 80
DVD-RW Disk 300
DVD+RW Disk 300
7 rows selected.
SQL> SELECT name, price FROM product WHERE name LIKE '%-RW%';
NAME PRICE
------------------------- ----------
CD-RW Disk 20
DVD-RW Disk 300
SQL> SELECT name, price FROM product WHERE name LIKE 'Milk%lt.';
NAME PRICE
------------------------- ----------
Milk 1 lt. 20
Milk 3 lt. 60
Milk 3 lt. 65
SQL> SELECT name, price FROM product WHERE name LIKE 'Milk _ lt.';
NAME PRICE
------------------------- ----------
Milk 1 lt. 20
Milk 3 lt. 60
Milk 3 lt. 65
SQL> SELECT name, price FROM product WHERE name LIKE 'DVD_R Disk';
NAME PRICE
------------------------- ----------
DVD-R Disk 80
DVD+R Disk 80
SQL> SELECT name, price FROM product WHERE name LIKE 'DVD_R%';
NAME PRICE
------------------------- ----------
DVD-R Disk 80
DVD+R Disk 80
DVD-RW Disk 300
DVD+RW Disk 300
SQL> --
SQL> -- УПОРЯДОЧИВАНИЕ ПОЛУЧАЕМЫХ ДАННЫХ (СТРОК)
SQL> --
SQL> SELECT name, price FROM product;
NAME PRICE
------------------------- ----------
CD-RW Disk 20
CD-R Disk 15