-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQLCommands.java
91 lines (68 loc) · 1.78 KB
/
SQLCommands.java
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
create table customer(
custid varchar(255),
firstname varchar(255),
lastname varchar(255),
aadhar varchar(255),
passport varchar(255),
address varchar(255),
dob varchar(255),
gender varchar(255),
contact varchar(255)
);
ALTER TABLE student
ADD PRIMARY KEY (rollno);
select * from customer;
drop table customer;
create database school;
use school;
describe database student;
drop database student;
show databases;
use airline;
create table flight(
flightid varchar(255),
src varchar(255),
destination varchar(255),
deptdate varchar(255),
departure varchar(255),
arrival varchar(255),
price varchar(255)
);
select * from flight;
drop table flight;
create table user(
firstname varchar(255),
lastname varchar(255),
username varchar(255),
password varchar(255)
);
use school;
select * from student;
delete * from student where rollno=16;
select * from user;
create table employee(
eno int primary key,
ename varchar(50),
sal int,
desg varchar(50),
pcode varchar(50)
);
create table project(
pcode varchar(50) primary key,
ptitle varchar(50),
cname varchar(50)
);
drop table project;
insert into employee values(1,"A",50000,"SE","P1");
insert into employee values(2,"B",60000,"ST","P2");
insert into employee values(3,"C",40000,"TL","P3");
insert into employee values(4,"D",70000,"PM","P1");
insert into employee values(5,"E",80000,"SE","P2");
insert into project values("P1","AscW","HDFC");
insert into project values("P2","BankSc","SBI");
insert into project values("P3","Frsl","Intel");
select * from project;
select * from employee;
select ename,ptitle from employee,project where employee.pcode=project.pcode;
*/