20 March 24 March. Relational Databases. Reading SQL. Perl DBI. SQL Tutorial or SQL Course MySQL tutorial

Size: px
Start display at page:

Download "20 March 24 March. Relational Databases. Reading SQL. Perl DBI. SQL Tutorial or SQL Course MySQL tutorial"

Transcription

1 20 March 24 March Relational Databases Reading SQL SQL Tutorial or SQL Course MySQL tutorial Perl DBI Database programming with Perl Appendix A and B Ch 1-5 Biol Practical Biocomputing 1

2 Database Design Entity Relationship approach Identify the entitites in your data: genes, sequences, citations, users, predictions, methods Make a preliminary layout of each as a table, list the attributes (columns) that define each entity Make sure each table has a primary key (unique) Identify one-to-many relationships. Make sure the "many" table has a foreign key pointing to the "one" table Identify many-to-many relationships For each, create an index table Check against use cases and try to write SQL for the use cases Review information for redundancy and consider breaking redundant information into separate tables Repeat Biol Practical Biocomputing 2

3 Database Design Formal Process Use cases Requirements Schema Design Implementation Testing Deployment Return to use cases Do you need a formal design process Is it just you for yourself? Do you have customers? Do you have deliverables? Biol Practical Biocomputing 3

4 Database Design Why design? Bad designs Lead to difficult queries May generate misleading results Generate inconsistent data/results Require redundant or excessive data entry Are difficult to change or extend May have poor performance Biol Practical Biocomputing 4

5 Database Design Use cases use cases are descriptions of the kinds of queries that you expect the database will have to perform Help prevent mission/function creep Used to define data Used to define tables and relationships Biol Practical Biocomputing 5

6 Database Design EcoliHub use cases Searches Find all the regulatory genes (i.e. all the genes in a functional class) Find all the regulatory genes for which there are/are not mutants, expression data, localization data, etc Find genes with particular combinations of protein motifs Find the genes that belong to any operon Find the genes that belong to any regulon Find the genes that have a particular phenotype when mutated Find the proteins that are found in a particular subcellular compartment Find groups of genes that are up or down regulated in an experiment Find evidence in the literature supporting assertions in the database Analyses For any of the above, find the neighboring genes to the initially identified set For any of the above, find/design primers for a certain gene For any of the above, find all the clones/kos for those genes Find commonalities in function in the genes that are up or down-regulated in a given experiment Find genes with similar behavior across sets of different experiments Given a gene name, find all the available info about this gene (motif, clones, mutants and relevant construction information, e.g., for making the mutants or the clones) For a gene, segment of DNA, operon/regulons, pathway, find all the available information Biol Practical Biocomputing 6

7 Database Design Requirements What will the user queries look like (use cases)? What will the reports look like? Translate use cases into tables What is the data needed to support the use cases What are the SQL queries needed What indices are needed Biol Practical Biocomputing 7

8 Database Design Considerations Archival vs current/encyclopedic Archival databases are much simpler because they don t need to be constantly updated Private vs public Controlling who has access to what adds a lot of overhead, including validation of users and timed release of information Data provenance Evidence codes Computational vs experimental Error recovery Timestamping Rollbacks and backups Biol Practical Biocomputing 8

9 Database Design Biggest Issues for biological databases Unique Identifiers Data updates Granularity and format of annotation Metadata for experiments Provenance Private Data status publication date privileges (owner, group,project,public,admin) Biol Practical Biocomputing 9

10 Database Design Reuse existing schema if possible Public Data Definitons MAGE/MIAME microarraysgene expression mmcif 3-dimensional structure De facto Standards FASTA EMBL/SWISS-Prot GENBANK ASN.1 CHADO General tools XML RDF OWL (replaces DAML/OIL) Biol Practical Biocomputing 10

11 DBI.pm Perl DBI Database Interface Provides a consistent interface to MySQL, MSSQL, Oracle, Informix, Sybase, ODBC etc. Makes Perl scripts (relatively) platform independent Biol Practical Biocomputing 11

12 DBI.pm Perl Application DBI Module DBD::Oracle DBD::Informix DBD::Other Oracle Server Informix Server Other Server Biol Practical Biocomputing 12

13 DBI.pm DBI works in four stages Make a database connection get a database handle (usually called $dbh) Set up a specific query in SQL done through a statement handle (usually called $sth) Execute the query Examine the results Biol Practical Biocomputing 13

14 DBI.pm Opening a database connection use DBI; use strict; $dbh = DBI->connect( $dsn, $user, $password, { RaiseError => 1, AutoCommit => 1 } ); DBI->connect( dsn, user, pass, { parameters } ) dsn - data source name the database name and connection information user - your username pass - your password hash of parameters RaiseError - report errors AutoCommit - makes changes permanent automatically Database connections are usually reused multiple times Biol Practical Biocomputing 14

15 DBI.pm Identifying the database data source name ($dsn) DBI:DriverName: database_name DBI:DriverName: database_name:hostname:port DBI:DriverName:database=database_name;host=hostname;port=port Drivername is mysql (lower case) would be different for other DBMS Host is thr.genomics.purdue.edu Port is 3306 (MySql standard port) installations can choose other ports $dsn = 'DBI:mysql:test:thr.genomics.purdue.edu:3306'; Biol Practical Biocomputing 15

16 DBI.pm Simple example #!/usr/bin/perl # ddbi.pl use DBI; use strict; my $dsn = 'DBI:mysql:test:thr.genomics.purdue.edu:3306'; my $user = "gribskov"; my $password = "mysql"; my $dbh = DBI->connect( $dsn, $user, $password ) or die $DBI::errstr; my $sth = $dbh->prepare( "show tables" ); $sth->execute; while ( = $sth->fetchrow_array ) { print "@result\n"; } $sth->finish; $dbh->disconnect; thr(~/scripts)-40% ddbi.pl employee project testaa testad Biol Practical Biocomputing 16

17 DBI.pm database handle methods prepare - set up and possibly optimize an SQL statement returns a statement handle do - prepare and execute a single SQL command last_insert_id - Returns a value 'identifying' the row just inserted, if possible. Usually a value assigned by the database server to a column with an auto_increment type. Returns undef if the driver can't determine the value. disconnect - undef the database handle and disconnect from the database ping - check if the database is responding Biol Practical Biocomputing 17

18 DBI.pm Statement handle methods execute - execute a single SQL command fetchrow methods - get one row of results from the statement handle and return it as an array (list), array reference, or hash reference fetchrow_array fetchrow_arrayref fetchrow_hashref (preferably use this) fetchall methods - get all of the results from a statement handle and return an array of array or hash references fetchall_arrayref fetchall_hashref rows - number of rows in the result finish - release the statement handle (statement handle will no longer be used clears the results of SQL) Biol Practical Biocomputing 18

19 DBI.pm #!/usr/bin/perl #ddbi.pl use DBI; use strict; my $dsn = 'DBI:mysql:gribskov:descartes.genomics.purdue.edu:3306'; my $user = "gribskov"; my $password = "mysql"; my $dbh = DBI->connect( $dsn, $user, $password ) or die $DBI::errstr; my $sql = qq{ SELECT name,phone FROM employee WHERE age > 30 } my $sth = $dbh->prepare( $sql ); $sth->execute; while ( = $sth->fetchrow_array ) { print "@result\n"; } $sth->finish; $dbh->disconnect; thr(~/scripts)-59% ddbi.pl Edgar Poe 666 Usher House sales Elmer Fudd 27 Pigsty Rd admin Bugs Bunny 1 Rabbit Hole Dr research Daffy Duck 43 Pond St sales Biol Practical Biocomputing 19

