Databases
- On a larger note we have two types of databases in terms of how they handle schema (structure)
- Strict on Structure (Relational databases)
- Minimal restrictions (NOSQL)
-
Relational database:
- Data is tabular in nature.
- Each column has a field and each row is a record
- In a database i can have multiple tables
- Tables can have relations between them
- Relational database have a formal language which is based on standard (Strucutred Query Language)
- Each DBMS adopts the standard and create their own query language
- orcale => pl/sql
- SQL Server => t-sql
- mysql
- postgres
-
SQL
-
Create:
- create a books table
“`sql
</ul>
<h1>mysql</h1>
CREATE TABLE books (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
author VARCHAR(100) NOT NULL,
description TEXT
);
<h1>microsoft sql server</h1>
CREATE TABLE books (
id INT IDENTITY(1,1) PRIMARY KEY,
title VARCHAR(255) NOT NULL,
author VARCHAR(100) NOT NULL,
description TEXT
);
<h1>mysql</h1>
INSERT INTO books (title, author, description) VALUES
('The Great Gatsby', 'F. Scott Fitzgerald', 'A novel set in the Roaring Twenties.'),
('To Kill a Mockingbird', 'Harper Lee', 'A novel about racial injustice in the Deep South.');
<h1>microsoft sql server</h1>
INSERT INTO books (title, author, description) VALUES
('The Great Gatsby', 'F. Scott Fitzgerald', 'A novel set in the Roaring Twenties.'),
('To Kill a Mockingbird', 'Harper Lee', 'A novel about racial injustice in the Deep South.');
<code>* Retrieve</code>sql
SELECT * FROM books;
SELECT title, author FROM books;
SELECT * FROM books WHERE author = 'Harper Lee';
SELECT * FROM books ORDER BY title ASC;
</li>
</ul>
<code>* Update</code>sql
UPDATE books
SET description = 'A classic American novel set in the 1920s.'
WHERE title = 'The Great Gatsby';
<code>* Delete</code>sql
DELETE FROM books WHERE id = 1;
“` - create a books table
Relational Database for Library

ORM (object relational mapping) libraries
- ORM frameworks map table to a class
- we can write the code where we deal with objects (records)
- The advantage of using orm framework is your code works with any relational database.
- Examples
- Java: Hibernate
- .net: EntityFramework
- python: SQL Alchemy
Application Types
- Commandline
- Desktop/Mobile Apps
- Web:
- Web Apps
- Web APIs
WebSite (WebApps)
- Generation 1: Readonly
- Technologies:
- html, css, javascript
- server: apache, iis
- Technologies:
- Generation 2: Interactivity
- Technologies:
- PHP, ASP, Servlets
- Databases:
- Technologies:
- Generation 3: Improvements
- Technologies
- Asp.net, JSP, Python Django …, bootstrap (css)
- Databases
- Technologies
- Generation 4: Mobile Apps , Desktop Apps with Web

-
Create:
