zoukankan      html  css  js  c++  java
  • 使用sqllie新建数据库

    
    
    1 #!/bin/bash
    2 sqlite3 contact.db << !
    3 drop table contact;
    4 create table contact (
    5 name char(32),
    6 address char(32)
    7 );
    8 insert into contact(address,name) values("jiangshang","wuxi");
    9 !
    10 sqlite3 contact.db<<!
    11 insert into contact (address,name) values("xuhunzhen","xuxu");
    12 !
    13 echo 'select *from contact;'|sqlite3 contact.db|awk 'BEGIN{FS="|"} {print "N ame",$1,"Address",$2}' ;

    #
    !/bin/sh
    sqlite3 contact.db<<!  #!与后面的!配对表示一整块
    drop table contact;    #删除已有的联系表
    create table contact (
    name char(32),
    address char(32)
    );
    insert into contact values ( 'test','test');
    !


    echo 'select * from contact;'|sqlite3 contact.db    //使用管道
  • 相关阅读:
    Redis其他命令
    Redis 键(key)
    Redis数据类型命令
    配置命令 CONFIG
    Redis简介
    idea破解
    jenkins+allure+testng
    Jenkins
    docker镜像
    docker命令
  • 原文地址:https://www.cnblogs.com/wuxi/p/2283338.html
Copyright © 2011-2022 走看看