-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path04_Inserting_data.sql
More file actions
66 lines (44 loc) · 1.9 KB
/
04_Inserting_data.sql
File metadata and controls
66 lines (44 loc) · 1.9 KB
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
USE college;
-- Inserting multiple records into the students table
INSERT INTO students(name, email, age, city) VALUES
("Alice John", "alice@gmail.com", 22, "New York"),
("Bob Smith", "bobsmith@gmail.com", 24, "Los Angeles"),
("Charlie Brown", "brown@gmail.com", 21, "Chicago");
INSERT INTO students(full_name, email, age, city) VALUES
("Akash","akash@gmail.com",23,"Delhi"),
("Ravi","ravi@gmail.com",22,"Mumbai"),
("Sita","sita@gmail.com",20,"Bangalore"),
("Anita","anita@gmail.com",21,"Vizag"),
("Rahul","rahul@gmail.com",24,"Kadapa"),
("Riya","riya@gmail.com",22,"Hyderabad");
-- Inserting a single record into the students table
INSERT INTO students (name , email, age, city) VALUES ("Akhileswar", "akhil@gmail.com",20,"Hyderabad");
INSERT INTO students (student_id, name , email, age, city) VALUES (5, "Vishnu", "vishnu@gmail.com", 23, "Bangalore"),(6, "Deepak", "deepak@gmail.com", 22, "Mumbai");
SELECT * FROM students;
-- Inserting records into the sales table
INSERT INTO sales VALUES
(1, "oil",2, 500.00),
(2, "bread",5, 150.00),
(3, "milk",3, 200.00),
(4, "eggs",12, 300.00),
(5, "butter",1, 250.00),
(6, "cheese",4, 600.00),
(7, "yogurt",6, 180.00);
SELECT * FROM sales;
-- Inserting records into the employees table
INSERT INTO employees (emp_id, emp_name, dept_id) VALUES
(1, "John Doe", 101),
(2, "Jane Smith", 102),
(3, "Mike Johnson", 101),
(4, "Emily Davis", 103);
INSERT INTO employees (emp_id, emp_name, dept_id) VALUES
(5,"Akhil",105);
-- Inserting records into the department table
INSERT INTO department (dept_id, dept_name) VALUES
(101, "Sales"),
(102, "Marketing"),
(103, "HR");
INSERT INTO department (dept_id, dept_name) VALUES
(104,"IT");
INSERT INTO final_students VALUES (12,"Akhil","Cyber"),(13,"Vishal","Computer Science"),(19,"Joshna","AIML"),(10,"Vivek","EEE");
INSERT INTO alumini VALUES ("Shashank","Google"),("Akhil","Cisco"),("Asha","Sachmans"),("Vivek","IBM"),("Joshna","Netflix");