Showing posts with label table creation and insert record in sqlite. Show all posts
Showing posts with label table creation and insert record in sqlite. Show all posts

Monday, March 12, 2018

Table Creation and Insert of Record in SQLite

A very simple code to show you how to create a table and insert a record using SQLite. 

I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Sample Program Output




Program Listing

--
-- File generated with SQLiteStudio v3.1.1 on Mon Mar 12 13:54:08 2018
--
-- Text encoding used: System
--
PRAGMA foreign_keys = off;
BEGIN TRANSACTION;

-- Table: users
DROP TABLE IF EXISTS users;

CREATE TABLE users (
    user_id INTEGER    PRIMARY KEY,
    name    TEXT (100),
    age     INTEGER
);

INSERT INTO users (user_id, name, age) VALUES (1, 'jake', 39);
INSERT INTO users (user_id, name, age) VALUES (2, 'iya', 3);
INSERT INTO users (user_id, name, age) VALUES (3, 'allie', 46);
INSERT INTO users (user_id, name, age) VALUES (4, 'jacob', 4);

-- Index: 
DROP INDEX IF EXISTS "";

CREATE INDEX "" ON users (
    user_id
);


COMMIT TRANSACTION;
PRAGMA foreign_keys = on;