20 DBI.pm use DBI; use strict; my $dsn = 'DBI:mysql:gribskov:descartes.genomics.purdue.edu:3306'; my $user = "gribskov"; my $password = "mysql"; my $dbh = DBI->connect( $dsn, $user, $password ) or die $DBI::errstr; my $sql = qq{ SELECT * FROM employee WHERE age > 30 }; my $sth = $dbh->prepare( $sql ); $sth->execute; while ( my ($name,$address,$phone,$age,$dept) = $sth->fetchrow_array ) { printf "%-15s %-20s %-10s %-4d %-10s\n", $name,$address,$phone,$age,$dept; } What happens if I add a column to the employee table? $sth->finish; $dbh->disconnect; thr(~/scripts)-66% ddbi.pl Edgar Poe 666 Usher House sales Elmer Fudd 27 Pigsty Rd admin Bugs Bunny 1 Rabbit Hole Dr research Daffy Duck 43 Pond St sales Biol Practical Biocomputing 20

21 DBI.pm Results fetchrow_array requires that you know the order of the columns in a table If you add columns to the table, scripts that rely on this order will fail fetchrow_hashref is much safer Biol Practical Biocomputing 21

22 DBI.pm with $sth->fetchrow_hashref #!/usr/local/bin/perl use DBI; use strict; my $dsn = 'DBI:mysql:gribskov:descartes.genomics.purdue.edu:3306'; my $user = "gribskov"; my $password = "mysql"; my $dbh = DBI->connect( $dsn, $user, $password ) or die $DBI::errstr; my $sql = qq{ SELECT * FROM employee WHERE age > 30 }; my $sth = $dbh->prepare( $sql ); $sth->execute; while ( my $result = $sth->fetchrow_hashref ) { foreach my $column ( keys %$result ) { print "$column => $$result{$column}\n"; } print "\n"; } $sth->finish; $dbh->disconnect; descartes(~/scripts)-61% ddbi.pl department => sales name => Edgar Poe address => 666 Usher House age => 45 phone => department => admin name => Elmer Fudd address => 27 Pigsty Rd. age => 65 phone => department => research name => Bugs Bunny address => 1 Rabbit Hole Dr. age => 35 phone => department => sales name => Daffy Duck address => 43 Pond St. age => 35 Biol Practical Biocomputing phone =>

23 DBI.pm Error messages database and statement handles can be interrogated about possible error status of previous calls $h->err - returns error number $h->errstr - returns descriptive message $h->state - returns a five digit SQLSTATE code, most importantly returns 0 if successful my $dbh = DBI->connect( $dsn, $user, $password ) or die $dbh->errstr; Biol Practical Biocomputing 23

24 DBI.pm Trapping errors my ( $sth ); my $sql = qq/ SELECT FROM TableName WHERE Field = 'value' /; eval { $sth = $dbh->prepare( $sql ); $sth->execute; }; if ( $@ ) { print "Error in the database: $@"; exit; } $@ has the last error message Biol Practical Biocomputing 24

25 DBI.pm Trapping errors eval executes a bit of code in its own context, as if it was a small separate script $i = 10; $zero = 0; thr(~/scripts)-95% error.pl Illegal division by zero at error.pl line 6. $result = $i / $zero; with eval - error message is $@ (special variable) $i = 10; $zero = 0; thr(~/scripts)-103% error.pl Error: Illegal division by zero at error.pl line 7. eval{ $result = $i / $zero; }; Biol Practical Biocomputing 25

26 DBI.pm Placeholders If a statement is to be reused repeatedly it need only be "prepared" once the position of the changing data is filled with a placeholder also called "bind value" placeholder sql executes much faster because you only prepare once prevents SQL injection attacks $sql = "INSERT into users (name, phone, ) values (?,?,?)"; $sth = $dbh->prepare( $sql ); while ( $line = <> ) { ( $name, $phone, $ ) = split " ", $line; $sth->execute( $name, $phone, $ ); } Biol Practical Biocomputing 26

27 SQL Left and right joins Include the rows of a table that do not satisfy the join condition RIGHT [OUTER] JOIN show all rows of second table LEFT [OUTER] JOIN show all rows of first table SELECT columns FROM table1 RIGHT JOIN table2 ON table1.id=table2.id conditions mysql> SELECT * -> FROM employee -> RIGHT JOIN project ON employee.name=project.name; name address phone age department number title name Jane Doe 127 Elm St sales 1 database Jane Doe Edgar Poe 666 Usher House sales 2 database Edgar Poe Elmer Fudd 27 Pigsty Rd admin 3 database Elmer Fudd Richard Roe 915 W. State St sales 4 space shuttle Richard Roe Bugs Bunny 1 Rabbit Hole Dr research 5 space shuttle Bugs Bunny Road Runner 177 Mesa Canyon Rd admin 6 space shuttle Road Runner Bugs Bunny 1 Rabbit Hole Dr research 7 nation building Bugs Bunny Daffy Duck 43 Pond St sales 8 nation building Daffy Duck rows in set (0.00 sec) Biol Practical Biocomputing 27

28 SQL Left and right joins mysql> SELECT * -> FROM employee -> LEFT JOIN project ON employee.name=project.name; name address phone age department number title name Jane Doe 127 Elm St sales 1 database Jane Doe Richard Roe 915 W. State St sales 4 space shuttle Richard Roe Edgar Poe 666 Usher House sales 2 database Edgar Poe Elmer Fudd 27 Pigsty Rd admin 3 database Elmer Fudd Bugs Bunny 1 Rabbit Hole Dr research 5 space shuttle Bugs Bunny Bugs Bunny 1 Rabbit Hole Dr research 7 nation building Bugs Bunny Daffy Duck 43 Pond St sales 8 nation building Daffy Duck Road Runner 177 Mesa Canyon Rd admin 6 space shuttle Road Runner Atom Ant 1 Deep Chamber research NULL NULL NULL rows in set (0.00 sec) Useful for finding missing data that should join Biol Practical Biocomputing 28

29 SQL Left and right joins What employees do not have projects assigned? mysql> SELECT employee.name -> FROM employee -> LEFT JOIN project ON employee.name=project.name -> WHERE project.number IS NULL; name Atom Ant row in set (0.00 sec) Biol Practical Biocomputing 29

30 SQL Functions (partial list) Mathematical Functions Trigonometry and logarithm sin, cos, tan, cot, asin, acos, atan, ln, log10, log2, exp, pi, radians, degrees Comparison/conversion floor, ceiling, abs, truncate, round Other sign, rand, mod, pow, sqrt, format Date and Time curdate, curtime, now Day, dayofmonth, dayofweek, dayofyear, dayname, from_days String (very partial list) Length password, encrypt, compress, uncompress Bit functions & (and), (or), ^(xor), << (shift left), >> (shift right), ~ (invert) Biol Practical Biocomputing 30

31 SQL Bit functions Sometimes a convenient way to perform multiple tests simultaneously Particularly useful when the data belongs to overlapping groups Example: PlantsP, PlantsT, PlantsUbq Three resources one database Biol Practical Biocomputing 31

