Git Product home page Git Product logo

dot-net-webform-app's Introduction

PGSQL/SQL

1. Login with "psql --username postgres"
2. Create User if not available "CREATE USER <<nama user>> WITH ENCRYPTED PASSWORD '<<password>>';"
3. Create DB "CREATE DATABASE <<nama database>>;"
4. Grant access and DB owner 
	"GRANT ALL ON DATABASE <<nama database>> TO <<nama user>>;"
	"ALTER DATABASE <<nama database>> OWNER TO <<nama user>>;"
5. Access DB with non-root user "psql --username <<nama user>> --dbname <<nama database>>"
	- Check all userlist with "\du" and check all DB and owner with "\l"
6. Create table with 
	"CREATE TABLE table_name (
	   column1 datatype(length) column_constraint,
	   column2 datatype(length) column_constraint,
	   column3 datatype(length) column_constraint,
	);"
	
	Example:
	"CREATE TABLE karyawan (
	   id VARCHAR(8) PRIMARY KEY,
	   nama_lengkap VARCHAR(30) NOT NULL,
	   tgl_lahir INT2 NOT NULL,
	   email VARCHAR(50) UNIQUE NOT NULL,
	   alamat TEXT
	);"
7. Do CRUD with "INSERT, SELECT, UPDATE, & DELETE"
	Example:
	"INSERT INTO karyawan VALUES ('DCD002', 'Gilang Ramadhan', '1993', '[email protected]', 'Batik Kumeli No. 50 Bandung');"
	"SELECT id, nama_lengkap, email, alamat FROM karyawan;"
	"SELECT * FROM karyawan;"
	"SELECT * FROM karyawan WHERE nama_lengkap = 'Gilang Ramadhan';"
	"UPDATE karyawan
	SET nama_lengkap = 'Gilang Ramadan'
	WHERE id = 'DCD002';"
	"DELETE FROM karyawan WHERE id = 'DCD001';"
	"SELECT departmen.nama_departemen 
	FROM karyawan 
	INNER JOIN departemen ON karyawan.id_departemen=departemen.id_departemen
	WHERE karyawan.id_karyawan = โ€˜DCD0001โ€™;"

dot-net-webform-app's People

Contributors

fortissible avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.