👷♂️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SCHEMA SHIPS; | |
--Напишете заявка, която извежда името на класа и страната | |
--за всички класове с брой на оръдията по-малък от 10 | |
SELECT COUNTRY, TYPE | |
FROM CLASSES | |
WHERE NUMGUNS < 10; | |
--Напишете заявка, която извежда имената на всички кораби, | |
--пуснати на вода преди 1918. Задайте псевдоним на колоната shipName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SCHEMA MOVIES; | |
--Напишете заявка, която извежда имената на актьорите мъже участвали в ‘Terms of Endearment’ | |
SELECT STARNAME | |
FROM STARSIN | |
WHERE MOVIETITLE = 'Terms of Endearment'; | |
--Напишете заявка, която извежда имената на актьорите участвали във филми продуцирани от | |
--‘MGM’през 1995 г. | |
SELECT STARSIN.STARNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SCHEMA PC; | |
--Напишете заявка, която извежда производителя и честотата на тези лаптопи с размер на диска поне 9 GB | |
SELECT SPEED, PRODUCT.MAKER | |
FROM LAPTOP, PRODUCT | |
WHERE HD <= 9 AND PRODUCT.MODEL = LAPTOP.MODEL; | |
--Напишете заявка, която извежда номер на модел и цена на всички продукти, произведени от производител с име ‘B’ | |
SELECT P.PRICE, P.MODEL | |
FROM PRODUCT, PRINTER AS P |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typos.draft1 = c(2,3,0,3,1,0,0,1) | |
typos.draft2 = c(0,3,0,3,1,0,0,1) | |
typos.draft2 = typos.draft1 | |
typos.draft2 | |
typos.draft2[1] = 0 | |
typos.draft2 | |
typos.draft2[2] | |
typos.draft2[-3] #printing the vector without it's third element | |
typos.draft2[c(2,4,5,8)] | |
typos=c(2,3,0,3,1,0,0,1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x2 = c(2,3,0,3,1,0,0,1) | |
max(x2) #max element in the vector x2 | |
min(x2) #min -//- | |
x2 == 3 | |
x2 == 0 | |
which(x2 == 3) | |
n=length(x2) | |
n | |
pages=1:n | |
pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SCHEMA SHIPS; | |
--Напишете заявка, която извежда името на корабите по-тежки от 35000 | |
SELECT SHIPS.NAME | |
FROM SHIPS, CLASSES | |
WHERE CLASSES.DISPLACEMENT > 35000 AND SHIPS.CLASS = CLASSES.CLASS; | |
--Напишете заявка, която извежда имената, водоизместимостта и броя оръжия | |
--на всички кораби участвали в битката при ‘Guadalcanal’ | |
SELECT SHIPS.NAME, CLASSES.DISPLACEMENT, CLASSES.NUMGUNS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SCHEMA MOVIES; | |
--Напишете заявка, която извежда | |
--имената на актрисите, които са също и продуценти с нетна стойност по-голяма от 10 милиона | |
SELECT NAME | |
FROM MOVIESTAR | |
WHERE GENDER = 'F' | |
AND NAME IN ((SELECT NAME | |
FROM MOVIEEXEC | |
WHERE NETWORTH > 10000000)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SCHEMA PC; | |
--Напишете заявка, която извежда производителите на персонални компютри с честота поне 500. | |
SELECT DISTINCT MAKER | |
FROM PRODUCT | |
WHERE TYPE = 'PC' | |
AND MODEL IN ((SELECT MODEL | |
FROM PC | |
WHERE SPEED >= 500)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SCHEMA SHIPS; | |
--Напишете заявка, която извежда страните, чиито кораби са с най-голям брой оръжия | |
SELECT DISTINCT COUNTRY | |
FROM CLASSES | |
WHERE NUMGUNS >= ALL (SELECT NUMGUNS | |
FROM CLASSES); | |
--Напишете заявка, която извежда класовете, за които поне един от | |
--корабите им е потънал в битка. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0|00022479 0,0,0,2,2,4,7,9,10,12,13,18...121,125... | |
#1|0238 #за 3 няма нищо | |
#2|34 | |
#3| | |
#12|159 | |
#стъбло/листа | |
sals = scan() | |
1:(*) #12, .4, 5, 2, 50, 8 3 1 4 .25, in the console | |
#до тук въвеждам в конзолата |
OlderNewer