Search This Blog

Saturday, November 7, 2020

Install MySQL on Ubuntu (18.04)

Type below commands in your terminals. 

First five commands are NOT required if you don't have any earlier version of mysql in your system. 

sudo apt-get remove --purge mysql*

sudo apt-get purge mysql*

sudo apt-get autoremove

sudo apt-get autoclean

sudo apt-get remove dbconfig-mysql

sudo apt-get dist-upgrade

sudo apt-get install mysql-server


This will install mysql without prompting for a password.

Use the cat command to view the default password.

sudo cat /etc/mysql/debian.cnf

======= the sample output will be========

# Automatically generated for Debian scripts. DO NOT TOUCH!

[client]

host     = localhost

user     = debian-sys-maint

password = it3vqmn8mXIBBama

socket   = /var/run/mysqld/mysqld.sock

[mysql_upgrade]

host     = localhost

user     = debian-sys-maint

password = it3vqmn8mXIBBama

socket   = /var/run/mysqld/mysqld.sock

==================


mysql -udebian-sys-maint -p

Log in with the default password as given in above file. In this example password is it3vqmn8mXIBBama (copy and paste this password after above command)


You will enter into mysql teriminal.
Change password.  ( In this example i am setting the password to root for user root)

UPDATE mysql.user SET authentication_string=PASSWORD('root'), PLUGIN='mysql_native_password' WHERE USER='root';

Exit from the mysql terminal (type exit)

exit

Restart the service 
/etc/init.d/mysql restart

Try to login with user root  (Type the password as root)
mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.32-0ubuntu0.18.04.1 (Ubuntu)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.03 sec)

mysql> create database test;
Query OK, 1 row affected (0.41 sec)

mysql> use test;
Database changed
mysql> 

Try to perform some basic queries as given in this file.
(If you are a beginner in SQL)


Monday, January 16, 2017

KTU University Question Papers and Answers - Paper: BE 101-05 INTRODUCTION TO COMPUTING AND PROBLEM SOLVING (ICP)


ICP - Jan 2017 (Regular Exam)


Write a program that reads an integer N from the keyboard and then calls a user defined function to compute and displays the sum of N numbers from N to (2*N)if N is nonnegative. If N is negative, then displays the sum of the numbers from (2*N) to N. The starting and ending points are included in the sum.
Write a python program to find the sum of all odd terms in a group of n numbers enterd by the user.
Write a program to check if a string is a palindrome or not, whith out reversing the original string.
Write a program to find the quadrant of a given point(X,Y).
Write a python program to create a dictionary of phone numbers and names of five persons. Display the contents of the dictionary in alphabetical order of names .
Create a class person with attributes Name, age, salary and method display() for showing the details. Create two instances of the class and call the method for each instance.
Write a menu driven program to calculate area of circle, triangle, rectangle and square. Use a seperate function to implement each operation.
Write a python code to find transpose of a matrix using list.
Write a program to find the sum of first n positive integers using a recursive function.
Write a python program that opens a file for input and prints the count of four letter words in it.

ICP - January 2016 (Regular Exam)

Sign in with your google account and try to open with Python Editor v5

Write a python program to display all Armstrong numbers in a given range.
Differentiate between break and continue statements with proper examples.
Create a class Car with attributes Model, year and price and a method cost() for displaying price. Create two instance of the class and call the method for each instance.
Write a python program to count the number of vowels, consonants , words and question marks in a given string.
Write a python program to count the number of zeros and negative terms in a given set of n numbers.
Write a python program to input a list of N numbers. Calculate and display the average of numbers. Also display the cube of each value in the list.
Write a python program to create a dictionary of roll numbers and names of five students. Display the contents of dictionary in alphabetical order of names.
Write a python program to compute the nth Fibonacci number, Use a recursive function for the implementation.
Write a python program to create a file conatiing 10 numbers. Read the contents of file and display the square of each number.
Write a python program to create a text file and to input a line of text to it.
Write a python program to simulate a menu driven calculator with addition, subtraction, multiplication, division and exponentiation operations. Use a separate function to implement each operation.
Write a python program to find the sum of digits of a number using functions (preferably a recursive function).
Write a python program to find the sum of all even terms in a group of n numbers enterd by the user.



ICP - June 2016 (Supplementary Exam)


