Presentation is loading. Please wait.

Presentation is loading. Please wait.

1302325 s1 2011 Advance Database Systems Week-2 Dr.Kwanchai Eurviriyanukul

Similar presentations


Presentation on theme: "1302325 s1 2011 Advance Database Systems Week-2 Dr.Kwanchai Eurviriyanukul"— Presentation transcript:

1 1302325 s1 2011 Advance Database Systems Week-2 Dr.Kwanchai Eurviriyanukul Kwanchai@rmutl.ac.th

2 Week-1-Homework Marking criteria. 1.You have successfully created your database. (2.5 marks) 2.You have successfully populated your data into your big table. (2.5 marks) 3.You have successfully populated your data into your normalized tables (2.5 marks) 4.Your have demonstrated the enforcement of foreign key constraints for your database. (2.5 marks)

3 Homework-Week-2 1.Data Population (Normalization from last week) 2.HTML processing 3.Venn Diagram Creation

4 Homework-Week-2 1.Data Population (Normalization from last week)

5 Homework-Week-2 1.HTML processing Your DOM.php

6 HTML processing (Your DOM.php)

7 Homework-Week-2 1.Venn Diagram Creation

8 Homework-Week-2 1.Venn Diagram Creation

9 End of the homework

10 Goal Data Integration Systems for …

11 Contents Constraints Concurrency Controls XML Basics Venn Diagram Google Maps

12 Normalization

13 Create Table and Constraints CREATE TABLE `village` ( `vill_id` int(11) NOT NULL, `vill_moo` varchar(10) DEFAULT NULL, `vill_name` varchar(100) DEFAULT NULL, `tambon_tam_id` char(10) NOT NULL, PRIMARY KEY (`vill_id`), foreign key (tambon_tam_id) references tambon(tam_id)) ENGINE=innodb DEFAULT CHARSET=utf8;

14 Sync Workbench with DB Update model

15 Now We got an updated Model Don’t forget to drag a new table into a new model

16 We need to populate data into new tables

17

18 Select Data use advancedb54; select * from villagebigtable;

19 Closer Look

20 How many records we have in villageBigTable?

21

22 We need to populate data into new tables From where to where?

23 We need to populate data into new tables From where to where?

24 Let’s analyse village ID

25 How many digits is used for provinceID province-district_name-sub_district_name- moo 50-02-09-13 เชียงใหม่ - จอมทอง - แม่สอย - หมู่ 13 => ห้วย พัฒนา 50-03-01-02 เชียงใหม่ - แม่แจ่ม - ช่างเคิ้ง - หมู่ 2 => ต่อเรือ

26 We need to populate data into new tables From where to where? Let’s start with region table;

27 How to populate a region table?

28 We need to get the unique name of the region_name from villageBigTable; => How?

29 How to populate a region table? We need to get the unique name of the region_name from villageBigTable; => How? select distinct region_name from villagebigtable;

30

31 We need to automatic create id for region name ALTER TABLE `advanceDB54`.`region` CHANGE COLUMN `region_id` `region_id` INT(11) NOT NULL AUTO_INCREMENT

32 select distinct region_name from villagebigtable;

33 Concurrency control Google doc

34 How many digits is used for provinceID Village_ID => Province+district_name+sub_district_name+mo o

35 Course Details Course Description Relational database theory, object-oriented database system, distributed database system, active database, distributed object- oriented database system, data warehouse, data mining, digital library, dynamic database system, and reasoning management database system. Course Objectives After completing the course students should be able to 1.Understand the concepts for Advance Database System and XML. 2.Know and select tools for Advance Database Systems and XML. 3.Able to develop programs by using the knowledge from 1. And 2.

