Android面試收集錄 資料庫

來源:互聯網
上載者:User

標籤:ted   函數   ==   db4o   個數   ase   當前日期   ble   creat   

 

1.SQLite資料庫如何查詢表table1的第20條到30條記錄?
  • select * from table1 limit 19,11   ==>從19開始,11個資料

 

2.如何才能將table1表的表結構和資料複製到表table2上?
  • create table table2 as select * from table1;

 

3.如何擷取最近一次執行SQL語句所影響的記錄行數?
  • insert into table1 values(1,‘bill‘);
  • select changes(); ==>返回insert語句影響的記錄行數

 

4.請分別使用like子句和like函數查詢table1的name欄位?
  • like函數:select * from table1 where like(‘%bill%‘,name);
  • like子句:select * from table1 where name like ‘%bill%‘;\

 

5.如果當前日期是2012-11-01,如何變成2011-12-01?
  • select date(‘2012-11-01‘,‘-1 years‘,‘+1 months‘)

 

6.Android支援集中開啟或建立SQLite資料庫的方式?
  • SQLiteOpenHelper類
  • Context.openOrCreateDatabase方法
  • SQLiteDatabase.openOrCreateDatabase方法

 

7.請解釋一下什麼是db4o資料庫?
  • db40即是database for objects,是一個嵌入式的開源物件導向資料庫
  • db4o是基於對象的資料庫
  • 而其他的對象持久化架構需要一個對應檔將關係型資料庫與對象進行關聯

Android面試收集錄 資料庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.