32 SQL Bit masks Use a column and store a comma delimited list of which database a datum belongs to requires time consuming parsing if list is big susceptible to spelling errors (use enum datatype) verbose Another solution use one boolean column for each database, simply mark each row as true or false with a 1 or 0 requires altering table to extend large numbers of choices make tables swell alarming Bit solution use one bit per option a zero bit means false, a one bit means true easily extensible can be included in SQL queries Biol Practical Biocomputing 32

33 SQL Bit masks bit mask query mysql> SELECT sequence -> FROM sequence_genomic -> WHERE dbmask & 4; PlantsP PlantsT PlantsUbq integer value 101 P and U T and U T only U only P only 4 Biol Practical Biocomputing 33

34 SQL Counting and grouping mysql> SELECT d.department AS dept,p.title AS project, count(*) -> FROM department d,employee e,project p -> WHERE d.department=e.department -> AND e.name=p.name -> GROUP BY project; dept project count(*) sales database 3 research nation building 2 sales space shuttle rows in set (0.00 sec) mysql> SELECT d.department AS dept,p.title AS project, count(*) -> FROM department d,employee e,project p -> WHERE d.department=e.department -> AND e.name=p.name -> GROUP BY project -> ORDER BY count(*) DESC; ERROR 1111 (HY000): Invalid use of group function Biol Practical Biocomputing 34

35 SQL Counting and grouping mysql> SELECT d.department AS dept,p.title AS project, count(*) AS number -> FROM department d,employee e,project p -> WHERE d.department=e.department -> AND e.name=p.name -> GROUP BY project -> ORDER BY number DESC; dept project number sales database 3 sales space shuttle 3 research nation building rows in set (0.00 sec) Biol Practical Biocomputing 35

36 SQL Functions with GROUP BY sum max, min std, variance mysql> SELECT student_name, MIN(test_score), MAX(test_score) -> FROM student -> GROUP BY student_name; Biol Practical Biocomputing 36

37 SQL Performance DBMS have sophisticated searching mechanisms that make them fast (much faster than sequential searching) Fast searching requires indexing Primary Key columns are indexed Other columns can be indexed as you wish In general, make an index on any column that you will use in looking things up (especially in making joins) Index when you CREATE TABLE Index later with ALTER TABLE files vs blobs store the complete text of large images, or just save the location of the file? Do you need to search the content? MySQL now allows compression using compress function Biol Practical Biocomputing 37

38 Database Design Unique IDs Every table row must have a unique primary key Can use data columns, e.g. gene name, person name, etc., but must be sure that it will be unique Often you cannot guarantee this so a unique number is used In MySQL this can be an autoincrementing number column Unique IDs once generated should not be re-used for a new object! Biol Practical Biocomputing 38

39 Database Design Problems with Unique IDs Not mnemonic If your database generates keys on the fly, you must guarantee that a race condition does not develop and give the same key to multiple events, e.g. Process 1 queries UID table for highest existing key (1 SQL query) Process 2 queries UID table for highest existing key Process 1 assigns new UID as highest + 1 and inserts into UID table Process 2 assigns new UID and tries to insert into UID table (fails due to non-unique primary key) Lock table can be used to prevent this Or catch error on process 2 insert and try again Biol Practical Biocomputing 39

40 Database Design Complicated fields one strategy Initially defined as a text block Add XML markup When data model is stable, convert to tables/columns mutation <Mutation> <Reference_sequence>... <Reference_sequence> <Sequence_position>... <Sequence_position> <Sequence_change>... </Sequence_change> <Begin>...</Begin> <End>... </End> <Difference>... </Difference> </Mutation> Biol Practical Biocomputing 40

41 Web Server CGI Scripts Html pages go in htdocs xampp -> htdocs localhost/mypage.html cgi scripts go in cgi-bin localhost/cgi-bin/plot.cgi localhost/blast.cgi Biol Practical Biocomputing 41

42 Web Server htdocs Index.php is default Biol Practical Biocomputing 42

43 Web Server Scripts CGI scripts are executed by server Conventionally stored in cgi-bin env.cgi #!perl use CGI; my $cgi = new CGI; print $cgi->header; print $cgi->start_html; print qq{ <pre>\n}; foreach my $symbol ( sort keys %ENV ) { print "$symbol\t$env{$symbol}\n"; } print "</prep>\n"; print "</body>\n"; print "</html>\n"; exit 0; Biol Practical Biocomputing 43

44 Web Server Biol Practical Biocomputing 44

45 Web Server Path Problems How do you find an executable? In unix, when I type the name of a program, the OS looks in a defined set of directories called the "path" my path looks like echo $PATH /cbio/server/software/bin:/home/gribskov/scripts:/usr/local/bin:/usr/local/perl/bin:/usr/local/genome/bin:/opt/csw/mysql5/ bin:/opt/csw/apache2/sbin:/opt/csw/bin:/opt/csw/sbin:/usr/bin:/usr/local/emboss/bin:/usr/x11/bin:/usr/ccs/bin:/usr/dt/bin: /usr/openwin/bin:/usr/ucb:/usr/sfw/bin:/usr/local/mummer:/usr/sbin:. Especially on UNIX, the web server often has an impoverished path such as path:/usr/sbin:/usr/bin Need to use complete path to executables Biol Practical Biocomputing 45

46 Web Server Path Problems Executable must be in the path to work #!perl use CGI; use strict; my $exe = "/usr/local/msatcommander/msatcommand.py"; my $cgi = new CGI; print $cgi->header; print $cgi->start_html; print qq{ <pre>\n}; my $command = $exe." test.fa"; print "command:$command\n"; system( $command ); command:/usr/local/msatcommander/msatcommand.py test.fa Traceback (most recent call last): File "/usr/local/msatcommander/msatcommand.py", line 15, in? import seqsearch File "/usr/local/msatcommander/seqsearch.py", line 13, in? from Bio.Seq import Seq ImportError: No module named Bio.Seq Biol Practical Biocomputing 46

47 Web Server Path Problems Add necessary directories to path #!/usr/bin/perl use CGI; use strict; my $exe = "/usr/local/msatcommander/msatcommand.py"; $ENV{PYTHONPATH} = "/usr/local/python:/usr/local/python/lib/python2.7/site-packages"; my $path = $ENV{PATH}; my $cgi = new CGI; print $cgi->header; print $cgi->start_html; print qq{ <pre>\n}; my $command = $exe." test.fa"; print "command:$command\n"; print "path:$path\n"; system( $command ); Biol Practical Biocomputing 47

48 Web Server Path Problems Output Biol Practical Biocomputing 48

49 CGI scripts See Web Development with Perl, Fenwick et al. some useful examples of CGI + database Don't forget your HTML HTML tutorial - HTML tag reference - really basic tutorial - Biol Practical Biocomputing 49

50 CGI scripts Package CGI.pm Major purpose Get parameters from html forms via both get and post write html web pages Additional escaping characters creating/managing cookies preserve state Functional vs object-oriented CGI.pm supports both a functional and object oriented interface. I am used to the OO one so that s what I ll show in examples. see the documentation for more information Biol Practical Biocomputing 50

51 CGI scripts fatalstobrowser with CGI::Carp qw(fatalstobrowser); Biol Practical Biocomputing 51

