-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
68 lines (51 loc) · 1.61 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
DataBase
--------------
store DataBaseDBMS=>Software,MySQL Workbench,ORACle
DAta=>Database=>DataBaseDBMSrealational-database || Structured=>SQL,MYSQL,ORACLE<POStgresSQL,SQL SERVER,MIcrosoft SQL server,
SQLite=>rows & columns
non-relational database || unstructured =>MandoDB,Cassandra,CouchDB,Redis
Evolution of DataBase
-------------------------
flat-file system=>Object relational system
IBM=>1970=>relational database model=>Edger Codd=> Table
RDBMS=> 1980 & 1990
MYSQL
________________
=>small & large datasets
shell,server,GUI=>3 parts
storage engine=>InnoDb storage engine
ACID-Atomicity,Consistency,ISolation ,Durability
-- create
CREATE TABLE EMPLOYEE (
empId INTEGER PRIMARY KEY,
name TEXT NOT NULL,
dept TEXT NOT NULL
);
-- insert
INSERT INTO EMPLOYEE VALUES (0001, 'Clark', 'Sales');
INSERT INTO EMPLOYEE VALUES (0002, 'Dave', 'Accounting');
INSERT INTO EMPLOYEE VALUES (0003, 'Ava', 'Sales');
-- fetch
SELECT * FROM EMPLOYEE WHERE dept = 'Sales';
-- create
CREATE TABLE STUDENT (
stdId INT AUTO_INCREMENT PRIMARY KEY,
FirstName varchar(20),
LastName varchar(20),
Age INTEGER
);
-- -- insert
INSERT INTO STUDENT(FirstName,LastName,Age) VALUES
("JOhn", 'Clark', '20'),
("Dave", 'Clark', '21'),
("Andrew", 'Johnson', '22')
;
-- -- fetch
SELECT * from STUDENT
+-------+-----------+----------+------+
| stdId | FirstName | LastName | Age |
+-------+-----------+----------+------+
| 1 | JOhn | Clark | 20 |
| 2 | Dave | Clark | 21 |
| 3 | Andrew | Johnson | 22 |
+-------+-----------+----------+------+