0% found this document useful (0 votes)
14 views14 pages

Database

Uploaded by

chatkall46
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views14 pages

Database

Uploaded by

chatkall46
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Day 36: Install MySQL/PostgreSQL

Activity: Install and set up MySQL or PostgreSQL.

 Work Done: Downloaded and installed MySQL, set up a local server, and created an initial user.

Day 37: Database Basics - Creating a Database

Activity: Create a database for a student management system.

 Work Done: Create a new database using MySQL.

sql
Copy code
CREATE DATABASE student_management;

Day 38: Understanding Tables and Data Types

Activity: Create tables and define proper data types for each field.

 Work Done: Created a students table with appropriate data types.

sql
Copy code
USE student_management;

CREATE TABLE students (


student_id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
age INT,
gender ENUM('Male', 'Female', 'Other'),
department VARCHAR(50),
admission_date DATE
);

Day 39: Inserting Data into Tables

Activity: Insert data into the students table.

 Work Done: Inserted sample student records.

sql
Copy code
INSERT INTO students (first_name, last_name, age, gender, department, admission_date)
VALUES
('John', 'Doe', 20, 'Male', 'Computer Science', '2023-09-01'),
('Jane', 'Smith', 22, 'Female', 'Mechanical Engineering', '2023-08-15');

Day 40: Simple SELECT Queries


Activity: Write basic SELECT queries to fetch data from the table.

 Work Done: Selected all records from the students table.

sql
Copy code
SELECT * FROM students;

Day 41: WHERE Clause and Filtering Data

Activity: Use the WHERE clause to filter records based on conditions.

 Work Done: Selected students from the Computer Science department.

sql
Copy code
SELECT * FROM students
WHERE department = 'Computer Science';

Day 42: UPDATE Query

Activity: Write an UPDATE query to modify records in the table.

 Work Done: Updated the age of a student.

sql
Copy code
UPDATE students
SET age = 21
WHERE student_id = 1;

Day 43: DELETE Query

Activity: Write a DELETE query to remove specific records from the table.

 Work Done: Deleted a record of a student from the table.

sql
Copy code
DELETE FROM students
WHERE student_id = 2;

Day 44: JOIN Operation - Basics

Activity: Learn and write basic JOIN operations.

 Work Done: Created a new courses table and joined it with the students table.

sql
Copy code
CREATE TABLE courses (
course_id INT AUTO_INCREMENT PRIMARY KEY,
course_name VARCHAR(100)
);

INSERT INTO courses (course_name)


VALUES ('C++ Programming'), ('Database Systems');

CREATE TABLE enrollments (


enrollment_id INT AUTO_INCREMENT PRIMARY KEY,
student_id INT,
course_id INT,
FOREIGN KEY (student_id) REFERENCES students(student_id),
FOREIGN KEY (course_id) REFERENCES courses(course_id)
);

INSERT INTO enrollments (student_id, course_id)


VALUES (1, 1), (1, 2);

-- Join students and courses to get student enrollments


SELECT s.first_name, s.last_name, c.course_name
FROM students s
JOIN enrollments e ON s.student_id = e.student_id
JOIN courses c ON e.course_id = c.course_id;

Day 45: Aggregate Functions - COUNT, SUM, AVG

Activity: Write queries using aggregate functions.

 Work Done: Used COUNT to find the total number of students.

sql
Copy code
SELECT COUNT(*) AS total_students
FROM students;

Day 46: GROUP BY and HAVING

Activity: Use GROUP BY to group data and HAVING for conditional filtering.

 Work Done: Grouped students by department and counted the number of students in each.

sql
Copy code
SELECT department, COUNT(*) AS num_students
FROM students
GROUP BY department
HAVING num_students > 1;

Day 47: Subqueries

Activity: Write subqueries to retrieve data.

 Work Done: Used a subquery to find students in departments with more than one student.
sql
Copy code
SELECT * FROM students
WHERE department IN (
SELECT department
FROM students
GROUP BY department
HAVING COUNT(*) > 1
);

Day 48: Simple Constraints (PRIMARY KEY, FOREIGN KEY)

