Department_id datatype int, also not null so you have to enter a value, auto_increment
so it will assign a value for you, and finally a primary key for the table
After selecting the database from the tree in the left panel you will notice you
see a more detailed description of your tables in the right panel
HTTP 5105 Database Development and Design 11 November 2014
Creating Tables
What is different?
Datatypes are different
Auto_increment for sequence number generation
The defining of an engine or type
What is the same?
The actual command CREATE TABLE
The open and close parentheses
The column list inside the parentheses
NOT NULL and PRIMARY KEY
FOREIGN KEY definition
If I click Cancel nothing will happen, all the rows will remain
As with Oracle the WHERE clause can be used to indicate which rows
are to be deleted
HTTP 5105 Database Development and Design 20 November 2014
Inserting, Updating and Deleting Data
If I click Cancel nothing will happen, and the row will remain
The WHERE clause is optional, so if I do not use the WHERE clause all
of the rows would have the update applied to them
HTTP 5105 Database Development and Design 22 November 2014
Inserting, Updating and Deleting Data
Can also specify the column names I wish to see in the output
The DISTINCT keyword will suppress any duplicates in the result set
The ORDER BY clause will sort the results on the columns and the
sequence specified, in this case it is ascending sequence on the JOB
and then pm descending sequence on the name
In this screen capture you will notice there is no join condition being
specified
HTTP 5105 Database Development and Design 46 November 2014
SELECT Statement
In this screen capture you will notice there is the cross join condition
being specified
HTTP 5105 Database Development and Design 48 November 2014
SELECT Statement
The GROUP BY function can also be used to group data in the result
set together
HTTP 5105 Database Development and Design 50 November 2014
SELECT Statement
Not the use of the HAVING clause to restrict the groups being
displayed
HTTP 5105 Database Development and Design 54 November 2014
SELECT Statement
The above rows are being inserted into the ACCOUNTS table
HTTP 5105 Database Development and Design 59 November 2014
Transactions
The COMMIT keyword will make the change permanent in the table ,
a ROLLBACK could also be used
HTTP 5105 Database Development and Design 61 November 2014
GROUP BY Revisited
Since there was a table now with a numeric value, I decided to add
to the various group functions So here are the ADD, SUM, MIN, and
MAX function in use