Drop Database Music _ Zone

765 WordsOct 4, 20144 Pages
drop database music_zone; create database music_zone ; use music_zone; /* Adress * id: address id * */ DROP TABLE IF EXISTS Address; CREATE TABLE Address ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, details VARCHAR(100) NOT NULL, province VARCHAR(20) NOT NULL, country VARCHAR(20) NOT NULL, zip VARCHAR(20) NOT NULL, phone VARCHAR(20), PRIMARY KEY(id) ) ENGINE = InnoDB; # # Dumping data for table 'address ' # INSERT INTO Address (details, province, country, zip, phone) VALUES ( '123 King adward ', 'ON ', 'Canada ', 'K1E6T5 ' , '613-123-4567 '); INSERT INTO Address (details, province, country, zip, phone) VALUES ( '34 Rue St-Dominiqu ', 'QC ', 'Canada ', 'K2E6K5 ' , '514-123-8569 '); INSERT INTO Address (details, province, country, zip, phone) VALUES ( '99 Main ave. ', 'ON ', 'Canada ', 'K6E9T5 ' , '613-123-9568 '); /** Account table */ DROP TABLE IF EXISTS Account ; CREATE TABLE Account ( username varchar(10) NOT NULL, password varchar(15), first_name varchar(30), last_name varchar(30), email varchar(30), addr_id int unsigned, PRIMARY KEY(username), FOREIGN KEY(addr_id) references Address(id) ); INSERT INTO Account VALUES ( 'johnsmith ', 'johnsmith35 ', 'John ', 'Smith ', 'johnsmith@hotmail.com ', 1) ; INSERT INTO Account VALUES ( 'carljones ', 'carljones35 ', 'Carl ', 'Jones ', 'carljones@hotmail.com ', 2) ; INSERT INTO Account VALUES ( 'kevinsingh ', 'kevinsingh35 ', 'Kevin ',

More about Drop Database Music _ Zone

Open Document