52 CGI scripts Getting parameters Forms include a method either get, or post these are fundamentally different ways to pass information from an web page with a form to a CGI script GET <form action= /cgi-bin/do_something.cgi method= get > parameters are passed in the url cpk POST <form action= /cgi-bin/do_something.cgi method= post > parameters are passed as part of the mime encoded message sent to the server cannot be seen by user CGI.pm uses a single syntax to get the values of parameters regardless of GET or POST Biol Practical Biocomputing 52

53 CGI scripts Getting Parameters when you create the CGI object (variable) it automatically fetches all input parameters if it is being run as a CGI script (through a web server) use CGI; my $query = new CGI; param function get a single parameter $value = = $query->param( 'name' ); # only if parameter has list of values Vars function get all parameters %params = $query->vars; Delete function not usually needed $query->delete('foo','bar','baz'); $query->delete_all(); Biol Practical Biocomputing 53

54 CGI scripts Debugging Offline mode lets you enter parameters in tag-value form for testing, i.e., name=john use CGI qw(-debug); #!/usr/bin/perl use strict; use CGI qw(-debug); my $cgi = new CGI; my %params = $cgi->vars; foreach my $k ( keys %params ) { print "k => $param{$k}\n"; } (offline mode: enter name=value pairs on standard input; press ^D or ^Z when done) name=john x=6 len=50 k => 50 k => john k => 6 Biol Practical Biocomputing 54

55 CGI scripts Debugging Sometimes you just want to know what the parameters passed to the script are so you can confirm your form is right dump function prints any parameters entered through a get or post print $cgi->dump;make sure to use FatalsToBrowser Biol Practical Biocomputing 55

56 CGI scripts URL encoding Certain characters are not allowed in URLs space + CGI.pm provides a function to convert a string to the URL encoded form - escape #!/usr/bin/perl use strict; use CGI; my $string = qq{xyz.cgi?name="john wilbur"&eq="1+3" }; print "original string $string \n"; my $ustring = $cgi->escape( $string ); print "url encoded string $ustring \n"; original string xyz.cgi?name="john wilbur"&eq="1+3" url encoded string xyz.cgi?name%3d%22john%20wilbur%22%26eq%3d%221%2b3%22%20 Biol Practical Biocomputing 56

57 CGI scripts Uploaded files Many websites let you upload a file instead of cutting and pasting something into a box <html> <head> <title>upload a file</title> </head> <body> <h1>upload a file</h1> <p> Please choose a file to upload: </p> <form action="cgi-bin/upload.cgi" method="post" enctype="multipart/formdata"> <input type="file" name="filename"> <input type="submit" value="ok"> </form> </body> </html> Biol Practical Biocomputing 57

