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
Ad

Recommended

Pop3ck sh
Pop3ck sh
Ben Pope
 
Logrotate sh
Logrotate sh
Ben Pope
 
libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발
libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발
WooKyoung Noh
 
Mkscript sh
Mkscript sh
Ben Pope
 
Angular Refactoring in Real World
Angular Refactoring in Real World
bitbank, Inc. Tokyo, Japan
 
The Art of Command Line (2021)
The Art of Command Line (2021)
Kenta Yamamoto
 
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
Zend by Rogue Wave Software
 
Having Fun Programming!
Having Fun Programming!
Aaron Patterson
 
Perl 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 Perspective
Eleanor McHugh
 
C99.php
C99.php
veng33k
 
Gun make
Gun make
psychesnet Hsieh
 
Character_Device_drvier_pc
Character_Device_drvier_pc
Rashila Rr
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1
Leandro Lima
 
The Magic Of Tie
The Magic Of Tie
brian d foy
 
R-Excel Integration
R-Excel Integration
Andrija Djurovic
 
Workshop 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 Extbase
Jochen Rau
 
Yy
Yy
yygh
 
Nouveau document texte
Nouveau document texte
Sai Ef
 
How to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
 
Bodlogiin code
Bodlogiin code
orgil
 
Customizing the unix environment
Customizing the unix environment
Dr. Girish GS
 
OpenCL 2.1 Reference Guide
OpenCL 2.1 Reference Guide
The Khronos Group Inc.
 
Parsing 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]
Eleanor McHugh
 
As400 session or device error
As400 session or device error
aminem_mp
 
Example Database normal form
Example Database normal form
Aey Unthika
 
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)
Aey Unthika
 

More Related Content

What's hot (19)

Perl 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 Perspective
Eleanor McHugh
 
C99.php
C99.php
veng33k
 
Gun make
Gun make
psychesnet Hsieh
 
Character_Device_drvier_pc
Character_Device_drvier_pc
Rashila Rr
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1
Leandro Lima
 
The Magic Of Tie
The Magic Of Tie
brian d foy
 
R-Excel Integration
R-Excel Integration
Andrija Djurovic
 
Workshop 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 Extbase
Jochen Rau
 
Yy
Yy
yygh
 
Nouveau document texte
Nouveau document texte
Sai Ef
 
How to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
 
Bodlogiin code
Bodlogiin code
orgil
 
Customizing the unix environment
Customizing the unix environment
Dr. Girish GS
 
OpenCL 2.1 Reference Guide
OpenCL 2.1 Reference Guide
The Khronos Group Inc.
 
Parsing 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]
Eleanor McHugh
 
As400 session or device error
As400 session or device error
aminem_mp
 
Perl 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 Perspective
Eleanor McHugh
 
Character_Device_drvier_pc
Character_Device_drvier_pc
Rashila Rr
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1
Leandro Lima
 
The Magic Of Tie
The Magic Of Tie
brian d foy
 
Workshop 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 Extbase
Jochen Rau
 
Yy
Yy
yygh
 
Nouveau document texte
Nouveau document texte
Sai Ef
 
How to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
 
Bodlogiin code
Bodlogiin code
orgil
 
Customizing the unix environment
Customizing the unix environment
Dr. Girish GS
 
Parsing 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]
Eleanor McHugh
 
As400 session or device error
As400 session or device error
aminem_mp
 

Viewers also liked (20)

Example Database normal form
Example Database normal form
Aey Unthika
 
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)
Aey Unthika
 
Vanson Bourne Data Summary: Shadow IT - BDMs
Vanson Bourne Data Summary: Shadow IT - BDMs
Vanson Bourne
 
Er diagram
Er diagram
LOKENDRA PRAJAPATI
 
00137
00137
prashnant
 
Mapping
Mapping
Samir Sabry
 
02er
02er
Abdulaziz Al-qurashi
 
Special lecture er diagram
Special lecture er diagram
Niaz Ali
 
Er diagrams presentation
Er diagrams presentation
Akanksha Jaiswal
 
