mysql note webex.txt - Database rdbms(mysql,sql server oracle ms access sybase foxbro ordbms(oracle 10g how to give instruction to dase base to store or

mysql note webex.txt - Database rdbms(mysql,sql server...

This preview shows page 1 - 5 out of 14 pages.

Database - rdbms (mysql,sql server , oracle, ms access, sybase, foxbro) - ordbms (oracle 10g) how to give instruction to dase base to store or retrieve the data sql - structured query language Ansi sql mysql is application of database type of statement (instruction) in sql - DDL (DATA DEFINITION LANGUAGE) CREATE,ALTER,DROP AND TRUNCATE ,RENAME - DML (DATA MANIPULATION LANGUAGE) INSERT,DELETE,UPDATE, SELECT , MERGE - DCL (DATA CONTROL LANGUAGE) GRANT AND REVOKE - TCL (TRANSACTION CONTROL LANGUAGE) COMMIT,ROLLBACK, SAVEPOINT DDL create, alter,drop and truncate mysql datatype int,float,char, varchar, varchar2, date blob,clob, CREATE TABLE table_name (columnlist); column_list column_name datatype[(size)], column_name datatype[(size))], .... column_name datatype[(size)] [PRIMARY KEY], column_name datatype[(size))], .... column_name datatype[(size)] REFERENCES parent_table_name(column_name), column_name datatype[(size))], .... example create table dept (dno int primary key, dname char(20),dloc varchar(20));
Image of page 1
create table emp (empno int primary key, ename char(20),sal float,dno int references dept(dno))create table emp (empno int primary key, ename char(20),sal float default 20000,dno int references dept(dno))how to create databaseCREATE DATABASE database_name;how to see what are database are availableSHOW DATABASES;how to switch databaseUSE database_name;how to see the tables are avaialble in databaseSHOW TABLES;how to see the structure of tablesDESC table_name;how to see|read|retreive the data in the table select * from table_name;select column_name , column_name from table_name; -------------- INSERT STATEMENT INSERT INTO table_name VALUES (v1,v2,v3...); -if the value datatype is char|varchar|date dataype you need put single quote) - date should be in the format year/month/day in oracle 01-jan-2015 in mysql 2015/01/01 inserting single record insert into dept values (10,'sales'); insert into emp values (111,'kavi',12000,10); insert into emailids value (111,'[email protected]', '2016/10/10'); how to insert mulitiple record insert into dept values (10,'sales'),(20,'purchase'),(30,'academy'); ------------ delete statement DELETE FROM table_name [ WHERE condition]; condtion - relational and logical operator
Image of page 2
Image of page 3
Image of page 4
Image of page 5

You've reached the end of your free preview.

Want to read all 14 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture