SQL Day1
SQL Day1
-- security
-- easy and fast access
-- large amount data
-- constraints/rules/limitations
-- concurrency
/*
emp : table
empid, empname,salary, loc CONTACT :
columns/features/attributes/fields
1001. rahul. 70000. pune 9028299590. : rows/records
project:
proj_id,proj_name,no_of_emp,empid
10. axis. 30. 1001
20. hdfc. 20
*/
-- oracle
-- mysql
-- DB2
-- sql server
-- postgreSQL
-- MySQL:
-- database server
-- user interface (workbench/shell)
-- connection
-- types of commands :
-- DDL (data definition language) : CREATE,ALTER,TRUNCATE,DROP --
auto_committed
-- DML ( data manipulation language) : INSERT,UPDATE,DELETE
-- DCL ( data control language) : GRANT,REVOKE (DBA)
-- TCL (transaction control language):
COMMIT(save),ROLLBACK(undo),SAVEPOINT
-- DQL (data query language) : SELECT
/*
customer :cust_id,cust_name,ac_no,ac_balance
1234. dhiraj. 9028. 9000
1234. dhiraj. 9028. 8000
transaction :tran_id,tran_type,amount,cust_id
10. debit. 5000. 1234
*/
/*
insert
insert
update
delete
commit;
insert
savepoint A;
insert
rollback;
rollback to savepoint A;