Unilever
Unilever
Ghulam Baddar
 
Eer >r.model
Eer >r.model
lavya3
 
ER Diagrams Simplified
ER Diagrams Simplified
Puneet Arora
 
Mapping ER and EER Model
Mapping ER and EER Model
Mary Brinda
 
Entity relationship diagram
Entity relationship diagram
Haseeb
 
Statistical learning
Statistical learning
Slideshare
 
enhanced er diagram
enhanced er diagram
CHANDRA BHUSHAN
 
Enhanced ER(database)
Enhanced ER(database)
welcometofacebook
 
Entity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by Creately
Creately
 
Er & eer to relational mapping
Er & eer to relational mapping
saurabhshertukde
 
Example Database normal form
Example Database normal form
Aey Unthika
 
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)
Aey Unthika
 
Vanson Bourne Data Summary: Shadow IT - BDMs
Vanson Bourne Data Summary: Shadow IT - BDMs
Vanson Bourne
 
Special lecture er diagram
Special lecture er diagram
Niaz Ali
 
Eer >r.model
Eer >r.model
lavya3
 
ER Diagrams Simplified
ER Diagrams Simplified
Puneet Arora
 
Mapping ER and EER Model
Mapping ER and EER Model
Mary Brinda
 
Entity relationship diagram
Entity relationship diagram
Haseeb
 
Statistical learning
Statistical learning
Slideshare
 
Entity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by Creately
Creately
 
Er & eer to relational mapping
Er & eer to relational mapping
saurabhshertukde
 
Ad

Similar to Try PostgreSQL on linux (20)

Airport traffic control simple database model
Airport traffic control simple database model
master student
 
Spring One 2012 Presentation – Effective design patterns with NewSQL
Spring One 2012 Presentation – Effective design patterns with NewSQL
VMware vFabric
 
Airline Database Design
Airline Database Design
Abhishek Jaisingh
 
here is the SQL. PLEASE ONLY START FROM # 6 TO #10 AS I DID #1 TO #5.docx
here is the SQL. PLEASE ONLY START FROM # 6 TO #10 AS I DID #1 TO #5.docx
howard4little59962
 
simple airline database project..By Amarulla khan, :- [email protected]
simple airline database project..By Amarulla khan, :- [email protected]
hk2208820
 
DashboardUMUC DATA 620Assignment 3.1Your NameProfessorDateProbl.docx
DashboardUMUC DATA 620Assignment 3.1Your NameProfessorDateProbl.docx
simonithomas47935
 
Air ticket reservation system presentation
Air ticket reservation system presentation
Smit Patel
 
Elm04 05
Elm04 05
ابو اسامة اليبناوي
 
SQLFire at VMworld Europe 2011
SQLFire at VMworld Europe 2011
Carter Shanklin
 
UNIT V PYTHON.pptx python basics ppt python
UNIT V PYTHON.pptx python basics ppt python
SuganthiDPSGRKCW
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
AkshatTiwari530170
 
PostgreSQL Modules Tutorial - chkpass, hstore, fuzzystrmach, isn
PostgreSQL Modules Tutorial - chkpass, hstore, fuzzystrmach, isn
Sagar Arlekar
 
Pg py-and-squid-pypgday
Pg py-and-squid-pypgday
PostgreSQL Experts, Inc.
 
Cs project
Cs project
subrat singh
 
KUMARPAWAN (2).pdf
KUMARPAWAN (2).pdf
RajKamal754430
 
Create a Microsoft Access Database that has multiple tables based on t.pdf
Create a Microsoft Access Database that has multiple tables based on t.pdf
KeithyZpBucklandu
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQL
Peter Eisentraut
 
Flight Reservation SystemThe flight reservation system” proje.docx
Flight Reservation SystemThe flight reservation system” proje.docx
AKHIL969626
 
Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM
Mark Rees
 
Chapter -7.pptx
Chapter -7.pptx
MikialeTesfamariam
 
Airport traffic control simple database model
Airport traffic control simple database model
master student
 
