Table creation (1)
Table creation (1)
DDL:
mysql> create database student;
Query OK, 1 row affected(0.00 sec)
mysql> create table stud1(Regno char(10)primary key,Name char(20) not null,Class char(10),
DOB date,Gender char(10),fees int check(fees>1000));
Query OK, 0 rows affected (0.22 sec)
ADD COLUMN
DROP TABLE
mysql> drop table stud1;
Query OK, 0 rows affected (0.05 sec)
DML LANGUAGE
TABLE CREATION AND INSERT VALUES
mysql> create table employee(sno int,empid int primary key,name varchar(20),department varchar(20),salary
int);
Query OK, 0 rows affected (0.07 sec)
mysql>insert into employee values(1,1001,"ram","cs",20000);
Query OK, 1 row affected (0.05 sec)
UPDATE COMMAND
DATA DELETION
mysql> delete from employee where name="ramya";
Query OK, 1 row affected (0.10 sec)
ORDERING TUPELS
TUPLE VARIABLE
mysql> select a.name,a.department from employee as a;
+------------+------------+
| name | department |
+------------+------------+
| ram | cs |
| sam | cs |
| kavi | bca |
| tamilselvi | bcom ca |
+------------+------------+
4 rows in set (0.01 sec)
PATTERN MATCHING
mysql> select * from employee where name like's%';
+------+-------+------+------------+--------+
| sno | empid | name | department | salary |
+------+-------+------+------------+--------+
| 2 | 1002 | sam | cs | 30000 |
+------+-------+------+------------+--------+
1 row in set (0.00 sec)
BUILT IN FUNCTIONS
SET OPERATIONS