-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQLQuery2.sql
More file actions
95 lines (44 loc) · 1.23 KB
/
Copy pathSQLQuery2.sql
File metadata and controls
95 lines (44 loc) · 1.23 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
SELECT * FROM Students;
SELECT FirstName, LastName FROM Students;
SELECT * FROM Students
WHERE StudentID = 5;
SELECT * FROM Students
WHERE StudentID > 5;
SELECT * FROM Students
WHERE StudentID > 5
AND FirstName LIKE 'M%';
INSERT INTO Students (StudentID, FirstName, LastName)
VALUES (11, 'Lucas', 'Brown');
UPDATE Students
SET LastName = 'Anderson'
WHERE StudentID = 8;
SELECT * FROM Students
WHERE BirthDate IS NULL;
SELECT * FROM Students
ORDER BY StudentID DESC;
DELETE FROM Students
WHERE StudentID = 9;
ALTER TABLE Students
ADD BirthDate DATE;
UPDATE Students
SET BirthDate = '2005-08-15'
WHERE StudentID = 2;
SELECT * FROM Students
WHERE FirstName LIKE '%a%';
SELECT TOP 1 * FROM Students
ORDER BY BirthDate ASC;
SELECT COUNT(*) AS 'Vowel Start Names'
FROM Students
WHERE FirstName LIKE 'A%'
OR FirstName LIKE 'E%'
OR FirstName LIKE 'I%'
OR FirstName LIKE 'O%'
OR FirstName LIKE 'U%';
ALTER TABLE Students
DROP COLUMN BirthDate;
SELECT * FROM Students
WHERE LastName <> 'Smith';
SELECT * FROM Students
WHERE StudentID BETWEEN 5 AND 8;
SELECT * FROM Students
WHERE StudentID IN (2, 4, 6);