Https UNIX

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

https://www.tutorialspoint.com/unix_terminal_online.

php

https://www.tutorialspoint.com/unix_terminal_online.php

http://rus-linux.net/MyLDP/BOOKS/Linux_Foundations/13/ch13.html

fact()
{

if [ $1 -le 1 ]
then
echo 1
else
{
echo $(( $1 * $(fact $(($1-1)))))
}
fi
}
fact 6

name=es
case $name in
'yes')
echo $name
;;
'no')
echo $name
;;
*) echo error
;;
esac

# Hello World Program in Bash Shell


set -u
echo "Hello World!"
echo $s
f()
{
z=$1
i=1
fact=1
while [ $i -le $1 ]
do
fact=$(($fact * $i))
let i=i+1
done
return $fact
}
f3
echo $fact

--Sql Server 2014 Express Edition


--Batches are separated by 'go'

select @@version as 'sql server version'

CREATE TABLE tab1

ID int IDENTITY PRIMARY key,

name varchar(20)

CREATE TABLE tab2

ID int IDENTITY PRIMARY key,


name varchar(20),

count int

CREATE TABLE tab3

ID1 int FOREIGN key references tab1(id),

ID2 int FOREIGN key references tab2(id),

count int

GO

CREATE FUNCTION dbo.Res(

@name varchar(20))

RETURNS TABLE

AS

RETURN (select t1.name, t2.name as product, t3.count - t2.count as "count"

from tab1 t1

inner join tab3 as t3

on t1.id=t3.id1

inner join tab2 as t2


on t2.ID=t3.ID2

where t3.count >t2.count and t1.name=@name

go

insert tab1

values('a')

insert tab1

values('s')

insert tab1

values('ba')

select * from tab1

insert tab2

values('pr3',2)

insert tab2

values('pr1',2)

insert tab2

values('pr2',2)

select * from tab2

insert tab3

values(1,2,42)

insert tab3

values(1,1,2)

select * from tab3

select * from dbo.res('a')


select * from dbo.res('a')
sql server ve
1 Microsoft SQL Server 2014 - 12.0.2000.8 (Intel X86) Feb 20 2014 19:20:46 Copyright (c) Microsoft C

ID name
11 a
22 s
3 3 ba

ID name count
11 pr3 2
22 pr1 2
33 pr2 2

ID
ID2 count
1
1 1 2 42
21 1 2

nam
product count
e
1a pr1 40

nam
product count
e
1a pr1 40

You might also like