qu.8
来自「linux 下用c++ 开发的一个小型数据库系统」· 8 代码 · 共 51 行
8
51 行
/* * test 8 tests QU_Delete with indices *//* create the relations and indices */create table soaps(soapid int, name char(28), network char(4), rating real);/*buildindex soaps(name);buildindex soaps(network);*/load table soaps from ("../data/soaps.data");create table stars(starid int, real_name char(20), plays char(12), soapid int);/*buildindex stars(real_name);buildindex stars(soapid);*/load table stars from ("../data/stars.data");print table stars;/* John Novak is being written out of Santa Barbara */delete from stars where stars.real_name = "Novak, John";print table stars;/* delete everyone on The Young and the Restless */delete from stars where stars.soapid = 5;select starid, real_name, plays, soapid from stars where soapid = 5;print table stars;print table soaps;/* get rid of all soaps that aren't doing well in the ratings */delete from soaps where soaps.rating < 6.0;select soapid from soaps where rating = 6.0;print table soaps;/* cancel all the soaps and fire all of the stars */delete from soaps;delete from stars;print table soaps;print table stars;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?