-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment SQL-8-Q3.sql
More file actions
42 lines (35 loc) · 880 Bytes
/
Copy pathAssignment SQL-8-Q3.sql
File metadata and controls
42 lines (35 loc) · 880 Bytes
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
create database crin;
use crin;
CREATE TABLE student_reg (
sid INT PRIMARY KEY,
name VARCHAR(50),
per DECIMAL(5, 2),
city VARCHAR(50)
);
INSERT INTO student_reg (sid, name, per, city) VALUES
(1, 'Harry', 95.26, 'Pune'),
(2, 'Mac', 98.45, 'Nashik'),
(3, 'Rox', 75.69, 'Nagar'),
(4, 'Shree', 85.65, 'Thane'),
(5, 'Seema', 89.45, 'Mumbai');
CREATE TABLE student_course (
cid INT,
sid INT,
cname VARCHAR(50),
branch VARCHAR(50)
);
INSERT INTO student_course (cid, sid, cname, branch) VALUES
(1, 1, 'Web designing', 'Mumbai'),
(2, 2, 'Python', 'Pune'),
(3, 4, 'PHP', 'Thane'),
(4, 5, 'DBMS', 'Nashik'),
(3, 1, 'PHP', 'Thane');
select * from student_reg;
select * from student_course;
-- Cross join
select *
from student_reg cross join student_course;
-- inner join
select *
from student_reg as A inner join student_course as B
on A.sid = B.sid;