36 Course Outlines WeekTopicDateLabBrief Content 1Reviews of Database Management Systems3/11/2554Basic PHP Programming-file processingSQL and Query Evaluation 2XML10/11/2554Basic PHP Programming-functionIntroduction to XML technology XML XML How to use XML Tree XML Syntax XML Elements XML Attributes 3DTD17/11/2554DTD Construction and ValidationDTD Structure Elements Attributes Elements vs Attr alidation Examples 4XML Schema/ XML namespace24/11/2553XML Schema Consturction and Validation-Simple TypeHow to declare the XML schema. How to refer XML schema in your XML document. How to construct the XML schema How to construct the simpleType elements for XML schema How to use restriction on simpleType 5XML Schema1/12/2554XML Schema Consturction and Validation-Complex TypeComplex Types Elements Mixed Indicators Data Types 6Xpath8/12/2554PHP Implementation for XpathIntro Nodes Syntax 7Xpath-Advance15/12/2554PHP Implementation for Xpath-1Syntax cont. Axes Operators Examples 8Xquery22/12/2554XQuery Evaluation with Eclipse-1Intro Example FLWOR expression XQuery Syntax 9Mid-Term29/12/2554 10Xquery-cont.5/01/2555XQuery Evaluation with Eclipse-2XQuery Add XQuery Select XQuery Functions 11XSLT12/01/2555XSLT programming with Eclipse and PHP-1XML Transformation XSLT Basic information XSLT Syntax and Running Example a. Template b. Value-of c. For-each 12XSLT-cont.19/01/2555XSLT programming with Eclipse and PHP-2Sort IF CHOOSE APPLY TEMPLATE XSL Element and XSL Attribute Processing XSL at server side Setting Webserver and PHP to support XSLT 13Web Services26/01/2555Remote Web Services InvocationWebservices Basic concept Webservices component WSDL 1.1 14Web Services cont.2/02/2555Implementation of Web Service PlatformsWSDL 2.0, SOAP, UDDI 15AJAX9/02/2555AJAX, Web Service, XML and Database Management SystemsCreate Object XHR Request XHR Response readyState AJAX ASP/PHP AJAX Database AJAX XML File 16Distributed Query Processing16/02/2555PHP and FQL implementationFacebook Query Language (FQL) Syntax, Function and Tables 17Final23/02/2555

37 Week-1 Lecture Reviews of Database Management Systems – SQL and Query Evaluation Lab – From Spreadsheets to the Web

38 Week-1:Lecture Reviews of Database Management Systems – SQL and Query Evaluation Introduction Data Modeling SQL

39 Exercise Let’s create an E-R for the following data (using a SQL statement) 39

40 Create a table

41 Show create table village

42 Village-ER

43 Village-ER => Normalization?

44 Why do we need normalization?

45 Village-ER => Normalization?

46 Now we need to populate the data

47 Week-1-Lab From Spreadsheets to the Web 1.Spreadsheets (MSExcel) to Relational DB (MySQL) 2.MySQL to Web (PHP) 3.Web (PHP) to WebService (Google Map)

48 Pre-requisite You need to have the following applications on your machine – Your local Web server (appserv) – Your IDE (Eclipse) – Mysql workbench Internet

49 Your local Web server (appserv) If you use appserv 2.6.x you might have a problem about calling phpMyAdmin You need to make a call to 127.0.0.1 instead And you need to change the config file and reboot

50 From Spreadsheets to the Web 1.Spreadsheets (MSExcel) to Relational DB (MySQL) 1.Let’s see Thai version created by my advisees.

51 Villages in ChiangMai

52 In CVS

53 Use MySQL workbench to create your database

54 Create Your Database

55 Some time you need to synchronize your model with your localhost

56 Output at localhost

57 Let’s import data from excel

58 Error Why?

59 Wrong Selection => Select your table

60 Now Select a file to import

61 Error Again

62 Choose the right option

63 Don’t forget to set your encoding

64 Choose the right option

65 Week-1-Lab From Spreadsheets to the Web 1.Spreadsheets (MSExcel) to Relational DB (MySQL) 2.MySQL to Web (PHP) 3.Web (PHP) to WebService (Google Map)

66 PHP Code

67 Output

68 Your turn: I want sub_district_name 1.No duplicate

69 Your turn: I want sub_district_name 1.No duplicate select distinct sub_district_name from village;

70 Write Your program

71 Output

72 Fix it http://www.thaicreate.com/community/php- mysql-thai.html http://www.thaicreate.com/community/php- mysql-thai.html

73 Modify your code

74 Thai


Download ppt "1302325 s1 2011 Advance Database Systems Week-2 Dr.Kwanchai Eurviriyanukul"

Similar presentations


Ads by Google