SlideShare a Scribd company logo
•
•
•
DATABASE
SYSTEM
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
sudo -i -u postgres
CREATE TABLE table_name (
column_name1 col_type (field_length) column_constraints,
column_name2 col_type (field_length),
column_name3 col_type (field_length)
);
print "Opened database successfully";
CREATE TABLE FLIGHT (
Number INT PRIMARY KEY NOT NULL,
Airline CHAR(20) NOT NULL,
Weekdays CHAR(10) NOT NULL
);
print "Table created FLIGHT";
CREATE TABLE FARE(
Code INT PRIMARY KEY NOT NULL,
Amount INT NOT NULL,
Restrictions CHAR(20) NOT NULL,
FAnumber INT NOT NULL,
FARES_Number INT NOT NULL,
FOREIGN KEY(FAnumber) REFERENCES FLIGHT(Number)
);
print "Table created FARE";
CREATE TABLE SEAT(
Seat_No INT PRIMARY KEY NOT NULL,
Sdate CHAR(20) NOT NULL,
RES_Date CHAR(20) NOT NULL,
RES_Customer_Name CHAR(20) NOT NULL,
RES_Cphone CHAR(10) NOT NULL
);
print "Table created SEAT";
conn.commit()
conn.close()
#FLIGHT
Number = []
Airline = []
Weekdays = []
def Generate_FLIGHT():
#Generate FLIGHT
Airline_Name = ['AirAsia','Nok_Air','ThaiSmile','ThaiAirways','BangkokAirways']
Weekdays_Name =
['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']
i = 90000000;
t = time.clock()
t1 = time.clock()
d = 0;
while i< 100000000:
Number.append(i);
Airline.append(Airline_Name[(i-1)%5]);
if( i % 60 == 0):
d = d + 1
if( d == 7 ):
d = 0
Weekdays.append(Weekdays_Name[d]);
if( i % 1000000 == 0):
print (i)
# print Number[i],Airline[i],Weekdays[i]
i = i + 1
print( "Generate FLIGHT success")
t1 = time.clock()
print (t ,"seconds")
print (t1,"seconds")
select * from flight where airline = nok_air
select * from flight where weekdays = 'sunday'
Try PostgreSQL on linux

More Related Content

What's hot

Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongers
brian d foy
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's Perspective
Eleanor McHugh
 
C99.php
C99.phpC99.php
C99.php
veng33k
 
Gun make
Gun makeGun make
Character_Device_drvier_pc
Character_Device_drvier_pcCharacter_Device_drvier_pc
Character_Device_drvier_pc
Rashila Rr
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
Leandro Lima
 
The Magic Of Tie
The Magic Of TieThe Magic Of Tie
The Magic Of Tie
brian d foy
 
R-Excel Integration
R-Excel IntegrationR-Excel Integration
R-Excel Integration
Andrija Djurovic
 
Workshop on command line tools - day 2
Workshop on command line tools - day 2Workshop on command line tools - day 2
Workshop on command line tools - day 2
Leandro Lima
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with Extbase
Jochen Rau
 
Yy
YyYy
Yy
yygh
 
Nouveau document texte
Nouveau document texteNouveau document texte
Nouveau document texte
Sai Ef
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
 
Bodlogiin code
Bodlogiin codeBodlogiin code
Bodlogiin code
orgil
 
Customizing the unix environment
Customizing the unix environmentCustomizing the unix environment
Customizing the unix environment
Dr. Girish GS
 
OpenCL 2.1 Reference Guide
OpenCL 2.1 Reference GuideOpenCL 2.1 Reference Guide
OpenCL 2.1 Reference Guide
The Khronos Group Inc.
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regex
brian d foy
 
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
Eleanor McHugh
 
As400 session or device error
As400   session or device errorAs400   session or device error
As400 session or device error
aminem_mp
 

What's hot (19)

Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongers
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's Perspective
 
C99.php
C99.phpC99.php
C99.php
 
Gun make
Gun makeGun make
Gun make
 
Character_Device_drvier_pc
Character_Device_drvier_pcCharacter_Device_drvier_pc
Character_Device_drvier_pc
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
 
The Magic Of Tie
The Magic Of TieThe Magic Of Tie
The Magic Of Tie
 
R-Excel Integration
R-Excel IntegrationR-Excel Integration
R-Excel Integration
 