A book shop details contains the title of book and number of copies of each title. As books are added to shop the number of copies in each should increase and as books are sold the number of copies in each should decrease. Implement this scenario using dictionary datatype in python.
Write a recursive function to find the factorial of a number.
Write a program to generate fibonacci series upto a limit.
Write a python code to read a text file and copy the contents to another file after removing the blank lines.
Write a python code to search an element in a list.
Write a python program to add two matrices using list.
Write a python code to print following pattern.
Write a python code to check whether two strings are equal or not.
Write a python program to reverse a string and print whether its palindrome or not.
Write a function to find the sum of numbers between a lower bound and upper bound.
Write a python program using function to check the types of a triangle(Scalene,Isosceles,Equilateral) by getting the vertices from user.

Thursday, April 28, 2016

Database Management Systems

Module I - Slides

Data models - schemas and instances - Three-schema architecture and data independence - Database languages and interfaces - The database system environment - Centralized and client-server architectures - Classification of Database Management systems, Entity-Relationship Model - Entity Types, Entity Sets, Attributes and Keys - Relationship types, Relationship Sets, Roles and Structural Constraints - Weak Entity Types - Refining the ER Design - ER Diagrams and Naming Conventions - Example of Other Notation: UML Class Diagrams

Module II - Slides

Relational Model and Relational Algebra Relational Model Concepts - Constraints - Relational Database Schemas, Relational Algebra: Unary Operations - Set Theoretic operations - Binary Operations - Aggregate functions and grouping – Outer Join and Outer Union - Examples of Queries - The Tuple Relational Calculus - The Domain Relational Calculus.
SQL - Data Definition and Data Types - Specifying constraints - Schema change statements - Basic queries – Aggregate functions and grouping - Insert, Delete and Update statements - Assertions and Triggers - View
Database Design - Informal Design Guidelines for Relation Schemas - Functional Dependencies - Normal Forms Based on Primary Keys (Up to BCNF), Properties of Relational Decompositions - Algorithms for Relational Database Schema Design. The Database Design and Implementation Process - Use of UML Diagrams in database design.

Module III - Slides

Parallelizing Disk Access Using RAID Technology - New Storage Systems, Indexing Structures for Files - Types of Single-Level Ordered Indexes - Multilevel Indexes - Dynamic Multilevel Indexes Using B-Trees and B+ Trees - Indexes on Multiple Keys

Module IV - Slides

Transaction Management - Transaction and System Concepts – ACID Properties - Schedules - Characterizing Schedules Based on Recoverability and Serializability - Transaction Support in SQL
Concurrency Control Techniques - Locking Techniques - Timestamp Ordering - Multiversion Concurrency Control - Optimistic Concurrency Control - Using Locks for Concurrency Control in Indexes
Database Recovery Techniques - Recovery Concepts - Recovery Techniques Based on Deferred and Immediate Updates - Shadow Paging - Recovery in Multidatabase Systems - Backup and Recovery from Catastrophic Failures.

Friday, September 5, 2014

Trigger Example on Oracle



Question:
Calculate fine in a library management system using following condition.
For the first 3 days of delay 10 RS per day; for following 3 days 20 RS per day and after 6
days fine of 30 RS per day.
Click Here to Download 

Saturday, July 26, 2014

Software Architecture and Project Management

Module I - Slides

Component-and-Connector Viewtype, Styles of Component-and-Connector Viewtype, Allocation Viewtype and Styles, Documenting Software Interfaces, Documenting Behavior, Building the Documentation Package, IS2000 The Advanced Imaging Solution, Global Analysis

Module II - Slides

Archetypes and Archetype Patterns, Model Driven Architecture with Archetype Patterns, Literate Modeling, Customer Relationship Management Archetype Pattern, Product Archetype Pattern, Quantity Archetype Pattern, Rule Archetype Pattern

Module IV - Slides

Module IV - Part 1.

Defining EAI, Data-Level EAI, Application Interface-Level EAI, Method- Level EAI, User Interface-Level EAI, The EAI Process, An Introduction to EAI and Middleware, Transactional Middleware and EAI, RPCs Messaging and EAI, Distributed Objects and EAI, Database Oriented Middleware and EAI, Java Middleware and EAI, Message Brokers—The Preferred EAI Engine, Process Automation and EAI, Implementing and Integrating Packaged Applications—The General Idea, XML and EAI

Module IV - Part 2.

Layering, Organizing Domain Logic & Domain Logic Patterns, Data Source Architectural Patterns, Object-Relational Behavioral Patterns, Object-Relational Behavioral Patterns, Mapping to Relational Databases, Object-Relational Metadata Mapping Patterns, Offline Concurrency Patterns

Tuesday, June 4, 2013

Set Operations in Java

Set Operations in Java: What is a Set Mathematically, a set is just a collection of objects, for example let set=["apple","orange","banan...