forked from profnoah/sql-cohort10
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsession1.sql
More file actions
41 lines (31 loc) · 1.27 KB
/
session1.sql
File metadata and controls
41 lines (31 loc) · 1.27 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
/*===================================================
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ı sorgulayiniz*/
SELECT name
FROM tracks
WHERE Composer='Jimi Hendrix';
/* invoices tablosunda Total değeri 10$ dan büyük olan faturaların tüm bilgilerini
sorgulayiniz */
SELECT *
FROM invoices
WHERE total>10;