Workshop on command line tools - day 2
Workshop on command line tools - day 2Workshop on command line tools - day 2
Workshop on command line tools - day 2
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with Extbase
 
Yy
YyYy
Yy
 
Nouveau document texte
Nouveau document texteNouveau document texte
Nouveau document texte
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
 
Bodlogiin code
Bodlogiin codeBodlogiin code
Bodlogiin code
 
Customizing the unix environment
Customizing the unix environmentCustomizing the unix environment
Customizing the unix environment
 
OpenCL 2.1 Reference Guide
OpenCL 2.1 Reference GuideOpenCL 2.1 Reference Guide
OpenCL 2.1 Reference Guide
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regex
 
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
The Browser Environment - A Systems Programmer's Perspective [sinatra edition]
 
As400 session or device error
As400   session or device errorAs400   session or device error
As400 session or device error
 

Viewers also liked

Example Database normal form
Example Database normal formExample Database normal form
Example Database normal form
Aey Unthika
 
Assignment 2 of Database (Database Security)
Assignment 2 of Database (Database Security)Assignment 2 of Database (Database Security)
Assignment 2 of Database (Database Security)
Aey Unthika
 
Assignment 1 of Database (MySQL & Sqlite3)
Assignment 1 of Database (MySQL & Sqlite3) Assignment 1 of Database (MySQL & Sqlite3)
Assignment 1 of Database (MySQL & Sqlite3)
Aey Unthika
 
Vanson Bourne Data Summary: Shadow IT - BDMs
Vanson Bourne Data Summary: Shadow IT - BDMsVanson Bourne Data Summary: Shadow IT - BDMs
Vanson Bourne Data Summary: Shadow IT - BDMs
Vanson Bourne
 
Er diagram
Er diagramEr diagram
Er diagram
LOKENDRA PRAJAPATI
 
00137
0013700137
00137
prashnant
 
Mapping
MappingMapping
Mapping
Samir Sabry
 
02er
02er02er
Special lecture er diagram
Special lecture er diagramSpecial lecture er diagram
Special lecture er diagram
Niaz Ali
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
Akanksha Jaiswal
 
Unilever
UnileverUnilever
Unilever
Ghulam Baddar
 
Eer >r.model
Eer >r.modelEer >r.model
Eer >r.model
lavya3
 
ER Diagrams Simplified
ER Diagrams SimplifiedER Diagrams Simplified
ER Diagrams Simplified
Puneet Arora
 
Mapping ER and EER Model
Mapping ER and EER ModelMapping ER and EER Model
Mapping ER and EER Model
Mary Brinda
 
Entity relationship diagram
Entity relationship diagramEntity relationship diagram
Entity relationship diagram
Haseeb
 
Statistical learning
Statistical learningStatistical learning
Statistical learning
Slideshare
 
enhanced er diagram
enhanced er diagramenhanced er diagram
enhanced er diagram
CHANDRA BHUSHAN
 
Enhanced ER(database)
Enhanced ER(database)Enhanced ER(database)
Enhanced ER(database)
welcometofacebook
 
Entity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by CreatelyEntity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by Creately
Creately
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
saurabhshertukde
 

Viewers also liked (20)

Example Database normal form
Example Database normal formExample Database normal form
Example Database normal form
 
Assignment 2 of Database (Database Security)
Assignment 2 of Database (Database Security)Assignment 2 of Database (Database Security)
Assignment 2 of Database (Database Security)
 
Assignment 1 of Database (MySQL & Sqlite3)
Assignment 1 of Database (MySQL & Sqlite3) Assignment 1 of Database (MySQL & Sqlite3)
Assignment 1 of Database (MySQL & Sqlite3)
 
Vanson Bourne Data Summary: Shadow IT - BDMs
Vanson Bourne Data Summary: Shadow IT - BDMsVanson Bourne Data Summary: Shadow IT - BDMs
Vanson Bourne Data Summary: Shadow IT - BDMs
 
Er diagram
Er diagramEr diagram
Er diagram
 
00137
0013700137
00137
 
Mapping
MappingMapping
Mapping
 
02er
02er02er
02er
 
Special lecture er diagram
Special lecture er diagramSpecial lecture er diagram
Special lecture er diagram
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Unilever
UnileverUnilever
Unilever
 