Activity: Add PRIMARY KEY and FOREIGN KEY constraints to tables.

 Work Done: Ensured that primary keys and foreign keys are correctly set in tables.

sql
Copy code
-- Already set PRIMARY KEY and FOREIGN KEY while creating tables:
-- PRIMARY KEY on student_id, course_id in students and courses
-- FOREIGN KEY in enrollments for student_id and course_id

Day 49: Database Backup

Activity: Perform a simple backup of the database.

 Work Done: Used the mysqldump tool to back up the database.

bash
Copy code
mysqldump -u root -p student_management > student_management_backup.sql

Day 50: Final Project - Student Management System

Activity: Create a final project for managing students using SQL queries.

 Work Done: Combined queries to manage students, courses, and enrollments.

sql
Copy code
-- Insert more students, courses, and enrollments
-- Write queries to view and manage data: listing students, updating records, etc.
Web and Mobile Application Development (WMAD): Day 21 - Day 35

Day 21: Install IDE (Android Studio/VS Code)

Activity: Install IDE and set up the development environment.

Work Done:

 Installed Android Studio for Android development.


 Installed Visual Studio Code (VS Code) for web development.
 Configured the necessary plugins and extensions for both IDEs.

Day 22: Introduction to HTML

Activity: Create a basic HTML page.

Work Done:

 Created a simple HTML page with basic structure.

html
Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My Web Page</h1>
<p>This is a paragraph of text.</p>
</body>
</html>

Day 23: CSS Basics: Styling Web Pages

Activity: Apply basic styling using CSS.

Work Done:

 Created a CSS file and applied styles to the HTML page.

html
Copy code
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Styled Page</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Styled Web Page</h1>
<p>This paragraph is styled using CSS.</p>
</body>
</html>
css
Copy code
/* styles.css */
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
color: #333;
}

h1 {
color: #007BFF;
}

p {
font-size: 18px;
}

Day 24: JavaScript: Basic Interactivity

Activity: Add JavaScript for basic interactivity.

Work Done:

 Implemented a button click event.

html
Copy code
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScript Interaction</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>JavaScript Interaction</h1>
<button onclick="showAlert()">Click Me</button>

<script>
function showAlert() {
alert('Button Clicked!');
}
</script>
</body>
</html>

Day 25: Responsive Design using CSS Flexbox

Activity: Implement a responsive layout using CSS Flexbox.


Work Done:

 Created a responsive layout using Flexbox.

html
Copy code
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Layout</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
</div>
</body>
</html>
css
Copy code
/* styles.css */
.container {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}

.box {
background-color: #007BFF;
color: white;
padding: 20px;
margin: 10px;
flex: 1 1 200px; /* Grow, shrink, basis */
text-align: center;
}

Day 26: Introduction to React (Web Framework)

Activity: Set up a basic React application.

Work Done:

 Used Create React App to initialize a new project.

bash
Copy code
npx create-react-app my-react-app
cd my-react-app
npm start

 Created a basic component.

jsx
Copy code
// src/App.js
import React from 'react';

function App() {
return (
<div className="App">
<header className="App-header">
<h1>Welcome to React</h1>
<p>This is a basic React application.</p>
</header>
</div>
);
}

export default App;

Day 27: React State Management

Activity: Implement state management in a React component.

Work Done:

 Added state to manage user input.

jsx
Copy code
// src/App.js
import React, { useState } from 'react';

function App() {
const [input, setInput] = useState('');

const handleChange = (event) => {


setInput(event.target.value);
};

return (
<div className="App">
<header className="App-header">
<h1>React State Management</h1>
<input type="text" value={input} onChange={handleChange} />
<p>You typed: {input}</p>
</header>
</div>
);
}

export default App;

Day 28: Firebase Setup for Web App

Activity: Integrate Firebase for authentication in a web app.

Work Done:

 Added Firebase to the React app and configured authentication.


bash
Copy code
npm install firebase
jsx
Copy code
// src/firebase.js
import firebase from 'firebase/app';
import 'firebase/auth';

