database sql

Solutions on MaxInterview for database sql by the best coders in the world

showing results for - "database sql"
Mira
13 Sep 2017
1SQL full form is a structured query language, and it allows you to interact through commands with the database. Here are some of the SQL Database functions:
2
3This allows users to retrieve information from the relational database.
4It enables the development of tables and databases.
5It allows data base and tables to be modified, added, removed, and changed.
6It gives protection, and allows permission to be set.
7Allows new ways for people to manage the info.
Erica
29 Aug 2018
1SQL is a domain-specific language used in programming and designed for managing
2data held in a relational database management system, or for stream processing
3in a relational data stream management system.
Maximiliano
27 Nov 2018
1SQL is basically a programming language that lets people manipulate databases.
Alonso
29 Feb 2019
1package com.example.sairamkrishna.myapplication;
2
3import java.util.ArrayList;
4import java.util.HashMap;
5import java.util.Hashtable;
6import android.content.ContentValues;
7import android.content.Context;
8import android.database.Cursor;
9import android.database.DatabaseUtils;
10import android.database.sqlite.SQLiteOpenHelper;
11import android.database.sqlite.SQLiteDatabase;
12
13public class DBHelper extends SQLiteOpenHelper {
14
15   public static final String DATABASE_NAME = "MyDBName.db";
16   public static final String CONTACTS_TABLE_NAME = "contacts";
17   public static final String CONTACTS_COLUMN_ID = "id";
18   public static final String CONTACTS_COLUMN_NAME = "name";
19   public static final String CONTACTS_COLUMN_EMAIL = "email";
20   public static final String CONTACTS_COLUMN_STREET = "street";
21   public static final String CONTACTS_COLUMN_CITY = "place";
22   public static final String CONTACTS_COLUMN_PHONE = "phone";
23   private HashMap hp;
24
25   public DBHelper(Context context) {
26      super(context, DATABASE_NAME , null, 1);
27   }
28
29   @Override
30   public void onCreate(SQLiteDatabase db) {
31      // TODO Auto-generated method stub
32      db.execSQL(
33         "create table contacts " +
34         "(id integer primary key, name text,phone text,email text, street text,place text)"
35      );
36   }
37
38   @Override
39   public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
40      // TODO Auto-generated method stub
41      db.execSQL("DROP TABLE IF EXISTS contacts");
42      onCreate(db);
43   }
44
45   public boolean insertContact (String name, String phone, String email, String street,String place) {
46      SQLiteDatabase db = this.getWritableDatabase();
47      ContentValues contentValues = new ContentValues();
48      contentValues.put("name", name);
49      contentValues.put("phone", phone);
50      contentValues.put("email", email);	
51      contentValues.put("street", street);
52      contentValues.put("place", place);
53      db.insert("contacts", null, contentValues);
54      return true;
55   }
56   
57   public Cursor getData(int id) {
58      SQLiteDatabase db = this.getReadableDatabase();
59      Cursor res =  db.rawQuery( "select * from contacts where id="+id+"", null );
60      return res;
61   }
62   
63   public int numberOfRows(){
64      SQLiteDatabase db = this.getReadableDatabase();
65      int numRows = (int) DatabaseUtils.queryNumEntries(db, CONTACTS_TABLE_NAME);
66      return numRows;
67   }
68   
69   public boolean updateContact (Integer id, String name, String phone, String email, String street,String place) {
70      SQLiteDatabase db = this.getWritableDatabase();
71      ContentValues contentValues = new ContentValues();
72      contentValues.put("name", name);
73      contentValues.put("phone", phone);
74      contentValues.put("email", email);
75      contentValues.put("street", street);
76      contentValues.put("place", place);
77      db.update("contacts", contentValues, "id = ? ", new String[] { Integer.toString(id) } );
78      return true;
79   }
80
81   public Integer deleteContact (Integer id) {
82      SQLiteDatabase db = this.getWritableDatabase();
83      return db.delete("contacts", 
84      "id = ? ", 
85      new String[] { Integer.toString(id) });
86   }
87   
88   public ArrayList<String> getAllCotacts() {
89      ArrayList<String> array_list = new ArrayList<String>();
90      
91      //hp = new HashMap();
92      SQLiteDatabase db = this.getReadableDatabase();
93      Cursor res =  db.rawQuery( "select * from contacts", null );
94      res.moveToFirst();
95      
96      while(res.isAfterLast() == false){
97         array_list.add(res.getString(res.getColumnIndex(CONTACTS_COLUMN_NAME)));
98         res.moveToNext();
99      }
100      return array_list;
101   }
102}
queries leading to this page
database management system sqlsql what isslq a database languagesql language querysql programwhats sqlwhat sql databasestructured query languagewhat is sqlquery language and sql languaesequel based softwaresql stands for whatsql meaningwhat is a sql data basewhat 27s sqlwhit is sqlbasics of sql 22sql 22dbms with sqlsql is standard language for relational database managementdatabase language sqlwhat does sql doon sql databasesql 3fsql database purposewot is sqlsql 29define 3a sqlsql what is the assql organisationwhat sql languagewhat is sql syntaxlanguae sqlwhat is data sqlmsql databaseslq data base theorysql 3d 25sql notesintroduction to sqlhow to use sql with htmlsql data 3fsql definitionsequal data basewhat is sql databasedbms sqlwhat is sqlwhat is 3c 3e in sqlsql relational databasewhat cabn i do with sqlwhat is 22 3f 22 sqlsql 2astructured sql queriesis sql open sourcecreate sql languagesql dsql programmigidentify the sql language sequel languagesql issql basicswhat are some things that sql can dolearn sqlsql query definesql 22 23 22sql learndata base sqlwhat is an sqlassociation of sql and http verbsall about sqlsimple sql programs what is sql sql language websitedbms sql w3schoolsleaning sqlwas is sql 3fwaht is sql 3fw3scools sqlsql what sql stands forwhat is sql forsql labguagesql programmingfor what sql is used for e2 80 99 sqldatabase sqlbriefly explain sqlsql databasessequel databasesql data basesql 28structured query language 29what is a sqlwaht is sqlsql whats 23ansci sqlansi sqlsql database exaplainedwhat can i do into sqlwat is sqlsql officialsql basissql select rational databasewhat is sql 27sql what is 3fsql databse 3f 3f sqlsql bqsicintro to sqlwhat is sql queryhow database interact with sqlembedded sql w3schoolsimple sql programmingwhat is sql used forlearn sql databsewhat is sql in databasewhat do you use sql 3f sqlsql in dbmmbswhats is sql 28 2b 29 sqlsql systemsdefining sqlwhat is sequelsql basic conceptswhat you can do with sqlwhat is sql database with sql databaseshat is sqlsql explainedwhat is sql languagewhat does sql stand forsql 27 40 7e 27 3bstruqured query languageis sqlwho database content sqlsql what forsql language 3a 3dsql 25meaningwhat can i do with a sql databasewhat is sql database used forwhat is mysqlwhta is sqlsql full formdatabases sqldefine sql data what is sql data basewhat is tsqlsql dartabasesql programs 5c sqlwhat is the sqlsql 25what is sql stands forsql on explainedsql whats thatwhat language is sqlwhat means sqlsql stands forsql databasesql languagesql query languagesql 3bsqlwhat is sql 5cwhat really is sqlsql language 3a 3dsql was created onstructured query language 28sql 29 23 sqlstandard query languageabout sqlw3schools sqldatabase in sqlsql can be used in any databasesql defsql 40sql programmizsql language is done inwhat sqlsql programming languagesql data languagesql stand forsql 3e 3cis sql a database 25 sqlsql what is 25based sql databasesql definition in databasesql 3f 3fwhat database does sql usesql 3cwhat is meaning sqlwhat does sql meanssql datadatabase sqlbasic sqlsql database managementsql database management systemsql is what 5e sqlprogrammiz sqlsql 7ewhat is an sql databasewhat is a sql databasesql stand for 3fhow to use an sql databasewhat does sql stands forsql 3eis there a database called sql databasre 25 sqlsql db 7c 7c sqlsql 23what are sql databasessql is what kind of databaseansi sql tutorial sql databasewhat is sql 3ebase of sqlsql basic where to write sql languagesql abbreviationsql dtatbasesql what is itsql what this meansql query databasedatabase sql