58 CGI scripts Uploaded files upload function gets a value that is the name of the file also can be used as a filehandle my $cgi = new CGI; my $filename = $cgi->upload( filename ); while( <$filename> ) { # do something with file contents } Biol Practical Biocomputing 58

59 CGI scripts Using CGI.pm to write HTML Not recommended - I don't find this very useful since you need to remember the HTML anyway, but your taste may differ HTML written by CGI.pm is often very hard to figure out since it doesn't contain newlines and indentation Several features are useful (even for me) header function prints an http format header line print $cgi->header; same as print "Content-type: text/plain\n\n"; start_html function prints an HTML header (or XHTML) print $cgi->start_html; end_html closes the HTML elements opened in start_html print $cgi->end_html; <?xml version="1.0" encoding="iso "?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " <html xmlns=" lang="en-us" xml:lang="en-us"> <head><title>hello World</title> </head><body> </body></html> Biol Practical Biocomputing 59

60 CGI scripts Using CGI.pm to write HTML Anchors (links) print $cgi->a( {-href=>" "purdue university" ) print qq{<a href=" university</a>}; Lists use CGI; my $cgi = CGI->new(); print $cgi->start_ul; foreach my $name (qw/jacob Jeremy Jacinta Jenni Jack/) { print $cgi->li($name); } print $cgi->end_ul; <ul><li>jacob</li><li>jeremy</li><li>jacinta</li><li>jenni</li><li>jack</li></ul> print qq{<ul>\n}; foreach my $name (qw/jacob Jeremy Jacinta Jenni Jack/) { print qq{ <li>$name<\li>\n"; } print qq{</ul>}; <ul> <li>jacob</li> <li>jeremy</li> <li>jacinta</li> <li>jenni</li> <li>jack</li> </ul> Biol Practical Biocomputing 60

General References on SQL (structured query language) SQL tutorial.

General References on SQL (structured query language) SQL tutorial. Week 8 Relational Databases Reading DBI - Database programming with Perl Appendix A and B, Ch 1-5 General References on SQL (structured query language) SQL tutorial http://www.w3schools.com/sql/default.asp

More information

A Crash Course in Perl5

A Crash Course in Perl5 z e e g e e s o f t w a r e A Crash Course in Perl5 Part 8: Database access in Perl Zeegee Software Inc. http://www.zeegee.com/ Terms and Conditions These slides are Copyright 2008 by Zeegee Software Inc.

More information

SQLite Perl tutorial. Perl DBI. Table of Contents

SQLite Perl tutorial. Perl DBI. Table of Contents This is a Perl programming tutorial for the SQLite database. It covers the basics of SQLite programming with the Perl language. Table of Contents SQLite Perl tutorial...6 Perl DBI...1 Related tutorials...2

More information

General Coding Standards

General Coding Standards Rick Cox rick@rescomp.berkeley.edu A description of general standards for all code generated by ResComp employees (including non-programmers), intended to make maintaince, reuse, upgrades, and trainig

More information

PERL DATABASE ACCESS

PERL DATABASE ACCESS http://www.tutialspoint.com/perl/perl_database.htm PERL DATABASE ACCESS Copyright tutialspoint.com This tutial will teach you how to access a database inside your Perl script. Starting from Perl 5 it has

More information

Perl Dbi Insert Hash Into Table >>>CLICK HERE<<<

Perl Dbi Insert Hash Into Table >>>CLICK HERE<<< Perl Dbi Insert Hash Into Table How to insert values in PostgreSQL faster than insert() value() functions? At the moment I am using DBI in Perl to connect to IQ(Sybase) then load the values into a hash,

More information

Hands-On Perl Scripting and CGI Programming

Hands-On Perl Scripting and CGI Programming Hands-On Course Description This hands on Perl programming course provides a thorough introduction to the Perl programming language, teaching attendees how to develop and maintain portable scripts useful

More information

CGI Programming. What is "CGI"?

CGI Programming. What is CGI? CGI Programming What is "CGI"? Common Gateway Interface A means of running an executable program via the Web. CGI is not a Perl-specific concept. Almost any language can produce CGI programs even C++ (gasp!!)

More information

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016 DATABASE SYSTEMS Database programming in a web environment Database System Course, 2016 AGENDA FOR TODAY Advanced Mysql More than just SELECT Creating tables MySQL optimizations: Storage engines, indexing.

More information

Biocomputing II Coursework guidance

Biocomputing II Coursework guidance Biocomputing II Coursework guidance I refer to the database layer as DB, the middle (business logic) layer as BL and the front end graphical interface with CGI scripts as (FE). Standardized file headers

More information

Senturus Analytics Connector. User Guide Cognos to Power BI Senturus, Inc. Page 1

Senturus Analytics Connector. User Guide Cognos to Power BI Senturus, Inc. Page 1 Senturus Analytics Connector User Guide Cognos to Power BI 2019-2019 Senturus, Inc. Page 1 Overview This guide describes how the Senturus Analytics Connector is used from Power BI after it has been configured.

More information

Server-side computing

Server-side computing Server-side computing Why server-side? Approaches 1 Why server-side? Markup languages cannot Specify Computations Interactions with users Provide access to Server-side resources Databases Programs Services

More information

Senturus Analytics Connector. User Guide Cognos to Tableau Senturus, Inc. Page 1

Senturus Analytics Connector. User Guide Cognos to Tableau Senturus, Inc. Page 1 Senturus Analytics Connector User Guide Cognos to Tableau 2019-2019 Senturus, Inc. Page 1 Overview This guide describes how the Senturus Analytics Connector is used from Tableau after it has been configured.

More information

10.3. SERIALIZING DATA. On Perl

10.3. SERIALIZING DATA. On Perl 10.3. SERIALIZING DATA #Read the serialized hash back, remove "\n", deserialize it $serializedhobbies = ; chomp ($serializedhobbies); my $hobbiesagain = $dumper-> deserialize ($serializedhobbies);

More information

1. Introduction. 2. Scalar Data

1. Introduction. 2. Scalar Data 1. Introduction What Does Perl Stand For? Why Did Larry Create Perl? Why Didn t Larry Just Use Some Other Language? Is Perl Easy or Hard? How Did Perl Get to Be So Popular? What s Happening with Perl Now?

More information

CERTIFICATE IN WEB PROGRAMMING

CERTIFICATE IN WEB PROGRAMMING COURSE DURATION: 6 MONTHS CONTENTS : CERTIFICATE IN WEB PROGRAMMING 1. PROGRAMMING IN C and C++ Language 2. HTML/CSS and JavaScript 3. PHP and MySQL 4. Project on Development of Web Application 1. PROGRAMMING

More information

CSE 530A SQL. Washington University Fall 2013

CSE 530A SQL. Washington University Fall 2013 CSE 530A SQL Washington University Fall 2013 SELECT SELECT * FROM employee; employee_id last_name first_name department salary -------------+-----------+------------+-----------------+-------- 12345 Bunny

More information

DATABASE SYSTEMS. Database programming in a web environment. Database System Course,

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, DATABASE SYSTEMS Database programming in a web environment Database System Course, 2016-2017 AGENDA FOR TODAY The final project Advanced Mysql Database programming Recap: DB servers in the web Web programming

More information

Mastering phpmyadmiri 3.4 for

Mastering phpmyadmiri 3.4 for Mastering phpmyadmiri 3.4 for Effective MySQL Management A complete guide to getting started with phpmyadmin 3.4 and mastering its features Marc Delisle [ t]open so 1 I community experience c PUBLISHING

More information

COMP284 Practical 3 Perl (3)

COMP284 Practical 3 Perl (3) COMP284 Practical 3 Perl (3) Introduction This practical contains further exercises that are intended to familiarise you with Perl Programming. While you work through the tasks below compare your results

More information

SAS Web Report Studio Performance Improvement

SAS Web Report Studio Performance Improvement SAS Web Report Studio Performance Improvement Using Stored Processes in Information Map Studio A tale of two methods Direct access to relational databases Including: DB2, SQL, MySQL, ODBC, Oracle, Teradata,

More information

FormFactory. Template based web forms. Wolfgang Friebel. Oct 25,

FormFactory. Template based web forms. Wolfgang Friebel. Oct 25, FormFactory Template based web forms Wolfgang Friebel Oct 25, 2005 1 Motivation CGI scripts are often used to collect information and send it by email or store the data in a database Frequently written

More information

MySQL 5.1 Past, Present and Future MySQL UC 2006 Santa Clara, CA

MySQL 5.1 Past, Present and Future MySQL UC 2006 Santa Clara, CA MySQL 5.1 Past, Present and Future jan@mysql.com MySQL UC 2006 Santa Clara, CA Abstract Last year at the same place MySQL presented the 5.0 release introducing Stored Procedures, Views and Triggers to

More information

PERL Scripting - Course Contents

PERL Scripting - Course Contents PERL Scripting - Course Contents Day - 1 Introduction to PERL Comments Reading from Standard Input Writing to Standard Output Scalar Variables Numbers and Strings Use of Single Quotes and Double Quotes

More information

Installation and Configuration Guide

Installation and Configuration Guide Senturus Analytics Connector Version 2.2 Installation and Configuration Guide Senturus Inc. 533 Airport Blvd. Suite 400 Burlingame CA 94010 P 888 601 6010 F 650 745 0640 2017 Senturus, Inc. Table of Contents

More information

SQL-PL Interface. Murali Mani. Perl /CGI with Oracle/mySQL Install your own web server and use servlets with JDBC and Oracle/mySQL

SQL-PL Interface. Murali Mani. Perl /CGI with Oracle/mySQL Install your own web server and use servlets with JDBC and Oracle/mySQL SQL-PL Interface Some Possible Options Web Interface Perl /CGI with Oracle/mySQL Install your own web server and use servlets with JDBC and Oracle/mySQL Non-Web Interface JDBC with Oracle/mySQL Also other

More information

CNIT 129S: Securing Web Applications. Ch 10: Attacking Back-End Components

CNIT 129S: Securing Web Applications. Ch 10: Attacking Back-End Components CNIT 129S: Securing Web Applications Ch 10: Attacking Back-End Components Injecting OS Commands Web server platforms often have APIs To access the filesystem, interface with other processes, and for network

More information

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT. Chapter 7:- PHP Compiled By:- Assistant Professor, SVBIT. Outline Starting to script on server side, Arrays, Function and forms, Advance PHP Databases:-Basic command with PHP examples, Connection to server,

More information

MySQL, Postgres, SQLite, Oracle, Sybase, DB2, each column is an "attribute" common to all rows

MySQL, Postgres, SQLite, Oracle, Sybase, DB2, each column is an attribute common to all rows Database systems in 21 minutes Relational Database Management Systems MySQL, Postgres, SQLite, Oracle, Sybase, DB2, a database is a collection of tables each table has a fixed number of columns each column

More information

Model Question Paper. Credits: 4 Marks: 140

Model Question Paper. Credits: 4 Marks: 140 Model Question Paper Subject Code: BT0075 Subject Name: RDBMS and MySQL Credits: 4 Marks: 140 Part A (One mark questions) 1. MySQL Server works in A. client/server B. specification gap embedded systems

More information

Numara FootPrints Changelog January 26, 2009

Numara FootPrints Changelog January 26, 2009 Numara FootPrints 9.0.3 Changelog January 26, 2009 Address Book The logo in the Address Book always pointed to the Numara Software URL. Address book fields were missing from a number of features in FootPrints

More information

Installation and Configuration Guide

Installation and Configuration Guide Senturus Analytics Connector Version 2.2 Installation and Configuration Guide Senturus Inc 533 Airport Blvd. Suite 400 Burlingame CA 94010 P 888 601 6010 F 650 745 0640 Table of Contents 1. Install Senturus

More information

IVOA Astronomical Data Query Language Version 0.6

IVOA Astronomical Data Query Language Version 0.6 IVOA Astronomical Data Query Language Version 0.6 IVOA Working Draft 2003-10-30 This version: 0.6 http://skyservice.pha.jhu.edu/develop/vo/adql/adql-0.6.pdf Previous versions: 0.5 http://skyservice.pha.jhu.edu/develop/vo/adql/skynodeinterface-0.5.pdf

More information

CS105 Perl: Perl CGI. Nathan Clement 24 Feb 2014

CS105 Perl: Perl CGI. Nathan Clement 24 Feb 2014 CS105 Perl: Perl CGI Nathan Clement 24 Feb 2014 Agenda We will cover some CGI basics, including Perl-specific CGI What is CGI? Server Architecture GET vs POST Preserving State in CGI URL Rewriting, Hidden

More information

Kaivos User Guide Getting a database account 2

Kaivos User Guide Getting a database account 2 Contents Kaivos User Guide 1 1. Getting a database account 2 2. MySQL client programs at CSC 2 2.1 Connecting your database..................................... 2 2.2 Setting default values for MySQL connection..........................

More information

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL.

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL. Hello everyone! Welcome to our PHP + MySQL (Easy to learn) E.T.L. free online course Hope you have installed your XAMPP? And you have created your forms inside the studio file in the htdocs folder using

More information

CISC 3140 (CIS 20.2) Design & Implementation of Software Application II

CISC 3140 (CIS 20.2) Design & Implementation of Software Application II CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Email Address: meyer@sci.brooklyn.cuny.edu Course Page: http://www.sci.brooklyn.cuny.edu/~meyer/ CISC3140-Meyer-lec4

More information

Web Programming with CGI.pm. Executing CGI scripts

Web Programming with CGI.pm. Executing CGI scripts Web Programming with CGI.pm Sheldon McKay Executing CGI scripts Use your personal web space /Users/yourusername/Sites/cgi-bin 1) Create your script (end with.pl ) 2) $ chmod 755 myscript.pl 1 A CGI Script

More information

SQLITE PERL TUTORIAL

SQLITE PERL TUTORIAL http://www.tutorialspoint.com/sqlite/sqlite_perl.htm SQLITE PERL TUTORIAL Copyright tutorialspoint.com Installation The SQLite3 can be integrated with Perl using Perl DBI module, which is a database access

More information

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client Lab 2.0 - MySQL CISC3140, Fall 2011 DUE: Oct. 6th (Part 1 only) Part 1 1. Getting started This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client host

More information

Automated Testing of Large Projects With Perl. Andy Lester

Automated Testing of Large Projects With Perl. Andy Lester Automated Testing of Large Projects With Perl Andy Lester andy@petdance.com http://petdance.com/perl/ Where we're going Strategy What & how to test 5 things you can do on Monday 5 things for next week

More information

Get Table Schema In Sql Server 2008 To Add Column If Not Exists >>>CLICK HERE<<<

Get Table Schema In Sql Server 2008 To Add Column If Not Exists >>>CLICK HERE<<< Get Table Schema In Sql Server 2008 To Add Column If Not Exists IF NOT EXISTS ( SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'(dbo). Also try catch is easily possible to use in sql serverand

More information

Writing Perl Programs using Control Structures Worked Examples

Writing Perl Programs using Control Structures Worked Examples Writing Perl Programs using Control Structures Worked Examples Louise Dennis October 27, 2004 These notes describe my attempts to do some Perl programming exercises using control structures and HTML Forms.

More information

So, if you receive data from a server, in JSON format, you can use it like any other JavaScript object.

So, if you receive data from a server, in JSON format, you can use it like any other JavaScript object. What is JSON? JSON stands for JavaScript Object Notation JSON is a lightweight data-interchange format JSON is "self-describing" and easy to understand JSON is language independent * JSON uses JavaScript

More information

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1 Basic Concepts :- 1. What is Data? Data is a collection of facts from which conclusion may be drawn. In computer science, data is anything in a form suitable for use with a computer. Data is often distinguished

More information

An Incredibly Brief Introduction to Relational Databases: Appendix B - Learning Rails

An Incredibly Brief Introduction to Relational Databases: Appendix B - Learning Rails O'Reilly Published on O'Reilly (http://oreilly.com/) See this if you're having trouble printing code examples An Incredibly Brief Introduction to Relational Databases: Appendix B - Learning Rails by Edd

More information

Sql Server Call Function Without Schema Name

Sql Server Call Function Without Schema Name Sql Server Call Function Without Schema Name But in the case of sql function query returns the first parameter name empty. t.user_type_id) LEFT JOIN sys.schemas s ON (t.schema_id = s.schema_id) SQL Server:

More information

Table of Contents DATA MANAGEMENT TOOLS 4. IMPORT WIZARD 6 Setting Import File Format (Step 1) 7 Setting Source File Name (Step 2) 8

Table of Contents DATA MANAGEMENT TOOLS 4. IMPORT WIZARD 6 Setting Import File Format (Step 1) 7 Setting Source File Name (Step 2) 8 Data Management Tools 1 Table of Contents DATA MANAGEMENT TOOLS 4 IMPORT WIZARD 6 Setting Import File Format (Step 1) 7 Setting Source File Name (Step 2) 8 Importing ODBC Data (Step 2) 10 Importing MSSQL

More information

Version Emergency Bug Fixes Fixed Limitations Known Limitations... 4 Informatica Global Customer Support...

Version Emergency Bug Fixes Fixed Limitations Known Limitations... 4 Informatica Global Customer Support... Informatica Corporation Informatica Data Archive 6.4.4 Release Notes January 2018 Copyright Informatica LLC 2003, 2018 Contents Version 6.4.4... 1 6.4.4 Emergency Bug Fixes.... 1 6.4.4 Fixed Limitations....

More information

JSON Home Improvement. Christophe Pettus PostgreSQL Experts, Inc. SCALE 14x, January 2016

JSON Home Improvement. Christophe Pettus PostgreSQL Experts, Inc. SCALE 14x, January 2016 JSON Home Improvement Christophe Pettus PostgreSQL Experts, Inc. SCALE 14x, January 2016 Greetings! Christophe Pettus CEO, PostgreSQL Experts, Inc. thebuild.com personal blog. pgexperts.com company website.

More information

USQ/CSC2406 Web Publishing

USQ/CSC2406 Web Publishing USQ/CSC2406 Web Publishing Lecture 4: HTML Forms, Server & CGI Scripts Tralvex (Rex) Yeap 19 December 2002 Outline Quick Review on Lecture 3 Topic 7: HTML Forms Topic 8: Server & CGI Scripts Class Activity

More information

Zend PHP 5.3 Certification Exam.

Zend PHP 5.3 Certification Exam. Zend 200-530 Zend PHP 5.3 Certification Exam TYPE: DEMO http://www.examskey.com/200-530.html Examskey Zend 200-530 exam demo product is here for you to test quality of the product. This Zend 200-530 demo

More information

Database Systems. Shan-Hung Wu CS, NTHU

Database Systems. Shan-Hung Wu CS, NTHU Database Systems Shan-Hung Wu CS, NTHU Outline Why DBMS? Data modeling SQL queries WeatherMood + DBMS Managing big data Text indexing Pagination Deployment 2 Outline Why DBMS? Data modeling SQL queries

More information

Web Programming with CGI.pm. Executing CGI scripts

Web Programming with CGI.pm. Executing CGI scripts Web Programming with CGI.pm Sheldon McKay, CSHL Executing CGI scripts Use your personal web space ~/Sites 1) Create your script (must end with.pl ) 2) $ chmod 755 myscript.pl A CGI Script that Creates

More information

Perl Mysql Dbi Insert Last Id >>>CLICK HERE<<<

Perl Mysql Dbi Insert Last Id >>>CLICK HERE<<< Perl Mysql Dbi Insert Last Id i am not able to get value in last_insert_id() after insert operation in sybase database. Taken from MySQL Perl DBI last_insert_id. +e(),'fix2mq')") or $DBI::err and die($dbi::errstr),