Eer >r.model
Eer >r.modelEer >r.model
Eer >r.model
 
ER Diagrams Simplified
ER Diagrams SimplifiedER Diagrams Simplified
ER Diagrams Simplified
 
Mapping ER and EER Model
Mapping ER and EER ModelMapping ER and EER Model
Mapping ER and EER Model
 
Entity relationship diagram
Entity relationship diagramEntity relationship diagram
Entity relationship diagram
 
Statistical learning
Statistical learningStatistical learning
Statistical learning
 
enhanced er diagram
enhanced er diagramenhanced er diagram
enhanced er diagram
 
Enhanced ER(database)
Enhanced ER(database)Enhanced ER(database)
Enhanced ER(database)
 
Entity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by CreatelyEntity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by Creately
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 

Similar to Try PostgreSQL on linux

vFabric SQLFire Introduction
vFabric SQLFire IntroductionvFabric SQLFire Introduction
vFabric SQLFire Introduction
Jags Ramnarayan
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinh
webhostingguy
 
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
webhostingguy
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
webhostingguy
 
SQL Database Design & Querying
SQL Database Design & QueryingSQL Database Design & Querying
SQL Database Design & Querying
Cobain Schofield
 
Data Warehouse and Business Intelligence - Recipe 3
Data Warehouse and Business Intelligence - Recipe 3Data Warehouse and Business Intelligence - Recipe 3
Data Warehouse and Business Intelligence - Recipe 3
Massimo Cenci
 
Cascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGCascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUG
Matthew McCullough
 
Sql
SqlSql
Sql
Joao
 
Dbms lab Manual
Dbms lab ManualDbms lab Manual
Dbms lab Manual
Vivek Kumar Sinha
 
Ppt INFORMATIVE PRACTICES for class 11th chapter 14
Ppt INFORMATIVE PRACTICES for class 11th chapter 14Ppt INFORMATIVE PRACTICES for class 11th chapter 14
Ppt INFORMATIVE PRACTICES for class 11th chapter 14
prashant0000
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
Achmad Solichin
 
MySQL
MySQLMySQL
Les09
Les09Les09
Taller4
Taller4Taller4
Taller4
Johan Ospina
 
Taller4
Taller4Taller4
Taller4
Johan Ospina
 
Raw system logs processing with hive
Raw system logs processing with hiveRaw system logs processing with hive
Raw system logs processing with hive
Arpit Patil
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shema
Murat Gülci
 
Java Unicode with Live GUI Examples
Java Unicode with Live GUI ExamplesJava Unicode with Live GUI Examples
Java Unicode with Live GUI Examples
Abdul Rahman Sherzad
 
Java Unicode with Cool GUI Examples
Java Unicode with Cool GUI ExamplesJava Unicode with Cool GUI Examples
Java Unicode with Cool GUI Examples
OXUS 20
 
Answer2 (clothing boutique)
Answer2 (clothing boutique)Answer2 (clothing boutique)
Answer2 (clothing boutique)
Nicky Valdo
 

Similar to Try PostgreSQL on linux (20)

vFabric SQLFire Introduction
vFabric SQLFire IntroductionvFabric SQLFire Introduction
vFabric SQLFire Introduction
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinh
 
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
SQL Database Design & Querying
SQL Database Design & QueryingSQL Database Design & Querying
SQL Database Design & Querying
 
Data Warehouse and Business Intelligence - Recipe 3
Data Warehouse and Business Intelligence - Recipe 3Data Warehouse and Business Intelligence - Recipe 3
Data Warehouse and Business Intelligence - Recipe 3
 
Cascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGCascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUG
 
Sql
SqlSql
Sql
 
Dbms lab Manual
Dbms lab ManualDbms lab Manual
Dbms lab Manual
 
Ppt INFORMATIVE PRACTICES for class 11th chapter 14
Ppt INFORMATIVE PRACTICES for class 11th chapter 14Ppt INFORMATIVE PRACTICES for class 11th chapter 14
Ppt INFORMATIVE PRACTICES for class 11th chapter 14
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
MySQL
MySQLMySQL
MySQL
 
Les09
Les09Les09
Les09
 
Taller4
Taller4Taller4
Taller4
 
Taller4
Taller4Taller4
Taller4
 
