0
以下是我爲Sqlite編寫的bash腳本。幫助按訂單排序並顯示訂單
#!/bin/bash
sqlite3 file.db "CREATE TABLE table1(name text,rolln integer PRIMARY KEY,examm integer CHECK(examm >=0 and examm <= 50));"
sqlite3 file.db "insert into table1(name,rolln,examm)values('Aldose Paul ',1234,'[email protected]',49); "
sqlite3 file.db "insert into table1(name,rolln,examm)values('Thomas Paul',1023,'[email protected]',45); "
sqlite3 file.db "CREATE TABLE project(title text PRIMARY KEY,marks integer CHECK(marks >= 0 and marks <= 20)) ;"
sqlite3 file.db "insert into project(title,marks)values('A',16);"
sqlite3 file.db "insert into project(title,marks)values('B',14);"
sqlite3 file.db "select rolln AS 'Roll Number' ,(examm) AS 'Total Marks'from table1 order by (examms) ;"