More information

B. V. Patel Institute of BMC & IT 2014

B. V. Patel Institute of BMC & IT 2014 Unit 1: Introduction Short Questions: 1. What are the rules for writing PHP code block? 2. Explain comments in your program. What is the purpose of comments in your program. 3. How to declare and use constants

More information

Wed 02 Nov :01:06 AM EST modpow.html

Wed 02 Nov :01:06 AM EST modpow.html Wed 02 Nov 2005 02:01:06 AM EST modpow.html

More information

COPYRIGHTED MATERIAL. Index SYMBOLS AND NUMERICS. Index

COPYRIGHTED MATERIAL. Index SYMBOLS AND NUMERICS. Index Index Index SYMBOLS AND NUMERICS + (addition operator), 272 (angle brackets), 15 * (asterisk), 233 234, 354 355, 669 @ (at symbol), 241, 555 \. (backslash, period), 445 > (bitwise shift right operator),

More information

CGS 3066: Spring 2017 SQL Reference

CGS 3066: Spring 2017 SQL Reference CGS 3066: Spring 2017 SQL Reference Can also be used as a study guide. Only covers topics discussed in class. This is by no means a complete guide to SQL. Database accounts are being set up for all students

More information

Data about data is database Select correct option: True False Partially True None of the Above

Data about data is database Select correct option: True False Partially True None of the Above Within a table, each primary key value. is a minimal super key is always the first field in each table must be numeric must be unique Foreign Key is A field in a table that matches a key field in another