Raw system logs processing with hive
Raw system logs processing with hiveRaw system logs processing with hive
Raw system logs processing with hive
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shema
 
Java Unicode with Live GUI Examples
Java Unicode with Live GUI ExamplesJava Unicode with Live GUI Examples
Java Unicode with Live GUI Examples
 
Java Unicode with Cool GUI Examples
Java Unicode with Cool GUI ExamplesJava Unicode with Cool GUI Examples
Java Unicode with Cool GUI Examples
 
Answer2 (clothing boutique)
Answer2 (clothing boutique)Answer2 (clothing boutique)
Answer2 (clothing boutique)
 

More from Aey Unthika

Assignmet 2 selectedtopic Topic in Computer Engineer
Assignmet 2 selectedtopic Topic in Computer EngineerAssignmet 2 selectedtopic Topic in Computer Engineer
Assignmet 2 selectedtopic Topic in Computer Engineer
Aey Unthika
 
Assignmet1 selectedtopic Topic in Computer Engineer
Assignmet1 selectedtopic Topic in Computer EngineerAssignmet1 selectedtopic Topic in Computer Engineer
Assignmet1 selectedtopic Topic in Computer Engineer
Aey Unthika
 
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Aey Unthika
 
To try use XSL for display group XML file movies
To try use XSL for display group XML file moviesTo try use XSL for display group XML file movies
To try use XSL for display group XML file movies
Aey Unthika
 
To try and create DTD and XML Schema
To try and create DTD and XML SchemaTo try and create DTD and XML Schema
To try and create DTD and XML Schema
Aey Unthika
 
Try to Use DOM and SAX API (python)
Try to Use DOM and SAX API (python)Try to Use DOM and SAX API (python)
Try to Use DOM and SAX API (python)
Aey Unthika
 
Xml parser week2
Xml parser week2Xml parser week2
Xml parser week2
Aey Unthika
 
Introduction to XML.
Introduction to XML.Introduction to XML.
Introduction to XML.
Aey Unthika
 

More from Aey Unthika (8)

Assignmet 2 selectedtopic Topic in Computer Engineer
Assignmet 2 selectedtopic Topic in Computer EngineerAssignmet 2 selectedtopic Topic in Computer Engineer
Assignmet 2 selectedtopic Topic in Computer Engineer
 
Assignmet1 selectedtopic Topic in Computer Engineer
Assignmet1 selectedtopic Topic in Computer EngineerAssignmet1 selectedtopic Topic in Computer Engineer
Assignmet1 selectedtopic Topic in Computer Engineer
 
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
Assignmet1:Start by finding web services using SOAP and WSDL on the Internet/...
 
To try use XSL for display group XML file movies
To try use XSL for display group XML file moviesTo try use XSL for display group XML file movies
To try use XSL for display group XML file movies
 
To try and create DTD and XML Schema
To try and create DTD and XML SchemaTo try and create DTD and XML Schema
To try and create DTD and XML Schema
 
Try to Use DOM and SAX API (python)
Try to Use DOM and SAX API (python)Try to Use DOM and SAX API (python)
Try to Use DOM and SAX API (python)
 
Xml parser week2
Xml parser week2Xml parser week2
Xml parser week2
 
Introduction to XML.
Introduction to XML.Introduction to XML.
Introduction to XML.
 

Recently uploaded

Sid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.pptSid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.ppt
ArshadAyub49
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
dataschool1
 
How To Control IO Usage using Resource Manager
How To Control IO Usage using Resource ManagerHow To Control IO Usage using Resource Manager
How To Control IO Usage using Resource Manager
Alireza Kamrani
 
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
actyx
 
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
oaxefes
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
blueshagoo1
 
Sample Devops SRE Product Companies .pdf
Sample Devops SRE  Product Companies .pdfSample Devops SRE  Product Companies .pdf
Sample Devops SRE Product Companies .pdf
Vineet
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
eoxhsaa
 
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
z6osjkqvd
 
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
ywqeos
 
