-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTableBrands.sql
26 lines (21 loc) · 913 Bytes
/
TableBrands.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
create table brands
(
/*
Brands (Brands):
BrandID (INT, PRIMARY KEY, NOT NULL, UNIQUE)
Name (VARCHAR, NOT NULL, UNIQUE)
Description (TEXT, NOT NULL)
AddressID (INT, FOREIGN KEY REFERENCES Address(AddressID), NOT NULL, UNIQUE) 1:1 with Address
*/
id int primary key auto_increment not null unique,
name varchar(30) not null unique,
description text not null,
address_id INT,
foreign key (address_id) references addresses (id)
);
insert into brands (name, description, address_id)
values ('Samsung', 'Electronics and Appliances manufacturer', 1),
('Apple', 'Consumer Electronics and Technology company', 2),
('Philips', 'Diversified Electronics company', 3),
('Dell', 'Computer Technology Solutions provider', 4),
('LG', 'Global Technology and Home Appliances company', 5);