Computer Applications for Computer Applications for p pp p pp
Construction Construction :: Database :: :: Database :: Presented by Presented byyy Assist.Prof.Dr. Vachara Peansupap Assist.Prof.Dr. Vachara Peansupap Department of Civil Engineering Department of Civil Engineering Chulalongkorn University Chulalongkorn University Bangkok, Thailand Bangkok, Thailand Introduction to database Introduction to database 11 Needs of database Needs of database 1. 1. Needs of database Needs of database 2. 2. Database concept Database concept 3. 3. Database structure Database structure 4. 4. Design of database Design of database 55 Application of database Application of database Copyright 2007 Vachara Peansupap. All Rights Reserved. 5. 5. Application of database Application of database 6. 6. Example of database Example of database 2 Needs of database Needs of database Why do we need database in Why do we need database in Why do we need database in Why do we need database in construction and infrastructure construction and infrastructure management? management? Construction is fragmented by its Construction is fragmented by its nature. nature. Copyright 2007 Vachara Peansupap. All Rights Reserved. Several information are stored in Several information are stored in different places. different places. 11. Needs of database . Needs of database Without information, project managers and Without information, project managers and Without information, project managers and Without information, project managers and engineers are hardly to manage and make a engineers are hardly to manage and make a decision on project processes. decision on project processes. Several construction processes are required Several construction processes are required information such as information such as Estimating needs material price, labor price, equipment, Estimating needs material price, labor price, equipment, supplier contact data, problems and risk of previous supplier contact data, problems and risk of previous project; project; Copyright 2007 Vachara Peansupap. All Rights Reserved. project; project; Planning and control needs information related to work Planning and control needs information related to work plan, delay, defects, sub plan, delay, defects, sub- -contractor, document, drawing contractor, document, drawing Procurement needs stock information, average time Procurement needs stock information, average time delivery delivery 3 11. Needs of database . Needs of database Estimating Document Estimating Inventory Contractor database Maintenance Payment Infrastructur e Project Tendering Copyright 2007 Vachara Peansupap. All Rights Reserved. Inspection Planning& monitoring Change order Customer records Training 11. Needs of database in . Needs of database in construction construction Copyright 2007 Vachara Peansupap. All Rights Reserved. 4 Estimating database Estimating database Copyright 2007 Vachara Peansupap. All Rights Reserved. Change Order Change Order Copyright 2007 Vachara Peansupap. All Rights Reserved. 5 Life cycle cost Life cycle cost Copyright 2007 Vachara Peansupap. All Rights Reserved. Document database Document database Copyright 2007 Vachara Peansupap. All Rights Reserved. 6 Inspection Inspection Copyright 2007 Vachara Peansupap. All Rights Reserved. Inspection Inspection Digital Camera DSS Result Image Acquistion Image Transfer to Computer Fitering Gray Scale Black&White Input Image Knowl edge Management Image Processi ng - Result of assessment (Defect/Non Defect) - Management method (Non action, repair and maintenance method) Add new data/ knowledge Copyright 2007 Vachara Peansupap. All Rights Reserved. Edge Detection Segmentation Height Level Image Processing Data Extraction/ Output Image Data Generation - Crack Type Classification - Crack assessment (Defect/Non Defect) - Alternative Management (Non action, repair and maintenance method) Peansupap and Laofor (2008) 7 3. QA MANAGEMENT MODULE (DOT) Other Databases Contracts Acceptance System Specification System Pay System Analysis System Analysis System 1.DATABASE SERVER MODULE INTERNET 4. DATA TRANSLATION MODULE Contracts Inventory PMS Cost Safety, etc Contract Information Material Design QC Testing Acceptance Testing Construction Records Checklist Internal Audit Evaluation Copyright 2007 Vachara Peansupap. All Rights Reserved. Architecture for construction quality database system(www.fhwa.dot.gov) Certification Qualification Contractors Contractors 2.QA DATA I NPUT MODULE (Contractor & DOT) Maintenance Maintenance Copyright 2007 Vachara Peansupap. All Rights Reserved. 8 Bridge management Bridge management Copyright 2007 Vachara Peansupap. All Rights Reserved. EE--Procurement Procurement Copyright 2007 Vachara Peansupap. All Rights Reserved. http://www.e-nvision.org/ 9 Construction material Construction material database database Copyright 2007 Vachara Peansupap. All Rights Reserved. Construction material Construction material database database Copyright 2007 Vachara Peansupap. All Rights Reserved. 10 22. Database concept . Database concept What is the database? What is the database? What is the database? What is the database? Database is a structured collection of Database is a structured collection of records or data that is stored in a records or data that is stored in a computer system. computer system. The structure is achieved by organizing The structure is achieved by organizing the data according to a database model the data according to a database model Copyright 2007 Vachara Peansupap. All Rights Reserved. the data according to a database model. the data according to a database model. 22. Database concept . Database concept Many ways of organizing and storing Many ways of organizing and storing Many ways of organizing and storing Many ways of organizing and storing information information Two main categories, which are Two main categories, which are simpler simpler data files data files that contain records of that contain records of information information Copyright 2007 Vachara Peansupap. All Rights Reserved. complex complex databases databases that might provide that might provide integrate access to interrelated blocks of integrate access to interrelated blocks of information information 11 22. Database concept . Database concept Organization Organization of of data file data file helps helps Organization Organization of of data file data file helps helps determine the means for creating, determine the means for creating, processing, selecting, and extracting processing, selecting, and extracting information. information. In In data file data file, it should define the , it should define the key key Copyright 2007 Vachara Peansupap. All Rights Reserved. that are used to contain that are used to contain data elements data elements for sorting or searching a file. for sorting or searching a file. 22. Database concept: data . Database concept: data file file Copyright 2007 Vachara Peansupap. All Rights Reserved. 12 22. Database concept . Database concept The keys also contains the The keys also contains the attributes attributes The keys also contains the The keys also contains the attributes attributes of the records. of the records. When the organization of the file is When the organization of the file is known, program can be written to known, program can be written to perform actions with the data such as perform actions with the data such as Copyright 2007 Vachara Peansupap. All Rights Reserved. the telephone book has the telephone book has a name, a name, address, and telephone number address, and telephone number as as attributes attributes in each of its records. in each of its records. 33. Database structure . Database structure DATABASE FI LE DATABASE FI LE DATABASE FI LE DATABASE FI LE Attribute -Name -Surname Table Table Copyright 2007 Vachara Peansupap. All Rights Reserved. -Address -Telephone Records 1. Mary J im Christine St New York 8101236634 2. J erry J ohnson Saint Kilda Beach Virginia 8101236548 13 33. Database structure . Database structure TABLES DATABASE Copyright 2007 Vachara Peansupap. All Rights Reserved. FI ELDS/ ATTRI BUTES Database Database Create Relationship Create Relationship Create Relationship Create Relationship Copyright 2007 Vachara Peansupap. All Rights Reserved. 14 Input Data Input Data Copyright 2007 Vachara Peansupap. All Rights Reserved. 33. Database structure . Database structure If the telephone book is available in electronic If the telephone book is available in electronic If the telephone book is available in electronic If the telephone book is available in electronic format file, it would be easy to write program that format file, it would be easy to write program that could search rapidly through file for a given name could search rapidly through file for a given name and report address or telephone number. and report address or telephone number. However, it would be harder to take a given However, it would be harder to take a given address or telephone number and find the address or telephone number and find the corresponding person if the file is not well corresponding person if the file is not well organized for the purpose For example organized for the purpose For example Copyright 2007 Vachara Peansupap. All Rights Reserved. organized for the purpose. For example, organized for the purpose. For example, the find the person who live in city of Bangkok and the find the person who live in city of Bangkok and Phayathai suburb or Phayathai suburb or telephone number is stored into telephone number is stored into 8 8 or or 9 9 digit. digit. 2186460 2186460 or or 022186460 022186460 15 File processing File processing Sequential file processing Sequential file processing Sequential file processing Sequential file processing Direct access file processing Direct access file processing Copyright 2007 Vachara Peansupap. All Rights Reserved. File processing File processing sequential data access sequential data access Sequential file processing Sequential file processing Sequential file processing Sequential file processing It is suitable for handling many It is suitable for handling many transactions together in a batch mode. transactions together in a batch mode. Pros Pros Simple to design and maintain, Simple to design and maintain, suitable for low suitable for low--cost media cost media Cons Cons data much be sorted before data much be sorted before Copyright 2007 Vachara Peansupap. All Rights Reserved. Cons Cons data much be sorted before data much be sorted before processing, the master file is only up processing, the master file is only up- -to to--date date to the last period when the transactions were to the last period when the transactions were run run 16 File processing File processing direct direct access data access data Direct access file processing Direct access file processing Direct access file processing Direct access file processing As the low cost of disk storage and the As the low cost of disk storage and the increase of powerful computer processors increase of powerful computer processors drive the way to process data directly so drive the way to process data directly so called direct access called direct access Cons Cons the file do become fragmented as new the file do become fragmented as new d dd d d ld difi d d dd d d ld difi d Copyright 2007 Vachara Peansupap. All Rights Reserved. records are added and old ones are modified records are added and old ones are modified or deleted. (file may be corrupted) or deleted. (file may be corrupted) Pros Pros the master file is online all the time the master file is online all the time and is available for inquires from terminals and is available for inquires from terminals Information organization Information organization and storage in database and storage in database Database Database refers to a complex system refers to a complex system Database Database refers to a complex system refers to a complex system of software and hardware that of software and hardware that integrates the various files. integrates the various files. It enhances different applications into It enhances different applications into on commonly accessible pool of on commonly accessible pool of information information Copyright 2007 Vachara Peansupap. All Rights Reserved. information. information. This integration makes it possible to This integration makes it possible to reduce the duplication of items. reduce the duplication of items. 17 Components of Databases Components of Databases Database Database an organized collection of an organized collection of Database Database an organized collection of an organized collection of information that pertains to a particular information that pertains to a particular subject or purpose subject or purpose Table Table a collection of data about a specific a collection of data about a specific topic, organized into columns and rows topic, organized into columns and rows Field Field a category of information in a table a category of information in a table ( l ) ( l ) Copyright 2007 Vachara Peansupap. All Rights Reserved. (column) (column) Record Record a collection of information a collection of information consisting of one or more related fields consisting of one or more related fields about a specific entity (row) about a specific entity (row) Relational Databases Relational Databases Relational database Relational database a database that a database that Relational database Relational database a database that a database that contains multiple tables related through contains multiple tables related through common fields common fields Common field Common field a field, contained in two or a field, contained in two or more tables, that forms a relationship more tables, that forms a relationship between the tables between the tables Copyright 2007 Vachara Peansupap. All Rights Reserved. between the tables between the tables Relationship Relationship a connection between two or a connection between two or more tables based on a common field more tables based on a common field Relating tables eliminates the duplication of Relating tables eliminates the duplication of data data 18 Relational Databases Relational Databases (contd) (contd) Tables are related through their common Tables are related through their common Tables are related through their common Tables are related through their common fields fields The common field is the primary key in one The common field is the primary key in one table and the foreign key in another table table and the foreign key in another table Primary key Primary key a field containing a value that a field containing a value that uniquely identifies each record in a table uniquely identifies each record in a table Copyright 2007 Vachara Peansupap. All Rights Reserved. q y q y Foreign key Foreign key a field in a related table that refers a field in a related table that refers to the primary key in another table to the primary key in another table Standard Relationships Standard Relationships One One--to to--one relationship one relationship each record in each record in One One to to one relationship one relationship each record in each record in Table A can have only one matching record Table A can have only one matching record in Table B. For example, the ID of personal in Table B. For example, the ID of personal is one to one relationship with Staff. is one to one relationship with Staff. One One- -to to--many relationship many relationship a record in a record in Table A can have many matching records in Table A can have many matching records in Copyright 2007 Vachara Peansupap. All Rights Reserved. y g y g Table B, but a record in Table B has only Table B, but a record in Table B has only one matching record in Table A (the most one matching record in Table A (the most common table relationship) For example, common table relationship) For example, the staff in table users can be shown in the staff in table users can be shown in borrowing equipment table) borrowing equipment table) 19 Standard Relationships Standard Relationships Many Many--to to--one relationship one relationship one record one record Many Many--to to--one relationship one relationship one record one record in Table A can related to many in Table A can related to many recordings in Table B (Many records recordings in Table B (Many records from maintenance table may have one from maintenance table may have one record to one crane in equipment record to one crane in equipment bl ) bl ) Copyright 2007 Vachara Peansupap. All Rights Reserved. table) table) Standard Relationships Standard Relationships Many Many--to to--many relationship many relationship one one Many Many--to to--many relationship many relationship one one record in either Table A or B can relate record in either Table A or B can relate to many matching records in the other to many matching records in the other table table Established by creating multiple one Established by creating multiple one- -to to-- Copyright 2007 Vachara Peansupap. All Rights Reserved. many relationships with a third table many relationships with a third table (junction table) (junction table) 20 Relating Database Tables Relating Database Tables (contd) (contd) One-to-many relationship Copyright 2007 Vachara Peansupap. All Rights Reserved. Many-to-one relationship One One- -to to- -one one Personal identification of staff with Personal identification of staff with Personal identification of staff with Personal identification of staff with name and surname name and surname Contact number with staff name Contact number with staff name Copyright 2007 Vachara Peansupap. All Rights Reserved. 21 One One- -to to- -many relationship many relationship Worker A borrows several safety Worker A borrows several safety Worker A borrows several safety Worker A borrows several safety equipments equipments An engineer inspects quality of rooms An engineer inspects quality of rooms A machine is used by several A machine is used by several construction projects construction projects Copyright 2007 Vachara Peansupap. All Rights Reserved. construction projects construction projects Many Many- -to to- -one relationship one relationship Sub Sub--contractors involve in construction contractors involve in construction Sub Sub--contractors involve in construction contractors involve in construction project project History of machine drivers (assume History of machine drivers (assume many drivers may use this machine) many drivers may use this machine) Maintenance historical data on a Maintenance historical data on a Copyright 2007 Vachara Peansupap. All Rights Reserved. Maintenance historical data on a Maintenance historical data on a tunnel section tunnel section 22 Many Many- -to to- -many many Maintenance historical data of tunnel Maintenance historical data of tunnel Maintenance historical data of tunnel Maintenance historical data of tunnel sections or tunnel projects sections or tunnel projects Knowledge of problem solving in Knowledge of problem solving in several infrastructure projects several infrastructure projects Copyright 2007 Vachara Peansupap. All Rights Reserved. Applications of Database Applications of Database Material management Material management Material management Material management Personal systems Personal systems Equipment information systems Equipment information systems Accounting systems Accounting systems Knowledge database Knowledge database Copyright 2007 Vachara Peansupap. All Rights Reserved. Knowledge database Knowledge database Quality management system Quality management system 23 Database Database - - MSAccess MSAccess Copyright 2007 Vachara Peansupap. All Rights Reserved. Database Database - - MSAccess MSAccess Copyright 2007 Vachara Peansupap. All Rights Reserved. 24 PhpMySQL PhpMySQL Copyright 2007 Vachara Peansupap. All Rights Reserved. Copyright 2007 Vachara Peansupap. All Rights Reserved. 25 Copyright 2007 Vachara Peansupap. All Rights Reserved. Copyright 2007 Vachara Peansupap. All Rights Reserved. 26 Copyright 2007 Vachara Peansupap. All Rights Reserved. Copyright 2007 Vachara Peansupap. All Rights Reserved. 27 Copyright 2007 Vachara Peansupap. All Rights Reserved. 44 Design of database Design of database 44. Design of database . Design of database 28 Component of database Component of database Database design Form Database Table Query data from field Output & Report Copyright 2007 Vachara Peansupap. All Rights Reserved. Table Field Input data into field 11. Conceptual design of . Conceptual design of Database Database Conceptual design aims to understand Conceptual design aims to understand Conceptual design aims to understand Conceptual design aims to understand the basic data and relationships for the basic data and relationships for developing database. developing database. This process may simulate objects and This process may simulate objects and interaction. interaction. For example database of equipment For example database of equipment Copyright 2007 Vachara Peansupap. All Rights Reserved. For example, database of equipment For example, database of equipment maintenance consists of equipment, maintenance consists of equipment, records, maintenance types. records, maintenance types. 29 11. Conceptual design . Conceptual design For example database of equipment For example database of equipment For example, database of equipment For example, database of equipment maintenance consists of equipment, maintenance consists of equipment, records, and maintenance tables. records, and maintenance tables. Equip ID Equipment Rec ID Record Maint ID Maintenance Copyright 2007 Vachara Peansupap. All Rights Reserved. Equip_ID Equip_Model Equip_Type Equip_Cost Equip_Age Rec_ID Equip_ID Maint_ID Rec_MileNumber Rec_Date Maint_ID Maint_Type Maint_Cost Material procurement Material procurement For example database of material For example database of material MAT ID For example, database of material For example, database of material procurement consists of material, procurement consists of material, order, and project tables order, and project tables MATERI AL ORDER ID ORDER PROJ ID PROJ ECT Copyright 2007 Vachara Peansupap. All Rights Reserved. MAT_ID MAT_DES MAT_PRICE MAT_UNIT ORDER_ID MAT_ID PROJ _ID ORDER_QUANTITY ORDER_DATE PROJ _ID PROJ _NAME PROJ _LOCATION PROJ _CONTACT PROJ _BUDGET 30 Quality control Quality control process process For example, database of quality For example, database of quality t l i t f h t l i t f h control process consists of house, control process consists of house, qc_check, defects and position. qc_check, defects and position. HOUSE QC_ID HOUSE_ID QC_CHECK DEF_ID DEF_NAME DEFECTS Copyright 2007 Vachara Peansupap. All Rights Reserved. HOUSE_ID HOUSE_MODEL HOUSE_STORY HOUSE_FL_AREA HOUSE_BUDGET DEF_ID QC_DATE QC_QUALITY POS_ID DEF_COST DEF_AMOUNT POS_ID POS_NAME POSI TI ON MAT_ID MAT_DES MAT_PRICE MATERI AL ORDER_ID MAT_ID PROJ _ID ORDER MAT_UNIT ORDER_QUANTITY ORDER_DATE MAT_ID MATERI AL ORDER_ID ORDER Copyright 2007 Vachara Peansupap. All Rights Reserved. MAT_DES MAT_PRICE MAT_UNIT MAT_ID PROJ _ID ORDER_QUANTITY ORDER_DATE 31 Copyright 2007 Vachara Peansupap. All Rights Reserved. 22. Create database . Create database Table Table Table Table Query Query Form Form Macro Macro Copyright 2007 Vachara Peansupap. All Rights Reserved. 32 22. Create database: table . Create database: table Basic group of information that will Basic group of information that will Basic group of information that will Basic group of information that will use to store data. use to store data. The table sometimes has the The table sometimes has the relationship between each other. relationship between each other. Copyright 2007 Vachara Peansupap. All Rights Reserved. 22. Create database: query . Create database: query Query is the command that helps to Query is the command that helps to Query is the command that helps to Query is the command that helps to manipulate information. manipulate information. Query can link data from one table Query can link data from one table with other table. Therefore, it can with other table. Therefore, it can present data in many dimension. present data in many dimension. Copyright 2007 Vachara Peansupap. All Rights Reserved. 33 22. Create database: form . Create database: form Formis an object that helps to Formis an object that helps to Form is an object that helps to Form is an object that helps to communicate with table/query. communicate with table/query. In addition, form is one of user In addition, form is one of user interface that allows user to input and interface that allows user to input and display information. display information. Copyright 2007 Vachara Peansupap. All Rights Reserved. 22. Create database: . Create database: macro macro Macro is the series of command that Macro is the series of command that Macro is the series of command that Macro is the series of command that automatically interact with user. automatically interact with user. Copyright 2007 Vachara Peansupap. All Rights Reserved. 34 33. Input data . Input data This process involves the transfer of This process involves the transfer of This process involves the transfer of This process involves the transfer of data into database. data into database. This data is one of the basic elements This data is one of the basic elements that need to analyze the information. that need to analyze the information. In fact, this input data should be In fact, this input data should be Copyright 2007 Vachara Peansupap. All Rights Reserved. In fact, this input data should be In fact, this input data should be designed according to the report designed according to the report output. output. 44. Access and Report data . Access and Report data Report data is the expected Report data is the expected Report data is the expected Report data is the expected information, which obtain from data information, which obtain from data manipulation. manipulation. The database should be flexible and The database should be flexible and allows user to manage data in allows user to manage data in Copyright 2007 Vachara Peansupap. All Rights Reserved. different perspectives. different perspectives. 35 Copyright 2007 Vachara Peansupap. All Rights Reserved. http://www.itcon.org/2002/7/paper.pdf 55. Database Language . Database Language SQL (Structured Query Language) is SQL (Structured Query Language) is SQL (Structured Query Language) is SQL (Structured Query Language) is the standard language designed to the standard language designed to interact with data and database. interact with data and database. SQL can use to create, input, modify SQL can use to create, input, modify and process data in database. and process data in database. Copyright 2007 Vachara Peansupap. All Rights Reserved. The processing data includes sorting The processing data includes sorting and searching data. and searching data. 36 SQL database SQL database Free database applications are Free database applications are Free database applications are Free database applications are available such as MySQL and SQL available such as MySQL and SQL Server Express Server Express. . Commercial database applications are Commercial database applications are SQL server, IBM, Oracle SQL server, IBM, Oracle Copyright 2007 Vachara Peansupap. All Rights Reserved. Questions? Questions?