create database adlog;
grant all on adlog.* to "arabdemog_com"@"localhost" identified by "p2a9r7cd";

use adlog;

create table tbl_country(country_cd char(2) primary key,country_name char(10),cntry char(1)) type=myisam;
create table tbl_product(prod_code char(4) primary key,prod_desc char(35),full_desc varchar(100),sec_code char(4)) type=myisam;
create table tbl_sec(sec_code char(4) primary key,sec_desc char(45), cate_code char(2)) type=myisam;
create table tbl_category(cate_code char(2) primary key,cate_desc char(50)) type=myisam;
create table tbl_ubc(ubc_code char(6) primary key,brand_code char(8),ubc_desc char(20), manu char(6)) type=myisam;
create table tbl_media(med_cd char(6) primary key,mt char(1),mt_detail char(10),med_desc char(20),circ int(10),type_code char(2)) type=myisam;
create table tbl_typology(type_code char(2) primary key, type_name char(20)) type=myisam;
create table tbl_subm(med_cd char(6),sub_med char(2), sub_name char(80), primary key(med_cd,sub_med)) type=myisam;
create table tbl_labels(group_code char(2),prod_code char(2),brand_code char(3),check_dig char(1),bdesc char(40),manu char(6),full_desc varchar(100), primary key(group_code,prod_code,brand_code,check_dig)) type=myisam;

create table tbl_ads(cate_code char(2),sec_code char(4),group_code char(2),prod_code char(2),brand_code char(4),sub_code char(4),bcode char(12),country_cd char(2),media_code char(10),media_type char(10),daypart char(25),time char(10),timeband char(10),ad_status char(8),amt_usd float,amt_loc float, freq int, space float,media_pub char(50),med_house char(50),media_typo char(30),color char(10),language char(10),purpose char(20),ad_desc varchar(100),position char(20),submedia char(2),page char(10),size_durn char(10),page_pos char(20),ad_date date,price float,fn char(20),primary key(bcode,fn)) type=myisam;

