Dynamic Web Development - Spring 2005 - assignment 3

mySQL table of some recent vacations I have taken

 
Create a table  
 

Database sws245 - Table vacation-vacations running on localhost

vacation-vacations

Field Type Null Default
id  int(3) No   
vacationName  varchar(128) No   
vacation_Start  date No  0000-00-00 
vacation_End  date No  0000-00-00 


 Indexes :
Keyname Type Cardinality Field
PRIMARY PRIMARY 5 id


 Space usage :
Type Usage
Data 208 Bytes
Index 2,048 Bytes
Total 2,256 Bytes
   Row Statistic :
Statements Value
Format dynamic
Rows 5
Row length ø 41
Row size  ø 451 Bytes
Next Autoindex 6


 
Insert Values to the table  
 

INSERT into vacation-vacations (vacationName,vacation_Start,vacation_End) VALUES

('Paris-Portugal',2000-07-06,2000-07-24),

('Kassel-SwissExpo-Portugal',2002-07-11,2002-07-28),

('Brazil',2001-05-24,2001-06-09),

('Venice-Germany',2003-10-30,2003-11-16),

('US-Canada-TrainTrip',1999-06-30,1999-08-15)

 

 
Resulting Table  
 

SQL result

Host: localhost
Database : sws245
Generation Time: Feb 13, 2005 at 07:35 PM
Generated by: phpMyAdmin 2.4.0-rc2
SQL-query: SELECT * FROM `vacation-vacations` LIMIT 0, 30;

id vacationName vacation_Start vacation_End
1 Paris-Portugal 2000-07-06 2000-07-24
2 Kassel-SwissExpo-Portugal 2002-07-11 0000-07-28
3 Brazil 2001-05-24 2001-06-09
4 Venice-Germany 2003-10-30 2003-11-16
5 US-Canada-TrainTrip 1999-06-30 1999-08-15
 
Submit Query for 'id' = 3  
 

Database sws245 - Table vacation-vacations running on localhost


SQL-query
SQL-query : [Edit] [Explain SQL] [Create PHP Code]
SELECT `id` , `vacationName` , `vacation_Start` , `vacation_End`
FROM `vacation-vacations`
WHERE 1 AND `id` = 3
 LIMIT 0 , 30

id vacationName vacation_Start vacation_End
Edit Delete 3 Brazil 2001-05-24 2001-06-09
 
Submit Query for 'vacationName = 'Brazil'  
 

Database sws245 - Table vacation-vacations running on localhost

SQL-query
SQL-query : [Edit] [Explain SQL] [Create PHP Code]
SELECT *
FROM `vacation-vacations`
WHERE vacationName = 'Brazil'
 LIMIT 0 , 30


id vacationName vacation_Start vacation_End
Edit Delete 3 Brazil 2001-05-24 2001-06-09
 
Submit Query fo 'id' < or = 3  
 

Database sws245 - Table vacation-vacations running on localhost

Showing rows 0 - 2 (3 total)
SQL-query : [Edit] [Explain SQL] [Create PHP Code]
SELECT `id` , `vacationName` , `vacation_Start` , `vacation_End`
FROM `vacation-vacations`
WHERE 1 AND `id` <= 3
 LIMIT 0 , 30

 

id vacationName vacation_Start vacation_End
Edit Delete 1 Paris-Portugal 2000-07-06 2000-07-24
Edit Delete 2 Kassel-SwissExpo-Portugal 2002-07-11 0000-07-28
Edit Delete 3 Brazil 2001-05-24 2001-06-09
 
Submit Query for dates between Jan. 1 2001 and Dec. 31 2003  
 

Database sws245 - Table vacation-vacations running on localhost

Showing rows 0 - 2 (3 total)
SQL-query : [Edit] [Explain SQL] [Create PHP Code]
SELECT `id` , `vacationName` , `vacation_Start` , `vacation_End`
FROM `vacation-vacations`
WHERE 1 AND `vacation_Start` >= '2001-01-01' AND `vacation_End` < '2003-12-31'
 LIMIT 0 , 30

id vacationName vacation_Start vacation_End
Edit Delete 2 Kassel-SwissExpo-Portugal 2002-07-11 0000-07-28
Edit Delete 3 Brazil 2001-05-24 2001-06-09
Edit Delete 4 Venice-Germany 2003-10-30 2003-11-16
 
Update vacationName 'Brazil' to 'Brasil'  
 

Database sws245 - Table vacation-vacations running on localhost

Affected rows: 1
SQL-query : [Edit] [Create PHP Code]
UPDATE `vacation-vacations` SET vacationName = 'Brasil' WHERE vacationName = 'Brazil'
  • Run SQL query/queries on database sws245 [Documentation]   Fields:

  •  
 
Delete 'id' = 5  
 

Database sws245 - Table vacation-vacations running on localhost

Deleted rows: 1
SQL-query : [Edit] [Create PHP Code]
DELETE FROM `vacation-vacations` WHERE id = 5
  • Run SQL query/queries on database sws245 [Documentation]   Fields:

  •