Code Monkey home page Code Monkey logo

dbproject's Introduction

该项目用python实现了一个简单列式数据库,实现了多表join和top N查询 详细设计可以参考:http://www.cnblogs.com/fengfenggirl/p/minit_db.html 数据在百度网盘:http://pan.baidu.com/share/link?shareid=361303219&uk=3271689851

1、下载数据文件后,将代码放在数据文件的上层目录; 2、修改createindex.py中的DATABASE = "minidb"改为存放数据文件的文件目录 3、运行createtable.py,建立元数据文件meta.table 4、运行createindex.py,将对所有的表建立索引 5、运行join_topk.py,执行sql: top N: select top 20 * from ORDERS where o_orderdate< "1995-05-20" order by o_totalprice;

多表连接:
select
l_orderkey,
o_orderdate,
o_shippriority
from
customer,
orders,
lineitem
where	
c_mktsegment = 'MACHINERY'
and c_custkey = o_custkey
and l_orderkey = o_orderkey
and o_orderdate < "1995-05-20"
and l_shipdate > "1995-05-18";

group by 没有实现。

dbproject's People

Contributors

bigpeng avatar

Watchers

James Cloos avatar zxsted avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.