-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSession1.sql
More file actions
38 lines (29 loc) · 1.33 KB
/
Session1.sql
File metadata and controls
38 lines (29 loc) · 1.33 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
/*===================================================
SELECT
===================================================*/
/* tracks tablosundaki track isimlerini (name) sorgulayınız */
SELECT name FROM tracks;
/* tracks tablosundaki besteci(Composer) ve şarkı isimlerini (name) sorgulayınız.*/
SELECT Composer, name FROM tracks;
/* tracks tablosundaki tüm bilgileri sorgulayınız */
SELECT * FROM tracks;
/*===================================================
DISTINCT
===================================================*/
/*tracks tablosundaki composer bilgileri sorgulayınız (TEKRARLI OLABİLİR)*/
SELECT Composer FROM tracks;
/*tracks tablosundaki composer bilgileri sorgulayınız (TEKRARSIZ) */
SELECT DISTINCT Composer FROM tracks;
/*tracks tablosundaki AlbumId ve MediaTypeId bigilerini TEKRARSIZ olarak
sorgulayınız */
SELECT DISTINCT AlbumId,MediaTypeId FROM tracks;
/*===================================================
WHERE
====================================================*/
/*Composer'ı Jimi Hendrix olan şarkıların isimlerini (name) sorgulayiniz*/
SELECT name FROM tracks WHERE Composer='Jimi Hendrix';
/*invoices tablosunda Total değeri 10$'dan büyük olan kayıtların InvoiceId,
InvoiceDate ve total bilgilerini sorgulayiniz */
SELECT InvoiceId, InvoiceDate, total
FROM invoices
WHERE total>10;