CREATE TABLE `creditcardsfeturres` (
  `idcreditcardsbenefits` int NOT NULL AUTO_INCREMENT,
  `creditcardsfeturesDetails` varchar(500) DEFAULT NULL,
  `idcreditcards` int DEFAULT NULL,
  PRIMARY KEY (`idcreditcardsbenefits`),
  KEY `fk_creditcardsfeturres_1_idx` (`idcreditcards`),
  CONSTRAINT `fk_creditcardsfeturres_1` FOREIGN KEY (`idcreditcards`) REFERENCES `creditcards` (`idcreditcards`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


insert into creditcardsfeturres(`creditcardsfeturesDetails`,`idcreditcards`)
select TRIM(Shrt_Features) features,idcreditcards from fetures_transformed fd
left outer join creditcards cc on TRIM(cc.creditcardsname)= TRIM(fd.card_name)
where cc.creditcardsname is not null;

select * from creditcardsfeturres




select * from creditcards;
alter table creditcards add column creditcardsimagename varchar(150);
INSERT INTO `banksfinders`.`creditcards`(`creditcardscode`,`creditcardsname`,`creditcardsDetails`,`idcardtypes`,`idbanks`,`creditcardsimagename`,`MinimumSalary`,`AnnualFee`)
SELECT'AAD', bd.CARD_name,bd.CARD_name,1,bs.idbanks,concat(bd.CARD_name,'.webp') creditcardsimagename,bd.Minimum_Salary,bd.Annual_Fee from banksfinders.banklatest bd 
LEFT OUTER JOIN banksfinders.banks bs on trim(bs.bankname)=trim(bd.Bank);



ALTER TABLE creditcards
ADD COLUMN showonfrontscreen BOOLEAN,
ADD COLUMN showfrontscreenseqno INT;



-- insert creditcardstypes(`idcreditcards`,`idcardtype`)
-- select idcreditcards,12 from creditcards cc where upper(cc.creditcardsname) like UPPER('%adcb%');




/*
12	BCC	Best Credit Card
13	BCBC	Best CashBack Card
14	BSKC	Best Skywords Card
15	BMOC	Best Movieoffer Card
16	BAIRM	Best Air-Miles Card
17	BDINOF	Best Dining Offer Card
18	BLIFEC	Best LifeStyle Card
*/