Spring One 2012 Presentation – Effective design patterns with NewSQL
Spring One 2012 Presentation – Effective design patterns with NewSQL
VMware vFabric
 
here is the SQL. PLEASE ONLY START FROM # 6 TO #10 AS I DID #1 TO #5.docx
here is the SQL. PLEASE ONLY START FROM # 6 TO #10 AS I DID #1 TO #5.docx
howard4little59962
 
DashboardUMUC DATA 620Assignment 3.1Your NameProfessorDateProbl.docx
DashboardUMUC DATA 620Assignment 3.1Your NameProfessorDateProbl.docx
simonithomas47935
 
Air ticket reservation system presentation
Air ticket reservation system presentation
Smit Patel
 
SQLFire at VMworld Europe 2011
SQLFire at VMworld Europe 2011
Carter Shanklin
 
UNIT V PYTHON.pptx python basics ppt python
UNIT V PYTHON.pptx python basics ppt python
SuganthiDPSGRKCW
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
AkshatTiwari530170
 
PostgreSQL Modules Tutorial - chkpass, hstore, fuzzystrmach, isn
PostgreSQL Modules Tutorial - chkpass, hstore, fuzzystrmach, isn
Sagar Arlekar
 
Create a Microsoft Access Database that has multiple tables based on t.pdf
Create a Microsoft Access Database that has multiple tables based on t.pdf
KeithyZpBucklandu
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQL
Peter Eisentraut
 
Flight Reservation SystemThe flight reservation system” proje.docx
Flight Reservation SystemThe flight reservation system” proje.docx
AKHIL969626
 
Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM
Mark Rees
 
Ad

More from Aey Unthika (8)

Assignmet 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 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/...
Aey Unthika
 
To 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 Schema
Aey Unthika
 
Try to Use DOM and SAX API (python)
Try to Use DOM and SAX API (python)
Aey Unthika
 
Xml parser week2
Xml parser week2
Aey Unthika
 
Introduction to XML.
Introduction to XML.
Aey Unthika
 
Assignmet 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 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/...
Aey Unthika
 
To 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 Schema
Aey Unthika
 
Try to Use DOM and SAX API (python)
Try to Use DOM and SAX API (python)
Aey Unthika
 
Xml parser week2
Xml parser week2
Aey Unthika
 
Introduction to XML.
Introduction to XML.
Aey Unthika
 

Recently uploaded (20)

最新版美国威斯康星大学河城分校毕业证(UWRF毕业证书)原版定制
最新版美国威斯康星大学河城分校毕业证(UWRF毕业证书)原版定制
taqyea
 
NASA ESE Study Results v4 05.29.2020.pptx
NASA ESE Study Results v4 05.29.2020.pptx
CiroAlejandroCamacho
 
25 items quiz for practical research 1 in grade 11
25 items quiz for practical research 1 in grade 11
leamaydayaganon81
 
Informatics Market Insights AI Workforce.pdf
Informatics Market Insights AI Workforce.pdf
karizaroxx
 
定制OCAD学生卡加拿大安大略艺术与设计大学成绩单范本,OCAD成绩单复刻
定制OCAD学生卡加拿大安大略艺术与设计大学成绩单范本,OCAD成绩单复刻
taqyed
 
Model Evaluation & Visualisation part of a series of intro modules for data ...
Model Evaluation & Visualisation part of a series of intro modules for data ...
brandonlee626749
 
Measurecamp Copenhagen - Consent Context
Measurecamp Copenhagen - Consent Context
Human37
 
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
Taqyea
 
PPT2 W1L2.pptx.........................................
PPT2 W1L2.pptx.........................................
palicteronalyn26
 
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
jed P
 
PPT1_CB_VII_CS_Ch3_FunctionsandChartsinCalc.ppsx
PPT1_CB_VII_CS_Ch3_FunctionsandChartsinCalc.ppsx
animaroy81
 
Mynd company all details what they are doing a
Mynd company all details what they are doing a
AniketKadam40952
 
