qu.1

来自「linux 下用c++ 开发的一个小型数据库系统」· 1 代码 · 共 50 行

1
50
字号
/* * test 1 tests QU_Select without indices *//* create relations */create table soaps(soapid int, name char(28), network char(4), rating real);load table soaps from ("../data/soaps.data");create table stars(starid int, real_name char(20), plays char(12), soapid int);load table stars from ("../data/stars.data");/* * various selections without indices *//* simple selection (should be the same as just printing the relation) */select soapid, name, network, rating from soaps;print table soaps;/* names, ratings, and networks of soaps on NBC */select name, rating, network from soaps where network = "NBC";/* print character name, real name, and ids of stars with id's < 12 */select plays, real_name, starid from stars where starid < 12;/* ratings, networks, and names of soaps with ratings of 5 or greater */select rating, network, name from soaps where rating >= 5.0;/* selection that doesn't find anything */select real_name, starid from stars where starid > 567;/* select into a non-existent relation */select network, soapid, name into nedfrom soapswhere network = "CBS";print table ned;/* select into a existing relation */select network, soapid, name into nedfrom soapswhere network = "NBC";print table ned;/* select into a relation with strings of different sizes */create table ted (plays char(12), soapid int);select plays, soapid into ted from stars where plays < "L";print table ted;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?