You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,11 @@ This repository contains solutions for database-related tasks involving SQL and
12
12
## Task Descriptions
13
13
14
14
### Task 1: SQL Queries on Employee Table
15
+
15
16
This task involves creating a table `Empl` to store employee details and writing SQL queries to retrieve specific information.
16
17
17
18
#### Table Structure
19
+
18
20
-**Empl**:
19
21
-`EName`: Employee name
20
22
-`Sal`: Salary
@@ -24,6 +26,7 @@ This task involves creating a table `Empl` to store employee details and writing
24
26
- Other fields as per standard employee details
25
27
26
28
#### Queries
29
+
27
30
1. Display `EName` and `Sal` of employees with a salary greater than or equal to 2200.
28
31
2. Display details of employees who are not receiving a commission.
29
32
3. Display `EName` and `Sal` of employees whose salary is not in the range of 2500 to 4000.
@@ -32,12 +35,15 @@ This task involves creating a table `Empl` to store employee details and writing
32
35
6. Display `EName` of employees whose name ends with "S".
33
36
34
37
### Task 2: JDBC Program for Employee Data Insertion
38
+
35
39
This task involves writing a Java program using JDBC to connect to a database and insert employee data into the `Empl` table.
36
40
37
41
### MongoDB Day 1: Queries on Product Dataset
42
+
38
43
This task involves writing MongoDB queries on a product dataset provided in JSON format ([product.json](https://github.com/rvsp/database/blob/master/mongodb/product.json)).
39
44
40
45
#### Queries
46
+
41
47
1. Retrieve all information about each product.
42
48
2. Find products with a price between 400 and 800.
43
49
3. Find products with a price not between 400 and 600.
@@ -52,6 +58,7 @@ This task involves writing MongoDB queries on a product dataset provided in JSON
52
58
## How to Run
53
59
54
60
### SQL Queries (Task 1)
61
+
55
62
1.**Set Up the Database**:
56
63
- Create a database (e.g., using MySQL).
57
64
- Create the `Empl` table with the appropriate columns.
@@ -60,6 +67,7 @@ This task involves writing MongoDB queries on a product dataset provided in JSON
60
67
- Execute the queries to view the results.
61
68
62
69
### JDBC Program (Task 2)
70
+
63
71
1.**Set Up the Database**:
64
72
- Ensure the `Empl` table exists in your database.
65
73
- Configure your JDBC driver (e.g., MySQL Connector/J).
@@ -68,9 +76,11 @@ This task involves writing MongoDB queries on a product dataset provided in JSON
68
76
javac Task2.java
69
77
java Task2
70
78
```
79
+
71
80
- Ensure your database credentials are updated in the code.
72
81
73
82
### MongoDB Queries (MongoDB Day 1)
83
+
74
84
1.**Set Up MongoDB**:
75
85
- Install MongoDB and start the MongoDB server.
76
86
- Import the `product.json` dataset into a MongoDB collection (e.g., `products`).
0 commit comments