Posts

Showing posts from October, 2024

Mangodb student, employee

 Q1. Create a collection called Students with following fields ⮚ use Masters switched to db Masters ⮚ db.createCollection('student') { ok: 1 } ⮚ db.student.insertMany([{usn:12345,name:'Preetham',course:'MBA',Grade:'A',major Statics'}, …{usn:12346, name:'Berty pais',course:'MBA', major:'Statics',Grade:'A'}, …{usn:12350,course:'BCA', name:'Dhanraj major:'Frontend developer',Grade:'A'}, …{usn:12351,name:'Vishal',course:'BSc',major:'Maths',Grade:'A}, …{usn:12352,name:'Balaji',course:'BCA',major:'Big Data Analytic',Grade:'A+'}, …{usn:12353,name:'Yashas',course:'MCA',major:'Ethichal hacking',Grade:'B'}, ... {usn:12560,name:'Sharath',course:'MCA',major:'Ethichal hacking',Grade:'A+'}, ... {usn:12561,name:'Abc',course:'MCA',major:'Backend Developing',Grad...
 CREATE KEYSPACE keyspace_name  WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 }  AND durable_writes = true;

Mangodb games , movies

Games :- A. Create a collection called ‘games’. We’re going to put some games in it. Creation - db.createCollection('games'); B. Add 5 games to the database. Give each document the following properties: name, genre, rating (out of 100) If you make some mistakes and want to clean it out, use remove()on your collection. Insertion - db.games.insertMany([  {  name: "The Legend of Zelda: Breath of the Wild",  genre: "Action-Adventure",  rating: 97,  achievements: {}  },  {  name: "Hollow Knight",  genre: "Metroidvania",  rating: 90,  achievements: {}  },  {  name: "Celeste",  genre: "Platformer",  rating: 94,  achievements: {}  },  {  name: "God of War",  genre: "Action",  rating: 93,  achievements: {}  },  {  name: "Stardew Valley",  genre: "Simulation",  rating: 89, achievements: {}  } ]); C. Write a query that returns all the games  db.ga...

Cassandra all programs

 1 question -Here's how you can perform these tasks in SQL: ### 1. Create the `Student_info` Table ```sql CREATE TABLE Student_info (     rollno INT PRIMARY KEY,     studname VARCHAR(50),     age INT,     department VARCHAR(50),     lastexampercent DECIMAL(5, 2) ); ``` ### 2. Insert Records ```sql INSERT INTO Student_info (rollno, studname, age, department, lastexampercent) VALUES (1, 'John', 20, 'Computer Science', 85.5), (2, 'Alice', 22, 'Mathematics', 90.0), (3, 'Bob', 21, 'Physics', 78.5); ``` ### 3. View Records of Students with Roll Numbers 1, 2, and 3 ```sql SELECT * FROM Student_info WHERE rollno IN (1, 2, 3); ``` ### 4. Create an Index on the `studname` Column ```sql CREATE INDEX idx_studname ON Student_info (studname); ``` ### 5. Display the Records with a Limit of 2 Results ```sql SELECT * FROM Student_info LIMIT 2; ``` ### 6. Add a New Column `address` to the `Student_info` Table ```sql ALTER TABLE Student_info ADD addre...