3. What are databases?
• A structured set of data held on a
computer
• A place to store data for reading and
writing and updating.
4. Types of databases
• Relational Databases
• Document Oriented Databases
• Distributed Databases
• Key Value Databases
• There are many other types of databases, you can read up on them here:
https://en.wikipedia.org/wiki/Category:Types_of_databases
5. Relational Database
• Relational Databases as databases that allow data tables to be related in
some manner.
• This allows for data integrity
• Normalization
• Relationships
6. Normalization
• Normalization is the process of organizing the columns (attributes)
and tables (relations) of a relational database to minimize data
redundancy.
• Basically it means, we take a table that has many columns and split it up
into smaller tables with little or no redundancy.
• Smaller organized tables also improves performance and disk space
usage.
14. Relationship Type
• One to Many
• One Client has Many Client Products
• One to One
• One Stock Item belongs to One Client
• Many to Many
• Many Users have Many Permissions
• http://www.techrepublic.com/article/relational-databases-defining-
relationships-between-database-tables/
16. Keys
• Primary Key
• Uniquely identifies a record
• Joint Key
• Two or more columns that uniquely identifies a record
• Indexes
• Improves queries to the database
• Useful on large tables
• index columns that will be used when querying the database
• Foreign Keys
• Theses are used when creating relationships between tables
20. Joins
• Left Join
• Inner Join
• Outer Join
• Union
Sub Query [select from a select] => expensive
http://www.codinghorror.com/blog/2007/10/a-visual-explanation-
of-sql-joins.html
http://www.mysqltutorial.org/
22. Transactions
START TRANSACTION – initiates the transaction
COMMIT – save everything in the transaction
ROLLBACK – revert all the changes
23. Features
• Triggers
• MySQL triggers are stored programs that are executed
automatically to respond to specific events associated with table
e.g., insert, update or delete a record
• Stored Procedures
• SQL wrapped in a callable function
• getUsers() = select * from Users;
• CALL getUsers()
24. NoSQL Databases
• Databases that stores information in Collections
• A Collection has Documents
• A Document has an Objects
• Most do not support transactions
• Used to store dynamic information
• GEO location data