Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL Queries Relational database and SQL MySQL LAMP SQL queries A MySQL Tutorial and applications Database Building Assignment.

Similar presentations


Presentation on theme: "SQL Queries Relational database and SQL MySQL LAMP SQL queries A MySQL Tutorial and applications Database Building Assignment."— Presentation transcript:

1 SQL Queries Relational database and SQL MySQL LAMP SQL queries A MySQL Tutorial and applications Database Building Assignment

2 Relational Database and SQL A particular kind of DBMS that is very good at relating information stored in one table to another –> to pull data from those tables and to join info from related tables to produce answers to the questions that can’t be answered from individual tables alone. SQL (Structured Query Language) standard database language.

3 MySQL Relational database system Client/server architecture (101 simultaneous connections) SQL (table size for Linux = 4GB) Programming languages: C, C++, Java, Perl, PHP, Python, and Tcl ODBC (Microsoft) Platform independence, security, and speed

4 LAMP Linux (operating system) Apache (web server system)Apache MySQL (database system) Perl/PHP (programming language)PHP LAMP is an open source dream team LAMP is supported here by: athena

5 PHP Pure HTML  static web site PHP  enable you to build dynamic web site A server-side scripting language designed specifically for the web Conceived in 1994 by Rasmus Lerdorf as one-man project then adapted by many PHP (Hypertext Preprocessor)

6 SQL Queries When you use MySQL, you are using 2 programs(client/server): –Database server is a program located on the machine where your data are stored. It listens for client requests coming from network –Clients are programs that connect to the database server and issue queries to tell it what info they want

7 Benefits of Client/Server The server provides concurrency control so that two users cannot modify the same record at the same time You don’t have to be logged in on the machine where your database is located

8 A MySQL Tutorial Books info and demo: MySQL, MySQL and Perl for the Web by DuBoisMySQL and Perl for the Web Establishing and terminating connection Issuing Queries Tutorial example: samp_db, tables Our database: webdb

9 Two Applications Examples of MySQL UCSC Human Genome Project Working DraftUCSC Human Genome Project Working Draft LOCal: A Flexible Web-Based Microscope Reservation System – Univ. of Wisconsin, MadisonLOCal: A Flexible Web-Based Microscope Reservation System

10 Database Building Assignment (Due 11/30/01) Part I Create a option file named.my.cnf in your home directory with contents to be given Familiar yourself with MySQL by using the tutorial handout Go to our Bioinformatics Software Review web site to edit and save a copy of your five reviews by using Note-takingBioinformatics Software Review Sign up to be a reviewer by using Reviewer Sign-up Enter you review by using Review Entry Check Review Summary

11 DB Assignment (cont.) Part II Construct one SQL query that will show number of reviews done so far for each software in our software collection (that is adding one more column in the software collection display in our review summary). You may also construct a query of your choice such that it will provide additional useful information to our web site visitors. You are required to give specification in the self-chosen query Construct and test your query in MySQL, then post your final query on WebCT discussion for grading. For PHP fan (not required), adapt review_summary.php and post your URL on WebCT discussion. Download the text file, put it under html directory and change the extension to php, integrate your new query, and chmod 644. You are ready to show off your improvement on web!review_summary.php

12 Database Design Issues Understanding the process and relations Objects  tables, attributes  columns, data types, relations  index, primary keys Our database: 3 tables student software review

13 The First Normal Form Columns with similar content must be eliminated A table must be created for each group of associated data Each data must be identifiable by means of a primary key (unique index)

14 Second Normal Form Whenever the contents of columns repeat themselves, this means that the table must be divided into several sub- tables These table must be linked by foreign keys (cross reference)

15 Third Normal Form Columns that are not directly related to the primary key must be eliminated A good example of normalizing a database


Download ppt "SQL Queries Relational database and SQL MySQL LAMP SQL queries A MySQL Tutorial and applications Database Building Assignment."

Similar presentations


Ads by Google