-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.sql
67 lines (25 loc) · 1.36 KB
/
Index.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
-- TABLO OLUŞTURMA
CREATE TABLE Person(
Id int,
FirstName varchar(255),
LastName varchar(255),
Salary int
);
SELECT * FROM Person; --tablonun oluştuğunu görelim
--şimdide içerisine kayıt atalım
INSERT INTO Person (Id, FirstName, LastName, Salary) VALUES (1, 'Yiğitcan', 'Ölmez', '1907');
INSERT INTO Person (Id, FirstName, LastName, Salary) VALUES (2, 'Mert', 'Ölmez', '2800');
INSERT INTO Person (Id, FirstName, LastName, Salary) VALUES (3, 'Edin','Dzeko', '3200');
INSERT INTO Person (Id, FirstName, LastName, Salary) VALUES (4, 'Sebastian', 'Szymanski', '2700');
INSERT INTO Person (Id, FirstName, LastName, Salary) VALUES (5, 'Dusan', 'Tadic', '5500');
INSERT INTO Person (Id, FirstName, LastName, Salary) VALUES (6, 'Dominik', 'Livakovic', '4000');
INSERT INTO Person (Id, FirstName, LastName, Salary) VALUES (7, 'Fred', 'Rodrigues', '3870');
INSERT INTO Person (Id, FirstName, LastName, Salary) VALUES (8, 'Rade', 'Krunic', '2500');
-- atılan kayıtları görelim
SELECT * FROM Person order by salary desc;
SELECT * FROM Person p WHERE Salary BETWEEN 2500 AND 3500;
CREATE INDEX IX_Person_Salary
on Person (Salary ASC); --IX prefix'i, index olduğunu belirtmek için kullanılmıştır.
select * from Person p ;
sp_Helpindex Person;
DROP INDEX Person.IX_Person_Salary;