Telemetry Solution for Gaming (AWS Summit'24)
Telemetry Solution for Gaming (AWS Summit'24)Telemetry Solution for Gaming (AWS Summit'24)
Telemetry Solution for Gaming (AWS Summit'24)
GeorgiiSteshenko
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
uevausa
 
一比一原版南昆士兰大学毕业证如何办理
一比一原版南昆士兰大学毕业证如何办理一比一原版南昆士兰大学毕业证如何办理
一比一原版南昆士兰大学毕业证如何办理
ugydym
 
8 things to know before you start to code in 2024
8 things to know before you start to code in 20248 things to know before you start to code in 2024
8 things to know before you start to code in 2024
ArianaRamos54
 
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
lzdvtmy8
 
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
yuvarajkumar334
 
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
eudsoh
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
bmucuha
 
一比一原版悉尼大学毕业证如何办理
一比一原版悉尼大学毕业证如何办理一比一原版悉尼大学毕业证如何办理
一比一原版悉尼大学毕业证如何办理
keesa2
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
Vietnam Cotton & Spinning Association
 

Recently uploaded (20)

Sid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.pptSid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.ppt
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
 
How To Control IO Usage using Resource Manager
How To Control IO Usage using Resource ManagerHow To Control IO Usage using Resource Manager
How To Control IO Usage using Resource Manager
 
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
 
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
 
Sample Devops SRE Product Companies .pdf
Sample Devops SRE  Product Companies .pdfSample Devops SRE  Product Companies .pdf
Sample Devops SRE Product Companies .pdf
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
 
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
 
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
 
Telemetry Solution for Gaming (AWS Summit'24)
Telemetry Solution for Gaming (AWS Summit'24)Telemetry Solution for Gaming (AWS Summit'24)
Telemetry Solution for Gaming (AWS Summit'24)
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
 
一比一原版南昆士兰大学毕业证如何办理
一比一原版南昆士兰大学毕业证如何办理一比一原版南昆士兰大学毕业证如何办理
一比一原版南昆士兰大学毕业证如何办理
 
8 things to know before you start to code in 2024
8 things to know before you start to code in 20248 things to know before you start to code in 2024
8 things to know before you start to code in 2024
 
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
 
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
 
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
一比一原版悉尼大学毕业证如何办理
一比一原版悉尼大学毕业证如何办理一比一原版悉尼大学毕业证如何办理
一比一原版悉尼大学毕业证如何办理
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
 

Try PostgreSQL on linux

  • 2. sudo apt-get update sudo apt-get install postgresql postgresql-contrib
  • 3. sudo -i -u postgres
  • 4. CREATE TABLE table_name ( column_name1 col_type (field_length) column_constraints, column_name2 col_type (field_length), column_name3 col_type (field_length) );
  • 5. print "Opened database successfully"; CREATE TABLE FLIGHT ( Number INT PRIMARY KEY NOT NULL, Airline CHAR(20) NOT NULL, Weekdays CHAR(10) NOT NULL ); print "Table created FLIGHT"; CREATE TABLE FARE( Code INT PRIMARY KEY NOT NULL, Amount INT NOT NULL, Restrictions CHAR(20) NOT NULL, FAnumber INT NOT NULL, FARES_Number INT NOT NULL, FOREIGN KEY(FAnumber) REFERENCES FLIGHT(Number) ); print "Table created FARE"; CREATE TABLE SEAT( Seat_No INT PRIMARY KEY NOT NULL, Sdate CHAR(20) NOT NULL, RES_Date CHAR(20) NOT NULL, RES_Customer_Name CHAR(20) NOT NULL, RES_Cphone CHAR(10) NOT NULL ); print "Table created SEAT"; conn.commit() conn.close()
  • 6. #FLIGHT Number = [] Airline = [] Weekdays = [] def Generate_FLIGHT(): #Generate FLIGHT Airline_Name = ['AirAsia','Nok_Air','ThaiSmile','ThaiAirways','BangkokAirways'] Weekdays_Name = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'] i = 90000000; t = time.clock() t1 = time.clock() d = 0; while i< 100000000: Number.append(i); Airline.append(Airline_Name[(i-1)%5]); if( i % 60 == 0): d = d + 1 if( d == 7 ): d = 0 Weekdays.append(Weekdays_Name[d]); if( i % 1000000 == 0): print (i) # print Number[i],Airline[i],Weekdays[i] i = i + 1 print( "Generate FLIGHT success") t1 = time.clock() print (t ,"seconds") print (t1,"seconds")
  • 7. select * from flight where airline = nok_air
  • 8. select * from flight where weekdays = 'sunday'