More information

Perl Scripting. Students Will Learn. Course Description. Duration: 4 Days. Price: $2295

Perl Scripting. Students Will Learn. Course Description. Duration: 4 Days. Price: $2295 Perl Scripting Duration: 4 Days Price: $2295 Discounts: We offer multiple discount options. Click here for more info. Delivery Options: Attend face-to-face in the classroom, remote-live or on-demand streaming.

More information

Oracle Compare Two Database Tables Sql Query List All

Oracle Compare Two Database Tables Sql Query List All Oracle Compare Two Database Tables Sql Query List All We won't show you that ad again. I need to implement comparing 2 tables by set of keys (columns of compared tables). This pl/sql stored procedure works

More information

Structured documents

Structured documents Structured documents An overview of XML Structured documents Michael Houghton 15/11/2000 Unstructured documents Broadly speaking, text and multimedia document formats can be structured or unstructured.

More information

Table of Contents. PDF created with FinePrint pdffactory Pro trial version

Table of Contents. PDF created with FinePrint pdffactory Pro trial version Table of Contents Course Description The SQL Course covers relational database principles and Oracle concepts, writing basic SQL statements, restricting and sorting data, and using single-row functions.

More information

End o' semester clean up. A little bit of everything

End o' semester clean up. A little bit of everything End o' semester clean up A little bit of everything Database Optimization Two approaches... what do you think they are? Improve the Hardware Has been a great solution in recent decades, thanks Moore! Throwing

More information

Senturus Analytics Connector Version 3.0. User Guide. Senturus, Inc. 533 Airport Blvd. Suite 400 Burlingame CA P F

Senturus Analytics Connector Version 3.0. User Guide. Senturus, Inc. 533 Airport Blvd. Suite 400 Burlingame CA P F Senturus Analytics Connector Version 3.0 User Guide Senturus, Inc. 533 Airport Blvd. Suite 400 Burlingame CA 94010 P 888 601 6010 F 650 745 0640 Table of Contents 1. Install and Configure Senturus Analytics

More information

Table of Contents. Developer Manual...1

Table of Contents. Developer Manual...1 Table of Contents Developer Manual...1 API...2 API Overview...2 API Basics: URL, Methods, Return Formats, Authentication...3 API Errors...4 API Response Examples...6 Get Articles in a Category...6 Get

More information

What is XHTML? XHTML is the language used to create and organize a web page:

What is XHTML? XHTML is the language used to create and organize a web page: XHTML Basics What is XHTML? XHTML is the language used to create and organize a web page: XHTML is newer than, but built upon, the original HTML (HyperText Markup Language) platform. XHTML has stricter

More information

PURR The Persistent URL Resource Resolver

PURR The Persistent URL Resource Resolver PURR The Persistent URL Resource Resolver Ed Sponsler October 9, 2001 Caltech Library System CONTENTS PURR THE PERSISTENT URL RESOURCE RESOLVER... 1 INTRODUCTION... 2 PURR IMPLEMENTATION... 3 The CLS Environment...

More information

Type Java.sql.sqlexception Error Code 0 Sql State S1000

Type Java.sql.sqlexception Error Code 0 Sql State S1000 Type Java.sql.sqlexception Error Code 0 Sql State S1000 sql query result parsing -SQL Error: 0, SQLState: S1000 - Unknown type '14 in column 3 of 4 in binary-encoded Browse other questions tagged java

More information

CSE 530A. ER Model to Relational Schema. Washington University Fall 2013

CSE 530A. ER Model to Relational Schema. Washington University Fall 2013 CSE 530A ER Model to Relational Schema Washington University Fall 2013 Relational Model A relational database consists of a group of relations (a.k.a., tables) A relation (table) is a set of tuples (rows)

More information

C Functions. 5.2 Program Modules in C

C Functions. 5.2 Program Modules in C 1 5 C Functions 5.2 Program Modules in C 2 Functions Modules in C Programs combine user-defined functions with library functions - C standard library has a wide variety of functions Function calls Invoking

More information

CONTENTS IN DETAIL INTRODUCTION 1 THE FAQS OF LIFE THE SCRIPTS EVERY PHP PROGRAMMER WANTS (OR NEEDS) TO KNOW 1 2 CONFIGURING PHP 19

CONTENTS IN DETAIL INTRODUCTION 1 THE FAQS OF LIFE THE SCRIPTS EVERY PHP PROGRAMMER WANTS (OR NEEDS) TO KNOW 1 2 CONFIGURING PHP 19 CONTENTS IN DETAIL INTRODUCTION xiii 1 THE FAQS OF LIFE THE SCRIPTS EVERY PHP PROGRAMMER WANTS (OR NEEDS) TO KNOW 1 #1: Including Another File as a Part of Your Script... 2 What Can Go Wrong?... 3 #2:

More information

Database Systems Fundamentals

Database Systems Fundamentals Database Systems Fundamentals Using PHP Language Arman Malekzade Amirkabir University of Technology (Tehran Polytechnic) Notice: The class is held under the supervision of Dr.Shiri github.com/arman-malekzade

More information

CSC 3300 Homework 3 Security & Languages