const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_PROJECT_ID.firebaseapp.com",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_PROJECT_ID.appspot.com",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};

const firebaseApp = firebase.initializeApp(firebaseConfig);

export const auth = firebaseApp.auth();

Day 29: Introduction to Flutter (Mobile Framework)

Activity: Set up a basic Flutter application.

Work Done:

 Installed Flutter SDK and created a new project.

bash
Copy code
flutter create my_flutter_app
cd my_flutter_app
flutter run

 Created a basic Flutter app.

dart
Copy code
// lib/main.dart
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Flutter App')),
body: Center(child: Text('Hello, Flutter!')),
),
);
}
}
Day 30: Flutter Widgets Basics

Activity: Explore basic Flutter widgets.

Work Done:

 Implemented common widgets like Text, Button, and Image.

dart
Copy code
// lib/main.dart
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Flutter Widgets')),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Welcome to Flutter!', style: TextStyle(fontSize: 24)),
ElevatedButton(
onPressed: () {},
child: Text('Click Me'),
),
Image.network('https://flutter.dev/images/flutter-logo-sharing.png'),
],
),
),
);
}
}

Day 31: Navigation in Flutter

Activity: Implement navigation between screens in Flutter.

Work Done:

 Created multiple screens and navigated between them.

dart
Copy code
// lib/main.dart
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return MaterialApp(
home: FirstScreen(),
);
}
}

class FirstScreen extends StatelessWidget {


@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('First Screen')),
body: Center(
child: ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondScreen()),
);
},
child: Text('Go to Second Screen'),
),
),
);
}
}

class SecondScreen extends StatelessWidget {


@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Second Screen')),
body: Center(child: Text('Welcome to the Second Screen')),
);
}
}

Day 32: REST API Integration in Flutter

Activity: Make HTTP requests and display data.

Work Done:

 Integrated REST API and displayed data in the app.

dart
Copy code
// lib/main.dart
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return MaterialApp(
home: DataScreen(),
);
}
}

class DataScreen extends StatefulWidget {


@override
_DataScreenState createState() => _DataScreenState();
}

class _DataScreenState extends State<DataScreen> {


Future<List<String>> fetchData() async {
final response = await
http.get(Uri.parse('https://jsonplaceholder.typicode.com/posts'));
final List<dynamic> data = json.decode(response.body);
return data.map((item) => item['title'].toString()).toList();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Data from API')),
body: FutureBuilder<List<String>>(
future: fetchData(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(child: CircularProgressIndicator());
} else if (snapshot.hasError) {
return Center(child: Text('Error: ${snapshot.error}'));
} else {
final data = snapshot.data!;
return ListView.builder(
itemCount: data.length,
itemBuilder: (context, index) {
return ListTile(title: Text(data[index]));
},
);
}
},
),
);
}
}

Day 33: Push Notifications Setup

Activity: Implement push notifications in a Flutter app.

Work Done:

 Added Firebase Cloud Messaging to handle push notifications.

bash
Copy code
flutter pub add firebase_messaging
dart
Copy code
// lib/main.dart
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';

void main() async {


WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}

class MyApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return MaterialApp(
home: NotificationScreen(),
);
}
}

class NotificationScreen extends StatefulWidget {


@override
_NotificationScreenState createState() => _NotificationScreenState();
}

class _NotificationScreenState extends State<NotificationScreen> {


FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;

@override
void initState() {
super.initState();
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
// Handle message when app is in foreground
print('Message received: ${message.notification?.title}');
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Push Notifications')),
body: Center(child: Text('You will receive push notifications here')),
);
}
}

Day 34: Deployment of Web App

Activity: Deploy the React web app.

Work Done:

 Deployed the React application using Firebase Hosting.

bash
Copy code
npm install -g firebase-tools
firebase login
firebase init
# Choose Hosting, select project, and deploy
firebase deploy
Day 35: Mobile App Deployment

Activity: Deploy the Flutter app to a physical device or emulator.

Work Done:

 Configured the Flutter project for release mode and deployed to an emulator or connected device.

bash
Copy code
flutter build apk --release
flutter install

You might also like