-
Notifications
You must be signed in to change notification settings - Fork 0
/
MusicStore_Create Tables.sql
98 lines (87 loc) · 2.48 KB
/
MusicStore_Create Tables.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
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
96
97
CREATE TABLE album (
album_id character varying(50) NOT NULL,
title character varying(120),
artist_id character varying(30)
);
CREATE TABLE artist (
artist_id character varying(50) NOT NULL,
name character varying(120)
);
CREATE TABLE customer (
customer_id integer NOT NULL,
first_name character(50),
last_name character(50),
company character varying(120),
address character varying(120),
city character varying(50),
state character varying(50),
country character varying(50),
postal_code character varying(50),
phone character varying(50),
fax character varying(50),
email character varying(50),
support_rep_id integer
);
CREATE TABLE employee (
employee_id character varying(50) NOT NULL,
last_name character(50),
first_name character(50),
title character varying(50),
reports_to character varying(30),
levels character varying(10),
birthdate timestamp,
hire_date timestamp,
address character varying(120),
city character varying(50),
state character varying(50),
country character varying(30),
postal_code character varying(30),
phone character varying(30),
fax character varying(30),
email character varying(30)
);
CREATE TABLE genre (
genre_id character varying(50) NOT NULL,
name character varying(120)
);
CREATE TABLE invoice (
invoice_id integer NOT NULL,
customer_id integer,
invoice_date timestamp,
billing_address character varying(120),
billing_city character varying(30),
billing_state character varying(30),
billing_country character varying(30),
billing_postal character varying(30),
total double precision
);
CREATE TABLE invoice_line (
invoice_line_id character varying(50) NOT NULL,
invoice_id integer,
track_id integer,
unit_price double precision,
quantity double precision
);
CREATE TABLE media_type (
media_type_id character varying(50) NOT NULL,
name character varying(120)
);
CREATE TABLE playlist (
playlist_id character varying(50) NOT NULL,
name character varying(120)
);
CREATE TABLE playlist_track (
playlist_id character varying(50),
track_id integer
);
CREATE TABLE track (
track_id integer NOT NULL,
name character varying(150),
album_id character varying(50),
media_type_id character varying(50),
genre_id character varying(50),
composer character varying(190),
milliseconds integer,
bytes integer,
unit_price double precision
);