CSC 3300 Homework 3 Security & Languages CSC 3300 Homework 3 Security & Languages Description Homework 3 has two parts. Part 1 is an exercise in database security. In particular, Part 1 has practice problems in which your will add constraints

More information

What is PHP? [1] Figure 1 [1]

What is PHP? [1] Figure 1 [1] PHP What is PHP? [1] PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on the server PHP is free to download and use Figure

More information

Database Technology Introduction. Heiko Paulheim

Database Technology Introduction. Heiko Paulheim Database Technology Introduction Outline The Need for Databases Data Models Relational Databases Database Design Storage Manager Query Processing Transaction Manager Introduction to the Relational Model

More information

A Web-Based Introduction

A Web-Based Introduction A Web-Based Introduction to Programming Essential Algorithms, Syntax, and Control Structures Using PHP, HTML, and MySQL Third Edition Mike O'Kane Carolina Academic Press Durham, North Carolina Contents

More information

Chapters 10 & 11 PHP AND MYSQL

Chapters 10 & 11 PHP AND MYSQL Chapters 10 & 11 PHP AND MYSQL Getting Started The database for a Web app would be created before accessing it from the web. Complete the design and create the tables independently. Use phpmyadmin, for

More information

I n p u t. This time. Security. Software. sanitization ); drop table slides. Continuing with. Getting insane with. New attacks and countermeasures:

I n p u t. This time. Security. Software. sanitization ); drop table slides. Continuing with. Getting insane with. New attacks and countermeasures: This time Continuing with Software Security Getting insane with I n p u t sanitization ); drop table slides New attacks and countermeasures: SQL injection Background on web architectures A very basic web

More information

CSCE Java. Dr. Chris Bourke. Prior to Lab. Peer Programming Pair-Up. Lab 15 - Databases & Java Database Connectivity API

CSCE Java. Dr. Chris Bourke. Prior to Lab. Peer Programming Pair-Up. Lab 15 - Databases & Java Database Connectivity API CSCE 155 - Java Lab 15 - Databases & Java Database Connectivity API Dr. Chris Bourke Prior to Lab Before attending this lab: 1. Read and familiarize yourself with this handout. Some additional resources

More information

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 (

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 ( Course Title PHP ( Level 1 ( Course Description PHP '' Hypertext Preprocessor" is the most famous server-side programming language in the world. It is used to create a dynamic website and it supports many

More information

Web Scripting using PHP

Web Scripting using PHP Web Scripting using PHP Server side scripting No Scripting example - how it works... User on a machine somewhere Server machine So what is a Server Side Scripting Language? Programming language code embedded

More information

Introduction to HTML5

Introduction to HTML5 Introduction to HTML5 History of HTML 1991 HTML first published 1995 1997 1999 2000 HTML 2.0 HTML 3.2 HTML 4.01 XHTML 1.0 After HTML 4.01 was released, focus shifted to XHTML and its stricter standards.

More information

Perl Dbi Last Insert Id Example >>>CLICK HERE<<<

Perl Dbi Last Insert Id Example >>>CLICK HERE<<< Perl Dbi Last Insert Id Example Last updated on June 4, 2015 Authored by Dan Nanni 2 Comments I am going to use SQLite DBI Perl driver to connect to SQLite3. Here is the full-blown Perl code example of

More information

CGI Programming in Perl. Kirrily Robert

CGI Programming in Perl. Kirrily Robert CGI Programming in Perl Kirrily Robert CGI Programming in Perl by Kirrily Robert Copyright 1999-2000, Netizen Pty Ltd2000 by Kirrily Robert Open Publications License 1.0 Copyright (c) 1999-2000 by Netizen

More information

Perl (5 Days Content)

Perl (5 Days Content) Perl (5 Days Content) Pre-requisites: Knowledge of any programming language ( C / C++ / Shell Scripting) Objective of the Course: The participants should be in a position to understand Perl Scripts written

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

Computational Theory MAT542 (Computational Methods in Genomics) - Part 2 & 3 -

Computational Theory MAT542 (Computational Methods in Genomics) - Part 2 & 3 - Computational Theory MAT542 (Computational Methods in Genomics) - Part 2 & 3 - Benjamin King Mount Desert Island Biological Laboratory bking@mdibl.org Overview of 4 Lectures Introduction to Computation

More information

Oracle SQL Developer. Oracle TimesTen In-Memory Database Support User's Guide Release 4.0 E

Oracle SQL Developer. Oracle TimesTen In-Memory Database Support User's Guide Release 4.0 E Oracle SQL Developer Oracle TimesTen In-Memory Database Support User's Guide Release 4.0 E39882-02 December 2013 Oracle SQL Developer Oracle TimesTen In-Memory Database Support User's Guide, Release 4.0

More information

User Scripting April 14, 2018

User Scripting April 14, 2018 April 14, 2018 Copyright 2013, 2018, Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and

More information

Sql Server Check If Global Temporary Table Exists

Sql Server Check If Global Temporary Table Exists Sql Server Check If Global Temporary Table Exists I am trying to create a temp table from the a select statement so that I can get the schema information from the temp I have yet to see a valid justification

More information

MySQL: an application

MySQL: an application Data Types and other stuff you should know in order to amaze and dazzle your friends at parties after you finally give up that dream of being a magician and stop making ridiculous balloon animals and begin

More information

Using MySQL on the Winthrop Linux Systems

Using MySQL on the Winthrop Linux Systems Using MySQL on the Winthrop Linux Systems by Dr. Kent Foster adapted for CSCI 297 Scripting Languages by Dr. Dannelly updated March 2017 I. Creating your MySQL password: Your mysql account username has

More information

Beginning Perl. Third Edition. Apress. JAMES LEE with SIMON COZENS

Beginning Perl. Third Edition. Apress. JAMES LEE with SIMON COZENS Beginning Perl Third Edition JAMES LEE with SIMON COZENS Apress About the Author... About the Technical Reviewers Acknowledgements Suitrod yetion «. xvi xvii xviii «xix. Chapter 1: First Steps in Perl..

More information

How To Guide Using and Developing Custom Phases in IKAN ALM

How To Guide Using and Developing Custom Phases in IKAN ALM How To Guide Using and Developing Custom Phases in IKAN ALM Release 5.6 January 2015 N.V. Schaliënhoevedreef 20A 2800 Mechelen BELGIUM 2006-2015 N.V. No part of this document may be reproduced or transmitted

More information

Mysql Workbench Cannot Drop Schema

Mysql Workbench Cannot Drop Schema Mysql Workbench Cannot Drop Schema Changes in MySQL Workbench 6.2.2 (2014-09-05, Release Candidate) If Required is selected, the connection will fail if a SSL connection cannot be enabled. Expanding the

More information

Field Types and Import/Export Formats

Field Types and Import/Export Formats Chapter 3 Field Types and Import/Export Formats Knowing Your Data Besides just knowing the raw statistics and capacities of your software tools ( speeds and feeds, as the machinists like to say), it s

More information

Perl Programming Fundamentals for the Computational Biologist

Perl Programming Fundamentals for the Computational Biologist Perl Programming Fundamentals for the Computational Biologist Class 2 Marine Biological Laboratory, Woods Hole Advances in Genome Technology and Bioinformatics Fall 2004 Andrew Tolonen Chisholm lab, MIT

More information