数据库已经建好,需要从键盘输入字符,然后把输入的字符和数据库中匹配的数据做比较。
Ex:
数据库的数据表格为:
CREATE TABLE scores (ID text not null,
E char(1) not null,
P char(1) not null,
N char(1) not null,
ACH char(1) not null,
CLV char(1) not null,
CON char(1) not null,
EST char(1) not null,
LED char(1) not null,
AFL char(1) not null,
REC char(1) not null);
插入数据为:
insert into scores values('_CONS23','0','+','0','+','-','+','0','0','-','0');
insert into scores values('_GUZZO','+','0','0','+','0','0','+','+','+','0');
insert into scores values('_HINCELI','0','0','+','+','-','+','0','-','0','0');
insert into scores values('4','0','-','-','0','+','-','0','+','+','+');
insert into scores values('4679','0','+','-','0','0','0','+','0','-','-');
insert into scores values('5','0','+','-','0','+','-','+','+','0','0');
insert into scores values('6','+','+','-','0','+','-','+','+','+','0');
insert into scores values('630528','+','0','-','0','+','-','+','+','0','0');
insert into scores values('7','0','-','0','-','0','0','0','0','+','+');
insert into scores values('8','0','-','0','-','0','0','0','-','+','+');
insert into scores values('9','0','-','0','-','0','0','0','0','+','+');
insert into scores values('A.F.N.','-','0','+','+','-','+','-','-','-','0');
insert into scores values('A.H','+','-','-','-','+','-','0','+','+','+');
insert into scores values('AATIQ','0','0','+','0','-','+','0','0','-','0');
insert into scores values('AATIQ2','+','+','0','+','-','0','+','+','-','-');
insert into scores values('ABCDE2','+','0','-','-','+','-','+','+','0','0');
insert into scores values('ABRAH','0','+','0','+','-','+','0','0','-','-');
insert into scores values('ABUMBA','0','0','-','0','0','0','0','0','0','0');
insert into scores values('ACCOU','-','+','0','+','+','0','0','0','-','-');
insert into scores values('ACQUAVIV','+','0','0','0','0','0','0','+','0','0');
insert into scores values('ACTI_PJ','-','0','+','+','-','+','-','-','-','0');
insert into scores values('ACTI_SK','+','+','+','+','0','0','+','+','0','-');
我从键盘输入“P=0;E=+;”
怎样把输入的字符和数据库中的数据做比较,输出与之匹配的元组?
各位大虾帮帮忙啊!!!