Indigo_Airlines_Strategy_Presentation.pptx
Indigo_Airlines_Strategy_Presentation.pptx
mukeshpurohit991
 
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪LJMU学生证办理学历认证
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪LJMU学生证办理学历认证
taqyed
 
一比一原版(TUC毕业证书)开姆尼茨工业大学毕业证如何办理
一比一原版(TUC毕业证书)开姆尼茨工业大学毕业证如何办理
taqyed
 
最新版美国约翰霍普金斯大学毕业证(JHU毕业证书)原版定制
最新版美国约翰霍普金斯大学毕业证(JHU毕业证书)原版定制
Taqyea
 
Daily, Weekly, Monthly Report MTC March 2025.pptx
Daily, Weekly, Monthly Report MTC March 2025.pptx
PanjiDewaPamungkas1
 
Prescriptive Process Monitoring Under Uncertainty and Resource Constraints: A...
Prescriptive Process Monitoring Under Uncertainty and Resource Constraints: A...
Mahmoud Shoush
 
Attendance Presentation Project Excel.pptx
Attendance Presentation Project Excel.pptx
s2025266191
 
Shifting Focus on AI: How it Can Make a Positive Difference
Shifting Focus on AI: How it Can Make a Positive Difference
1508 A/S
 
最新版美国威斯康星大学河城分校毕业证(UWRF毕业证书)原版定制
最新版美国威斯康星大学河城分校毕业证(UWRF毕业证书)原版定制
taqyea
 
NASA ESE Study Results v4 05.29.2020.pptx
NASA ESE Study Results v4 05.29.2020.pptx
CiroAlejandroCamacho
 
25 items quiz for practical research 1 in grade 11
25 items quiz for practical research 1 in grade 11
leamaydayaganon81
 
Informatics Market Insights AI Workforce.pdf
Informatics Market Insights AI Workforce.pdf
karizaroxx
 
定制OCAD学生卡加拿大安大略艺术与设计大学成绩单范本,OCAD成绩单复刻
定制OCAD学生卡加拿大安大略艺术与设计大学成绩单范本,OCAD成绩单复刻
taqyed
 
Model Evaluation & Visualisation part of a series of intro modules for data ...
Model Evaluation & Visualisation part of a series of intro modules for data ...
brandonlee626749
 
Measurecamp Copenhagen - Consent Context
Measurecamp Copenhagen - Consent Context
Human37
 
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
Taqyea
 
PPT2 W1L2.pptx.........................................
PPT2 W1L2.pptx.........................................
palicteronalyn26
 
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
jed P
 
PPT1_CB_VII_CS_Ch3_FunctionsandChartsinCalc.ppsx
PPT1_CB_VII_CS_Ch3_FunctionsandChartsinCalc.ppsx
animaroy81
 
Mynd company all details what they are doing a
Mynd company all details what they are doing a
AniketKadam40952
 
Indigo_Airlines_Strategy_Presentation.pptx
Indigo_Airlines_Strategy_Presentation.pptx
mukeshpurohit991
 
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪LJMU学生证办理学历认证
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪LJMU学生证办理学历认证
taqyed
 
一比一原版(TUC毕业证书)开姆尼茨工业大学毕业证如何办理
一比一原版(TUC毕业证书)开姆尼茨工业大学毕业证如何办理
taqyed
 
最新版美国约翰霍普金斯大学毕业证(JHU毕业证书)原版定制
最新版美国约翰霍普金斯大学毕业证(JHU毕业证书)原版定制
Taqyea
 
Daily, Weekly, Monthly Report MTC March 2025.pptx
Daily, Weekly, Monthly Report MTC March 2025.pptx
PanjiDewaPamungkas1
 
Prescriptive Process Monitoring Under Uncertainty and Resource Constraints: A...
Prescriptive Process Monitoring Under Uncertainty and Resource Constraints: A...
Mahmoud Shoush
 
Attendance Presentation Project Excel.pptx
Attendance Presentation Project Excel.pptx
s2025266191
 
Shifting Focus on AI: How it Can Make a Positive Difference
Shifting Focus on AI: How it Can Make a Positive Difference
1508 A/S
 

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'